Do application reset on first store_or_update
This commit is contained in:
parent
385150ab6b
commit
24bd4f69a1
2 changed files with 6 additions and 3 deletions
|
|
@ -25,13 +25,15 @@ namespace application {
|
|||
const Database::Item Database::Unknown{};
|
||||
|
||||
Database::Database() :
|
||||
storage_(std::make_shared<LauncherStorage>(SystemConfiguration::instance().application_item_dir())) {
|
||||
storage_->reset();
|
||||
}
|
||||
storage_(std::make_shared<LauncherStorage>(SystemConfiguration::instance().application_item_dir())) {}
|
||||
|
||||
Database::~Database() {}
|
||||
|
||||
void Database::store_or_update(const Item &item) {
|
||||
if (!done_reset) {
|
||||
storage_->reset();
|
||||
done_reset = true;
|
||||
}
|
||||
storage_->add_or_update(item);
|
||||
items_[item.package] = item;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ class Database {
|
|||
private:
|
||||
std::shared_ptr<LauncherStorage> storage_;
|
||||
std::map<std::string,Item> items_;
|
||||
bool done_reset = false;
|
||||
};
|
||||
} // namespace application
|
||||
} // namespace anbox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue