diff --git a/iaito_win32 b/iaito_win32 index 67f5cc71..d06d30b2 160000 --- a/iaito_win32 +++ b/iaito_win32 @@ -1 +1 @@ -Subproject commit 67f5cc7119faddf1eac5dab6e4f4b7639d6a0a85 +Subproject commit d06d30b2742899c0ac098374078a58848a9d2986 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b5cac6b5..3e017149 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -959,17 +960,8 @@ void MainWindow::add_debug_output(QString msg) void MainWindow::on_actionNew_triggered() { - QString path = qApp->applicationDirPath(); - eprintf ("(((%s)))\n", path.toLocal8Bit().data()); - int pid = fork(); - if (pid==-1) - return; - if(!pid) { - QString cmd = path+ "/iaito"; - system (cmd.toLocal8Bit().data()); - exit(0); - } - exit(0); + qApp->quit(); + on_actionLoad_triggered(); } void MainWindow::on_actionSave_triggered() @@ -1016,15 +1008,10 @@ void MainWindow::on_actionSDB_browser_triggered() void MainWindow::on_actionLoad_triggered() { - QString path = qApp->applicationDirPath(); - eprintf ("(((%s)))\n", path.toLocal8Bit().data()); - int pid = fork(); - if (pid==-1) - return; - if(!pid) { - QString cmd = path+ "/iaito"; - exit(system (cmd.toLocal8Bit().data())); - } + QProcess* process = new QProcess(this); + process->setProgram(qApp->applicationFilePath()); + process->setEnvironment(QProcess::systemEnvironment()); + process->start(); } void MainWindow::on_actionShow_Hide_mainsidebar_triggered()