mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-18 09:35:17 -04:00
Fix close down semantics and suppress subprocess errors during close down
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6705 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
9773afcb0a
commit
b49999f96d
@ -1492,7 +1492,7 @@ void MainWindow::subProcessFailed (QProcess * process, int exit_code, QProcess::
|
|||||||
.arg (exit_code)
|
.arg (exit_code)
|
||||||
.arg (process->program () + ' ' + arguments.join (' '))
|
.arg (process->program () + ' ' + arguments.join (' '))
|
||||||
.arg (QString {process->readAllStandardError()}));
|
.arg (QString {process->readAllStandardError()}));
|
||||||
close ();
|
QTimer::singleShot (0, this, SLOT (close ()));
|
||||||
m_valid = false; // ensures exit if still constructing
|
m_valid = false; // ensures exit if still constructing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1510,13 +1510,14 @@ void MainWindow::subProcessError (QProcess * process, QProcess::ProcessError)
|
|||||||
msgBox (tr ("Subprocess error\nRunning: %1\n%2")
|
msgBox (tr ("Subprocess error\nRunning: %1\n%2")
|
||||||
.arg (process->program () + ' ' + arguments.join (' '))
|
.arg (process->program () + ' ' + arguments.join (' '))
|
||||||
.arg (process->errorString ()));
|
.arg (process->errorString ()));
|
||||||
close ();
|
QTimer::singleShot (0, this, SLOT (close ()));
|
||||||
m_valid = false; // ensures exit if still constructing
|
m_valid = false; // ensures exit if still constructing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent * e)
|
void MainWindow::closeEvent(QCloseEvent * e)
|
||||||
{
|
{
|
||||||
|
m_valid = false; // suppresses subprocess errors
|
||||||
m_config.transceiver_offline ();
|
m_config.transceiver_offline ();
|
||||||
writeSettings ();
|
writeSettings ();
|
||||||
m_guiTimer.stop ();
|
m_guiTimer.stop ();
|
||||||
@ -1530,7 +1531,7 @@ void MainWindow::closeEvent(QCloseEvent * e)
|
|||||||
quitFile.open(QIODevice::ReadWrite);
|
quitFile.open(QIODevice::ReadWrite);
|
||||||
QFile {m_config.temp_dir ().absoluteFilePath (".lock")}.remove(); // Allow jt9 to terminate
|
QFile {m_config.temp_dir ().absoluteFilePath (".lock")}.remove(); // Allow jt9 to terminate
|
||||||
bool b=proc_jt9.waitForFinished(1000);
|
bool b=proc_jt9.waitForFinished(1000);
|
||||||
if(!b) proc_jt9.kill();
|
if(!b) proc_jt9.close();
|
||||||
quitFile.remove();
|
quitFile.remove();
|
||||||
|
|
||||||
Q_EMIT finished ();
|
Q_EMIT finished ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user