mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Port to KStandardActions
This commit is contained in:
parent
d49143456e
commit
6da6f3fd55
2 changed files with 4 additions and 4 deletions
|
|
@ -41,7 +41,6 @@ target_link_libraries(mobileshellplugin
|
||||||
Qt::Qml
|
Qt::Qml
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::Quick
|
Qt::Quick
|
||||||
KF6::ConfigWidgets # for KStandardAction
|
|
||||||
KF6::KIOGui
|
KF6::KIOGui
|
||||||
Plasma::Plasma
|
Plasma::Plasma
|
||||||
KF6::I18n
|
KF6::I18n
|
||||||
|
|
@ -51,6 +50,7 @@ target_link_libraries(mobileshellplugin
|
||||||
KF6::KIOWidgets # for PreviewJob
|
KF6::KIOWidgets # for PreviewJob
|
||||||
KF6::Service
|
KF6::Service
|
||||||
KF6::Package
|
KF6::Package
|
||||||
|
KF6::ConfigGui
|
||||||
LayerShellQt::Interface
|
LayerShellQt::Interface
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include <KPropertiesDialog>
|
#include <KPropertiesDialog>
|
||||||
#include <KProtocolManager>
|
#include <KProtocolManager>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
#include <KStandardAction>
|
#include <KStandardActions>
|
||||||
#include <KUrlMimeData>
|
#include <KUrlMimeData>
|
||||||
|
|
||||||
#include <KIO/DeleteOrTrashJob>
|
#include <KIO/DeleteOrTrashJob>
|
||||||
|
|
@ -147,7 +147,7 @@ void NotificationFileMenu::open(int x, int y)
|
||||||
auto *job = new KIO::DeleteOrTrashJob(urls, KIO::AskUserActionInterface::Trash, KIO::AskUserActionInterface::DefaultConfirmation, this);
|
auto *job = new KIO::DeleteOrTrashJob(urls, KIO::AskUserActionInterface::Trash, KIO::AskUserActionInterface::DefaultConfirmation, this);
|
||||||
job->start();
|
job->start();
|
||||||
};
|
};
|
||||||
auto moveToTrashAction = KStandardAction::moveToTrash(this, moveToTrashLambda, menu);
|
auto moveToTrashAction = KStandardActions::moveToTrash(this, moveToTrashLambda, menu);
|
||||||
moveToTrashAction->setShortcut({}); // Can't focus notification to press Delete
|
moveToTrashAction->setShortcut({}); // Can't focus notification to press Delete
|
||||||
menu->addAction(moveToTrashAction);
|
menu->addAction(moveToTrashAction);
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +162,7 @@ void NotificationFileMenu::open(int x, int y)
|
||||||
auto *job = new KIO::DeleteOrTrashJob(urls, KIO::AskUserActionInterface::Delete, KIO::AskUserActionInterface::DefaultConfirmation, this);
|
auto *job = new KIO::DeleteOrTrashJob(urls, KIO::AskUserActionInterface::Delete, KIO::AskUserActionInterface::DefaultConfirmation, this);
|
||||||
job->start();
|
job->start();
|
||||||
};
|
};
|
||||||
auto deleteAction = KStandardAction::deleteFile(this, deleteLambda, menu);
|
auto deleteAction = KStandardActions::deleteFile(this, deleteLambda, menu);
|
||||||
deleteAction->setShortcut({});
|
deleteAction->setShortcut({});
|
||||||
menu->addAction(deleteAction);
|
menu->addAction(deleteAction);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue