From d824118bbc21592cbd054c8cae49f7b63dd99e5c Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Thu, 17 Aug 2023 10:58:11 +0500 Subject: [PATCH] UI: ConfManager: Minor refactor --- src/ui/conf/confmanager.cpp | 8 +++++--- src/ui/stat/statblockmanager.cpp | 8 +++++--- src/ui/stat/statmanager.cpp | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/ui/conf/confmanager.cpp b/src/ui/conf/confmanager.cpp index 33d9e17c..43c66c56 100644 --- a/src/ui/conf/confmanager.cpp +++ b/src/ui/conf/confmanager.cpp @@ -314,11 +314,13 @@ bool migrateFunc(SqliteDb *db, int version, bool isNewDb, void *ctx) { Q_UNUSED(ctx); - if (isNewDb) + if (isNewDb) { + // COMPAT: DB schema return true; + } - // COMPAT - if (version <= 21) { + // COMPAT: DB content + if (version < 21) { migrateAppPaths(db); } diff --git a/src/ui/stat/statblockmanager.cpp b/src/ui/stat/statblockmanager.cpp index 6b1a625f..781817ed 100644 --- a/src/ui/stat/statblockmanager.cpp +++ b/src/ui/stat/statblockmanager.cpp @@ -26,11 +26,13 @@ bool migrateFunc(SqliteDb *db, int version, bool isNewDb, void *ctx) { Q_UNUSED(ctx); - if (isNewDb) + if (isNewDb) { + // COMPAT: DB schema return true; + } - // COMPAT - if (version <= 7) { + // COMPAT: DB content + if (version < 7) { const QString srcSchema = SqliteDb::migrationOldSchemaName(); const QString dstSchema = SqliteDb::migrationNewSchemaName(); diff --git a/src/ui/stat/statmanager.cpp b/src/ui/stat/statmanager.cpp index 524d15b0..27ea66f6 100644 --- a/src/ui/stat/statmanager.cpp +++ b/src/ui/stat/statmanager.cpp @@ -31,11 +31,13 @@ bool migrateFunc(SqliteDb *db, int version, bool isNewDb, void *ctx) { Q_UNUSED(ctx); - if (isNewDb) + if (isNewDb) { + // COMPAT: DB schema return true; + } - // COMPAT - if (version <= 3) { + // COMPAT: DB content + if (version < 3) { // Move apps' total traffic to separate table const QString srcSchema = SqliteDb::migrationOldSchemaName(); const QString dstSchema = SqliteDb::migrationNewSchemaName();