forked from qt-creator/qt-creator
ProjectExplorer: Fix enabling of buttons in the output pane.
Enable debug only if run control has a valid process handle. Restore icon of rerun-button. Take the concept of the ProcessHandle further (give it descriptive string, add change signal to run control, clear it when process stops to correctly enable debug). No longer set ProcessHandle to debug run control as this would allow attach a 2nd debugger to the process. Reviewed-by: hjk Change-Id: Iecf388e239fcd365864fe59177d76afac7484ecc Reviewed-on: http://codereview.qt.nokia.com/1212 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -154,8 +154,43 @@ IRunConfigurationFactory *findRunConfigurationFactory(RunConfigurationFactoryMat
|
||||
\class ProjectExplorer::ProcessHandle
|
||||
\brief Helper class to describe a process.
|
||||
|
||||
Encapsulates parameters of a running process, local (PID) or remote (to be done,
|
||||
address, port, etc).
|
||||
*/
|
||||
|
||||
ProcessHandle::ProcessHandle(quint64 pid) :
|
||||
m_pid(pid)
|
||||
{
|
||||
}
|
||||
|
||||
bool ProcessHandle::isValid() const
|
||||
{
|
||||
return m_pid != 0;
|
||||
}
|
||||
|
||||
void ProcessHandle::setPid(quint64 pid)
|
||||
{
|
||||
m_pid = pid;
|
||||
}
|
||||
|
||||
quint64 ProcessHandle::pid() const
|
||||
{
|
||||
return m_pid;
|
||||
}
|
||||
|
||||
QString ProcessHandle::toString() const
|
||||
{
|
||||
if (m_pid)
|
||||
return RunControl::tr("PID %1").arg(m_pid);
|
||||
//: Invalid process handle.
|
||||
return RunControl::tr("Invalid");
|
||||
}
|
||||
|
||||
bool ProcessHandle::equals(const ProcessHandle &rhs) const
|
||||
{
|
||||
return m_pid == rhs.m_pid;
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::RunConfiguration
|
||||
\brief Base class for a run configuration. A run configuration specifies how a
|
||||
@@ -506,7 +541,10 @@ ProcessHandle RunControl::applicationProcessHandle() const
|
||||
|
||||
void RunControl::setApplicationProcessHandle(const ProcessHandle &handle)
|
||||
{
|
||||
m_applicationProcessHandle = handle;
|
||||
if (m_applicationProcessHandle != handle) {
|
||||
m_applicationProcessHandle = handle;
|
||||
emit applicationProcessHandleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool RunControl::promptToStop(bool *optionalPrompt) const
|
||||
|
||||
Reference in New Issue
Block a user