Skip to content

Commit

Permalink
Merge pull request #48 from pvuorela/master
Browse files Browse the repository at this point in the history
Fix clearing tracker database
  • Loading branch information
pvuorela authored Jan 31, 2018
2 parents c77077f + ecd1c91 commit 24d04e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 2 additions & 5 deletions plugin/utiltools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -78,7 +75,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";
}
Expand Down
3 changes: 3 additions & 0 deletions tools/sailfish_tools_system_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ std::map<std::string, action_type> 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");
}}
};

Expand Down
2 changes: 1 addition & 1 deletion tools/tracker_reindex.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

tracker reset --hard
tracker reset -y --hard

0 comments on commit 24d04e1

Please sign in to comment.