mirror of
https://github.com/KDE/kasts.git
synced 2024-12-25 08:00:48 +01:00
Add option to never delete entries
This commit is contained in:
parent
196e6bb003
commit
c6a59392e0
@ -11,7 +11,7 @@
|
|||||||
</entry>
|
</entry>
|
||||||
<entry name="deleteAfterType" type="Int">
|
<entry name="deleteAfterType" type="Int">
|
||||||
<label>Delete after type</label>
|
<label>Delete after type</label>
|
||||||
<default>2</default>
|
<default>3</default>
|
||||||
</entry>
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
</kcfg>
|
</kcfg>
|
||||||
|
@ -106,15 +106,19 @@ void Database::cleanup()
|
|||||||
int count = settings.deleteAfterCount();
|
int count = settings.deleteAfterCount();
|
||||||
int type = settings.deleteAfterType();
|
int type = settings.deleteAfterType();
|
||||||
|
|
||||||
if (type == 0) { // Delete after <count> posts per feed
|
if(type == 0) { //Never delete Entries
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 1) { // Delete after <count> posts per feed
|
||||||
// TODO
|
// TODO
|
||||||
} else {
|
} else {
|
||||||
QDateTime dateTime = QDateTime::currentDateTime();
|
QDateTime dateTime = QDateTime::currentDateTime();
|
||||||
if (type == 1)
|
if (type == 2)
|
||||||
dateTime = dateTime.addDays(-count);
|
dateTime = dateTime.addDays(-count);
|
||||||
else if (type == 2)
|
|
||||||
dateTime = dateTime.addDays(-7 * count);
|
|
||||||
else if (type == 3)
|
else if (type == 3)
|
||||||
|
dateTime = dateTime.addDays(-7 * count);
|
||||||
|
else if (type == 4)
|
||||||
dateTime = dateTime.addMonths(-count);
|
dateTime = dateTime.addMonths(-count);
|
||||||
qint64 sinceEpoch = dateTime.toSecsSinceEpoch();
|
qint64 sinceEpoch = dateTime.toSecsSinceEpoch();
|
||||||
|
|
||||||
|
@ -34,11 +34,12 @@ Kirigami.ScrollablePage {
|
|||||||
id: deleteAfterCount
|
id: deleteAfterCount
|
||||||
text: settings.deleteAfterCount
|
text: settings.deleteAfterCount
|
||||||
Kirigami.FormData.label: i18n("Delete posts after:")
|
Kirigami.FormData.label: i18n("Delete posts after:")
|
||||||
|
enabled: deleteAfterType.currentIndex !== 0
|
||||||
}
|
}
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
id: deleteAfterType
|
id: deleteAfterType
|
||||||
currentIndex: settings.deleteAfterType
|
currentIndex: settings.deleteAfterType
|
||||||
model: [i18n("Posts"), i18n("Days"), i18n("Weeks"), i18n("Months")]
|
model: [i18n("Never"), i18n("Posts"), i18n("Days"), i18n("Weeks"), i18n("Months")]
|
||||||
}
|
}
|
||||||
Controls.Button {
|
Controls.Button {
|
||||||
text: i18n("Save")
|
text: i18n("Save")
|
||||||
|
Loading…
Reference in New Issue
Block a user