]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinsettings.cpp
As requested by Peter: upgrade version to 1.0
[dolphin.git] / src / dolphinsettings.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at), *
3 * Cvetoslav Ludmiloff and Patrice Tremblay *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
20
21 #include "dolphinsettings.h"
22
23 #include <kfileplacesmodel.h>
24 #include <kcomponentdata.h>
25 #include <klocale.h>
26 #include <kstandarddirs.h>
27
28 #include "dolphin_columnmodesettings.h"
29 #include "dolphin_detailsmodesettings.h"
30 #include "dolphin_generalsettings.h"
31 #include "dolphin_iconsmodesettings.h"
32
33 DolphinSettings& DolphinSettings::instance()
34 {
35 static DolphinSettings* instance = 0;
36 if (instance == 0) {
37 instance = new DolphinSettings();
38 }
39 return *instance;
40 }
41
42 void DolphinSettings::save()
43 {
44 m_generalSettings->writeConfig();
45 m_iconsModeSettings->writeConfig();
46 m_detailsModeSettings->writeConfig();
47 m_columnModeSettings->writeConfig();
48 }
49
50 DolphinSettings::DolphinSettings()
51 {
52 m_generalSettings = new GeneralSettings();
53 m_iconsModeSettings = new IconsModeSettings();
54 m_detailsModeSettings = new DetailsModeSettings();
55 m_columnModeSettings = new ColumnModeSettings();
56 m_placesModel = new KFilePlacesModel();
57 }
58
59 DolphinSettings::~DolphinSettings()
60 {
61 delete m_generalSettings;
62 m_generalSettings = 0;
63
64 delete m_iconsModeSettings;
65 m_iconsModeSettings = 0;
66
67 delete m_detailsModeSettings;
68 m_detailsModeSettings = 0;
69
70 delete m_columnModeSettings;
71 m_columnModeSettings = 0;
72
73 delete m_placesModel;
74 m_placesModel = 0;
75 }