dont use 'fork' (closes issue #20)

This commit is contained in:
mrexodia 2017-03-31 02:40:27 +02:00
parent bcfd398d1d
commit 0cc548e96e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 8 additions and 21 deletions

@ -1 +1 @@
Subproject commit 67f5cc7119faddf1eac5dab6e4f4b7639d6a0a85
Subproject commit d06d30b2742899c0ac098374078a58848a9d2986

View File

@ -20,6 +20,7 @@
#include <QFileDialog>
#include <QPropertyAnimation>
#include <QStyledItemDelegate>
#include <QProcess>
#include <QtGlobal>
#include <QToolTip>
@ -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()