From ab473de90a2d884c517f48f5921b9a82b1270aad Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Tue, 1 Mar 2011 01:52:37 +0100 Subject: [Fix] Startup problems with xsession (Quick&Dirty) --- src/vsession.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/vsession.cpp') diff --git a/src/vsession.cpp b/src/vsession.cpp index 31602ed..16a8a97 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -16,6 +16,7 @@ bool VSession::init(const QString& xml, const QString& baseDirPath) { this->baseDirPath_ = baseDirPath; + _process = new QProcess(); return this->doc_.setContent(xml); } @@ -275,8 +276,12 @@ bool VSession::run() const { tmpfile.close(); tmpfile.setAutoRemove(false); - return QProcess::startDetached(runVmScript, - QStringList(tmpfile.fileName())); + _process->start(runVmScript, QStringList(tmpfile.fileName())); + QObject::connect(_process, SIGNAL(finished(int, QProcess::ExitStatus)), QApplication::instance(), SLOT(quit())); + if (_process->state() == QProcess::Starting || QProcess::Running) + return true; + else + return false; } QList VSession::readXmlFile(const QString& filepath) { -- cgit v1.2.3-55-g7522