summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Feck <[email protected]>2014-10-02 00:03:34 +0200
committerChristoph Feck <[email protected]>2014-10-02 00:03:34 +0200
commit2851d2904b86ed841829f2e305755c3b6bd7b015 (patch)
tree1c4960e8a300a4e664bb2411caacb8631736c72b
parent1e4f42485e5a053b672940c4e3dd39046df11a46 (diff)
KMenu -> QMenu
This fixes finding the tools menu, as well as undo/redo popups
-rw-r--r--commands/kpCommandHistoryBase.cpp10
-rw-r--r--mainWindow/kpMainWindow.cpp7
-rw-r--r--mainWindow/kpMainWindow_Image.cpp2
3 files changed, 9 insertions, 10 deletions
diff --git a/commands/kpCommandHistoryBase.cpp b/commands/kpCommandHistoryBase.cpp
index 4e7f7d2..6140a2f 100644
--- a/commands/kpCommandHistoryBase.cpp
+++ b/commands/kpCommandHistoryBase.cpp
@@ -35,13 +35,13 @@
#include <qdatetime.h>
#include <qlinkedlist.h>
+#include <qmenu.h>
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
-#include <kmenu.h>
#include <kstandardshortcut.h>
#include <kstandardaction.h>
#include <ktoolbarpopupaction.h>
@@ -617,7 +617,7 @@ void kpCommandHistoryBase::trimCommandLists ()
}
-static void populatePopupMenu (KMenu *popupMenu,
+static void populatePopupMenu (QMenu *popupMenu,
const QString &undoOrRedo,
const QLinkedList <kpCommand *> &commandList)
{
@@ -640,7 +640,7 @@ static void populatePopupMenu (KMenu *popupMenu,
{
// TODO: maybe have a scrollview show all the items instead, like KOffice in KDE 3
// LOCOMPAT: should be centered text.
- popupMenu->addTitle (i18np ("%1 more item", "%1 more items",
+ popupMenu->addSection (i18np ("%1 more item", "%1 more items",
commandList.size () - i));
}
}
@@ -666,7 +666,7 @@ void kpCommandHistoryBase::updateActions ()
#if DEBUG_KP_COMMAND_HISTORY
QTime timer; timer.start ();
#endif
- populatePopupMenu (qobject_cast<KMenu*> (m_actionUndo->menu ()),
+ populatePopupMenu (m_actionUndo->menu (),
i18n ("Undo"),
m_undoCommandList);
#if DEBUG_KP_COMMAND_HISTORY
@@ -687,7 +687,7 @@ void kpCommandHistoryBase::updateActions ()
#if DEBUG_KP_COMMAND_HISTORY
timer.restart ();
#endif
- populatePopupMenu (qobject_cast<KMenu*> (m_actionRedo->menu ()),
+ populatePopupMenu (m_actionRedo->menu (),
i18n ("Redo"),
m_redoCommandList);
#if DEBUG_KP_COMMAND_HISTORY
diff --git a/mainWindow/kpMainWindow.cpp b/mainWindow/kpMainWindow.cpp
index 8387b4a..27049af 100644
--- a/mainWindow/kpMainWindow.cpp
+++ b/mainWindow/kpMainWindow.cpp
@@ -30,6 +30,7 @@
#include <kpMainWindowPrivate.h>
#include <qevent.h>
+#include <qmenu.h>
#include <qtimer.h>
#include <kconfig.h>
@@ -37,8 +38,6 @@
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
-#include <KMenu>
-#include <KMenuBar>
#include <krecentfilesaction.h>
#include <kpAbstractImageSelection.h>
@@ -179,9 +178,9 @@ void kpMainWindow::finalizeGUI(KXMLGUIClient *client)
{
if ( client == this )
{
- const QList<KMenu *> menuToHide = findChildren<KMenu *>("toolToolBarHiddenMenu");
+ const QList<QMenu *> menuToHide = findChildren<QMenu *>("toolToolBarHiddenMenu");
// should only contain one but...
- foreach (KMenu *menu, menuToHide)
+ foreach (QMenu *menu, menuToHide)
{
menu->menuAction()->setVisible(false);
}
diff --git a/mainWindow/kpMainWindow_Image.cpp b/mainWindow/kpMainWindow_Image.cpp
index ab8a04b..11e21de 100644
--- a/mainWindow/kpMainWindow_Image.cpp
+++ b/mainWindow/kpMainWindow_Image.cpp
@@ -31,6 +31,7 @@
#include <qaction.h>
#include <qcolor.h>
+#include <qmenubar.h>
#include <qsize.h>
#include <kactioncollection.h>
@@ -40,7 +41,6 @@
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
-#include <kmenubar.h>
#include <KToggleAction>
#include <kpAbstractImageSelection.h>