File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -397,24 +397,19 @@ EmuCallbacks main_application::CreateCallbacks()
397397 fi.setFile (fi.path ());
398398 }
399399
400- const QString result = QDir ( fi.canonicalFilePath ()).filePath (tail);
400+ QString result = QDir::cleanPath ( QDir ( fi.canonicalFilePath ()).filePath (tail) );
401401
402402#ifdef _WIN32
403- std::string result_with_drive = QDir::cleanPath (result).toStdString ();
404-
405- if (!tail.isEmpty () && sv.starts_with (" /" ) && !sv.starts_with (" //" ))
403+ if (sv.starts_with (" /" ) && !sv.starts_with (" //" ))
406404 {
407405 // Erase absolute path for non-existant path
408- if (result_with_drive .size () > 1 && result_with_drive [1 ] == ' :' )
406+ if (result .size () >= 3 && result [1 ] == ' :' && result[ 2 ] == ' / ' )
409407 {
410- result_with_drive. erase (result_with_drive. begin (), result_with_drive. begin () + 2 );
408+ result. remove ( 0 , 2 );
411409 }
412410 }
413-
414- return result_with_drive;
415- #else
416- return QDir::cleanPath (result).toStdString ();
417411#endif
412+ return result.toStdString ();
418413 };
419414
420415 callbacks.get_font_dirs = []()
You can’t perform that action at this time.
0 commit comments