mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Clean includes + port to QMenu
This commit is contained in:
parent
64bc639395
commit
6f6b1bbb69
|
@ -39,7 +39,7 @@
|
|||
#include <KIO/JobUiDelegate>
|
||||
#include <KJobUiDelegate>
|
||||
#include <KJobWidgets>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KMenuBar>
|
||||
#include <KMessageBox>
|
||||
#include <KMimeTypeTrader>
|
||||
|
@ -66,7 +66,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
|
|||
const QPoint& pos,
|
||||
const KFileItem& fileInfo,
|
||||
const KUrl& baseUrl) :
|
||||
KMenu(parent),
|
||||
QMenu(parent),
|
||||
m_pos(pos),
|
||||
m_mainWindow(parent),
|
||||
m_fileInfo(fileInfo),
|
||||
|
@ -131,7 +131,7 @@ void DolphinContextMenu::keyPressEvent(QKeyEvent *ev)
|
|||
if (m_removeAction && ev->key() == Qt::Key_Shift) {
|
||||
m_removeAction->update();
|
||||
}
|
||||
KMenu::keyPressEvent(ev);
|
||||
QMenu::keyPressEvent(ev);
|
||||
}
|
||||
|
||||
void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev)
|
||||
|
@ -139,7 +139,7 @@ void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev)
|
|||
if (m_removeAction && ev->key() == Qt::Key_Shift) {
|
||||
m_removeAction->update();
|
||||
}
|
||||
KMenu::keyReleaseEvent(ev);
|
||||
QMenu::keyReleaseEvent(ev);
|
||||
}
|
||||
|
||||
void DolphinContextMenu::openTrashContextMenu()
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <KService>
|
||||
#include <KUrl>
|
||||
#include <konq_copytomenu.h>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
@ -50,7 +50,7 @@ class DolphinRemoveAction;
|
|||
* - 'Actions': Contains all actions which can be applied to the
|
||||
* given item.
|
||||
*/
|
||||
class DolphinContextMenu : public KMenu
|
||||
class DolphinContextMenu : public QMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#include <KInputDialog>
|
||||
#include <KLocale>
|
||||
#include <KProtocolManager>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KMenuBar>
|
||||
#include <KMessageBox>
|
||||
#include <KFileItemListProperties>
|
||||
|
@ -797,10 +797,10 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
|
|||
|
||||
void DolphinMainWindow::updateControlMenu()
|
||||
{
|
||||
KMenu* menu = qobject_cast<KMenu*>(sender());
|
||||
QMenu* menu = qobject_cast<QMenu*>(sender());
|
||||
Q_ASSERT(menu);
|
||||
|
||||
// All actions get cleared by KMenu::clear(). The sub-menus are deleted
|
||||
// All actions get cleared by QMenu::clear(). The sub-menus are deleted
|
||||
// by connecting to the aboutToHide() signal from the parent-menu.
|
||||
menu->clear();
|
||||
|
||||
|
@ -842,7 +842,7 @@ void DolphinMainWindow::updateControlMenu()
|
|||
}
|
||||
|
||||
addActionToMenu(ac->action("panels"), menu);
|
||||
KMenu* locationBarMenu = new KMenu(i18nc("@action:inmenu", "Location Bar"), menu);
|
||||
QMenu* locationBarMenu = new QMenu(i18nc("@action:inmenu", "Location Bar"), menu);
|
||||
locationBarMenu->addAction(ac->action("editable_location"));
|
||||
locationBarMenu->addAction(ac->action("replace_location"));
|
||||
menu->addMenu(locationBarMenu);
|
||||
|
@ -850,8 +850,8 @@ void DolphinMainWindow::updateControlMenu()
|
|||
menu->addSeparator();
|
||||
|
||||
// Add "Go" menu
|
||||
KMenu* goMenu = new KMenu(i18nc("@action:inmenu", "Go"), menu);
|
||||
connect(menu, &KMenu::aboutToHide, goMenu, &KMenu::deleteLater);
|
||||
QMenu* goMenu = new QMenu(i18nc("@action:inmenu", "Go"), menu);
|
||||
connect(menu, &QMenu::aboutToHide, goMenu, &QMenu::deleteLater);
|
||||
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Back)));
|
||||
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Forward)));
|
||||
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Up)));
|
||||
|
@ -860,8 +860,8 @@ void DolphinMainWindow::updateControlMenu()
|
|||
menu->addMenu(goMenu);
|
||||
|
||||
// Add "Tool" menu
|
||||
KMenu* toolsMenu = new KMenu(i18nc("@action:inmenu", "Tools"), menu);
|
||||
connect(menu, &KMenu::aboutToHide, toolsMenu, &KMenu::deleteLater);
|
||||
QMenu* toolsMenu = new QMenu(i18nc("@action:inmenu", "Tools"), menu);
|
||||
connect(menu, &QMenu::aboutToHide, toolsMenu, &QMenu::deleteLater);
|
||||
toolsMenu->addAction(ac->action("show_filter_bar"));
|
||||
toolsMenu->addAction(ac->action("compare_files"));
|
||||
toolsMenu->addAction(ac->action("open_terminal"));
|
||||
|
@ -874,8 +874,8 @@ void DolphinMainWindow::updateControlMenu()
|
|||
addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Preferences)), menu);
|
||||
|
||||
// Add "Help" menu
|
||||
KMenu* helpMenu = new KMenu(i18nc("@action:inmenu", "Help"), menu);
|
||||
connect(menu, &KMenu::aboutToHide, helpMenu, &KMenu::deleteLater);
|
||||
QMenu* helpMenu = new QMenu(i18nc("@action:inmenu", "Help"), menu);
|
||||
connect(menu, &QMenu::aboutToHide, helpMenu, &QMenu::deleteLater);
|
||||
helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::HelpContents)));
|
||||
helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::WhatsThis)));
|
||||
helpMenu->addSeparator();
|
||||
|
@ -1352,8 +1352,8 @@ void DolphinMainWindow::createControlButton()
|
|||
m_controlButton->setPopupMode(QToolButton::InstantPopup);
|
||||
m_controlButton->setToolButtonStyle(toolBar()->toolButtonStyle());
|
||||
|
||||
KMenu* controlMenu = new KMenu(m_controlButton);
|
||||
connect(controlMenu, &KMenu::aboutToShow, this, &DolphinMainWindow::updateControlMenu);
|
||||
QMenu* controlMenu = new QMenu(m_controlButton);
|
||||
connect(controlMenu, &QMenu::aboutToShow, this, &DolphinMainWindow::updateControlMenu);
|
||||
|
||||
m_controlButton->setMenu(controlMenu);
|
||||
|
||||
|
@ -1381,7 +1381,7 @@ void DolphinMainWindow::deleteControlButton()
|
|||
m_updateToolBarTimer = 0;
|
||||
}
|
||||
|
||||
bool DolphinMainWindow::addActionToMenu(QAction* action, KMenu* menu)
|
||||
bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)
|
||||
{
|
||||
Q_ASSERT(action);
|
||||
Q_ASSERT(menu);
|
||||
|
|
|
@ -448,7 +448,7 @@ private:
|
|||
* case if it has not added already to the toolbar.
|
||||
* @return True if the action has been added to the menu.
|
||||
*/
|
||||
bool addActionToMenu(QAction* action, KMenu* menu);
|
||||
bool addActionToMenu(QAction* action, QMenu* menu);
|
||||
|
||||
/**
|
||||
* Connects the signals from the created DolphinView with
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <KIO/NetAccess>
|
||||
#include <KToolInvocation>
|
||||
#include <kauthorized.h>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KInputDialog>
|
||||
#include <KProtocolInfo>
|
||||
#include <kdeversion.h>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <KLocalizedString>
|
||||
#include <KAcceleratorManager>
|
||||
#include <kio/global.h>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
|
||||
DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
|
||||
KActionMenu(QIcon::fromTheme("edit-undo"), i18n("Recently Closed Tabs"), parent)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <QTimer>
|
||||
#include <QDragEnterEvent>
|
||||
#include <KLocalizedString>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <QIcon>
|
||||
#include <KUrl>
|
||||
|
||||
|
@ -122,7 +122,7 @@ void DolphinTabBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
|
||||
if (index >= 0) {
|
||||
// Tab context menu
|
||||
KMenu menu(this);
|
||||
QMenu menu(this);
|
||||
|
||||
QAction* newTabAction = menu.addAction(QIcon::fromTheme("tab-new"), i18nc("@action:inmenu", "New Tab"));
|
||||
QAction* detachTabAction = menu.addAction(QIcon::fromTheme("tab-detach"), i18nc("@action:inmenu", "Detach Tab"));
|
||||
|
|
|
@ -20,15 +20,14 @@
|
|||
***************************************************************************/
|
||||
#include "filterbar.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QToolButton>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
#include <QIcon>
|
||||
#include <KLocale>
|
||||
#include <KLineEdit>
|
||||
#include <KIconLoader>
|
||||
|
||||
FilterBar::FilterBar(QWidget* parent) :
|
||||
QWidget(parent)
|
||||
|
|
|
@ -32,7 +32,6 @@ class KItemListController;
|
|||
class KItemListSmoothScroller;
|
||||
class KItemListView;
|
||||
class KItemModelBase;
|
||||
class QPropertyAnimation;
|
||||
|
||||
/**
|
||||
* @brief Provides a QWidget based scrolling view for a KItemListController.
|
||||
|
|
|
@ -44,7 +44,6 @@ class QGraphicsSceneWheelEvent;
|
|||
class QHideEvent;
|
||||
class QInputMethodEvent;
|
||||
class QKeyEvent;
|
||||
class QMimeData;
|
||||
class QShowEvent;
|
||||
class QTransform;
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ class KItemListViewLayouter;
|
|||
class KItemListWidget;
|
||||
class KItemListWidgetInformant;
|
||||
class KItemListWidgetCreatorBase;
|
||||
class KItemListViewCreatorBase;
|
||||
class QTimer;
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "kitemlistheaderwidget.h"
|
||||
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <kitemviews/kitemmodelbase.h>
|
||||
|
||||
#include <QApplication>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <QGraphicsWidget>
|
||||
#include <QPixmap>
|
||||
|
||||
class QPropertyAnimation;
|
||||
|
||||
/**
|
||||
* @brief Allows to toggle between the selected and unselected state of an item.
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
class KItemListView;
|
||||
class QGraphicsWidget;
|
||||
class QPointF;
|
||||
class QPropertyAnimation;
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <KIO/CopyJob>
|
||||
#include <KIO/DeleteJob>
|
||||
#include <KIO/JobUiDelegate>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <QIcon>
|
||||
#include <KJobWidgets>
|
||||
#include <KSharedConfig>
|
||||
|
@ -58,7 +58,7 @@ TreeViewContextMenu::~TreeViewContextMenu()
|
|||
|
||||
void TreeViewContextMenu::open()
|
||||
{
|
||||
KMenu* popup = new KMenu(m_parent);
|
||||
QMenu* popup = new QMenu(m_parent);
|
||||
|
||||
if (!m_fileItem.isNull()) {
|
||||
KFileItemListProperties capabilities(KFileItemList() << m_fileItem);
|
||||
|
@ -147,7 +147,7 @@ void TreeViewContextMenu::open()
|
|||
}
|
||||
}
|
||||
|
||||
QWeakPointer<KMenu> popupPtr = popup;
|
||||
QWeakPointer<QMenu> popupPtr = popup;
|
||||
popup->exec(QCursor::pos());
|
||||
if (popupPtr.data()) {
|
||||
popupPtr.data()->deleteLater();
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <KIconLoader>
|
||||
#include <QIcon>
|
||||
#include <KLocale>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <kseparator.h>
|
||||
#include <KStringHandler>
|
||||
|
||||
|
@ -289,7 +289,7 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event)
|
|||
|
||||
void InformationPanelContent::configureSettings(const QList<QAction*>& customContextMenuActions)
|
||||
{
|
||||
KMenu popup(this);
|
||||
QMenu popup(this);
|
||||
|
||||
QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
|
||||
previewAction->setIcon(QIcon::fromTheme("view-preview"));
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <kitemviews/kitemlistcontroller.h>
|
||||
#include <kitemviews/kitemlistselectionmanager.h>
|
||||
#include <kitemviews/kstandarditem.h>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KMessageBox>
|
||||
#include <KNotification>
|
||||
#include "placesitem.h"
|
||||
|
@ -155,7 +155,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
|
|||
return;
|
||||
}
|
||||
|
||||
KMenu menu(this);
|
||||
QMenu menu(this);
|
||||
|
||||
QAction* emptyTrashAction = 0;
|
||||
QAction* addAction = 0;
|
||||
|
@ -221,7 +221,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
|
|||
}
|
||||
|
||||
menu.addSeparator();
|
||||
KMenu* iconSizeSubMenu = new KMenu(i18nc("@item:inmenu", "Icon Size"), &menu);
|
||||
QMenu* iconSizeSubMenu = new QMenu(i18nc("@item:inmenu", "Icon Size"), &menu);
|
||||
|
||||
struct IconSizeInfo
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
|
|||
|
||||
void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos)
|
||||
{
|
||||
KMenu menu(this);
|
||||
QMenu menu(this);
|
||||
|
||||
QAction* addAction = menu.addAction(QIcon::fromTheme("document-new"), i18nc("@item:inmenu", "Add Entry..."));
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <QList>
|
||||
#include <QListWidget>
|
||||
|
||||
class QCheckBox;
|
||||
|
||||
/**
|
||||
* @brief Dialog for changing the additional information shown in the view.
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <settings/settingspagebase.h>
|
||||
#include <KUrl>
|
||||
|
||||
class KComboBox;
|
||||
class QCheckBox;
|
||||
class QLabel;
|
||||
class QRadioButton;
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include <QMap>
|
||||
#include <QString>
|
||||
|
||||
class QCheckBox;
|
||||
class QGroupBox;
|
||||
class QListView;
|
||||
class QSortFilterProxyModel;
|
||||
class ServiceModel;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <KIconLoader>
|
||||
#include <QIcon>
|
||||
#include <KLocale>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KVBox>
|
||||
|
||||
#include "statusbarspaceinfo.h"
|
||||
|
@ -259,7 +259,7 @@ void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
{
|
||||
Q_UNUSED(event);
|
||||
|
||||
KMenu menu(this);
|
||||
QMenu menu(this);
|
||||
|
||||
QAction* showZoomSliderAction = menu.addAction(i18nc("@action:inmenu", "Show Zoom Slider"));
|
||||
showZoomSliderAction->setCheckable(true);
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "libdolphin_export.h"
|
||||
|
||||
class DolphinNewFileMenu;
|
||||
class KUrl;
|
||||
|
||||
/**
|
||||
* @brief Allows to observe new file items that have been created
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <KMimeType>
|
||||
#include <KConfig>
|
||||
#include <KCharsets>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KProtocolInfo>
|
||||
#include <KProtocolManager>
|
||||
#include <KIO/Scheduler>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include <KIO/PreviewJob>
|
||||
#include <KIO/Paste>
|
||||
#include <KJob>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KGlobal>
|
||||
#include <KMessageBox>
|
||||
#include <KJobWidgets>
|
||||
|
@ -874,7 +874,7 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
|
|||
{
|
||||
ViewProperties props(viewPropertiesUrl());
|
||||
|
||||
QPointer<KMenu> menu = new KMenu(QApplication::activeWindow());
|
||||
QPointer<QMenu> menu = new QMenu(QApplication::activeWindow());
|
||||
|
||||
KItemListView* view = m_container->controller()->view();
|
||||
const QSet<QByteArray> visibleRolesSet = view->visibleRoles().toSet();
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
typedef KIO::FileUndoManager::CommandType CommandType;
|
||||
|
||||
class DolphinItemListView;
|
||||
class KActionCollection;
|
||||
class KFileItemModel;
|
||||
class KItemListContainer;
|
||||
class KItemModelBase;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <KActionMenu>
|
||||
#include <kitemviews/kfileitemmodel.h>
|
||||
#include <KLocale>
|
||||
#include <KMenu>
|
||||
#include <QMenu>
|
||||
#include <KNewFileMenu>
|
||||
#include <KSelectAction>
|
||||
#include <KToggleAction>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
class KFileItem;
|
||||
class KUrl;
|
||||
class QDropEvent;
|
||||
class QWidget;
|
||||
class KonqOperations;
|
||||
|
||||
class LIBDOLPHINPRIVATE_EXPORT DragAndDropHelper
|
||||
|
|
|
@ -25,11 +25,7 @@
|
|||
|
||||
#include <KFileItem>
|
||||
|
||||
class DolphinModel;
|
||||
class DolphinSortFilterProxyModel;
|
||||
class FileMetaDataToolTip;
|
||||
class QAbstractItemView;
|
||||
class QModelIndex;
|
||||
class QTimer;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue