From 4963e8be37aafe83e849349fb8e42192385db821 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 1 Apr 2021 15:04:21 +0300 Subject: [PATCH] [utilities] Remove backup removal. Fixes JB#37682 Old vault version, not needed anymore. --- plugin/utiltools.cpp | 21 --------------------- plugin/utiltools.h | 3 --- qml/ActionList.qml | 2 +- qml/plugins/CleanBackup.qml | 20 -------------------- 4 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 qml/plugins/CleanBackup.qml diff --git a/plugin/utiltools.cpp b/plugin/utiltools.cpp index d214faa..1a6857d 100644 --- a/plugin/utiltools.cpp +++ b/plugin/utiltools.cpp @@ -15,27 +15,6 @@ UtilTools::~UtilTools() { } -void UtilTools::removeBackups(QJSValue successCallback, QJSValue errorCallback) -{ - QDir vaultDir(QDir::homePath() + "/.vault"); - - if (vaultDir.removeRecursively()) { - if (successCallback.isCallable()) { - QJSValue result = successCallback.call(); - if (result.isError()) { - qmlInfo(this) << "Error executing callback"; - } - } - } else { - if (errorCallback.isCallable()) { - QJSValue result = errorCallback.call(); - if (result.isError()) { - qmlInfo(this) << "Error executing error callback"; - } - } - } -} - void UtilTools::cleanRpmDb(QJSValue successCallback, QJSValue errorCallback) { execute(SystemTool, QStringList("repair_rpm_db"), successCallback, errorCallback); diff --git a/plugin/utiltools.h b/plugin/utiltools.h index 636a159..f2342a3 100644 --- a/plugin/utiltools.h +++ b/plugin/utiltools.h @@ -12,9 +12,6 @@ class UtilTools: public QObject UtilTools(QObject *parent = 0); virtual ~UtilTools(); - Q_INVOKABLE void removeBackups(QJSValue successCallback = QJSValue::UndefinedValue, - QJSValue errorCallback = QJSValue::UndefinedValue); - Q_INVOKABLE void cleanRpmDb(QJSValue successCallback = QJSValue::UndefinedValue, QJSValue errorCallback = QJSValue::UndefinedValue); diff --git a/qml/ActionList.qml b/qml/ActionList.qml index 74aa19e..bbf5b3b 100644 --- a/qml/ActionList.qml +++ b/qml/ActionList.qml @@ -28,7 +28,7 @@ Column { var info = { name: name, path: "plugins/" + name + ".qml" } plugins.append(info) } - var names = [ "RestartNetwork", "RestartUI", "CleanBackup", + var names = [ "RestartNetwork", "RestartUI", "CleanPackageCache", "CleanTracker" ] for (var i = 0; i < names.length; ++i) justLoad(names[i]) diff --git a/qml/plugins/CleanBackup.qml b/qml/plugins/CleanBackup.qml deleted file mode 100644 index 000cb85..0000000 --- a/qml/plugins/CleanBackup.qml +++ /dev/null @@ -1,20 +0,0 @@ -import QtQuick 2.0 -import Sailfish.Silica 1.0 -import Sailfish.Utilities 1.0 - -ActionItem { - //: Title for backup-related recover actions - //% "Backup" - title: qsTrId("sailfish-tools-he-backup") - //% "Clean" - actionName: qsTrId("sailfish-tools-bt-clean") - //% "Clean backup storage to free space occupied by backups." - //% " All backups will be removed" - description: qsTrId("sailfish-utilities-me-clean-backups-desc") - //% "Removing backups" - remorseText: qsTrId("sailfish-utilities-me-remorse-removing-backups") - - function action(on_reply, on_error) { - UtilTools.removeBackups(on_reply, on_error) - } -}