summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2014-10-12 14:33:19 +0200
committerMontel Laurent <[email protected]>2014-10-12 14:33:19 +0200
commit8245bc4e8a0cfce856aadfb429b7d7ed99867c69 (patch)
tree9d195238153e1db8cebc9651aa0d6ba8a5027f22
parent8d1b26e911371be955e0e74568920611a9b0afea (diff)
Port to QMenu
-rw-r--r--core/plugin/transferfactory.cpp2
-rw-r--r--core/transfergrouphandler.cpp2
-rw-r--r--extensions/konqueror/kget_plug_in.cpp2
-rw-r--r--transfer-plugins/bittorrent/advanceddetails/fileview.cpp4
-rw-r--r--transfer-plugins/bittorrent/advanceddetails/fileview.h4
-rw-r--r--transfer-plugins/bittorrent/advanceddetails/peerview.cpp4
-rw-r--r--transfer-plugins/bittorrent/advanceddetails/peerview.h4
-rw-r--r--ui/contextmenu.cpp22
-rw-r--r--ui/contextmenu.h8
-rw-r--r--ui/droptarget.cpp6
-rw-r--r--ui/droptarget.h4
-rw-r--r--ui/transfersview.cpp6
-rw-r--r--ui/transfersview.h4
-rw-r--r--ui/transfersviewdelegate.cpp4
-rw-r--r--ui/tray.cpp2
15 files changed, 39 insertions, 39 deletions
diff --git a/core/plugin/transferfactory.cpp b/core/plugin/transferfactory.cpp
index b6f3ee3..cc45f88 100644
--- a/core/plugin/transferfactory.cpp
+++ b/core/plugin/transferfactory.cpp
@@ -13,7 +13,7 @@
#include "kget.h"
-#include <kmenu.h>
+#include <QMenu>
#include <klocale.h>
#include <kdebug.h>
diff --git a/core/transfergrouphandler.cpp b/core/transfergrouphandler.cpp
index 355aafa..72d16ec 100644
--- a/core/transfergrouphandler.cpp
+++ b/core/transfergrouphandler.cpp
@@ -18,7 +18,7 @@
#include "core/kget.h"
#include <kdebug.h>
-#include <kmenu.h>
+#include <QMenu>
#include <QAction>
#include <kactioncollection.h>
#include <klocale.h>
diff --git a/extensions/konqueror/kget_plug_in.cpp b/extensions/konqueror/kget_plug_in.cpp
index e6d4b84..f680dba 100644
--- a/extensions/konqueror/kget_plug_in.cpp
+++ b/extensions/konqueror/kget_plug_in.cpp
@@ -23,7 +23,7 @@
#include <KComponentData>
#include <KLocale>
#include <KMessageBox>
-#include <KMenu>
+#include <QMenu>
#include <KRun>
#include <KIcon>
#include <KToolInvocation>
diff --git a/transfer-plugins/bittorrent/advanceddetails/fileview.cpp b/transfer-plugins/bittorrent/advanceddetails/fileview.cpp
index 1ed91ae..07d7aed 100644
--- a/transfer-plugins/bittorrent/advanceddetails/fileview.cpp
+++ b/transfer-plugins/bittorrent/advanceddetails/fileview.cpp
@@ -25,7 +25,7 @@
#include <klocale.h>
#include <kiconloader.h>
#include <kglobal.h>
-#include <kmenu.h>
+#include <QMenu>
#include <krun.h>
#include <kmessagebox.h>
#include <kmimetype.h>
@@ -62,7 +62,7 @@ namespace kt
proxy_model->setSortRole(Qt::UserRole);
setModel(proxy_model);
- context_menu = new KMenu(this);
+ context_menu = new QMenu(this);
open_action = context_menu->addAction(KIcon("document-open"),i18nc("Open file", "Open"),this,SLOT(open()));
context_menu->addSeparator();
download_first_action = context_menu->addAction(i18n("Download first"),this,SLOT(downloadFirst()));
diff --git a/transfer-plugins/bittorrent/advanceddetails/fileview.h b/transfer-plugins/bittorrent/advanceddetails/fileview.h
index 0953193..f53b18d 100644
--- a/transfer-plugins/bittorrent/advanceddetails/fileview.h
+++ b/transfer-plugins/bittorrent/advanceddetails/fileview.h
@@ -24,7 +24,7 @@
#include <util/constants.h>
#include <ksharedconfig.h>
-class KMenu;
+class QMenu;
class QSortFilterProxyModel;
namespace bt
@@ -86,7 +86,7 @@ namespace kt
bt::TorrentInterface* curr_tc;
TorrentFileModel* model;
- KMenu* context_menu;
+ QMenu* context_menu;
QAction* open_action;
QAction* download_first_action;
QAction* download_normal_action;
diff --git a/transfer-plugins/bittorrent/advanceddetails/peerview.cpp b/transfer-plugins/bittorrent/advanceddetails/peerview.cpp
index 8222d5e..31457b7 100644
--- a/transfer-plugins/bittorrent/advanceddetails/peerview.cpp
+++ b/transfer-plugins/bittorrent/advanceddetails/peerview.cpp
@@ -23,7 +23,7 @@
#include <QHeaderView>
#include <klocale.h>
#include <kicon.h>
-#include <kmenu.h>
+#include <QMenu>
#include <kstandarddirs.h>
#include <kconfiggroup.h>
#include <interfaces/peerinterface.h>
@@ -48,7 +48,7 @@ namespace kt
model = new PeerViewModel(this);
setModel(model);
- context_menu = new KMenu(this);
+ context_menu = new QMenu(this);
context_menu->addAction(KIcon("list-remove-user"),i18n("Kick Peer"),this,SLOT(kickPeer()));
context_menu->addAction(KIcon("view-filter"),i18n("Ban Peer"),this,SLOT(banPeer()));
connect(this,SIGNAL(customContextMenuRequested(QPoint)),
diff --git a/transfer-plugins/bittorrent/advanceddetails/peerview.h b/transfer-plugins/bittorrent/advanceddetails/peerview.h
index 1eb3994..70e25f2 100644
--- a/transfer-plugins/bittorrent/advanceddetails/peerview.h
+++ b/transfer-plugins/bittorrent/advanceddetails/peerview.h
@@ -26,7 +26,7 @@
#include <interfaces/peerinterface.h>
#include <ksharedconfig.h>
-class KMenu;
+class QMenu;
namespace kt
{
@@ -63,7 +63,7 @@ namespace kt
void kickPeer();
private:
- KMenu* context_menu;
+ QMenu* context_menu;
PeerViewModel* model;
};
}
diff --git a/ui/contextmenu.cpp b/ui/contextmenu.cpp
index 721c52f..7b57b65 100644
--- a/ui/contextmenu.cpp
+++ b/ui/contextmenu.cpp
@@ -20,14 +20,14 @@
#include "core/plugin/transferfactory.h"
#include "core/transferhandler.h"
#include "core/transfergrouphandler.h"
-#include <KMenu>
+#include <QMenu>
#include <QWidgetAction>
#include <KFileItem>
#include <kfileitemlistproperties.h>
#include <kfileitemactions.h>
-KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers, QWidget *parent)
+QMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers, QWidget *parent)
{
if (transfers.empty())
return 0;
@@ -45,11 +45,11 @@ KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers
// transfers.first()->m_transfer->factory() );
}*/
- KMenu *popup = new KMenu(parent);
- popup->addTitle(transfers.first()->dest().fileName());
+ QMenu *popup = new QMenu(parent);
+ popup->addSection(transfers.first()->dest().fileName());
//Get the transfer factory actions
QList<QAction*> actionList = transfers.first()->factoryActions();
-// popup->addTitle( i18np("%1 Download selected", "%1 Downloads selected", transfers.count()) );
+// popup->addSection( i18np("%1 Download selected", "%1 Downloads selected", transfers.count()) );
//Plug all the actions in the popup menu
popup->addActions(transfers.first()->contextActions());
@@ -72,7 +72,7 @@ KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers
items << transfer->nepomukHandler()->fileItems();
}
- KMenu *nepomukMenu = new KMenu(i18n("Semantic Desktop"), parent);
+ QMenu *nepomukMenu = new QMenu(i18n("Semantic Desktop"), parent);
nepomukMenu->setIcon(KIcon("nepomuk"));
QWidgetAction *nepomukWidgetAction = new QWidgetAction(parent);
Nepomuk2::FileMetaDataWidget *nepomukWidget = new Nepomuk2::FileMetaDataWidget(parent);
@@ -90,9 +90,9 @@ KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers
return popup;
}
-KMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget *parent)
+QMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget *parent)
{
- KMenu *popup = ContextMenu::createTransferContextMenu(QList<TransferHandler*>() << handler, parent);
+ QMenu *popup = ContextMenu::createTransferContextMenu(QList<TransferHandler*>() << handler, parent);
// only shows the open with actions if the transfer is finished
if (handler->status() == Job::Finished || handler->status() == Job::FinishedKeepAlive) {
@@ -117,13 +117,13 @@ KMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget
return popup;
}
-KMenu * ContextMenu::createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent)
+QMenu * ContextMenu::createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent)
{
if (!handler)
return 0;
- KMenu * popup = new KMenu(parent);
- popup->addTitle(handler->name());
+ QMenu * popup = new QMenu(parent);
+ popup->addSection(handler->name());
popup->addActions(handler->actions());
popup->addSeparator();
diff --git a/ui/contextmenu.h b/ui/contextmenu.h
index 791057d..fd79341 100644
--- a/ui/contextmenu.h
+++ b/ui/contextmenu.h
@@ -16,14 +16,14 @@
class TransferHandler;
class TransferGroupHandler;
-class KMenu;
+class QMenu;
class QWidget;
namespace ContextMenu
{
- KMenu * createTransferContextMenu(QList<TransferHandler*> transfer, QWidget *parent);
- KMenu * createTransferContextMenu(TransferHandler* handler, QWidget *parent);
- KMenu * createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent);
+ QMenu * createTransferContextMenu(QList<TransferHandler*> transfer, QWidget *parent);
+ QMenu * createTransferContextMenu(TransferHandler* handler, QWidget *parent);
+ QMenu * createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent);
}
#endif
diff --git a/ui/droptarget.cpp b/ui/droptarget.cpp
index a3fcc42..c9e5580 100644
--- a/ui/droptarget.cpp
+++ b/ui/droptarget.cpp
@@ -21,7 +21,7 @@
#include "ui/newtransferdialog.h"
#include <kwindowsystem.h>
-#include <kmenu.h>
+#include <QMenu>
#include <kmessagebox.h>
#include <KPassivePopup>
#include <kapplication.h>
@@ -72,8 +72,8 @@ DropTarget::DropTarget(MainWindow * mw)
setMask(QBitmap());
// popup menu for right mouse button
- popupMenu = new KMenu(this);
- popupMenu->addTitle(mw->windowTitle());
+ popupMenu = new QMenu(this);
+ popupMenu->addSection(mw->windowTitle());
QAction * downloadAction = mw->actionCollection()->action("start_all_download");
popupMenu->addAction( downloadAction );
diff --git a/ui/droptarget.h b/ui/droptarget.h
index f91660a..15fffde 100644
--- a/ui/droptarget.h
+++ b/ui/droptarget.h
@@ -22,7 +22,7 @@
class QAction;
class QTimer;
-class KMenu;
+class QMenu;
class MainWindow;
class DropTargetModelObserver;
@@ -72,7 +72,7 @@ private slots:
void slotClose();
private:
- KMenu * popupMenu;
+ QMenu * popupMenu;
MainWindow * parentWidget;
QTimer * animTimer;
QTimer * popupTimer;
diff --git a/ui/transfersview.cpp b/ui/transfersview.cpp
index 4305a45..104ae97 100644
--- a/ui/transfersview.cpp
+++ b/ui/transfersview.cpp
@@ -19,7 +19,7 @@
#include <KDebug>
#include <QAction>
#include <KLocale>
-#include <KMenu>
+#include <QMenu>
#include <KRun>
#include <QDropEvent>
@@ -39,7 +39,7 @@ TransfersView::TransfersView(QWidget * parent)
header()->setMinimumSectionSize(80);
header()->setContextMenuPolicy(Qt::CustomContextMenu);
header()->setClickable(true);
- m_headerMenu = new KMenu(header());
+ m_headerMenu = new QMenu(header());
setSelectionMode(QAbstractItemView::ExtendedSelection);
setDragEnabled(true);
@@ -124,7 +124,7 @@ void TransfersView::rowsInserted(const QModelIndex & parent, int start, int end)
void TransfersView::populateHeaderActions()
{
m_headerMenu->clear();
- m_headerMenu->addTitle(i18n("Select columns"));
+ m_headerMenu->addSection(i18n("Select columns"));
QSignalMapper *columnMapper = new QSignalMapper(this);
connect(columnMapper, SIGNAL(mapped(int)), SLOT(slotHideSection(int)));
diff --git a/ui/transfersview.h b/ui/transfersview.h
index 88b75ab..a509a33 100644
--- a/ui/transfersview.h
+++ b/ui/transfersview.h
@@ -13,7 +13,7 @@
#include <QTreeView>
-class KMenu;
+class QMenu;
class TransferHandler;
class TransfersView : public QTreeView
@@ -53,7 +53,7 @@ class TransfersView : public QTreeView
QWidget *getDetailsWidgetForTransfer(TransferHandler *handler);
QList<QModelIndex> m_editingIndexes;
- KMenu *m_headerMenu;
+ QMenu *m_headerMenu;
};
#endif
diff --git a/ui/transfersviewdelegate.cpp b/ui/transfersviewdelegate.cpp
index 9b5acf0..2e9ba09 100644
--- a/ui/transfersviewdelegate.cpp
+++ b/ui/transfersviewdelegate.cpp
@@ -24,7 +24,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <kmenu.h>
+#include <QMenu>
#include <kicon.h>
#include <QApplication>
@@ -456,7 +456,7 @@ bool TransfersViewDelegate::editorEvent(QEvent * event, QAbstractItemModel * mod
{
// kDebug(5001) << "TransfersViewDelegate::editorEvent() -> rightClick";
- KMenu *popup = 0;
+ QMenu *popup = 0;
TransferTreeModel * transferTreeModel = KGet::model();
diff --git a/ui/tray.cpp b/ui/tray.cpp
index d0893c7..72c1aec 100644
--- a/ui/tray.cpp
+++ b/ui/tray.cpp
@@ -13,7 +13,7 @@
#include <kaboutdata.h>
#include <kactioncollection.h>
#include <kapplication.h>
-#include <kmenu.h>
+#include <QMenu>
#include <kdebug.h>
#include <klocale.h>