1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix icons path for macOS if editor started from installed package

This commit is contained in:
nordsoft 2022-12-20 19:11:49 +04:00 committed by Nordsoft91
parent 4674e240d8
commit 3a49bc6f8b

View File

@ -120,6 +120,10 @@ MainWindow::MainWindow(QWidget* parent) :
ui(new Ui::MainWindow),
controller(this)
{
// Set current working dir to executable folder.
// This is important on Mac for relative paths to work inside DMG.
QDir::setCurrent(QApplication::applicationDirPath());
for(auto & string : VCMIDirs::get().dataPaths())
QDir::addSearchPath("icons", pathToQString(string / "mapeditor" / "icons"));
QDir::addSearchPath("icons", pathToQString(VCMIDirs::get().userDataPath() / "mapeditor" / "icons"));
@ -128,10 +132,6 @@ MainWindow::MainWindow(QWidget* parent) :
loadUserSettings(); //For example window size
setTitle();
// Set current working dir to executable folder.
// This is important on Mac for relative paths to work inside DMG.
QDir::setCurrent(QApplication::applicationDirPath());
ExtractionOptions extractionOptions;
parseCommandLine(extractionOptions);