From 4d09225252b6605dbc2ff5a53a1fc863d34fe1f4 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 19 Feb 2021 12:38:30 +0200 Subject: CollectionSetup: added writeConfig() function. Idea taken from amaroK. Signed-off-by: Mavridis Philippe --- src/directorylist.cpp | 10 ++++++++++ src/directorylist.h | 1 + 2 files changed, 11 insertions(+) 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 #include +#include +#include #include #include #include @@ -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 m_refcount; TQStringList pruneSelectedDirs(); + void writeConfig( const char* optGroup, const char* optName ); signals: void dirsSelected(TQStringList& dirs); -- cgit v1.2.1