diff options
Diffstat (limited to 'src/logic.cpp')
-rw-r--r-- | src/logic.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/logic.cpp b/src/logic.cpp index da1599c..170f566 100644 --- a/src/logic.cpp +++ b/src/logic.cpp @@ -30,9 +30,6 @@ using namespace std; -// FIXME: Popup temporary disabled -#define POPUP 0 - namespace CCHECKER { namespace { @@ -41,6 +38,11 @@ const char *const DB_PATH = tzplatform_mkpath(TZ_SYS_DB, ".cert-checker.db"); Logic::~Logic(void) { + clean(); +} + +void Logic::clean(void) +{ LogDebug("Cert-checker cleaning."); // wait and join processing thread @@ -519,6 +521,19 @@ void Logic::add_app_to_buffer_and_database(const app_t &app) // We can do nothing about it. We can only log the error. } + // Then add app to buffer - skip if already added. + // FIXME: What to do if the same app will be installed twice? + // Add it twice to the buffer, or check if apps in buffer are unique? + // At the moment doubled apps are skipped. + for (auto &iter : m_buffer) { + if (iter.app_id == app.app_id && + iter.pkg_id == app.pkg_id && + iter.uid == app.uid) { + LogDebug(app.str() << " already in buffer. Skip."); + return; + } + } + // Then add app to buffer m_buffer.push_back(app); } |