Hide debug toolbar outside of debug area

Niko Sams niko.sams at gmail.com
Sat Apr 10 06:47:21 UTC 2010


Hi,

The debug toolbar should really not be avaliable in code area, this is
especially annoying
for the first-time start of kdevelop.

With the following patch the toolbar gets shown/hidden on area switching.
Issues:
- It's a dirty hack and should be solved properly
- When the user shows/hides the toolbar himself this is overriden on
the next area switch

Niko

diff --git a/kdevplatform/sublime/mainwindow.cpp
b/kdevplatform/sublime/mainwindow.cpp
index 4abbeb1..8c1097f 100644
--- a/kdevplatform/sublime/mainwindow.cpp
+++ b/kdevplatform/sublime/mainwindow.cpp
@@ -145,7 +145,22 @@ void MainWindow::setArea(Area *area)
     d->ignoreDockShown = false;

     loadSettings();
-
+
+    KToolBar *debugToolBar = 0;
+    foreach (KToolBar *t, toolBars()) {
+        if (t->objectName() == "debugToolBar") {
+            debugToolBar = t;
+            break;
+        }
+    }
+    if (debugToolBar) {
+        if (area->objectName() == "debug") {
+            debugToolBar->show();
+        } else {
+            debugToolBar->hide();
+        }
+    }
+
     connect(area, SIGNAL(viewAdded(Sublime::AreaIndex*, Sublime::View*)),
         this, SLOT(viewAdded(Sublime::AreaIndex*, Sublime::View*)));
     connect(area, SIGNAL(viewRemoved(Sublime::AreaIndex*,Sublime::View*)),




More information about the KDevelop-devel mailing list