summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2021-02-19 12:38:30 +0200
committerMavridis Philippe <[email protected]>2021-02-19 12:38:30 +0200
commit4d09225252b6605dbc2ff5a53a1fc863d34fe1f4 (patch)
tree386db200b0f9562e9962b643f82e1be3ef33e558
parenteacf9e0adbf7ec4ee903e82b3b84b4770ae02476 (diff)
downloadklamav-4d09225252b6605dbc2ff5a53a1fc863d34fe1f4.tar.gz
klamav-4d09225252b6605dbc2ff5a53a1fc863d34fe1f4.zip
CollectionSetup: added writeConfig() function.
Idea taken from amaroK. Signed-off-by: Mavridis Philippe <[email protected]>
-rw-r--r--src/directorylist.cpp10
-rw-r--r--src/directorylist.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/directorylist.cpp b/src/directorylist.cpp
index c4ff438..8e8bf76 100644
--- a/src/directorylist.cpp
+++ b/src/directorylist.cpp
@@ -20,6 +20,8 @@
#include <tqtooltip.h>
#include <tqdir.h>
+#include <tdeconfig.h>
+#include <tdeglobal.h>
#include <tdemessagebox.h>
#include <tdefileitem.h>
#include <tdelocale.h>
@@ -528,4 +530,12 @@ TQStringList CollectionSetup::pruneSelectedDirs(){
return filepattern;
}
+void CollectionSetup::writeConfig( const char* optGroup, const char* optName )
+{
+ TDEConfig *config = TDEGlobal::config();
+ config->setGroup( optGroup );
+ config->writeEntry( optName, dirs() );
+ config->sync();
+}
+
#include "directorylist.moc"
diff --git a/src/directorylist.h b/src/directorylist.h
index c1820c8..0c84988 100644
--- a/src/directorylist.h
+++ b/src/directorylist.h
@@ -49,6 +49,7 @@ public:
TQMap<TQString,int> m_refcount;
TQStringList pruneSelectedDirs();
+ void writeConfig( const char* optGroup, const char* optName );
signals:
void dirsSelected(TQStringList& dirs);