From 51b007ce95254a6d08763a86803c02951875535d Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Wed, 5 May 2021 15:06:38 +0200 Subject: [PATCH] Remove settings from Alligator which are not used anymore in Kasts --- src/database.cpp | 26 +------------------------- src/settingsmanager.kcfg | 8 -------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/database.cpp b/src/database.cpp index e8f4af72..edace8bd 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -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 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 } diff --git a/src/settingsmanager.kcfg b/src/settingsmanager.kcfg index 82b01d71..70c3627b 100644 --- a/src/settingsmanager.kcfg +++ b/src/settingsmanager.kcfg @@ -17,10 +17,6 @@ false - - - 0 - 10 @@ -29,10 +25,6 @@ true - - - 0 -