Port to KStandardActions

This commit is contained in:
Nicolas Fella 2024-10-31 01:53:12 +01:00 committed by Carl Schwan
parent d49143456e
commit 6da6f3fd55
2 changed files with 4 additions and 4 deletions

View file

@ -41,7 +41,6 @@ target_link_libraries(mobileshellplugin
Qt::Qml
Qt::Gui
Qt::Quick
KF6::ConfigWidgets # for KStandardAction
KF6::KIOGui
Plasma::Plasma
KF6::I18n
@ -51,6 +50,7 @@ target_link_libraries(mobileshellplugin
KF6::KIOWidgets # for PreviewJob
KF6::Service
KF6::Package
KF6::ConfigGui
LayerShellQt::Interface
)

View file

@ -21,7 +21,7 @@
#include <KPropertiesDialog>
#include <KProtocolManager>
#include <KSharedConfig>
#include <KStandardAction>
#include <KStandardActions>
#include <KUrlMimeData>
#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);
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
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);
job->start();
};
auto deleteAction = KStandardAction::deleteFile(this, deleteLambda, menu);
auto deleteAction = KStandardActions::deleteFile(this, deleteLambda, menu);
deleteAction->setShortcut({});
menu->addAction(deleteAction);
}