summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-01-24 19:34:12 +0100
committerTannin <devnull@localhost>2015-01-24 19:34:12 +0100
commitc3a95bdef1d989a54684b966e042b12bf682046d (patch)
tree83a09ca9252b9d5a060acb415b8c3c0923cfe2c3 /src/settings.cpp
parent9edc39633b82b5e02d33c4b0a395fe110af28eb4 (diff)
parentf756aede08edb315ebe5882098191ebfe971fd81 (diff)
Merge with branch1.2
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index a052620d..862ed5f3 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -413,7 +413,19 @@ void Settings::updateServers(const QList<ServerInfo> &servers)
}
}
+ // clean up unavailable servers
+ QDate now = QDate::currentDate();
+ foreach (const QString &key, m_Settings.childKeys()) {
+ QVariantMap val = m_Settings.value(key).toMap();
+ QDate lastSeen = val["lastSeen"].toDate();
+ if (lastSeen.daysTo(now) > 30) {
+ qDebug("removing server %s since it hasn't been available for downloads in over a month", qPrintable(key));
+ m_Settings.remove(key);
+ }
+ }
+
m_Settings.endGroup();
+
m_Settings.sync();
}