1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at), *
3 * Cvetoslav Ludmiloff and Patrice Tremblay *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #include "dolphinsettings.h"
23 #include <kfileplacesmodel.h>
24 #include <kcomponentdata.h>
26 #include <kstandarddirs.h>
28 #include "dolphin_columnmodesettings.h"
29 #include "dolphin_detailsmodesettings.h"
30 #include "dolphin_generalsettings.h"
31 #include "dolphin_iconsmodesettings.h"
33 class DolphinSettingsSingleton
36 DolphinSettings instance
;
38 K_GLOBAL_STATIC(DolphinSettingsSingleton
, s_settings
)
40 DolphinSettings
& DolphinSettings::instance()
42 return s_settings
->instance
;
45 void DolphinSettings::save()
47 m_generalSettings
->writeConfig();
48 m_iconsModeSettings
->writeConfig();
49 m_detailsModeSettings
->writeConfig();
50 m_columnModeSettings
->writeConfig();
53 DolphinSettings::DolphinSettings()
55 m_generalSettings
= new GeneralSettings();
56 m_iconsModeSettings
= new IconsModeSettings();
57 m_detailsModeSettings
= new DetailsModeSettings();
58 m_columnModeSettings
= new ColumnModeSettings();
59 m_placesModel
= new KFilePlacesModel();
62 DolphinSettings::~DolphinSettings()
64 delete m_generalSettings
;
65 m_generalSettings
= 0;
67 delete m_iconsModeSettings
;
68 m_iconsModeSettings
= 0;
70 delete m_detailsModeSettings
;
71 m_detailsModeSettings
= 0;
73 delete m_columnModeSettings
;
74 m_columnModeSettings
= 0;