Commit 2851d290 authored by Christoph Feck's avatar Christoph Feck

KMenu -> QMenu

This fixes finding the tools menu, as well as undo/redo popups
parent 1e4f4248
...@@ -35,13 +35,13 @@ ...@@ -35,13 +35,13 @@
#include <qdatetime.h> #include <qdatetime.h>
#include <qlinkedlist.h> #include <qlinkedlist.h>
#include <qmenu.h>
#include <kapplication.h> #include <kapplication.h>
#include <kconfig.h> #include <kconfig.h>
#include <kdebug.h> #include <kdebug.h>
#include <kglobal.h> #include <kglobal.h>
#include <klocale.h> #include <klocale.h>
#include <kmenu.h>
#include <kstandardshortcut.h> #include <kstandardshortcut.h>
#include <kstandardaction.h> #include <kstandardaction.h>
#include <ktoolbarpopupaction.h> #include <ktoolbarpopupaction.h>
...@@ -617,7 +617,7 @@ void kpCommandHistoryBase::trimCommandLists () ...@@ -617,7 +617,7 @@ void kpCommandHistoryBase::trimCommandLists ()
} }
static void populatePopupMenu (KMenu *popupMenu, static void populatePopupMenu (QMenu *popupMenu,
const QString &undoOrRedo, const QString &undoOrRedo,
const QLinkedList <kpCommand *> &commandList) const QLinkedList <kpCommand *> &commandList)
{ {
...@@ -640,7 +640,7 @@ static void populatePopupMenu (KMenu *popupMenu, ...@@ -640,7 +640,7 @@ static void populatePopupMenu (KMenu *popupMenu,
{ {
// TODO: maybe have a scrollview show all the items instead, like KOffice in KDE 3 // TODO: maybe have a scrollview show all the items instead, like KOffice in KDE 3
// LOCOMPAT: should be centered text. // 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)); commandList.size () - i));
} }
} }
...@@ -666,7 +666,7 @@ void kpCommandHistoryBase::updateActions () ...@@ -666,7 +666,7 @@ void kpCommandHistoryBase::updateActions ()
#if DEBUG_KP_COMMAND_HISTORY #if DEBUG_KP_COMMAND_HISTORY
QTime timer; timer.start (); QTime timer; timer.start ();
#endif #endif
populatePopupMenu (qobject_cast<KMenu*> (m_actionUndo->menu ()), populatePopupMenu (m_actionUndo->menu (),
i18n ("Undo"), i18n ("Undo"),
m_undoCommandList); m_undoCommandList);
#if DEBUG_KP_COMMAND_HISTORY #if DEBUG_KP_COMMAND_HISTORY
...@@ -687,7 +687,7 @@ void kpCommandHistoryBase::updateActions () ...@@ -687,7 +687,7 @@ void kpCommandHistoryBase::updateActions ()
#if DEBUG_KP_COMMAND_HISTORY #if DEBUG_KP_COMMAND_HISTORY
timer.restart (); timer.restart ();
#endif #endif
populatePopupMenu (qobject_cast<KMenu*> (m_actionRedo->menu ()), populatePopupMenu (m_actionRedo->menu (),
i18n ("Redo"), i18n ("Redo"),
m_redoCommandList); m_redoCommandList);
#if DEBUG_KP_COMMAND_HISTORY #if DEBUG_KP_COMMAND_HISTORY
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <kpMainWindowPrivate.h> #include <kpMainWindowPrivate.h>
#include <qevent.h> #include <qevent.h>
#include <qmenu.h>
#include <qtimer.h> #include <qtimer.h>
#include <kconfig.h> #include <kconfig.h>
...@@ -37,8 +38,6 @@ ...@@ -37,8 +38,6 @@
#include <kdebug.h> #include <kdebug.h>
#include <kglobal.h> #include <kglobal.h>
#include <klocale.h> #include <klocale.h>
#include <KMenu>
#include <KMenuBar>
#include <krecentfilesaction.h> #include <krecentfilesaction.h>
#include <kpAbstractImageSelection.h> #include <kpAbstractImageSelection.h>
...@@ -179,9 +178,9 @@ void kpMainWindow::finalizeGUI(KXMLGUIClient *client) ...@@ -179,9 +178,9 @@ void kpMainWindow::finalizeGUI(KXMLGUIClient *client)
{ {
if ( client == this ) if ( client == this )
{ {
const QList<KMenu *> menuToHide = findChildren<KMenu *>("toolToolBarHiddenMenu"); const QList<QMenu *> menuToHide = findChildren<QMenu *>("toolToolBarHiddenMenu");
// should only contain one but... // should only contain one but...
foreach (KMenu *menu, menuToHide) foreach (QMenu *menu, menuToHide)
{ {
menu->menuAction()->setVisible(false); menu->menuAction()->setVisible(false);
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <qaction.h> #include <qaction.h>
#include <qcolor.h> #include <qcolor.h>
#include <qmenubar.h>
#include <qsize.h> #include <qsize.h>
#include <kactioncollection.h> #include <kactioncollection.h>
...@@ -40,7 +41,6 @@ ...@@ -40,7 +41,6 @@
#include <kdebug.h> #include <kdebug.h>
#include <kglobal.h> #include <kglobal.h>
#include <klocale.h> #include <klocale.h>
#include <kmenubar.h>
#include <KToggleAction> #include <KToggleAction>
#include <kpAbstractImageSelection.h> #include <kpAbstractImageSelection.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment