working DB layer for limitting feature
This commit is contained in:
parent
796fbf916e
commit
e3ff40ce28
@ -2532,12 +2532,30 @@ void DatabaseQueries::createOverwriteFeed(const QSqlDatabase& db, Feed* feed, in
|
||||
feed->setSortOrder(next_sort_order);
|
||||
|
||||
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, is_quiet = :is_quiet, open_articles ="
|
||||
" :open_articles, is_rtl = :is_rtl, add_any_datetime_articles = :add_any_datetime_articles,"
|
||||
" datetime_to_avoid = :datetime_to_avoid, account_id"
|
||||
" = :account_id, custom_id = :custom_id, custom_data = :custom_data WHERE id = :id;");
|
||||
"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, "
|
||||
"is_quiet = :is_quiet, "
|
||||
"open_articles = :open_articles, "
|
||||
"is_rtl = :is_rtl, "
|
||||
"add_any_datetime_articles = :add_any_datetime_articles, "
|
||||
"datetime_to_avoid = :datetime_to_avoid, "
|
||||
"keep_article_count = :keep_article_count, "
|
||||
"keep_unread_articles = :keep_unread_articles, "
|
||||
"keep_starred_articles = :keep_starred_articles, "
|
||||
"recycle_articles = :recycle_articles, "
|
||||
"account_id = :account_id, "
|
||||
"custom_id = :custom_id, "
|
||||
"custom_data = :custom_data "
|
||||
"WHERE id = :id;");
|
||||
q.bindValue(QSL(":title"), feed->title());
|
||||
q.bindValue(QSL(":description"), feed->description());
|
||||
q.bindValue(QSL(":date_created"), feed->creationDate().toMSecsSinceEpoch());
|
||||
@ -2563,6 +2581,11 @@ void DatabaseQueries::createOverwriteFeed(const QSqlDatabase& db, Feed* feed, in
|
||||
? art.m_dtToAvoid.toMSecsSinceEpoch()
|
||||
: art.m_hoursToAvoid);
|
||||
|
||||
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);
|
||||
q.bindValue(QSL(":recycle_articles"), art.m_moveToBinDontPurge);
|
||||
|
||||
auto custom_data = feed->customDatabaseData();
|
||||
QString serialized_custom_data = serializeCustomData(custom_data);
|
||||
|
||||
|
@ -395,6 +395,11 @@ Assignment DatabaseQueries::getFeeds(const QSqlDatabase& db,
|
||||
art.m_hoursToAvoid = time_to_avoid;
|
||||
}
|
||||
|
||||
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();
|
||||
art.m_moveToBinDontPurge = query.value(RECYCLE_ARTICLE_DONT_PURGE).toBool();
|
||||
|
||||
feed->setArticleIgnoreLimit(art);
|
||||
feed->setOpenArticlesDirectly(query.value(FDS_DB_OPEN_ARTICLES_INDEX).toBool());
|
||||
|
||||
|
@ -149,6 +149,22 @@ void ArticleAmountControl::saveFeed(Feed* fd, bool batch_edit) const {
|
||||
art.m_hoursToAvoid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isChangeAllowed(m_ui.m_mcbArticleCount, 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();
|
||||
}
|
||||
}
|
||||
|
||||
void ArticleAmountControl::updateArticleCountSuffix(int count) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user