Commit ef74f8ea authored by Alexandre Lision's avatar Alexandre Lision

* #38138: fix history entries duplication and managerimpl finish state

There were two issues in one: first managerimpl was locked in a finished state event after reopening
the app. Therefore on the next call to finish() the manager did nothing.

Next, The history added entries during managerimpl init. But there was nothing to check if entries
were already loaded from last application run.
parent f6d4ca61
......@@ -52,6 +52,10 @@ using std::vector;
bool History::load(int limit)
// load only once
if (!items_.empty())
return true;
std::ifstream infile(path_.c_str());
if (!infile) {
......@@ -92,7 +96,7 @@ void History::ensurePath()
if (path_.empty()) {
#ifdef __ANDROID__
path_ = fileutils::get_home_dir() + DIR_SEPARATOR_STR "history";
path_ = fileutils::get_home_dir() + DIR_SEPARATOR_STR + "history";
const string xdg_data = fileutils::get_home_dir() + DIR_SEPARATOR_STR +
......@@ -169,6 +169,9 @@ void ManagerImpl::init(const std::string &config_file)
bool no_errors = true;
// manager can restart without being recreated (android)
finished_ = false;
try {
no_errors = parseConfiguration();
} catch (const Conf::YamlParserException &e) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment