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);
|
EnableProjectOpenActions(true);
|
||||||
EnableProjectActions(false);
|
EnableProjectActions(false);
|
||||||
|
|
||||||
QStringList args = QCoreApplication::arguments();
|
// Must setup MRU menu before CLI param handling as it can load a
|
||||||
//Remove the application itself
|
// project file and update MRU menu.
|
||||||
args.removeFirst();
|
|
||||||
if (!args.isEmpty()) {
|
|
||||||
HandleCLIParams(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < MaxRecentProjects; ++i) {
|
for (int i = 0; i < MaxRecentProjects; ++i) {
|
||||||
mRecentProjectActs[i] = new QAction(this);
|
mRecentProjectActs[i] = new QAction(this);
|
||||||
mRecentProjectActs[i]->setVisible(false);
|
mRecentProjectActs[i]->setVisible(false);
|
||||||
|
@ -151,6 +146,13 @@ MainWindow::MainWindow() :
|
||||||
mUI.mActionProjectMRU->setVisible(false);
|
mUI.mActionProjectMRU->setVisible(false);
|
||||||
UpdateMRUMenuItems();
|
UpdateMRUMenuItems();
|
||||||
|
|
||||||
|
QStringList args = QCoreApplication::arguments();
|
||||||
|
//Remove the application itself
|
||||||
|
args.removeFirst();
|
||||||
|
if (!args.isEmpty()) {
|
||||||
|
HandleCLIParams(args);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < mPlatforms.getCount(); i++) {
|
for (int i = 0; i < mPlatforms.getCount(); i++) {
|
||||||
Platform plat = mPlatforms.mPlatforms[i];
|
Platform plat = mPlatforms.mPlatforms[i];
|
||||||
QAction *act = new QAction(this);
|
QAction *act = new QAction(this);
|
||||||
|
|
Loading…
Reference in New Issue