OSDN Git Service

kwalletmanager: remove stub authorization helper
authorIvailo Monev <xakepa10@gmail.com>
Sat, 2 Apr 2022 17:49:06 +0000 (20:49 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 2 Apr 2022 17:49:06 +0000 (20:49 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kwalletmanager/src/konfigurator/CMakeLists.txt
kwalletmanager/src/konfigurator/konfigurator.cpp
kwalletmanager/src/konfigurator/savehelper.cpp [deleted file]
kwalletmanager/src/konfigurator/savehelper.h [deleted file]

index ff37dbb..bf967ec 100644 (file)
@@ -13,16 +13,6 @@ target_link_libraries(kcm_kwallet ${KDE4_KDEUI_LIBS})
 
 install(TARGETS kcm_kwallet  DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
 
-########### kauth helper ################
-set(kcm_kwallet_helper_SRCS savehelper.cpp)
-
-add_executable(kcm_kwallet_helper ${kcm_kwallet_helper_SRCS})
-target_link_libraries(kcm_kwallet_helper ${KDE4_KDECORE_LIBS})
-
-install(TARGETS kcm_kwallet_helper DESTINATION ${KDE4_LIBEXEC_INSTALL_DIR})
-
-kde4_install_auth_helper_files(kcm_kwallet_helper org.kde.kcontrol.kcmkwallet root)
-
 ########### install files ###############
 
 install( FILES kwalletconfig.desktop kwalletmanager_show.desktop  DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
index d658146..2dc0310 100644 (file)
@@ -28,7 +28,6 @@
 #include <kinputdialog.h>
 #include <kmenu.h>
 #include <kwallet.h>
-#include <kauthaction.h>
 #include <kdebug.h>
 
 #include <QCheckBox>
@@ -56,8 +55,6 @@ KWalletConfig::KWalletConfig(QWidget *parent, const QVariantList& args)
     about->addAuthor(ki18n("George Staikos"), KLocalizedString(), "staikos@kde.org");
     setAboutData( about );
 
-    setNeedsAuthorization(true);
-
     QVBoxLayout *vbox = new QVBoxLayout(this);
     vbox->setSpacing(KDialog::spacingHint());
     vbox->setMargin(0);
@@ -259,28 +256,6 @@ void KWalletConfig::load() {
 
 
 void KWalletConfig::save() {
-    QVariantMap args;
-    KAuth::Action *action = authAction();
-    if (0 == action) {
-        kDebug() << "There's no authAction, not saving settings";
-        return;
-    }
-    action->setArguments(args);
-
-    KAuth::ActionReply reply = action->execute();
-
-    if (reply.failed()) {
-        if (reply.type() == KAuth::ActionReply::KAuthError){
-            kDebug() << "Save action was not authorized!";
-            KMessageBox::error(this, i18n("Sorry, the system security policy didn't allow you to save the changes."), i18n("KDE Wallet Control Module"));
-        } else {
-            KMessageBox::error(this, reply.errorDescription(), i18n("KDE Wallet Control Module"));
-            kDebug() << "Save action failed. Not saving the settings.";
-        }
-        load();
-        return;
-    }
-
     KConfigGroup config(_cfg, "Wallet");
     config.writeEntry("Enabled", _wcw->_enabled->isChecked());
     config.writeEntry("Launch Manager", _wcw->_launchManager->isChecked());
diff --git a/kwalletmanager/src/konfigurator/savehelper.cpp b/kwalletmanager/src/konfigurator/savehelper.cpp
deleted file mode 100644 (file)
index ba15f70..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-   Copyright (C) 2013 Valentin Rusu <kde@rusu.info>
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#include "savehelper.h"
-
-#include <kdebug.h>
-#include <kauthhelpersupport.h>
-#include <unistd.h>
-
-ActionReply SaveHelper::save(QVariantMap args)
-{
-    kDebug() << "executing uid=" << getuid();
-
-    return ActionReply::SuccessReply;
-}
-
-KDE4_AUTH_HELPER_MAIN("org.kde.kcontrol.kcmkwallet", SaveHelper)
diff --git a/kwalletmanager/src/konfigurator/savehelper.h b/kwalletmanager/src/konfigurator/savehelper.h
deleted file mode 100644 (file)
index d6f6662..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-   Copyright (C) 2013 Valentin Rusu <kde@rusu.info>
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#ifndef _SAVEHELPER_H_
-#define _SAVEHELPER_H_
-
-#include <kauthactionreply.h>
-
-using namespace KAuth;
-
-class SaveHelper : public QObject {
-    Q_OBJECT;
-public slots:
-    ActionReply save(QVariantMap args);
-};
-
-#endif // _SAVEHELPER_H_