mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-02 10:27:15 +01:00
Removed obsolete TODOs.
This commit is contained in:
parent
ed4c293a3b
commit
2204e8b753
@ -128,7 +128,6 @@ void SystemTrayIcon::setNumber(int number, bool any_unread_message) {
|
|||||||
QPainter tray_painter;
|
QPainter tray_painter;
|
||||||
|
|
||||||
// TODO: Here draw different background instead of different color of number.
|
// TODO: Here draw different background instead of different color of number.
|
||||||
|
|
||||||
tray_painter.begin(&background);
|
tray_painter.begin(&background);
|
||||||
tray_painter.setPen(any_unread_message ? Qt::blue : Qt::black);
|
tray_painter.setPen(any_unread_message ? Qt::blue : Qt::black);
|
||||||
tray_painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
tray_painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||||
|
@ -68,9 +68,6 @@ void AdBlockManager::setEnabled(bool enabled) {
|
|||||||
|
|
||||||
// Load subscriptions and other data.
|
// Load subscriptions and other data.
|
||||||
load();
|
load();
|
||||||
|
|
||||||
// TODO
|
|
||||||
//mainApp->reloadUserStyleBrowser();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<AdBlockSubscription*> AdBlockManager::subscriptions() const {
|
QList<AdBlockSubscription*> AdBlockManager::subscriptions() const {
|
||||||
@ -146,8 +143,6 @@ AdBlockSubscription *AdBlockManager::addSubscription(const QString &title, const
|
|||||||
// This expects that there is at least "Custom rules" subscription available in
|
// This expects that there is at least "Custom rules" subscription available in
|
||||||
// active subscriptions.
|
// active subscriptions.
|
||||||
m_subscriptions.insert(m_subscriptions.size() - 1, subscription);
|
m_subscriptions.insert(m_subscriptions.size() - 1, subscription);
|
||||||
|
|
||||||
// TODO: přidáno, asi pořeší pár bugů
|
|
||||||
m_matcher->update();
|
m_matcher->update();
|
||||||
|
|
||||||
return subscription;
|
return subscription;
|
||||||
@ -161,10 +156,7 @@ bool AdBlockManager::removeSubscription(AdBlockSubscription *subscription) {
|
|||||||
QFile::remove(subscription->filePath());
|
QFile::remove(subscription->filePath());
|
||||||
m_subscriptions.removeOne(subscription);
|
m_subscriptions.removeOne(subscription);
|
||||||
delete subscription;
|
delete subscription;
|
||||||
|
|
||||||
// TODO: přidáno, asi pořeší pár bugů
|
|
||||||
m_matcher->update();
|
m_matcher->update();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,7 +184,6 @@ QString AdBlockManager::baseSubscriptionDirectory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
directory += QDir::separator() + ADBLOCK_BASE_DIRECTORY_NAME;
|
directory += QDir::separator() + ADBLOCK_BASE_DIRECTORY_NAME;
|
||||||
|
|
||||||
return QDir::toNativeSeparators(directory);
|
return QDir::toNativeSeparators(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +202,6 @@ void AdBlockManager::load() {
|
|||||||
m_enabled = settings->value(GROUP(AdBlock), SETTING(AdBlock::Enabled)).toBool();
|
m_enabled = settings->value(GROUP(AdBlock), SETTING(AdBlock::Enabled)).toBool();
|
||||||
m_useLimitedEasyList = settings->value(GROUP(AdBlock), SETTING(AdBlock::UseLimitedEasyList)).toBool();
|
m_useLimitedEasyList = settings->value(GROUP(AdBlock), SETTING(AdBlock::UseLimitedEasyList)).toBool();
|
||||||
m_disabledRules = settings->value(GROUP(AdBlock), SETTING(AdBlock::DisabledRules)).toStringList();
|
m_disabledRules = settings->value(GROUP(AdBlock), SETTING(AdBlock::DisabledRules)).toStringList();
|
||||||
//QDateTime last_update = settings->value(GROUP(AdBlock), SETTING(AdBlock::LastUpdated)).toDateTime();
|
|
||||||
|
|
||||||
if (!m_enabled) {
|
if (!m_enabled) {
|
||||||
// We loaded settings, but Adblock should be disabled. Do not continue to save memory.
|
// We loaded settings, but Adblock should be disabled. Do not continue to save memory.
|
||||||
@ -263,8 +253,6 @@ void AdBlockManager::load() {
|
|||||||
foreach (AdBlockSubscription *subscription, m_subscriptions) {
|
foreach (AdBlockSubscription *subscription, m_subscriptions) {
|
||||||
subscription->loadSubscription(m_disabledRules);
|
subscription->loadSubscription(m_disabledRules);
|
||||||
|
|
||||||
// TODO
|
|
||||||
//connect(subscription, SIGNAL(subscriptionUpdated()), mainApp, SLOT(reloadUserStyleBrowser()));
|
|
||||||
connect(subscription, SIGNAL(subscriptionChanged()), m_matcher, SLOT(update()));
|
connect(subscription, SIGNAL(subscriptionChanged()), m_matcher, SLOT(update()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,19 +271,16 @@ void AdBlockManager::updateAllSubscriptions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AdBlockManager::save() {
|
void AdBlockManager::save() {
|
||||||
if (!m_loaded) {
|
if (m_loaded) {
|
||||||
// There is nothing to save, because these is nothing loaded.
|
foreach (AdBlockSubscription *subscription, m_subscriptions) {
|
||||||
return;
|
subscription->saveSubscription();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (AdBlockSubscription *subscription, m_subscriptions) {
|
Settings *settings = qApp->settings();
|
||||||
subscription->saveSubscription();
|
settings->setValue(GROUP(AdBlock), AdBlock::Enabled, m_enabled);
|
||||||
|
settings->setValue(GROUP(AdBlock), AdBlock::UseLimitedEasyList, m_useLimitedEasyList);
|
||||||
|
settings->setValue(GROUP(AdBlock), AdBlock::DisabledRules, m_disabledRules);
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings *settings = qApp->settings();
|
|
||||||
settings->setValue(GROUP(AdBlock), AdBlock::Enabled, m_enabled);
|
|
||||||
settings->setValue(GROUP(AdBlock), AdBlock::UseLimitedEasyList, m_useLimitedEasyList);
|
|
||||||
settings->setValue(GROUP(AdBlock), AdBlock::DisabledRules, m_disabledRules);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AdBlockManager::isEnabled() const {
|
bool AdBlockManager::isEnabled() const {
|
||||||
|
@ -241,11 +241,6 @@ const AdBlockRule *AdBlockSubscription::enableRule(int offset) {
|
|||||||
|
|
||||||
emit subscriptionChanged();
|
emit subscriptionChanged();
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
if (rule->isCssRule())
|
|
||||||
mainApp->reloadUserStyleBrowser();
|
|
||||||
*/
|
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,12 +255,6 @@ const AdBlockRule *AdBlockSubscription::disableRule(int offset) {
|
|||||||
|
|
||||||
emit subscriptionChanged();
|
emit subscriptionChanged();
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
if (rule->isCssRule())
|
|
||||||
mainApp->reloadUserStyleBrowser();
|
|
||||||
*/
|
|
||||||
|
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,11 +350,6 @@ int AdBlockCustomList::addRule(AdBlockRule *rule) {
|
|||||||
m_rules.append(rule);
|
m_rules.append(rule);
|
||||||
emit subscriptionChanged();
|
emit subscriptionChanged();
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
if (rule->isCssRule())
|
|
||||||
mainApp->reloadUserStyleBrowser();
|
|
||||||
*/
|
|
||||||
return m_rules.size() - 1;
|
return m_rules.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,11 +363,6 @@ bool AdBlockCustomList::removeRule(int offset) {
|
|||||||
|
|
||||||
m_rules.remove(offset);
|
m_rules.remove(offset);
|
||||||
emit subscriptionChanged();
|
emit subscriptionChanged();
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
if (rule->isCssRule())
|
|
||||||
mainApp->reloadUserStyleBrowser();
|
|
||||||
*/
|
|
||||||
|
|
||||||
AdBlockManager::instance()->removeDisabledRule(filter);
|
AdBlockManager::instance()->removeDisabledRule(filter);
|
||||||
delete rule;
|
delete rule;
|
||||||
@ -399,12 +378,6 @@ const AdBlockRule *AdBlockCustomList::replaceRule(AdBlockRule *rule, int offset)
|
|||||||
m_rules[offset] = rule;
|
m_rules[offset] = rule;
|
||||||
emit subscriptionChanged();
|
emit subscriptionChanged();
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
if (rule->isCssRule() || oldRule->isCssRule())
|
|
||||||
mainApp->reloadUserStyleBrowser();
|
|
||||||
*/
|
|
||||||
|
|
||||||
delete oldRule;
|
delete oldRule;
|
||||||
return m_rules[offset];
|
return m_rules[offset];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user