From d5a02c098f6fde9864acb5814c353ff93527e82c Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 3 Dec 2022 09:28:26 +0100 Subject: [PATCH] work on #745 --- resources/sql.qrc | 2 + resources/sql/db_init_sqlite.sql | 1 + resources/sql/db_update_mysql_3_4.sql | 8 ++ resources/sql/db_update_sqlite_3_4.sql | 29 +++++ src/librssguard/database/databasequeries.cpp | 4 +- src/librssguard/database/databasequeries.h | 123 +++++++++++------- src/librssguard/definitions/definitions.h | 11 +- src/librssguard/services/abstract/feed.cpp | 13 +- src/librssguard/services/abstract/feed.h | 5 +- .../services/abstract/gui/formfeeddetails.cpp | 2 + .../services/abstract/gui/formfeeddetails.ui | 17 ++- .../services/abstract/serviceroot.cpp | 2 + 12 files changed, 161 insertions(+), 56 deletions(-) create mode 100644 resources/sql/db_update_mysql_3_4.sql create mode 100644 resources/sql/db_update_sqlite_3_4.sql diff --git a/resources/sql.qrc b/resources/sql.qrc index b2b3b136b..f0d0402b9 100644 --- a/resources/sql.qrc +++ b/resources/sql.qrc @@ -3,9 +3,11 @@ sql/db_init_mysql.sql sql/db_update_mysql_1_2.sql sql/db_update_mysql_2_3.sql + sql/db_update_mysql_3_4.sql sql/db_init_sqlite.sql sql/db_update_sqlite_1_2.sql sql/db_update_sqlite_2_3.sql + sql/db_update_sqlite_3_4.sql \ No newline at end of file diff --git a/resources/sql/db_init_sqlite.sql b/resources/sql/db_init_sqlite.sql index c6d1b4590..13ccdad12 100644 --- a/resources/sql/db_init_sqlite.sql +++ b/resources/sql/db_init_sqlite.sql @@ -42,6 +42,7 @@ CREATE TABLE Feeds ( update_type INTEGER NOT NULL CHECK (update_type >= 0), update_interval INTEGER NOT NULL DEFAULT 900 CHECK (update_interval >= 1), is_off INTEGER NOT NULL DEFAULT 0 CHECK (is_off >= 0 AND is_off <= 1), + is_quiet INTEGER NOT NULL DEFAULT 0 CHECK (is_quiet >= 0 AND is_quiet <= 1), open_articles INTEGER NOT NULL DEFAULT 0 CHECK (open_articles >= 0 AND open_articles <= 1), account_id INTEGER NOT NULL, custom_id TEXT NOT NULL CHECK (custom_id != ''), /* Custom ID cannot be empty, it must contain either service-specific ID, or Feeds/id. */ diff --git a/resources/sql/db_update_mysql_3_4.sql b/resources/sql/db_update_mysql_3_4.sql new file mode 100644 index 000000000..d59935efe --- /dev/null +++ b/resources/sql/db_update_mysql_3_4.sql @@ -0,0 +1,8 @@ +USE ##; +-- ! +SET FOREIGN_KEY_CHECKS = 0; +-- ! +!! db_update_sqlite_3_4.sql +-- ! +SET FOREIGN_KEY_CHECKS = 1; +-- ! \ No newline at end of file diff --git a/resources/sql/db_update_sqlite_3_4.sql b/resources/sql/db_update_sqlite_3_4.sql new file mode 100644 index 000000000..c06a9035c --- /dev/null +++ b/resources/sql/db_update_sqlite_3_4.sql @@ -0,0 +1,29 @@ +ALTER TABLE Feeds RENAME TO backup_Feeds; +-- ! +CREATE TABLE Feeds ( + id $$, + ordr INTEGER NOT NULL CHECK (ordr >= 0), + title TEXT NOT NULL CHECK (title != ''), + description TEXT, + date_created BIGINT, + icon ^^, + category INTEGER NOT NULL CHECK (category >= -1), /* Physical category ID, also root feeds contain -1 here. */ + source TEXT, + update_type INTEGER NOT NULL CHECK (update_type >= 0), + update_interval INTEGER NOT NULL DEFAULT 900 CHECK (update_interval >= 1), + is_off INTEGER NOT NULL DEFAULT 0 CHECK (is_off >= 0 AND is_off <= 1), + is_quiet INTEGER NOT NULL DEFAULT 0 CHECK (is_quiet >= 0 AND is_quiet <= 1), + open_articles INTEGER NOT NULL DEFAULT 0 CHECK (open_articles >= 0 AND open_articles <= 1), + account_id INTEGER NOT NULL, + custom_id TEXT NOT NULL CHECK (custom_id != ''), /* Custom ID cannot be empty, it must contain either service-specific ID, or Feeds/id. */ + /* Custom column for (serialized) custom account-specific data. */ + custom_data TEXT, + + FOREIGN KEY (account_id) REFERENCES Accounts (id) ON DELETE CASCADE +); +-- ! +INSERT INTO Feeds (id, ordr, title, description, date_created, icon, category, source, update_type, update_interval, is_off, open_articles, account_id, custom_id, custom_data) +SELECT id, ordr, title, description, date_created, icon, category, source, update_type, update_interval, is_off, open_articles, account_id, custom_id, custom_data +FROM backup_Feeds; +-- ! +DROP TABLE backup_Feeds; \ No newline at end of file diff --git a/src/librssguard/database/databasequeries.cpp b/src/librssguard/database/databasequeries.cpp index 402c82916..5de60aa49 100644 --- a/src/librssguard/database/databasequeries.cpp +++ b/src/librssguard/database/databasequeries.cpp @@ -2072,7 +2072,8 @@ void DatabaseQueries::createOverwriteFeed(const QSqlDatabase& db, Feed* feed, in q.prepare("UPDATE Feeds " "SET title = :title, ordr = :ordr, description = :description, date_created = :date_created, " " icon = :icon, category = :category, source = :source, update_type = :update_type, " - " update_interval = :update_interval, is_off = :is_off, open_articles = :open_articles, " + " update_interval = :update_interval, is_off = :is_off, is_quiet = :is_quiet, open_articles = " + ":open_articles, " " account_id = :account_id, custom_id = :custom_id, custom_data = :custom_data " "WHERE id = :id;"); q.bindValue(QSL(":title"), feed->title()); @@ -2088,6 +2089,7 @@ void DatabaseQueries::createOverwriteFeed(const QSqlDatabase& db, Feed* feed, in q.bindValue(QSL(":id"), feed->id()); q.bindValue(QSL(":ordr"), feed->sortOrder()); q.bindValue(QSL(":is_off"), feed->isSwitchedOff()); + q.bindValue(QSL(":is_quiet"), feed->isQuiet()); q.bindValue(QSL(":open_articles"), feed->openArticlesDirectly()); auto custom_data = feed->customDatabaseData(); diff --git a/src/librssguard/database/databasequeries.h b/src/librssguard/database/databasequeries.h index 014aba460..37913768d 100644 --- a/src/librssguard/database/databasequeries.h +++ b/src/librssguard/database/databasequeries.h @@ -34,7 +34,9 @@ class DatabaseQueries { static bool assignLabelToMessage(const QSqlDatabase& db, Label* label, const Message& msg); static bool setLabelsForMessage(const QSqlDatabase& db, const QList& labels, const Message& msg); static QList getLabelsForAccount(const QSqlDatabase& db, int account_id); - static QList getLabelsForMessage(const QSqlDatabase& db, const Message& msg, const QList installed_labels); + static QList getLabelsForMessage(const QSqlDatabase& db, + const Message& msg, + const QList installed_labels); static bool updateLabel(const QSqlDatabase& db, Label* label); static bool deleteLabel(const QSqlDatabase& db, Label* label); static bool createLabel(const QSqlDatabase& db, Label* label, int account_id); @@ -45,7 +47,10 @@ class DatabaseQueries { static bool markUnreadMessagesRead(const QSqlDatabase& db, int account_id); static bool markMessagesReadUnread(const QSqlDatabase& db, const QStringList& ids, RootItem::ReadStatus read); static bool markMessageImportant(const QSqlDatabase& db, int id, RootItem::Importance importance); - static bool markFeedsReadUnread(const QSqlDatabase& db, const QStringList& ids, int account_id, RootItem::ReadStatus read); + static bool markFeedsReadUnread(const QSqlDatabase& db, + const QStringList& ids, + int account_id, + RootItem::ReadStatus read); static bool markBinReadUnread(const QSqlDatabase& db, int account_id, RootItem::ReadStatus read); static bool markAccountReadUnread(const QSqlDatabase& db, int account_id, RootItem::ReadStatus read); static bool switchMessagesImportance(const QSqlDatabase& db, const QStringList& ids); @@ -68,27 +73,44 @@ class DatabaseQueries { static bool purgeLabelsAndLabelAssignments(const QSqlDatabase& db, int account_id); // Counts of unread/all messages. - static QMap> getMessageCountsForCategory(const QSqlDatabase& db, const QString& custom_id, - int account_id, bool only_total_counts, + static QMap> getMessageCountsForCategory(const QSqlDatabase& db, + const QString& custom_id, + int account_id, + bool only_total_counts, bool* ok = nullptr); - static QMap> getMessageCountsForAccount(const QSqlDatabase& db, int account_id, - bool only_total_counts, bool* ok = nullptr); - static int getMessageCountsForFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id, - bool only_total_counts, bool* ok = nullptr); - static int getMessageCountsForLabel(const QSqlDatabase& db, Label* label, int account_id, - bool only_total_counts, bool* ok = nullptr); - static int getImportantMessageCounts(const QSqlDatabase& db, int account_id, - bool only_total_counts, bool* ok = nullptr); + static QMap> getMessageCountsForAccount(const QSqlDatabase& db, + int account_id, + bool only_total_counts, + bool* ok = nullptr); + static int getMessageCountsForFeed(const QSqlDatabase& db, + const QString& feed_custom_id, + int account_id, + bool only_total_counts, + bool* ok = nullptr); + static int getMessageCountsForLabel(const QSqlDatabase& db, + Label* label, + int account_id, + bool only_total_counts, + bool* ok = nullptr); + static int getImportantMessageCounts(const QSqlDatabase& db, + int account_id, + bool only_total_counts, + bool* ok = nullptr); static int getUnreadMessageCounts(const QSqlDatabase& db, int account_id, bool* ok = nullptr); - static int getMessageCountsForBin(const QSqlDatabase& db, int account_id, bool including_total_counts, bool* ok = nullptr); + static int getMessageCountsForBin(const QSqlDatabase& db, + int account_id, + bool including_total_counts, + bool* ok = nullptr); // Get messages (for newspaper view for example). static QList getUndeletedMessagesWithLabel(const QSqlDatabase& db, const Label* label, bool* ok = nullptr); static QList getUndeletedLabelledMessages(const QSqlDatabase& db, int account_id, bool* ok = nullptr); static QList getUndeletedImportantMessages(const QSqlDatabase& db, int account_id, bool* ok = nullptr); static QList getUndeletedUnreadMessages(const QSqlDatabase& db, int account_id, bool* ok = nullptr); - static QList getUndeletedMessagesForFeed(const QSqlDatabase& db, const QString& feed_custom_id, - int account_id, bool* ok = nullptr); + static QList getUndeletedMessagesForFeed(const QSqlDatabase& db, + const QString& feed_custom_id, + int account_id, + bool* ok = nullptr); static QList getUndeletedMessagesForBin(const QSqlDatabase& db, int account_id, bool* ok = nullptr); static QList getUndeletedMessagesForAccount(const QSqlDatabase& db, int account_id, bool* ok = nullptr); @@ -100,23 +122,30 @@ class DatabaseQueries { static QStringList customIdsOfUnreadMessages(const QSqlDatabase& db, int account_id, bool* ok = nullptr); static QStringList customIdsOfMessagesFromAccount(const QSqlDatabase& db, int account_id, bool* ok = nullptr); static QStringList customIdsOfMessagesFromBin(const QSqlDatabase& db, int account_id, bool* ok = nullptr); - static QStringList customIdsOfMessagesFromFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id, + static QStringList customIdsOfMessagesFromFeed(const QSqlDatabase& db, + const QString& feed_custom_id, + int account_id, bool* ok = nullptr); // Common account methods. - template + template static QList getAccounts(const QSqlDatabase& db, const QString& code, bool* ok = nullptr); - template - static void loadRootFromDatabase(ServiceRoot* root); + template static void loadRootFromDatabase(ServiceRoot* root); static bool storeNewOauthTokens(const QSqlDatabase& db, const QString& refresh_token, int account_id); static void createOverwriteAccount(const QSqlDatabase& db, ServiceRoot* account); // Returns counts of updated messages . - static QPair updateMessages(QSqlDatabase db, QList& messages, - Feed* feed, bool force_update, bool* ok = nullptr); + static QPair updateMessages(QSqlDatabase db, + QList& messages, + Feed* feed, + bool force_update, + bool* ok = nullptr); 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 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); static bool cleanUnreadMessages(const QSqlDatabase& db, int account_id); @@ -127,12 +156,13 @@ class DatabaseQueries { static bool deleteFeed(const QSqlDatabase& db, Feed* feed, int account_id); static bool deleteCategory(const QSqlDatabase& db, Category* category); - template - static Assignment getCategories(const QSqlDatabase& db, int account_id, bool* ok = nullptr); + template static Assignment getCategories(const QSqlDatabase& db, int account_id, bool* ok = nullptr); - template - static Assignment getFeeds(const QSqlDatabase& db, const QList& global_filters, - int account_id, bool* ok = nullptr); + template + static Assignment getFeeds(const QSqlDatabase& db, + const QList& global_filters, + int account_id, + bool* ok = nullptr); // Item order methods. static void moveItem(RootItem* item, bool move_top, bool move_bottom, int move_index, const QSqlDatabase& db); @@ -144,11 +174,17 @@ class DatabaseQueries { static void removeMessageFilterAssignments(const QSqlDatabase& db, int filter_id, bool* ok = nullptr); static QList getMessageFilters(const QSqlDatabase& db, bool* ok = nullptr); static QMultiMap messageFiltersInFeeds(const QSqlDatabase& db, int account_id, bool* ok = nullptr); - static void assignMessageFilterToFeed(const QSqlDatabase& db, const QString& feed_custom_id, int filter_id, - int account_id, bool* ok = nullptr); + static void assignMessageFilterToFeed(const QSqlDatabase& db, + const QString& feed_custom_id, + int filter_id, + int account_id, + bool* ok = nullptr); static void updateMessageFilter(const QSqlDatabase& db, MessageFilter* filter, bool* ok = nullptr); - static void removeMessageFilterFromFeed(const QSqlDatabase& db, const QString& feed_custom_id, int filter_id, - int account_id, bool* ok = nullptr); + static void removeMessageFilterFromFeed(const QSqlDatabase& db, + const QString& feed_custom_id, + int filter_id, + int account_id, + bool* ok = nullptr); // Gmail account. static QStringList getAllGmailRecipients(const QSqlDatabase& db, int account_id); @@ -159,7 +195,7 @@ class DatabaseQueries { explicit DatabaseQueries() = default; }; -template +template QList DatabaseQueries::getAccounts(const QSqlDatabase& db, const QString& code, bool* ok) { QSqlQuery query(db); QList roots; @@ -189,11 +225,8 @@ QList DatabaseQueries::getAccounts(const QSqlDatabase& db, const Q } } else { - qWarningNN << LOGSEC_DB - << "Loading of accounts with code" - << QUOTE_W_SPACE(code) - << "failed with error:" - << QUOTE_W_SPACE_DOT(query.lastError().text()); + qWarningNN << LOGSEC_DB << "Loading of accounts with code" << QUOTE_W_SPACE(code) + << "failed with error:" << QUOTE_W_SPACE_DOT(query.lastError().text()); if (ok != nullptr) { *ok = false; @@ -203,8 +236,7 @@ QList DatabaseQueries::getAccounts(const QSqlDatabase& db, const Q return roots; } -template -Assignment DatabaseQueries::getCategories(const QSqlDatabase& db, int account_id, bool* ok) { +template Assignment DatabaseQueries::getCategories(const QSqlDatabase& db, int account_id, bool* ok) { Assignment categories; // Obtain data for categories from the database. @@ -215,7 +247,8 @@ Assignment DatabaseQueries::getCategories(const QSqlDatabase& db, int account_id query_categories.bindValue(QSL(":account_id"), account_id); if (!query_categories.exec()) { - qFatal("Query for obtaining categories failed. Error message: '%s'.", qPrintable(query_categories.lastError().text())); + qFatal("Query for obtaining categories failed. Error message: '%s'.", + qPrintable(query_categories.lastError().text())); if (ok != nullptr) { *ok = false; @@ -254,7 +287,7 @@ Assignment DatabaseQueries::getCategories(const QSqlDatabase& db, int account_id return categories; } -template +template Assignment DatabaseQueries::getFeeds(const QSqlDatabase& db, const QList& global_filters, int account_id, @@ -306,11 +339,10 @@ Assignment DatabaseQueries::getFeeds(const QSqlDatabase& db, feed->setAutoUpdateType(static_cast(query.value(FDS_DB_UPDATE_TYPE_INDEX).toInt())); feed->setAutoUpdateInterval(query.value(FDS_DB_UPDATE_INTERVAL_INDEX).toInt()); feed->setIsSwitchedOff(query.value(FDS_DB_IS_OFF_INDEX).toBool()); + feed->setIsQuiet(query.value(FDS_DB_IS_QUIET_INDEX).toBool()); feed->setOpenArticlesDirectly(query.value(FDS_DB_OPEN_ARTICLES_INDEX).toBool()); - qDebugNN << LOGSEC_CORE - << "Custom ID of feed when loading from DB is" - << QUOTE_W_SPACE_DOT(feed->customId()); + qDebugNN << LOGSEC_CORE << "Custom ID of feed when loading from DB is" << QUOTE_W_SPACE_DOT(feed->customId()); // Load custom data. feed->setCustomDatabaseData(deserializeCustomData(query.value(FDS_DB_CUSTOM_DATA_INDEX).toString())); @@ -333,8 +365,7 @@ Assignment DatabaseQueries::getFeeds(const QSqlDatabase& db, return feeds; } -template -void DatabaseQueries::loadRootFromDatabase(ServiceRoot* root) { +template void DatabaseQueries::loadRootFromDatabase(ServiceRoot* root) { QSqlDatabase database = qApp->database()->driver()->connection(root->metaObject()->className()); Assignment categories = DatabaseQueries::getCategories(database, root->accountId()); Assignment feeds = DatabaseQueries::getFeeds(database, qApp->feedReader()->messageFilters(), root->accountId()); diff --git a/src/librssguard/definitions/definitions.h b/src/librssguard/definitions/definitions.h index e7ba14adc..3287a81ae 100644 --- a/src/librssguard/definitions/definitions.h +++ b/src/librssguard/definitions/definitions.h @@ -205,7 +205,7 @@ #define APP_DB_SQLITE_FILE "database.db" // Keep this in sync with schema versions declared in SQL initialization code. -#define APP_DB_SCHEMA_VERSION "3" +#define APP_DB_SCHEMA_VERSION "4" #define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql" #define APP_DB_COMMENT_SPLIT "-- !\n" #define APP_DB_INCLUDE_PLACEHOLDER "!!" @@ -284,10 +284,11 @@ #define FDS_DB_UPDATE_TYPE_INDEX 8 #define FDS_DB_UPDATE_INTERVAL_INDEX 9 #define FDS_DB_IS_OFF_INDEX 10 -#define FDS_DB_OPEN_ARTICLES_INDEX 11 -#define FDS_DB_ACCOUNT_ID_INDEX 12 -#define FDS_DB_CUSTOM_ID_INDEX 13 -#define FDS_DB_CUSTOM_DATA_INDEX 14 +#define FDS_DB_IS_QUIET_INDEX 11 +#define FDS_DB_OPEN_ARTICLES_INDEX 12 +#define FDS_DB_ACCOUNT_ID_INDEX 13 +#define FDS_DB_CUSTOM_ID_INDEX 14 +#define FDS_DB_CUSTOM_DATA_INDEX 15 // Indexes of columns for feed models. #define FDS_MODEL_TITLE_INDEX 0 diff --git a/src/librssguard/services/abstract/feed.cpp b/src/librssguard/services/abstract/feed.cpp index a705ce259..882d74df7 100644 --- a/src/librssguard/services/abstract/feed.cpp +++ b/src/librssguard/services/abstract/feed.cpp @@ -22,8 +22,8 @@ Feed::Feed(RootItem* parent) : RootItem(parent), m_source(QString()), m_status(Status::Normal), m_statusString(QString()), m_autoUpdateType(AutoUpdateType::DefaultAutoUpdate), m_autoUpdateInterval(DEFAULT_AUTO_UPDATE_INTERVAL), - m_lastUpdated(QDateTime::currentDateTimeUtc()), m_isSwitchedOff(false), m_openArticlesDirectly(false), - m_messageFilters(QList>()) { + m_lastUpdated(QDateTime::currentDateTimeUtc()), m_isSwitchedOff(false), m_isQuiet(false), + m_openArticlesDirectly(false), m_messageFilters(QList>()) { setKind(RootItem::Kind::Feed); } @@ -46,6 +46,7 @@ Feed::Feed(const Feed& other) : RootItem(other) { setMessageFilters(other.messageFilters()); setOpenArticlesDirectly(other.openArticlesDirectly()); setIsSwitchedOff(other.isSwitchedOff()); + setIsQuiet(other.isQuiet()); } QList Feed::undeletedMessages() const { @@ -283,6 +284,14 @@ QString Feed::getStatusDescription() const { } } +bool Feed::isQuiet() const { + return m_isQuiet; +} + +void Feed::setIsQuiet(bool quiet) { + m_isQuiet = quiet; +} + QDateTime Feed::lastUpdated() const { return m_lastUpdated; } diff --git a/src/librssguard/services/abstract/feed.h b/src/librssguard/services/abstract/feed.h index cc2195a57..7522f2ac0 100644 --- a/src/librssguard/services/abstract/feed.h +++ b/src/librssguard/services/abstract/feed.h @@ -72,6 +72,9 @@ class Feed : public RootItem { bool isSwitchedOff() const; void setIsSwitchedOff(bool switched_off); + bool isQuiet() const; + void setIsQuiet(bool quiet); + void appendMessageFilter(MessageFilter* filter); QList> messageFilters() const; void setMessageFilters(const QList>& messageFilters); @@ -79,7 +82,6 @@ class Feed : public RootItem { QDateTime lastUpdated() const; void setLastUpdated(const QDateTime& last_updated); - public slots: virtual void updateCounts(bool including_total_count); @@ -95,6 +97,7 @@ class Feed : public RootItem { int m_autoUpdateInterval{}; // In seconds. QDateTime m_lastUpdated; bool m_isSwitchedOff; + bool m_isQuiet; bool m_openArticlesDirectly; int m_totalCount{}; int m_unreadCount{}; diff --git a/src/librssguard/services/abstract/gui/formfeeddetails.cpp b/src/librssguard/services/abstract/gui/formfeeddetails.cpp index 76f86a0f9..4adb9b1f5 100644 --- a/src/librssguard/services/abstract/gui/formfeeddetails.cpp +++ b/src/librssguard/services/abstract/gui/formfeeddetails.cpp @@ -50,6 +50,7 @@ void FormFeedDetails::apply() { m_feed->setAutoUpdateInterval(int(m_ui->m_spinAutoUpdateInterval->value())); m_feed->setOpenArticlesDirectly(m_ui->m_cbOpenArticlesAutomatically->isChecked()); m_feed->setIsSwitchedOff(m_ui->m_cbDisableFeed->isChecked()); + m_feed->setIsQuiet(m_ui->m_cbSuppressFeed->isChecked()); if (!m_creatingNew) { // We need to make sure that common data are saved. @@ -97,6 +98,7 @@ void FormFeedDetails::loadFeedData() { m_ui->m_spinAutoUpdateInterval->setValue(m_feed->autoUpdateInterval()); m_ui->m_cbOpenArticlesAutomatically->setChecked(m_feed->openArticlesDirectly()); m_ui->m_cbDisableFeed->setChecked(m_feed->isSwitchedOff()); + m_ui->m_cbSuppressFeed->setChecked(m_feed->isQuiet()); } void FormFeedDetails::acceptIfPossible() { diff --git a/src/librssguard/services/abstract/gui/formfeeddetails.ui b/src/librssguard/services/abstract/gui/formfeeddetails.ui index 30899ae4a..92a388c56 100644 --- a/src/librssguard/services/abstract/gui/formfeeddetails.ui +++ b/src/librssguard/services/abstract/gui/formfeeddetails.ui @@ -66,13 +66,20 @@ Miscellaneous - + Disable this feed + + + + Suppress this feed + + + @@ -99,6 +106,14 @@
timespinbox.h
+ + m_tabWidget + m_cmbAutoUpdateType + m_spinAutoUpdateInterval + m_cbOpenArticlesAutomatically + m_cbSuppressFeed + m_cbDisableFeed + diff --git a/src/librssguard/services/abstract/serviceroot.cpp b/src/librssguard/services/abstract/serviceroot.cpp index 6b67ec8db..e9ab1d0bf 100644 --- a/src/librssguard/services/abstract/serviceroot.cpp +++ b/src/librssguard/services/abstract/serviceroot.cpp @@ -374,6 +374,7 @@ QMap ServiceRoot::storeCustomFeedsData() { feed_custom_data.insert(QSL("auto_update_type"), int(feed->autoUpdateType())); feed_custom_data.insert(QSL("msg_filters"), QVariant::fromValue(feed->messageFilters())); feed_custom_data.insert(QSL("is_off"), feed->isSwitchedOff()); + feed_custom_data.insert(QSL("is_quiet"), feed->isQuiet()); feed_custom_data.insert(QSL("open_articles_directly"), feed->openArticlesDirectly()); // NOTE: These are here specifically to be able to restore custom sort order. @@ -406,6 +407,7 @@ void ServiceRoot::restoreCustomFeedsData(const QMap& data, feed->setMessageFilters(feed_custom_data.value(QSL("msg_filters")).value>>()); feed->setIsSwitchedOff(feed_custom_data.value(QSL("is_off")).toBool()); + feed->setIsQuiet(feed_custom_data.value(QSL("is_quiet")).toBool()); feed->setOpenArticlesDirectly(feed_custom_data.value(QSL("open_articles_directly")).toBool()); } }