]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Port all instances of Kauthorized action/shell_command to shell_command
authorDavid Edmundson <kde@davidedmundson.co.uk>
Thu, 26 May 2016 12:51:23 +0000 (13:51 +0100)
committerDavid Edmundson <kde@davidedmundson.co.uk>
Thu, 26 May 2016 12:51:35 +0000 (13:51 +0100)
The KAuthorized key to prevent shell access according the documentation
is simply "shell_action" not "action/shellAction" so should use
authorize not authorizeKAction

This appears to have come about as part of a porting bug when going from
KApplication::authorize to KAuthorized in kdelibs3 to kdelibs4.

To currently block shell access a sysadmin currently needs to
have both keys set already, so we can be confident it won't have any
actual compatibility problems.

src/dolphinmainwindow.cpp
src/dolphinpart.cpp

index 1fadaf7fd81332b4c0b929d6f9ed86bad11f6ac3..3a06d2c0e4494b91ddeaa3d9132ac272a3a62ca4 100644 (file)
@@ -1099,7 +1099,7 @@ void DolphinMainWindow::setupActions()
     compareFiles->setEnabled(false);
     connect(compareFiles, &QAction::triggered, this, &DolphinMainWindow::compareFiles);
 
-    if (KAuthorized::authorizeKAction(QStringLiteral("shell_access"))) {
+    if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal"));
         openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal"));
         openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal")));
@@ -1208,7 +1208,7 @@ void DolphinMainWindow::setupDockWidgets()
 
     // Setup "Terminal"
 #ifndef Q_OS_WIN
-    if (KAuthorized::authorizeKAction(QStringLiteral("shell_access"))) {
+    if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
         terminalDock->setLocked(lock);
         terminalDock->setObjectName(QStringLiteral("terminalDock"));
index f62bc51390aa19686a6a534b57e093474913137c..332f8e9b9316eece22c48e3d623ba14cc4a5fcff 100644 (file)
@@ -222,7 +222,7 @@ void DolphinPart::createActions()
     m_findFileAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-find")));
     connect(m_findFileAction, &QAction::triggered, this, &DolphinPart::slotFindFile);
 
-    if (KAuthorized::authorizeKAction(QStringLiteral("shell_access"))) {
+    if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         m_openTerminalAction = actionCollection()->addAction(QStringLiteral("open_terminal"));
         m_openTerminalAction->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal")));
         m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal"));