Browse Source

Fix icons path for macOS if editor started from installed package

nordsoft 2 năm trước cách đây
mục cha
commit
3a49bc6f8b
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      mapeditor/mainwindow.cpp

+ 4 - 4
mapeditor/mainwindow.cpp

@@ -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);