Emulation: Fix boot path resolving

* Fix /dev_flash executables path arg. (/host_root is wrong for it)
* Fix usage of /host_root for homebrew applications when it is not mounted, use /app_home.
* Fix path source detection. (don't get fooled by path slashes repetitions, symlinks, '.', ".." and ('\' on Windows))
* Unescape tail of /dev_hdd0 paths.
This commit is contained in:
Eladash 2021-04-06 23:16:58 +03:00 committed by Ivan
parent 95725bf7fc
commit 49c5ce30cc
7 changed files with 70 additions and 124 deletions

View file

@ -27,6 +27,7 @@
#include <QFontDatabase>
#include <QLibraryInfo>
#include <QDirIterator>
#include <QFileInfo>
#include <clocale>
@ -390,6 +391,11 @@ void gui_application::InitializeCallbacks()
return localized_emu::get_u32string(id, args);
};
callbacks.resolve_path = [](std::string_view sv)
{
return QFileInfo(QString::fromUtf8(sv.data(), static_cast<int>(sv.size()))).canonicalFilePath().toStdString();
};
Emu.SetCallbacks(std::move(callbacks));
}