GUI: Fix crash opening project file from command line.
The GUI crashed if the project file was tried to open from the command line. The project file loading was run before the MRU menu was created but tried to add a new item to it.
This commit is contained in:
parent
42b7a4fadd
commit
362c5f604c
|
@ -134,13 +134,8 @@ MainWindow::MainWindow() :
|
|||
EnableProjectOpenActions(true);
|
||||
EnableProjectActions(false);
|
||||
|
||||
QStringList args = QCoreApplication::arguments();
|
||||
//Remove the application itself
|
||||
args.removeFirst();
|
||||
if (!args.isEmpty()) {
|
||||
HandleCLIParams(args);
|
||||
}
|
||||
|
||||
// Must setup MRU menu before CLI param handling as it can load a
|
||||
// project file and update MRU menu.
|
||||
for (int i = 0; i < MaxRecentProjects; ++i) {
|
||||
mRecentProjectActs[i] = new QAction(this);
|
||||
mRecentProjectActs[i]->setVisible(false);
|
||||
|
@ -151,6 +146,13 @@ MainWindow::MainWindow() :
|
|||
mUI.mActionProjectMRU->setVisible(false);
|
||||
UpdateMRUMenuItems();
|
||||
|
||||
QStringList args = QCoreApplication::arguments();
|
||||
//Remove the application itself
|
||||
args.removeFirst();
|
||||
if (!args.isEmpty()) {
|
||||
HandleCLIParams(args);
|
||||
}
|
||||
|
||||
for (int i = 0; i < mPlatforms.getCount(); i++) {
|
||||
Platform plat = mPlatforms.mPlatforms[i];
|
||||
QAction *act = new QAction(this);
|
||||
|
|
Loading…
Reference in New Issue