- QAction* cutAction = new QAction(KIcon("edit-cut"), i18nc("@action:inmenu", "Cut"), this);
+ QAction* cutAction = new QAction(KIcon("edit-cut"), i18nc("@action:inmenu", "Cut"), this);
+ cutAction->setEnabled(capabilities.supportsMoving());
connect(cutAction, SIGNAL(triggered()), this, SLOT(cut()));
connect(cutAction, SIGNAL(triggered()), this, SLOT(cut()));
- QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
+ QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
connect(copyAction, SIGNAL(triggered()), this, SLOT(copy()));
QAction* pasteAction = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste"), this);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
connect(copyAction, SIGNAL(triggered()), this, SLOT(copy()));
QAction* pasteAction = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste"), this);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
connect(renameAction, SIGNAL(triggered()), this, SLOT(rename()));
popup->addAction(renameAction);
// insert 'Move to Trash' and (optionally) 'Delete'
connect(renameAction, SIGNAL(triggered()), this, SLOT(rename()));
popup->addAction(renameAction);
// insert 'Move to Trash' and (optionally) 'Delete'
- KConfigGroup kdeConfig(KGlobal::config(), "KDE");
- bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
+ KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
+ KConfigGroup configGroup(globalConfig, "KDE");
+ bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
+
const KUrl& url = m_fileInfo.url();
if (url.isLocalFile()) {
QAction* moveToTrashAction = new QAction(KIcon("user-trash"),
i18nc("@action:inmenu", "Move To Trash"), this);
const KUrl& url = m_fileInfo.url();
if (url.isLocalFile()) {
QAction* moveToTrashAction = new QAction(KIcon("user-trash"),
i18nc("@action:inmenu", "Move To Trash"), this);
connect(moveToTrashAction, SIGNAL(triggered()), this, SLOT(moveToTrash()));
popup->addAction(moveToTrashAction);
} else {
connect(moveToTrashAction, SIGNAL(triggered()), this, SLOT(moveToTrash()));
popup->addAction(moveToTrashAction);
} else {
if (showDeleteCommand) {
QAction* deleteAction = new QAction(KIcon("edit-delete"), i18nc("@action:inmenu", "Delete"), this);
if (showDeleteCommand) {
QAction* deleteAction = new QAction(KIcon("edit-delete"), i18nc("@action:inmenu", "Delete"), this);
connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItem()));
popup->addAction(deleteAction);
}
connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItem()));
popup->addAction(deleteAction);
}