diff options
author | hjk <hjk@qt.io> | 2017-03-13 13:48:55 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-03-24 13:37:46 +0000 |
commit | 2360a2d743514014db57ec143c5ff1b469e5ada1 (patch) | |
tree | 9a52695e0d5a13898fabd95aa33e13bccbe2117a /src/plugins/projectexplorer/appoutputpane.cpp | |
parent | 1a416d3f982d1fc574c578fdd6bafce51714f8a3 (diff) | |
download | qt-creator-2360a2d743514014db57ec143c5ff1b469e5ada1.tar.gz |
ProjectExplorer: Run RunControl::{start,stop} always asynchronously
This introduces a mini-state-"machine" to handle RunControl states
Intialized->[Starting->Running->Stopping->Stopped->]*->Finished.
Needing time between trying to start and getting feedback is nowadays
the normal setup for all remote targets as well as for most local tools.
Making that the default for all runs simplifies the code and provides an
opportunity to (a) fix some currently wrong reports of "stopped
immediately" and (b) to remove target-specific (WinRT) or tool-specific
(Valgrind, GammaRay) state members doing essentially the same.
Change-Id: I7f52fee41144188ee8389e922fdc265f8c0a6459
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/appoutputpane.cpp')
-rw-r--r-- | src/plugins/projectexplorer/appoutputpane.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 4be4b6697d..e387b1d0da 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -506,7 +506,7 @@ void AppOutputPane::reRunRunControl() handleOldOutput(tab.window); tab.window->scrollToBottom(); - tab.runControl->start(); + tab.runControl->initiateStart(); } void AppOutputPane::attachToRunControl() @@ -525,7 +525,7 @@ void AppOutputPane::stopRunControl() RunControl *rc = m_runControlTabs.at(index).runControl; if (rc->isRunning() && optionallyPromptToStop(rc)) - rc->stop(); + rc->initiateStop(); if (debug) qDebug() << "OutputPane::stopRunControl " << rc; @@ -556,7 +556,7 @@ bool AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode) if (debug) qDebug() << "OutputPane::closeTab tab " << tabIndex << m_runControlTabs[index].runControl - << m_runControlTabs[index].window << m_runControlTabs[index].asyncClosing; + << m_runControlTabs[index].window; // Prompt user to stop if (m_runControlTabs[index].runControl->isRunning()) { switch (closeTabMode) { @@ -575,15 +575,8 @@ bool AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode) break; } if (m_runControlTabs[index].runControl->isRunning()) { // yes it might have stopped already, then just close - QWidget *tabWidget = m_tabWidget->widget(tabIndex); - if (m_runControlTabs[index].runControl->stop() == RunControl::AsynchronousStop) { - m_runControlTabs[index].asyncClosing = true; - return false; - } - tabIndex = m_tabWidget->indexOf(tabWidget); - index = indexOf(tabWidget); - if (tabIndex == -1 || index == -1) - return false; + m_runControlTabs[index].runControl->initiateStop(); + return false; } } @@ -741,10 +734,6 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender) m_runControlTabs.at(senderIndex).window->setFormatter(nullptr); // Reset formater for this RC - // Check for asynchronous close. Close the tab. - if (m_runControlTabs.at(senderIndex).asyncClosing) - closeTab(tabWidgetIndexOf(senderIndex), CloseTabNoPrompt); - emit runControlFinished(sender); if (!isRunning()) |