From 18b6441fadacac2f49aaec062d9ed1d776dd9da8 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Thu, 18 Dec 2025 17:23:58 +0100 Subject: [PATCH] fix auto-delete switch initialization in the settings window --- .../src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt index d41ece3..eb3b838 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/ConfigWindow.kt @@ -13,6 +13,7 @@ class ConfigWindow { val defaultUpdateInterval: UiInteger val minUpdateWaitTime: UiInteger val autoUpdateStartDelay: UiInteger + val autoDelete: UiInteger val maxItemAge: UiInteger val message: UiString @@ -33,6 +34,7 @@ class ConfigWindow { defaultUpdateInterval = window.integer() minUpdateWaitTime = window.integer() autoUpdateStartDelay = window.integer() + autoDelete = window.integer() maxItemAge = window.integer() message = window.string() @@ -71,12 +73,12 @@ class ConfigWindow { row { rlabel("Auto Delete Items") - switch(overrideDefaults = true, vfill = true, enableState = ENABLE_AUTO_DELETE) + switch(value = autoDelete, overrideDefaults = true, vfill = true, enableState = ENABLE_AUTO_DELETE) } row { rlabel("Max Item Age (Days)") - spinbox(intValue = maxItemAge, min = 0.0, max = 200000.0, states = intArrayOf(ENABLE_AUTO_DELETE)) + spinbox(intValue = maxItemAge, min = 1.0, max = 200000.0, states = intArrayOf(ENABLE_AUTO_DELETE)) } } } @@ -108,6 +110,7 @@ class ConfigWindow { defaultUpdateInterval.setIntValue(App.settings.defaultRefreshInterval) minUpdateWaitTime.setIntValue(App.settings.minRefreshWaitTime) autoUpdateStartDelay.setIntValue(App.settings.autoRefreshStartDelay) + autoDelete.setBooleanValue(App.settings.maxItemAge > 0) maxItemAge.setIntValue(App.settings.maxItemAge) } -- 2.47.3