mirror of
https://github.com/KDE/kasts.git
synced 2024-12-28 09:21:13 +01:00
Remove settings from Alligator which are not used anymore in Kasts
This commit is contained in:
parent
97c3fc6e4d
commit
51b007ce95
@ -100,29 +100,5 @@ int Database::version()
|
||||
|
||||
void Database::cleanup()
|
||||
{
|
||||
int count = SettingsManager::self()->deleteAfterCount();
|
||||
int type = SettingsManager::self()->deleteAfterType();
|
||||
|
||||
if (type == 0) { // Never delete Entries
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == 1) { // Delete after <count> posts per feed
|
||||
// TODO
|
||||
} else {
|
||||
QDateTime dateTime = QDateTime::currentDateTime();
|
||||
if (type == 2)
|
||||
dateTime = dateTime.addDays(-count);
|
||||
else if (type == 3)
|
||||
dateTime = dateTime.addDays(-7 * count);
|
||||
else if (type == 4)
|
||||
dateTime = dateTime.addMonths(-count);
|
||||
qint64 sinceEpoch = dateTime.toSecsSinceEpoch();
|
||||
|
||||
QSqlQuery query;
|
||||
query.prepare(QStringLiteral("DELETE FROM Entries WHERE updated < :sinceEpoch;"));
|
||||
query.bindValue(QStringLiteral(":sinceEpoch"), sinceEpoch);
|
||||
execute(query);
|
||||
// TODO: also delete enclosures and authors(?)
|
||||
}
|
||||
// TODO: create database sanity checks, or, alternatively, create database scrub routine
|
||||
}
|
||||
|
@ -17,10 +17,6 @@
|
||||
<label>Automatically download new episodes</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="deleteAfterCount" type="Int">
|
||||
<label>Delete after count</label>
|
||||
<default>0</default>
|
||||
</entry>
|
||||
<entry name="articleFontSize" type="Int">
|
||||
<label>Article font size</label>
|
||||
<default>10</default>
|
||||
@ -29,10 +25,6 @@
|
||||
<label>Use default system font</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="deleteAfterType" type="Int">
|
||||
<label>Delete after type</label>
|
||||
<default>0</default>
|
||||
</entry>
|
||||
</group>
|
||||
<group name="Persistency">
|
||||
<entry name="lastOpenedPage" type="String">
|
||||
|
Loading…
Reference in New Issue
Block a user