diff --git a/src/librssguard/database/databasequeries.cpp b/src/librssguard/database/databasequeries.cpp index 176d303e2..ee6a7f9ab 100644 --- a/src/librssguard/database/databasequeries.cpp +++ b/src/librssguard/database/databasequeries.cpp @@ -1274,18 +1274,19 @@ QPair DatabaseQueries::updateMessages(QSqlDatabase db, // // 4) FOR ALL SERVICES: Message update is forced, we want to overwrite message as some arbitrary atribute was changed, // this particularly happens when manual message filter execution happens. + bool ignore_contents_changes = qApp->settings()->value(GROUP(Messages), SETTING(Messages::IgnoreContentsChanges)).toBool(); bool cond_1 = !message.m_customId.isEmpty() && feed->getParentServiceRoot()->isSyncable() && (message.m_created.toMSecsSinceEpoch() != date_existing_message || message.m_isRead != is_read_existing_message || message.m_isImportant != is_important_existing_message || message.m_feedId != feed_id_existing_message || message.m_title != title_existing_message || - message.m_contents != contents_existing_message); + (!ignore_contents_changes && message.m_contents != contents_existing_message)); bool cond_2 = !message.m_customId.isEmpty() && !feed->getParentServiceRoot()->isSyncable() && (message.m_title != title_existing_message || - message.m_contents != contents_existing_message); - bool cond_3 = message.m_createdFromFeed && message.m_created.toMSecsSinceEpoch() != date_existing_message && - message.m_contents != contents_existing_message; + (!ignore_contents_changes && message.m_contents != contents_existing_message)); + bool cond_3 = (message.m_createdFromFeed && message.m_created.toMSecsSinceEpoch() != date_existing_message) || + (!ignore_contents_changes && message.m_contents != contents_existing_message); if (cond_1 || cond_2 || cond_3 || force_update) { // Message exists and is changed, update it. diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.cpp b/src/librssguard/gui/settings/settingsfeedsmessages.cpp index ba2146e36..67c6c5458 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.cpp +++ b/src/librssguard/gui/settings/settingsfeedsmessages.cpp @@ -47,6 +47,7 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent connect(m_ui->m_spinHeightRowsFeeds, static_cast(&QSpinBox::valueChanged), this, &SettingsFeedsMessages::requireRestart); + connect(m_ui->m_cmbIgnoreContentsChanges, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_cbHideCountsIfNoUnread, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkAutoUpdate, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); connect(m_ui->m_checkAutoUpdateOnlyUnfocused, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings); @@ -148,9 +149,12 @@ void SettingsFeedsMessages::loadSettings() { m_ui->m_spinFeedUpdateTimeout->setValue(settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt()); m_ui->m_checkUpdateAllFeedsOnStartup->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::FeedsUpdateOnStartup)).toBool()); m_ui->m_spinStartupUpdateDelay->setValue(settings()->value(GROUP(Feeds), SETTING(Feeds::FeedsUpdateStartupDelay)).toDouble()); - m_ui->m_cmbCountsFeedList->addItems(QStringList() << "(%unread)" << "[%unread]" << "%unread/%all" << "%unread-%all" << "[%unread|%all]"); + m_ui->m_cmbCountsFeedList->addItems({ QSL("(%unread)"), QSL("[%unread]"), QSL("%unread/%all"), + QSL("%unread-%all"), QSL("[%unread|%all]") }); m_ui->m_cmbCountsFeedList->setEditText(settings()->value(GROUP(Feeds), SETTING(Feeds::CountFormat)).toString()); m_ui->m_checkShowTooltips->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::EnableTooltipsFeedsMessages)).toBool()); + m_ui->m_cmbIgnoreContentsChanges->setChecked(settings()->value(GROUP(Messages), + SETTING(Messages::IgnoreContentsChanges)).toBool()); #if !defined (USE_WEBENGINE) m_ui->m_checkDisplayPlaceholders->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()); @@ -215,6 +219,7 @@ void SettingsFeedsMessages::saveSettings() { settings()->setValue(GROUP(Feeds), Feeds::CountFormat, m_ui->m_cmbCountsFeedList->currentText()); settings()->setValue(GROUP(Messages), Messages::UseCustomDate, m_ui->m_checkMessagesDateTimeFormat->isChecked()); settings()->setValue(GROUP(Feeds), Feeds::EnableTooltipsFeedsMessages, m_ui->m_checkShowTooltips->isChecked()); + settings()->setValue(GROUP(Messages), Messages::IgnoreContentsChanges, m_ui->m_cmbIgnoreContentsChanges->isChecked()); #if !defined (USE_WEBENGINE) settings()->setValue(GROUP(Messages), Messages::DisplayImagePlaceholders, m_ui->m_checkDisplayPlaceholders->isChecked()); diff --git a/src/librssguard/gui/settings/settingsfeedsmessages.ui b/src/librssguard/gui/settings/settingsfeedsmessages.ui index 24867d0f4..2deb5e19f 100644 --- a/src/librssguard/gui/settings/settingsfeedsmessages.ui +++ b/src/librssguard/gui/settings/settingsfeedsmessages.ui @@ -240,7 +240,7 @@ - + Display placeholders to indicate locations of pictures @@ -248,27 +248,34 @@ + + + Display attached pictures directly in article + + + + Display real icons of feeds in list of articles instead of read/unread icons - + Bring application window to front once article is opened in external web browser - + Keep article selection in the middle of the article list viewport - + Height or rows in article list (-1 = default height) @@ -278,7 +285,7 @@ - + -1 @@ -288,7 +295,7 @@ - + Height of image attachments @@ -298,7 +305,7 @@ - + 22 @@ -308,7 +315,23 @@ - + + + + Use custom date/time format (overrides format loaded from active localization) + + + true + + + true + + + + + + + @@ -377,23 +400,7 @@ - - - - Use custom date/time format (overrides format loaded from active localization) - - - true - - - true - - - - - - - + Qt::Vertical @@ -406,10 +413,10 @@ - - + + - Display attached pictures directly in article + Ignore changes in article contents when determining if article is "new" @@ -440,6 +447,7 @@ m_cbHideCountsIfNoUnread m_checkShowTooltips m_checkRemoveReadMessagesOnExit + m_cmbIgnoreContentsChanges m_checkDisplayPlaceholders m_cbShowEnclosuresDirectly m_checkDisplayFeedIcons diff --git a/src/librssguard/miscellaneous/settings.cpp b/src/librssguard/miscellaneous/settings.cpp index 63fea839b..198331930 100644 --- a/src/librssguard/miscellaneous/settings.cpp +++ b/src/librssguard/miscellaneous/settings.cpp @@ -105,6 +105,9 @@ DVALUE(char*) Messages::CustomDateFormatDef = ""; DKEY Messages::ClearReadOnExit = "clear_read_on_exit"; DVALUE(bool) Messages::ClearReadOnExitDef = false; +DKEY Messages::IgnoreContentsChanges = "ignore_contents_changes"; +DVALUE(bool) Messages::IgnoreContentsChangesDef = true; + DKEY Messages::DisplayFeedIconsInList = "display_feed_icons_in_message_list"; DVALUE(bool) Messages::DisplayFeedIconsInListDef = false; diff --git a/src/librssguard/miscellaneous/settings.h b/src/librssguard/miscellaneous/settings.h index c10c7596c..97c8f211a 100644 --- a/src/librssguard/miscellaneous/settings.h +++ b/src/librssguard/miscellaneous/settings.h @@ -122,6 +122,9 @@ namespace Messages { KEY ClearReadOnExit; VALUE(bool) ClearReadOnExitDef; + KEY IgnoreContentsChanges; + VALUE(bool) IgnoreContentsChangesDef; + KEY DisplayFeedIconsInList; VALUE(bool) DisplayFeedIconsInListDef;