File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 33HexEditor::HexEditor ()
44{
55 this ->fileSize = 0 ;
6+ #ifdef WINDOWS
7+ string path = string (getenv (" HOMEDRIVE" )) + string (getenv (" HOMEPATH" )) + " \\ fhex\\ config.json" ;
8+ #else
69 string path = string (getenv (" HOME" )) + " /fhex/config.json" ;
10+ #endif
711 this ->patternMatching = new PatternMatching (path);
812}
913
Original file line number Diff line number Diff line change @@ -304,7 +304,11 @@ bool Fhex::loadFile(QString path) {
304304 this ->clearFloatingLabels ();
305305 this ->statusBar .setText (" Loading " + path);
306306 auto t1 = std::chrono::high_resolution_clock::now ();
307+ #ifdef WINDOWS
308+ bool res = this ->hexEditor ->loadFile (path.toStdString ());
309+ #else
307310 bool res = this ->hexEditor ->loadFileAsync (path.toStdString ());
311+ #endif
308312 auto t2 = std::chrono::high_resolution_clock::now ();
309313 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>( t2 - t1 ).count ();
310314
@@ -384,7 +388,11 @@ void Fhex::compare(QString filename) {
384388 future<vector<pair<unsigned long , uint8_t >>> fut_res = async ([this , filename]()
385389 {
386390 HexEditor newHexEditor;
391+ #ifdef WINDOWS
392+ newHexEditor.loadFile (filename.toStdString ());
393+ #else
387394 newHexEditor.loadFileAsync (filename.toStdString ());
395+ #endif
388396 while (!newHexEditor.isFileLoaded ()) {
389397 std::this_thread::sleep_for (std::chrono::milliseconds (100 ));
390398 }
You can’t perform that action at this time.
0 commit comments