mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
RSS: Correctly clean up config file when removing a feed
This commit is contained in:
parent
1e1094f8da
commit
8219c29b0c
1 changed files with 7 additions and 2 deletions
|
@ -104,15 +104,20 @@ void RssFeed::refresh() {
|
||||||
void RssFeed::removeAllSettings() {
|
void RssFeed::removeAllSettings() {
|
||||||
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
||||||
QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on", QHash<QString, QVariant>()).toHash();
|
QHash<QString, QVariant> feeds_w_downloader = qBTRSS.value("downloader_on", QHash<QString, QVariant>()).toHash();
|
||||||
if(feeds_w_downloader.contains(m_url)) {
|
if (feeds_w_downloader.contains(m_url)) {
|
||||||
feeds_w_downloader.remove(m_url);
|
feeds_w_downloader.remove(m_url);
|
||||||
qBTRSS.setValue("downloader_on", feeds_w_downloader);
|
qBTRSS.setValue("downloader_on", feeds_w_downloader);
|
||||||
}
|
}
|
||||||
QHash<QString, QVariant> all_feeds_filters = qBTRSS.value("feed_filters", QHash<QString, QVariant>()).toHash();
|
QHash<QString, QVariant> all_feeds_filters = qBTRSS.value("feed_filters", QHash<QString, QVariant>()).toHash();
|
||||||
if(all_feeds_filters.contains(m_url)) {
|
if (all_feeds_filters.contains(m_url)) {
|
||||||
all_feeds_filters.remove(m_url);
|
all_feeds_filters.remove(m_url);
|
||||||
qBTRSS.setValue("feed_filters", all_feeds_filters);
|
qBTRSS.setValue("feed_filters", all_feeds_filters);
|
||||||
}
|
}
|
||||||
|
QHash<QString, QVariant> all_old_items = qBTRSS.value("old_items", QHash<QString, QVariant>()).toHash();
|
||||||
|
if (all_old_items.contains(m_url)) {
|
||||||
|
all_old_items.remove(m_url);
|
||||||
|
qBTRSS.setValue("old_items", all_old_items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RssFeed::itemAlreadyExists(const QString &hash) const {
|
bool RssFeed::itemAlreadyExists(const QString &hash) const {
|
||||||
|
|
Loading…
Reference in a new issue