bit better DB/logic handling
This commit is contained in:
parent
e3ff40ce28
commit
34167c3f9f
@ -48,6 +48,7 @@ CREATE TABLE Feeds (
|
||||
add_any_datetime_articles INTEGER NOT NULL DEFAULT 0 CHECK (add_any_datetime_articles >= 0 AND add_any_datetime_articles <= 1),
|
||||
datetime_to_avoid BIGINT NOT NULL DEFAULT 0 CHECK (datetime_to_avoid >= 0),
|
||||
|
||||
keep_article_customize INTEGER NOT NULL DEFAULT 0 CHECK (keep_article_customize >= 0 AND keep_article_customize <= 1),
|
||||
keep_article_count INTEGER NOT NULL DEFAULT 0 CHECK (keep_article_count >= 0),
|
||||
keep_unread_articles INTEGER NOT NULL DEFAULT 1 CHECK (keep_unread_articles >= 0 AND keep_unread_articles <= 1),
|
||||
keep_starred_articles INTEGER NOT NULL DEFAULT 1 CHECK (keep_starred_articles >= 0 AND keep_starred_articles <= 1),
|
||||
|
@ -18,6 +18,7 @@ CREATE TABLE Feeds (
|
||||
add_any_datetime_articles INTEGER NOT NULL DEFAULT 0 CHECK (add_any_datetime_articles >= 0 AND add_any_datetime_articles <= 1),
|
||||
datetime_to_avoid BIGINT NOT NULL DEFAULT 0 CHECK (datetime_to_avoid >= 0),
|
||||
|
||||
keep_article_customize INTEGER NOT NULL DEFAULT 0 CHECK (keep_article_customize >= 0 AND keep_article_customize <= 1),
|
||||
keep_article_count INTEGER NOT NULL DEFAULT 0 CHECK (keep_article_count >= 0),
|
||||
keep_unread_articles INTEGER NOT NULL DEFAULT 1 CHECK (keep_unread_articles >= 0 AND keep_unread_articles <= 1),
|
||||
keep_starred_articles INTEGER NOT NULL DEFAULT 1 CHECK (keep_starred_articles >= 0 AND keep_starred_articles <= 1),
|
||||
|
@ -232,6 +232,9 @@ void FeedDownloader::updateOneFeed(ServiceRoot* acc,
|
||||
|
||||
try {
|
||||
QSqlDatabase database = qApp->database()->driver()->threadSafeConnection(metaObject()->className());
|
||||
|
||||
feed->removeUnwantedArticles(database);
|
||||
|
||||
QList<Message> msgs = feed->getParentServiceRoot()->obtainNewMessages(feed, stated_messages, tagged_messages);
|
||||
|
||||
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Downloaded" << NONQUOTE_W_SPACE(msgs.size()) << "messages for feed ID"
|
||||
|
@ -546,6 +546,15 @@ bool DatabaseQueries::restoreBin(const QSqlDatabase& db, int account_id) {
|
||||
return q.exec();
|
||||
}
|
||||
|
||||
void DatabaseQueries::removeUnwantedArticlesFromFeed(const QSqlDatabase& db,
|
||||
const Feed::ArticleIgnoreLimit& feed_setup,
|
||||
const Feed::ArticleIgnoreLimit& app_setup) {
|
||||
// Feed setup has higher preference.
|
||||
int amount_to_remove =
|
||||
feed_setup.m_keepCountOfArticles > 0 ? feed_setup.m_keepCountOfArticles : app_setup.m_keepCountOfArticles;
|
||||
// bool dont_remove_unread = feed_setup.m_doNotRemoveUnread
|
||||
}
|
||||
|
||||
bool DatabaseQueries::purgeMessage(const QSqlDatabase& db, int message_id) {
|
||||
QSqlQuery q(db);
|
||||
|
||||
@ -2548,6 +2557,7 @@ void DatabaseQueries::createOverwriteFeed(const QSqlDatabase& db, Feed* feed, in
|
||||
"is_rtl = :is_rtl, "
|
||||
"add_any_datetime_articles = :add_any_datetime_articles, "
|
||||
"datetime_to_avoid = :datetime_to_avoid, "
|
||||
"keep_article_customize = :keep_article_customize, "
|
||||
"keep_article_count = :keep_article_count, "
|
||||
"keep_unread_articles = :keep_unread_articles, "
|
||||
"keep_starred_articles = :keep_starred_articles, "
|
||||
@ -2581,6 +2591,7 @@ void DatabaseQueries::createOverwriteFeed(const QSqlDatabase& db, Feed* feed, in
|
||||
? art.m_dtToAvoid.toMSecsSinceEpoch()
|
||||
: art.m_hoursToAvoid);
|
||||
|
||||
q.bindValue(QSL(":keep_article_customize"), art.m_customizeLimitting);
|
||||
q.bindValue(QSL(":keep_article_count"), art.m_keepCountOfArticles);
|
||||
q.bindValue(QSL(":keep_unread_articles"), art.m_doNotRemoveUnread);
|
||||
q.bindValue(QSL(":keep_starred_articles"), art.m_doNotRemoveStarred);
|
||||
|
@ -72,6 +72,10 @@ class DatabaseQueries {
|
||||
static bool restoreBin(const QSqlDatabase& db, int account_id);
|
||||
|
||||
// Purge database.
|
||||
static void removeUnwantedArticlesFromFeed(const QSqlDatabase& db,
|
||||
const Feed::ArticleIgnoreLimit& feed_setup,
|
||||
const Feed::ArticleIgnoreLimit& app_setup);
|
||||
|
||||
static bool purgeMessage(const QSqlDatabase& db, int message_id);
|
||||
static bool purgeImportantMessages(const QSqlDatabase& db);
|
||||
static bool purgeReadMessages(const QSqlDatabase& db);
|
||||
@ -395,6 +399,7 @@ Assignment DatabaseQueries::getFeeds(const QSqlDatabase& db,
|
||||
art.m_hoursToAvoid = time_to_avoid;
|
||||
}
|
||||
|
||||
art.m_customizeLimitting = query.value(FDS_DB_KEEP_CUSTOMIZE).toBool();
|
||||
art.m_keepCountOfArticles = query.value(FDS_DB_KEEP_ARTICLES_COUNT).toInt();
|
||||
art.m_doNotRemoveUnread = query.value(FDS_DB_KEEP_UNREAD_ARTICLES).toBool();
|
||||
art.m_doNotRemoveStarred = query.value(FDS_DB_KEEP_STARRED_ARTICLES).toBool();
|
||||
|
@ -311,14 +311,15 @@
|
||||
#define FDS_DB_IS_RTL_INDEX 12
|
||||
#define FDS_DB_ADD_ANY_DATETIME_ARTICLES_INDEX 13
|
||||
#define FDS_DB_DATETIME_TO_AVOID_INDEX 14
|
||||
#define FDS_DB_KEEP_ARTICLES_COUNT 15
|
||||
#define FDS_DB_KEEP_UNREAD_ARTICLES 16
|
||||
#define FDS_DB_KEEP_STARRED_ARTICLES 17
|
||||
#define RECYCLE_ARTICLE_DONT_PURGE 18
|
||||
#define FDS_DB_OPEN_ARTICLES_INDEX 19
|
||||
#define FDS_DB_ACCOUNT_ID_INDEX 20
|
||||
#define FDS_DB_CUSTOM_ID_INDEX 21
|
||||
#define FDS_DB_CUSTOM_DATA_INDEX 22
|
||||
#define FDS_DB_KEEP_CUSTOMIZE 15
|
||||
#define FDS_DB_KEEP_ARTICLES_COUNT 16
|
||||
#define FDS_DB_KEEP_UNREAD_ARTICLES 17
|
||||
#define FDS_DB_KEEP_STARRED_ARTICLES 18
|
||||
#define RECYCLE_ARTICLE_DONT_PURGE 19
|
||||
#define FDS_DB_OPEN_ARTICLES_INDEX 20
|
||||
#define FDS_DB_ACCOUNT_ID_INDEX 21
|
||||
#define FDS_DB_CUSTOM_ID_INDEX 22
|
||||
#define FDS_DB_CUSTOM_DATA_INDEX 23
|
||||
|
||||
// Indexes of columns for feed models.
|
||||
#define FDS_MODEL_TITLE_INDEX 0
|
||||
|
@ -19,7 +19,7 @@ ArticleAmountControl::ArticleAmountControl(QWidget* parent) : QWidget(parent) {
|
||||
false);
|
||||
|
||||
m_ui.m_spinArticleCount->setSpecialValueText(tr("all articles"));
|
||||
// m_ui.m_cbAddAnyDateArticles->setChecked(true);
|
||||
m_ui.m_cbArticleLimittingCustomize->setChecked(true);
|
||||
m_ui.m_dtDateTimeToAvoid->setEnabled(false);
|
||||
m_ui.m_spinHoursAvoid->setEnabled(false);
|
||||
m_ui.m_spinHoursAvoid->setMode(TimeSpinBox::Mode::DaysHours);
|
||||
@ -46,6 +46,7 @@ ArticleAmountControl::ArticleAmountControl(QWidget* parent) : QWidget(parent) {
|
||||
QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
this,
|
||||
&ArticleAmountControl::updateArticleCountSuffix);
|
||||
connect(m_ui.m_cbArticleLimittingCustomize, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||
connect(m_ui.m_spinArticleCount, QOverload<int>::of(&QSpinBox::valueChanged), this, &ArticleAmountControl::changed);
|
||||
connect(m_ui.m_cbMoveToBinNoPurge, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||
connect(m_ui.m_cbNoRemoveImportant, &QCheckBox::toggled, this, &ArticleAmountControl::changed);
|
||||
@ -55,9 +56,14 @@ ArticleAmountControl::ArticleAmountControl(QWidget* parent) : QWidget(parent) {
|
||||
void ArticleAmountControl::setForAppWideFeatures(bool app_wide, bool batch_edit) {
|
||||
if (app_wide) {
|
||||
m_ui.m_cbAddAnyDateArticles->setVisible(false);
|
||||
m_ui.m_cbArticleLimittingCustomize->setVisible(false);
|
||||
}
|
||||
else {
|
||||
connect(m_ui.m_cbAddAnyDateArticles, &QCheckBox::toggled, m_ui.m_wdgAvoidOldArticles, &QGroupBox::setDisabled);
|
||||
connect(m_ui.m_cbArticleLimittingCustomize,
|
||||
&QCheckBox::toggled,
|
||||
m_ui.m_wdgArticleLimittingCustomize,
|
||||
&QGroupBox::setEnabled);
|
||||
}
|
||||
|
||||
if (batch_edit) {
|
||||
@ -65,10 +71,8 @@ void ArticleAmountControl::setForAppWideFeatures(bool app_wide, bool batch_edit)
|
||||
m_ui.m_mcbAddAnyDateArticles->addActionWidget(m_ui.m_cbAddAnyDateArticles);
|
||||
m_ui.m_mcbAvoidOldArticles->addActionWidget(m_ui.m_wdgAvoidOldArticles);
|
||||
|
||||
m_ui.m_mcbArticleCount->addActionWidget(m_ui.m_spinArticleCount);
|
||||
m_ui.m_mcbMoveToBinNoPurge->addActionWidget(m_ui.m_cbMoveToBinNoPurge);
|
||||
m_ui.m_mcbNoRemoveImportant->addActionWidget(m_ui.m_cbNoRemoveImportant);
|
||||
m_ui.m_mcbNoRemoveUnread->addActionWidget(m_ui.m_cbNoRemoveUnread);
|
||||
m_ui.m_mcbArticleLimittingCustomize->addActionWidget(m_ui.m_cbArticleLimittingCustomize);
|
||||
m_ui.m_mcbArticleLimittingSetup->addActionWidget(m_ui.m_wdgArticleLimittingCustomize);
|
||||
}
|
||||
else {
|
||||
// We hide batch selectors.
|
||||
@ -93,6 +97,7 @@ void ArticleAmountControl::load(const Feed::ArticleIgnoreLimit& setup) {
|
||||
m_ui.m_cbAddAnyDateArticles->setChecked(setup.m_addAnyArticlesToDb);
|
||||
|
||||
// Limitting articles.
|
||||
m_ui.m_cbArticleLimittingCustomize->setChecked(setup.m_customizeLimitting);
|
||||
m_ui.m_spinArticleCount->setValue(setup.m_keepCountOfArticles);
|
||||
m_ui.m_cbMoveToBinNoPurge->setChecked(setup.m_moveToBinDontPurge);
|
||||
m_ui.m_cbNoRemoveImportant->setChecked(setup.m_doNotRemoveStarred);
|
||||
@ -114,6 +119,7 @@ Feed::ArticleIgnoreLimit ArticleAmountControl::save() const {
|
||||
}
|
||||
|
||||
// Limitting articles.
|
||||
setup.m_customizeLimitting = m_ui.m_cbArticleLimittingCustomize->isChecked();
|
||||
setup.m_keepCountOfArticles = m_ui.m_spinArticleCount->value();
|
||||
setup.m_moveToBinDontPurge = m_ui.m_cbMoveToBinNoPurge->isChecked();
|
||||
setup.m_doNotRemoveStarred = m_ui.m_cbNoRemoveImportant->isChecked();
|
||||
@ -150,19 +156,14 @@ void ArticleAmountControl::saveFeed(Feed* fd, bool batch_edit) const {
|
||||
}
|
||||
}
|
||||
|
||||
if (isChangeAllowed(m_ui.m_mcbArticleCount, batch_edit)) {
|
||||
if (isChangeAllowed(m_ui.m_mcbArticleLimittingCustomize, batch_edit)) {
|
||||
art.m_customizeLimitting = m_ui.m_cbArticleLimittingCustomize->isChecked();
|
||||
}
|
||||
|
||||
if (isChangeAllowed(m_ui.m_mcbArticleLimittingSetup, batch_edit)) {
|
||||
art.m_keepCountOfArticles = m_ui.m_spinArticleCount->value();
|
||||
}
|
||||
|
||||
if (isChangeAllowed(m_ui.m_mcbNoRemoveImportant, batch_edit)) {
|
||||
art.m_doNotRemoveStarred = m_ui.m_cbNoRemoveImportant->isChecked();
|
||||
}
|
||||
|
||||
if (isChangeAllowed(m_ui.m_mcbNoRemoveUnread, batch_edit)) {
|
||||
art.m_doNotRemoveUnread = m_ui.m_cbNoRemoveUnread->isChecked();
|
||||
}
|
||||
|
||||
if (isChangeAllowed(m_ui.m_mcbMoveToBinNoPurge, batch_edit)) {
|
||||
art.m_moveToBinDontPurge = m_ui.m_cbMoveToBinNoPurge->isChecked();
|
||||
}
|
||||
}
|
||||
|
@ -169,84 +169,82 @@
|
||||
<attribute name="title">
|
||||
<string>Limiting amount of article in feeds</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="MultiFeedEditCheckBox" name="m_mcbArticleCount"/>
|
||||
<widget class="MultiFeedEditCheckBox" name="m_mcbArticleLimittingCustomize"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QCheckBox" name="m_cbArticleLimittingCustomize">
|
||||
<property name="text">
|
||||
<string>In database, keep</string>
|
||||
<string>Customize article limits</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="m_spinArticleCount">
|
||||
<property name="maximum">
|
||||
<number>100000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="MultiFeedEditCheckBox" name="m_mcbNoRemoveImportant"/>
|
||||
<widget class="MultiFeedEditCheckBox" name="m_mcbArticleLimittingSetup"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_cbNoRemoveImportant">
|
||||
<property name="text">
|
||||
<string>Do not remove important articles</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_wdgArticleLimittingCustomize" native="true">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>In database, keep</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="m_spinArticleCount">
|
||||
<property name="maximum">
|
||||
<number>100000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_cbNoRemoveImportant">
|
||||
<property name="text">
|
||||
<string>Do not remove important articles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_cbNoRemoveUnread">
|
||||
<property name="text">
|
||||
<string>Do not remove unread articles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="m_cbMoveToBinNoPurge">
|
||||
<property name="text">
|
||||
<string>Just move articles to recycle bin, do not purge them</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="MultiFeedEditCheckBox" name="m_mcbNoRemoveUnread"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_cbNoRemoveUnread">
|
||||
<property name="text">
|
||||
<string>Do not remove unread articles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="MultiFeedEditCheckBox" name="m_mcbMoveToBinNoPurge"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_cbMoveToBinNoPurge">
|
||||
<property name="text">
|
||||
<string>Just move articles to recycle bin, do not purge them</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="HelpSpoiler" name="m_helpLimit" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -283,18 +283,7 @@ void SettingsFeedsMessages::loadSettings() {
|
||||
->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::UseLegacyArticleFormat)).toBool());
|
||||
}
|
||||
|
||||
Feed::ArticleIgnoreLimit art_limit;
|
||||
art_limit.m_avoidOldArticles = settings()->value(GROUP(Messages), SETTING(Messages::AvoidOldArticles)).toBool();
|
||||
art_limit.m_dtToAvoid = settings()->value(GROUP(Messages), SETTING(Messages::DateTimeToAvoidArticle)).toDateTime();
|
||||
art_limit.m_hoursToAvoid = settings()->value(GROUP(Messages), SETTING(Messages::HoursToAvoidArticle)).toInt();
|
||||
|
||||
art_limit.m_doNotRemoveStarred =
|
||||
settings()->value(GROUP(Messages), SETTING(Messages::LimitDoNotRemoveStarred)).toBool();
|
||||
art_limit.m_doNotRemoveUnread =
|
||||
settings()->value(GROUP(Messages), SETTING(Messages::LimitDoNotRemoveUnread)).toBool();
|
||||
art_limit.m_keepCountOfArticles = settings()->value(GROUP(Messages), SETTING(Messages::LimitCountOfArticles)).toInt();
|
||||
art_limit.m_moveToBinDontPurge =
|
||||
settings()->value(GROUP(Messages), SETTING(Messages::LimitRecycleInsteadOfPurging)).toBool();
|
||||
Feed::ArticleIgnoreLimit art_limit = Feed::ArticleIgnoreLimit::fromSettings();
|
||||
|
||||
m_ui->m_wdgArticleLimiting->load(art_limit);
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "definitions/definitions.h"
|
||||
#include "miscellaneous/application.h"
|
||||
#include "miscellaneous/feedreader.h"
|
||||
#include "miscellaneous/settings.h"
|
||||
#include "miscellaneous/textfactory.h"
|
||||
#include "services/abstract/cacheforserviceroot.h"
|
||||
#include "services/abstract/gui/formfeeddetails.h"
|
||||
@ -200,6 +201,13 @@ void Feed::setIsRtl(bool rtl) {
|
||||
m_isRtl = rtl;
|
||||
}
|
||||
|
||||
void Feed::removeUnwantedArticles(QSqlDatabase& db) {
|
||||
Feed::ArticleIgnoreLimit feed_setup = articleIgnoreLimit();
|
||||
Feed::ArticleIgnoreLimit app_setup = Feed::ArticleIgnoreLimit::fromSettings();
|
||||
|
||||
DatabaseQueries::removeUnwantedArticlesFromFeed(db, feed_setup, app_setup);
|
||||
}
|
||||
|
||||
void Feed::appendMessageFilter(MessageFilter* filter) {
|
||||
m_messageFilters.append(QPointer<MessageFilter>(filter));
|
||||
}
|
||||
@ -381,3 +389,23 @@ QString Feed::additionalTooltip() const {
|
||||
Qt::ItemFlags Feed::additionalFlags() const {
|
||||
return Qt::ItemFlag::ItemNeverHasChildren;
|
||||
}
|
||||
|
||||
Feed::ArticleIgnoreLimit Feed::ArticleIgnoreLimit::fromSettings() {
|
||||
Feed::ArticleIgnoreLimit art_limit;
|
||||
|
||||
art_limit.m_avoidOldArticles = qApp->settings()->value(GROUP(Messages), SETTING(Messages::AvoidOldArticles)).toBool();
|
||||
art_limit.m_dtToAvoid =
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::DateTimeToAvoidArticle)).toDateTime();
|
||||
art_limit.m_hoursToAvoid = qApp->settings()->value(GROUP(Messages), SETTING(Messages::HoursToAvoidArticle)).toInt();
|
||||
|
||||
art_limit.m_doNotRemoveStarred =
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::LimitDoNotRemoveStarred)).toBool();
|
||||
art_limit.m_doNotRemoveUnread =
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::LimitDoNotRemoveUnread)).toBool();
|
||||
art_limit.m_keepCountOfArticles =
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::LimitCountOfArticles)).toInt();
|
||||
art_limit.m_moveToBinDontPurge =
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::LimitRecycleInsteadOfPurging)).toBool();
|
||||
|
||||
return art_limit;
|
||||
}
|
||||
|
@ -24,10 +24,13 @@ class Feed : public RootItem {
|
||||
int m_hoursToAvoid = 0;
|
||||
|
||||
// Limitting articles.
|
||||
bool m_customizeLimitting = false;
|
||||
int m_keepCountOfArticles = 0;
|
||||
bool m_doNotRemoveStarred = true;
|
||||
bool m_doNotRemoveUnread = true;
|
||||
bool m_moveToBinDontPurge = false;
|
||||
|
||||
static ArticleIgnoreLimit fromSettings();
|
||||
};
|
||||
|
||||
// Specifies the auto-download strategy for the feed.
|
||||
@ -105,6 +108,8 @@ class Feed : public RootItem {
|
||||
bool isRtl() const;
|
||||
void setIsRtl(bool rtl);
|
||||
|
||||
void removeUnwantedArticles(QSqlDatabase& db);
|
||||
|
||||
ArticleIgnoreLimit& articleIgnoreLimit();
|
||||
const ArticleIgnoreLimit& articleIgnoreLimit() const;
|
||||
void setArticleIgnoreLimit(const ArticleIgnoreLimit& ignore_limit);
|
||||
|
Loading…
x
Reference in New Issue
Block a user