From: Olaf Wintermann Date: Tue, 30 Jun 2026 17:25:26 +0000 (+0200) Subject: reload feed list when a feed is moved to another group X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=105efd6266d32a910f15d5373fe1eb1225154708;p=rssreader.git reload feed list when a feed is moved to another group --- diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedSourceList.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedSourceList.kt index 292d364..e9353e5 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedSourceList.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/FeedSourceList.kt @@ -9,10 +9,14 @@ import kotlinx.coroutines.launch class FeedSourceList : Document() { val feeds = this.sourcelist("feeds") - val groups: MutableList + var groups: MutableList init { groups = Database.getFeedTree(this) + initTree() + } + + fun initTree() { groups.forEach { val sublist = SubList() sublist.header = it.name @@ -130,6 +134,13 @@ class FeedSourceList : Document() { } } + fun reloadTree() { + feeds.clear() + groups = Database.getFeedTree(this) + initTree() + feeds.update() + } + fun updateFeeds() { val selection = feeds.selectedIndex feeds.update() diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt index 8aaa807..01b6d92 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt @@ -472,10 +472,15 @@ class MainWindow() { height = 450, onClick = { ev -> if(ev.intValue == 4) { + var prevGroupId = feedConfig?.feed?.groupId feedConfig?.updateFeed() + if(feedConfig?.feed?.groupId != prevGroupId) { + sourceList.reloadTree() + } else { + sourceList.updateFeeds() + } } ev.`object`.close() - sourceList.updateFeeds() }, ui = null) feedConfig = FeedConfig(w) diff --git a/ui-java/src/main/java/de/unixwork/ui/ListFuncs.java b/ui-java/src/main/java/de/unixwork/ui/ListFuncs.java index 69f98e9..089dfb4 100644 --- a/ui-java/src/main/java/de/unixwork/ui/ListFuncs.java +++ b/ui-java/src/main/java/de/unixwork/ui/ListFuncs.java @@ -111,7 +111,7 @@ public class ListFuncs { srclist_insert = linker.downcallHandle(ui_srclist_insert_addr, sigv_mim); srclist_remove = linker.downcallHandle(ui_srclist_remove_addr, sigv_mi); srclist_swap = linker.downcallHandle(ui_srclist_swap_addr, sigv_mii); - srclist_clear = linker.downcallHandle(ui_srclist_remove_addr, sigv_m); + srclist_clear = linker.downcallHandle(ui_srclist_clear_addr, sigv_m); srclist_size = linker.downcallHandle(ui_srclist_size_addr, sigi_m); srclist_generate_sublist_num_data = linker.downcallHandle(ui_srclist_generate_sublist_num_data_addr, sigv_m);