From e7a195a52d045baf5a5b6d407cec9a1a3ca7776f Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 30 Jan 2018 18:21:58 +0200 Subject: [PATCH 1/2] Pass error code to error callback --- plugin/utiltools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/utiltools.cpp b/plugin/utiltools.cpp index 20ff39c..a611385 100644 --- a/plugin/utiltools.cpp +++ b/plugin/utiltools.cpp @@ -78,7 +78,7 @@ void UtilTools::handleProcessExit(int exitCode, QProcess::ExitStatus status) } } } else if (callbacks.second.isCallable()) { - QJSValue result = callbacks.second.call(); + QJSValue result = callbacks.second.call(QJSValueList() << QJSValue(exitCode)); if (result.isError()) { qmlInfo(this) << "Error executing error callback"; } From ecd1c91819cb89cfd5efa531495555b9a45e9ddf Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 30 Jan 2018 18:24:12 +0200 Subject: [PATCH 2/2] [utilities] Fix clearing tracker database. Fixes JB#39110 --- plugin/utiltools.cpp | 5 +---- tools/sailfish_tools_system_action.cpp | 3 +++ tools/tracker_reindex.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/utiltools.cpp b/plugin/utiltools.cpp index a611385..d214faa 100644 --- a/plugin/utiltools.cpp +++ b/plugin/utiltools.cpp @@ -41,12 +41,9 @@ void UtilTools::cleanRpmDb(QJSValue successCallback, QJSValue errorCallback) execute(SystemTool, QStringList("repair_rpm_db"), successCallback, errorCallback); } - void UtilTools::cleanTrackerDb(QJSValue successCallback, QJSValue errorCallback) { - QStringList arguments; - arguments << "--user" << "start" << "tracker-reindex.service"; - execute("systemctl", arguments, successCallback, errorCallback); + execute(SystemTool, QStringList("tracker_reindex"), successCallback, errorCallback); } void UtilTools::restartNetwork(QJSValue successCallback, QJSValue errorCallback) diff --git a/tools/sailfish_tools_system_action.cpp b/tools/sailfish_tools_system_action.cpp index 982ada5..983bbef 100644 --- a/tools/sailfish_tools_system_action.cpp +++ b/tools/sailfish_tools_system_action.cpp @@ -70,6 +70,9 @@ std::map actions = { }}, { "restart_network", [](action_ctx const *) { return execute_own_utility("restart_network.sh"); + }}, + { "tracker_reindex", [](action_ctx const *) { + return execute_own_utility("tracker_reindex.sh"); }} }; diff --git a/tools/tracker_reindex.sh b/tools/tracker_reindex.sh index 11aeabd..45d9100 100755 --- a/tools/tracker_reindex.sh +++ b/tools/tracker_reindex.sh @@ -1,3 +1,3 @@ #!/bin/sh -tracker reset --hard +tracker reset -y --hard