CCMAIL: markg85@gmail.com
svn path=/trunk/KDE/kdebase/apps/; revision=
1176513
m_customActions(),
m_popup(new KMenu(m_mainWindow)),
m_showDeleteCommand(false),
m_customActions(),
m_popup(new KMenu(m_mainWindow)),
m_showDeleteCommand(false),
- m_shiftIsPressed(false)
+ m_shiftPressed(false),
+ m_keyInfo()
{
// The context menu either accesses the URLs of the selected items
// or the items itself. To increase the performance both lists are cached.
{
// The context menu either accesses the URLs of the selected items
// or the items itself. To increase the performance both lists are cached.
m_selectedItems = view->selectedItems();
m_showDeleteCommand = KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false);
m_selectedItems = view->selectedItems();
m_showDeleteCommand = KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false);
+
+ if (m_keyInfo.isKeyPressed(Qt::Key_Shift) || m_keyInfo.isKeyLatched(Qt::Key_Shift)) {
+ m_shiftPressed = true;
+ }
+
+ connect(&m_keyInfo, SIGNAL(keyPressed(Qt::Key, bool)), this, SLOT(deleteOrTrashMenuEntry(Qt::Key, bool)));
}
DolphinContextMenu::~DolphinContextMenu()
}
DolphinContextMenu::~DolphinContextMenu()
collection->action("delete")->setVisible(true);
}
collection->action("delete")->setVisible(true);
}
- if(m_shiftIsPressed) {
- deleteOrTrashMenuEntry(Qt::Key_Shift, m_shiftIsPressed);
+ if(m_shiftPressed) {
+ deleteOrTrashMenuEntry(Qt::Key_Shift, m_shiftPressed);
-void DolphinContextMenu::setShiftIsPressed(bool pressed)
-{
- m_shiftIsPressed = pressed;
-}
-
void DolphinContextMenu::deleteOrTrashMenuEntry(Qt::Key key, bool pressed)
{
if(m_mainWindow->activeViewContainer()->url().isLocalFile() && !m_showDeleteCommand && key == Qt::Key_Shift) {
void DolphinContextMenu::deleteOrTrashMenuEntry(Qt::Key key, bool pressed)
{
if(m_mainWindow->activeViewContainer()->url().isLocalFile() && !m_showDeleteCommand && key == Qt::Key_Shift) {
virtual ~DolphinContextMenu();
void setCustomActions(const QList<QAction*>& actions);
virtual ~DolphinContextMenu();
void setCustomActions(const QList<QAction*>& actions);
- void setShiftIsPressed(bool pressed);
/** Opens the context menu model. */
void open();
/** Opens the context menu model. */
void open();
void deleteOrTrashMenuEntry(Qt::Key key, bool pressed);
private:
void deleteOrTrashMenuEntry(Qt::Key key, bool pressed);
private:
QAction* createPasteAction();
QAction* createPasteAction();
KFileItemListProperties& capabilities();
void addServiceActions(KFileItemActions& fileItemActions);
void addVersionControlActions();
KFileItemListProperties& capabilities();
void addServiceActions(KFileItemActions& fileItemActions);
void addVersionControlActions();
QList<QAction*> m_customActions;
QScopedPointer<KMenu> m_popup;
bool m_showDeleteCommand;
QList<QAction*> m_customActions;
QScopedPointer<KMenu> m_popup;
bool m_showDeleteCommand;
+ bool m_shiftPressed;
+
+ KModifierKeyInfo m_keyInfo;
m_actionHandler(0),
m_remoteEncoding(0),
m_settingsDialog(0),
m_actionHandler(0),
m_remoteEncoding(0),
m_settingsDialog(0),
- m_lastHandleUrlStatJob(0),
- m_keyInfo(new KModifierKeyInfo)
+ m_lastHandleUrlStatJob(0)
{
setObjectName("Dolphin#");
{
setObjectName("Dolphin#");
const QList<QAction*>& customActions)
{
DolphinContextMenu contextMenu(this, item, url);
const QList<QAction*>& customActions)
{
DolphinContextMenu contextMenu(this, item, url);
-
- if(m_keyInfo.isKeyPressed(Qt::Key_Shift) || m_keyInfo.isKeyLatched(Qt::Key_Shift)) {
- contextMenu.setShiftIsPressed(true);
- }
-
- connect(&m_keyInfo, SIGNAL(keyPressed(Qt::Key, bool)), &contextMenu, SLOT(deleteOrTrashMenuEntry(Qt::Key, bool)));
contextMenu.setCustomActions(customActions);
contextMenu.open();
}
contextMenu.setCustomActions(customActions);
contextMenu.open();
}
#include <ksortablelist.h>
#include <kxmlguiwindow.h>
#include <kactionmenu.h>
#include <ksortablelist.h>
#include <kxmlguiwindow.h>
#include <kactionmenu.h>
-#include <kmodifierkeyinfo.h>
#include "views/dolphinview.h"
#include "views/dolphinview.h"
-#include "dolphincontextmenu.h"
-
#include <QList>
typedef KIO::FileUndoManager::CommandType CommandType;
#include <QList>
typedef KIO::FileUndoManager::CommandType CommandType;
QPointer<DolphinSettingsDialog> m_settingsDialog;
KJob* m_lastHandleUrlStatJob;
QPointer<DolphinSettingsDialog> m_settingsDialog;
KJob* m_lastHandleUrlStatJob;
-
- KModifierKeyInfo m_keyInfo;
};
inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
};
inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const