Clear stationsListWidget each time listWidget is changed

This commit is contained in:
Wiktor Zykubek 2023-06-18 17:46:16 +02:00
parent 32ed78e7bc
commit c26d8833b3
No known key found for this signature in database
GPG Key ID: 0DAA9DC01449FCA2

View File

@ -64,12 +64,14 @@ class MainWindow(QMainWindow):
def printRadioGroups(self) -> None: def printRadioGroups(self) -> None:
"""Print groups (categories) in radioGroupsListWidget.""" """Print groups (categories) in radioGroupsListWidget."""
self.ui.stationsListWidget.clear()
self.ui.radioGroupsListWidget.addItems( self.ui.radioGroupsListWidget.addItems(
[e["name"] for e in self.__stations["groups"]] [e["name"] for e in self.__stations["groups"]]
) )
def printPodcastGroups(self) -> None: def printPodcastGroups(self) -> None:
"""Print groups (categories) in podcastGroupsListWidget.""" """Print groups (categories) in podcastGroupsListWidget."""
self.ui.stationsListWidget.clear()
self.ui.podcastGroupsListWidget.addItems( self.ui.podcastGroupsListWidget.addItems(
[e["name"] for e in self.__podcasts_groups] [e["name"] for e in self.__podcasts_groups]
) )
@ -93,6 +95,7 @@ class MainWindow(QMainWindow):
def printPodcasts(self) -> None: def printPodcasts(self) -> None:
"""Print podcasts in podcastListWidget.""" """Print podcasts in podcastListWidget."""
self.ui.stationsListWidget.clear()
group = self.ui.podcastGroupsListWidget.selectedItems()[0].text() group = self.ui.podcastGroupsListWidget.selectedItems()[0].text()
group_name = None group_name = None
for e in self.__podcasts_groups: for e in self.__podcasts_groups: