diff --git a/debugjob.h b/debugjob.h --- a/debugjob.h +++ b/debugjob.h @@ -82,6 +82,7 @@ private slots: void sessionFinished(); + void processError(QProcess::ProcessError); private: QUrl m_url; diff --git a/debugjob.cpp b/debugjob.cpp --- a/debugjob.cpp +++ b/debugjob.cpp @@ -258,7 +258,6 @@ setError(-1); QString errmsg = i18n("Could not start program '%1'. Make sure that the " "path is specified correctly.", m_proc->property("executable").toString()); - KMessageBox::error(KDevelop::ICore::self()->uiController()->activeMainWindow(), errmsg, i18n("Could not start application")); setErrorText(errmsg); emitResult(); } @@ -266,6 +265,12 @@ if (m_session && m_session->connection()) { m_session->connection()->setState(DebugSession::EndedState); + + } + else if(m_session) + { + m_session->stateChanged(DebugSession::EndedState); + m_session->stopDebugger(); } } @@ -288,7 +293,9 @@ setCapabilities(Killable); session->setLaunchConfiguration(cfg); - + + setObjectName(cfg->name()); + IExecuteBrowserPlugin* iface = KDevelop::ICore::self()->pluginController() ->pluginForExtension("org.kdevelop.IExecuteBrowserPlugin")->extension(); Q_ASSERT(iface); @@ -336,10 +343,38 @@ } } else { KProcess proc(this); + proc.setProgram(QStringList() << m_browser << url.url()); - proc.execute(); + if( !proc.startDetached() ) + { + processError(QProcess::FailedToStart); + } + + } +} + + +void XDebugBrowserJob::processError(QProcess::ProcessError error) +{ + qWarning() << "Cannot start application" << m_browser << " error " << error; + if (error == QProcess::FailedToStart) { + setError(-1); + QString errmsg = i18n("Could not start program '%1'. Make sure that the " + "path is specified correctly.", m_browser); + setErrorText(errmsg); emitResult(); } + qDebug() << "Process error"; + + if (m_session && m_session->connection()) { + m_session->connection()->setState(DebugSession::EndedState); + } + else if(m_session) + { + m_session->stateChanged(DebugSession::EndedState); + m_session->stopDebugger(); + } + } bool XDebugBrowserJob::doKill() @@ -356,4 +391,5 @@ { emitResult(); } + }