From ecd1c91819cb89cfd5efa531495555b9a45e9ddf Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 30 Jan 2018 18:24:12 +0200 Subject: [PATCH] [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