Port to enum values for KAuthorized::authorize

Task: https://phabricator.kde.org/T11948
wilder-5.24
Alexander Lohnau 4 years ago
parent c78d50fb5c
commit ce6088868b
No known key found for this signature in database
GPG Key ID: 1F58708D54A003E7
  1. 4
      applets/icon/iconapplet.cpp
  2. 2
      components/shellprivate/widgetexplorer/widgetexplorer.cpp
  3. 2
      runners/shell/shellrunner.cpp

@ -128,7 +128,7 @@ void IconApplet::populate()
// if this restriction is set, KIO won't allow running desktop files from outside
// registered services, applications, and so on, in this case we'll use the original
// .desktop file and lose the ability to customize it
if (!KAuthorized::authorize(QStringLiteral("run_desktop_files"))) {
if (!KAuthorized::authorize(KAuthorized::RUN_DESKTOP_FILES)) {
populateFromDesktopFile(localUrlString);
// we don't call setLocalPath here as we don't want to store localPath to be a system-location
// so that the fact that we cannot edit is re-evaluated every time
@ -491,7 +491,7 @@ bool IconApplet::isAcceptableDrag(QObject *dropEvent)
QMimeDatabase db;
const QMimeType mimeType = db.mimeTypeForUrl(m_url);
if (KAuthorized::authorize(QStringLiteral("shell_access")) && isExecutable(mimeType)) {
if (KAuthorized::authorize(KAuthorized::SHELL_ACCESS) && isExecutable(mimeType)) {
return true;
}

@ -195,7 +195,7 @@ QList<QObject *> WidgetExplorer::widgetsMenuActions()
WidgetAction *action = nullptr;
if (KAuthorized::authorize(QStringLiteral("ghns"))) {
if (KAuthorized::authorize(KAuthorized::GHNS)) {
action = new WidgetAction(QIcon::fromTheme(QStringLiteral("internet-services")), i18n("Download New Plasma Widgets"), this);
connect(action, &QAction::triggered, this, &WidgetExplorer::downloadWidgets);
actionList << action;

@ -28,7 +28,7 @@ ShellRunner::ShellRunner(QObject *parent, const KPluginMetaData &metaData, const
// The results from the services runner are preferred, consequently we set a low priority
setPriority(AbstractRunner::LowestPriority);
// If the runner is not authorized we can suspend it
bool enabled = KAuthorized::authorize(QStringLiteral("run_command")) && KAuthorized::authorize(QStringLiteral("shell_access"));
bool enabled = KAuthorized::authorize(QStringLiteral("run_command")) && KAuthorized::authorize(KAuthorized::SHELL_ACCESS);
suspendMatching(!enabled);
addSyntax(Plasma::RunnerSyntax(QStringLiteral(":q:"), i18n("Finds commands that match :q:, using common shell syntax")));

Loading…
Cancel
Save