From f9724ec5d286e1d16225dcc3bf507026cfbc8be9 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 8 Mar 2022 07:42:46 +0100 Subject: [PATCH] bump min qt 5 version, save --- CMakeLists.txt | 5 +++-- src/librssguard/database/databasequeries.cpp | 4 ++-- src/librssguard/database/databasequeries.h | 2 +- src/librssguard/services/abstract/serviceroot.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4cf12c25..933f5238f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,8 @@ # # Other information: # - supports Windows, Linux, *BSD, macOS, OS/2, Android, -# - Qt 5.9.0 or newer is required, +# - Qt 5.10.0 or newer is required, +# - Qt 6.3.0 or newer is required, # - cmake 3.9.0 or newer is required, # - if you wish to make packages for Windows, then you must initialize all submodules # within repository before compilation, @@ -111,7 +112,7 @@ option(REVISION_FROM_GIT "Get revision using `git rev-parse`" ON) # Import Qt libraries. set(QT6_MIN_VERSION 6.2.3) -set(QT5_MIN_VERSION 5.9.0) +set(QT5_MIN_VERSION 5.10.0) set(QT_COMPONENTS Core diff --git a/src/librssguard/database/databasequeries.cpp b/src/librssguard/database/databasequeries.cpp index 1fa9081ca..b4dd20383 100644 --- a/src/librssguard/database/databasequeries.cpp +++ b/src/librssguard/database/databasequeries.cpp @@ -1491,7 +1491,7 @@ bool DatabaseQueries::purgeMessagesFromBin(const QSqlDatabase& db, bool clear_on return q.exec(); } -bool DatabaseQueries::deleteAccount(const QSqlDatabase& db, int account_id) { +bool DatabaseQueries::deleteAccount(const QSqlDatabase& db, ServiceRoot* account) { QSqlQuery query(db); query.setForwardOnly(true); @@ -1507,7 +1507,7 @@ bool DatabaseQueries::deleteAccount(const QSqlDatabase& db, int account_id) { for (const QString& q : qAsConst(queries)) { query.prepare(q); - query.bindValue(QSL(":account_id"), account_id); + query.bindValue(QSL(":account_id"), account->accountId()); if (!query.exec()) { qCriticalNN << LOGSEC_DB diff --git a/src/librssguard/database/databasequeries.h b/src/librssguard/database/databasequeries.h index ca99323a7..ce9455f72 100644 --- a/src/librssguard/database/databasequeries.h +++ b/src/librssguard/database/databasequeries.h @@ -115,7 +115,7 @@ class DatabaseQueries { // Returns counts of updated messages . static QPair updateMessages(QSqlDatabase db, QList& messages, Feed* feed, bool force_update, bool* ok = nullptr); - static bool deleteAccount(const QSqlDatabase& db, int account_id); + static bool deleteAccount(const QSqlDatabase& db, ServiceRoot* account); static bool deleteAccountData(const QSqlDatabase& db, int account_id, bool delete_messages_too, bool delete_labels_too); static bool cleanLabelledMessages(const QSqlDatabase& db, bool clean_read_only, Label* label); static bool cleanImportantMessages(const QSqlDatabase& db, bool clean_read_only, int account_id); diff --git a/src/librssguard/services/abstract/serviceroot.cpp b/src/librssguard/services/abstract/serviceroot.cpp index 5f08a449b..c10a2e8df 100644 --- a/src/librssguard/services/abstract/serviceroot.cpp +++ b/src/librssguard/services/abstract/serviceroot.cpp @@ -33,7 +33,7 @@ ServiceRoot::~ServiceRoot() = default; bool ServiceRoot::deleteViaGui() { QSqlDatabase database = qApp->database()->driver()->connection(metaObject()->className()); - if (DatabaseQueries::deleteAccount(database, accountId())) { + if (DatabaseQueries::deleteAccount(database, this)) { stop(); requestItemRemoval(this); return true;