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 name="deleteAfterType" type="Int">
|
||||
<label>Delete after type</label>
|
||||
<default>2</default>
|
||||
<default>3</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
@ -106,15 +106,19 @@ void Database::cleanup()
|
||||
int count = settings.deleteAfterCount();
|
||||
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
|
||||
} else {
|
||||
QDateTime dateTime = QDateTime::currentDateTime();
|
||||
if (type == 1)
|
||||
if (type == 2)
|
||||
dateTime = dateTime.addDays(-count);
|
||||
else if (type == 2)
|
||||
dateTime = dateTime.addDays(-7 * count);
|
||||
else if (type == 3)
|
||||
dateTime = dateTime.addDays(-7 * count);
|
||||
else if (type == 4)
|
||||
dateTime = dateTime.addMonths(-count);
|
||||
qint64 sinceEpoch = dateTime.toSecsSinceEpoch();
|
||||
|
||||
|
@ -34,11 +34,12 @@ Kirigami.ScrollablePage {
|
||||
id: deleteAfterCount
|
||||
text: settings.deleteAfterCount
|
||||
Kirigami.FormData.label: i18n("Delete posts after:")
|
||||
enabled: deleteAfterType.currentIndex !== 0
|
||||
}
|
||||
Controls.ComboBox {
|
||||
id: 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 {
|
||||
text: i18n("Save")
|
||||
|
Loading…
Reference in New Issue
Block a user