From fbd25fe84e6f417bc9b80a714f9b77c103b3a432 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 21 Jul 2010 12:18:50 +0200
Subject: [PATCH] debugger: fix cursor busy state in output pane and in state
 DebuggerFinished.

---
 src/plugins/debugger/debuggeroutputwindow.cpp |  4 ++--
 src/plugins/debugger/debuggeroutputwindow.h   |  3 ++-
 src/plugins/debugger/debuggerplugin.cpp       | 20 +++----------------
 3 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp
index d04460144da..cc83911adf1 100644
--- a/src/plugins/debugger/debuggeroutputwindow.cpp
+++ b/src/plugins/debugger/debuggeroutputwindow.cpp
@@ -446,8 +446,8 @@ void DebuggerOutputWindow::clearContents()
 
 void DebuggerOutputWindow::setCursor(const QCursor &cursor)
 {
-    m_combinedText->setCursor(cursor);
-    m_inputText->setCursor(cursor);
+    m_combinedText->viewport()->setCursor(cursor);
+    m_inputText->viewport()->setCursor(cursor);
     QWidget::setCursor(cursor);
 }
 
diff --git a/src/plugins/debugger/debuggeroutputwindow.h b/src/plugins/debugger/debuggeroutputwindow.h
index b43c13ac0b8..e203211468c 100644
--- a/src/plugins/debugger/debuggeroutputwindow.h
+++ b/src/plugins/debugger/debuggeroutputwindow.h
@@ -33,8 +33,9 @@
 #include <QtGui/QWidget>
 
 QT_BEGIN_NAMESPACE
-class QPlainTextEdit;
+class QCursor;
 class QLineEdit;
+class QPlainTextEdit;
 QT_END_NAMESPACE
 
 namespace Debugger {
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 7d6b91db74e..1db8857ab97 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1269,7 +1269,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
     localsAndWatchers->addWidget(m_localsWindow);
     localsAndWatchers->addWidget(m_returnWindow);
     localsAndWatchers->addWidget(m_watchersWindow);
-    //localsAndWatchers->addWidget(m_tooltipWindow);
     localsAndWatchers->setStretchFactor(0, 3);
     localsAndWatchers->setStretchFactor(1, 1);
     localsAndWatchers->setStretchFactor(2, 1);
@@ -2028,33 +2027,19 @@ void DebuggerPluginPrivate::setBusyCursor(bool busy)
     //STATE_DEBUG("BUSY FROM: " << m_busy << " TO: " << busy);
     if (busy == m_busy)
         return;
-
     m_busy = busy;
-
     QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor);
     m_breakWindow->setCursor(cursor);
-    m_returnWindow->setCursor(cursor);
     m_localsWindow->setCursor(cursor);
     m_modulesWindow->setCursor(cursor);
     m_outputWindow->setCursor(cursor);
     m_registerWindow->setCursor(cursor);
-    m_stackWindow->setCursor(cursor);
-    m_sourceFilesWindow->setCursor(cursor);
-    m_threadsWindow->setCursor(cursor);
-    //m_tooltipWindow->setCursor(cursor);
-    m_watchersWindow->setCursor(cursor);
-
-    m_breakWindow->setCursor(cursor);
     m_returnWindow->setCursor(cursor);
-    m_localsWindow->setCursor(cursor);
-    m_modulesWindow->setCursor(cursor);
-    m_outputWindow->setCursor(cursor);
-    m_registerWindow->setCursor(cursor);
-    m_stackWindow->setCursor(cursor);
     m_sourceFilesWindow->setCursor(cursor);
+    m_stackWindow->setCursor(cursor);
     m_threadsWindow->setCursor(cursor);
-    //m_tooltipWindow->setCursor(cursor);
     m_watchersWindow->setCursor(cursor);
+    m_snapshotWindow->setCursor(cursor);
 }
 
 void DebuggerPluginPrivate::setSimpleDockWidgetArrangement(const QString &activeLanguage)
@@ -2260,6 +2245,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
 
     const bool notbusy = m_state == InferiorStopOk
         || m_state == DebuggerNotReady
+        || m_state == DebuggerFinished
         || m_state == InferiorUnrunnable;
     setBusyCursor(!notbusy);
 
-- 
GitLab