From eacf9e0adbf7ec4ee903e82b3b84b4770ae02476 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sun, 14 Feb 2021 18:42:34 +0200 Subject: Fixed tab duplication when closing through the Tabs menu. Signed-off-by: Mavridis Philippe --- src/klamav.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/klamav.cpp') diff --git a/src/klamav.cpp b/src/klamav.cpp index dbe311c..6c191f7 100644 --- a/src/klamav.cpp +++ b/src/klamav.cpp @@ -267,7 +267,8 @@ void Klamav::tabClosed(TQString name) { optionName="ShowEventsTab"; } - tabs_menu->setItemChecked(uncheck, false); + tabs_menu->setItemChecked(uncheck, false); + config->setGroup("Tabs"); config->writeEntry(optionName, false); } @@ -288,6 +289,9 @@ void Klamav::slotOptions() { } void Klamav::slotToggleWelcome() { + if( config->group() != "Tabs" ) + config->setGroup("Tabs"); + bool newState = ! config->readBoolEntry("ShowWelcomeTab", true); config->writeEntry("ShowWelcomeTab", newState); config->sync(); @@ -295,6 +299,9 @@ void Klamav::slotToggleWelcome() { updateTabState(0, false); } void Klamav::slotToggleQuarantine() { + if( config->group() != "Tabs" ) + config->setGroup("Tabs"); + bool newState = ! config->readBoolEntry("ShowQuarantineTab", true); config->writeEntry("ShowQuarantineTab", newState); config->sync(); @@ -302,6 +309,9 @@ void Klamav::slotToggleQuarantine() { updateTabState(1, false); } void Klamav::slotToggleDBViewer() { + if( config->group() != "Tabs" ) + config->setGroup("Tabs"); + bool newState = ! config->readBoolEntry("ShowDBViewerTab", true); config->writeEntry("ShowDBViewerTab", newState); config->sync(); @@ -309,6 +319,9 @@ void Klamav::slotToggleDBViewer() { updateTabState(2, false); } void Klamav::slotToggleEvents() { + if( config->group() != "Tabs" ) + config->setGroup("Tabs"); + bool newState = ! config->readBoolEntry("ShowEventsTab", true); config->writeEntry("ShowEventsTab", newState); config->sync(); -- cgit v1.2.1