From 39bec638d2f681019fbc8e762427fe1b820f7078 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 11 Nov 2008 21:38:02 +0100 Subject: [PATCH] Use the standard menu entry to show and hide the toolbar. This avoids the deprecated KStdAction::showToolbar() function and a compiler warning. Based on work by Matt McCormick (thewtex) --- kdbg/dbgmainwnd.cpp | 14 ++------------ kdbg/dbgmainwnd.h | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/kdbg/dbgmainwnd.cpp b/kdbg/dbgmainwnd.cpp index 1de4a03..de1fbbd 100644 --- a/kdbg/dbgmainwnd.cpp +++ b/kdbg/dbgmainwnd.cpp @@ -79,6 +79,7 @@ DebuggerMainWnd::DebuggerMainWnd(const char* name) : m_bpTable->setDebugger(m_debugger); m_memoryWindow->setDebugger(m_debugger); + setStandardToolBarMenuEnabled(true); initKAction(); initToolbar(); // kind of obsolete? @@ -204,7 +205,6 @@ void DebuggerMainWnd::initKAction() SLOT(slotFileGlobalSettings()), actionCollection(), "settings_global"); KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection()); - KStdAction::showToolbar(this, SLOT(slotViewToolbar()), actionCollection()); KStdAction::showStatusbar(this, SLOT(slotViewStatusbar()), actionCollection()); // view menu @@ -310,9 +310,6 @@ void DebuggerMainWnd::initKAction() void DebuggerMainWnd::initToolbar() { KToolBar* toolbar = toolBar("mainToolBar"); - toolbar->setBarPos(KToolBar::Top); - //moveToolBar(toolbar); - toolbar->insertAnimatedWidget(ID_STATUS_BUSY, actionCollection()->action("exec_break"), SLOT(activate()), "pulse", -1); @@ -867,20 +864,13 @@ void DebuggerMainWnd::slotFileProgSettings() } } -void DebuggerMainWnd::slotViewToolbar() -{ - if (toolBar()->isVisible()) - toolBar()->hide(); - else - toolBar()->show(); -} - void DebuggerMainWnd::slotViewStatusbar() { if (statusBar()->isVisible()) statusBar()->hide(); else statusBar()->show(); + setSettingsDirty(); } void DebuggerMainWnd::slotExecUntil() diff --git a/kdbg/dbgmainwnd.h b/kdbg/dbgmainwnd.h index bfb8013..e3133b3 100644 --- a/kdbg/dbgmainwnd.h +++ b/kdbg/dbgmainwnd.h @@ -103,7 +103,6 @@ public slots: void slotFileCore(); void slotFileGlobalSettings(); void slotFileProgSettings(); - void slotViewToolbar(); void slotViewStatusbar(); void slotExecUntil(); void slotExecAttach(); -- 2.11.4.GIT