Mercurial > hg > octave-lyh
comparison gui/src/ResourceManager.cpp @ 13539:a4b5cad8f7c6
Added command line parser class.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Tue, 26 Jul 2011 21:21:23 +0200 |
parents | a43ecce77eec |
children | ad905cd33563 |
comparison
equal
deleted
inserted
replaced
13538:ac64163efbe8 | 13539:a4b5cad8f7c6 |
---|---|
1 /* OctaveGUI - A graphical user interface for Octave | |
2 * Copyright (C) 2011 Jacob Dawid | |
3 * jacob.dawid@googlemail.com | |
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 3 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, see <http://www.gnu.org/licenses/>. | |
17 */ | |
18 | |
1 #include "ResourceManager.h" | 19 #include "ResourceManager.h" |
2 | 20 |
3 ResourceManager ResourceManager::m_singleton; | 21 ResourceManager ResourceManager::m_singleton; |
4 | 22 |
5 ResourceManager::ResourceManager () | 23 ResourceManager::ResourceManager () |
6 { | 24 { |
25 m_settings = 0; | |
7 QDesktopServices desktopServices; | 26 QDesktopServices desktopServices; |
8 m_homePath = desktopServices.storageLocation (QDesktopServices::HomeLocation); | 27 m_homePath = desktopServices.storageLocation (QDesktopServices::HomeLocation); |
9 m_settings = new QSettings (m_homePath + "/.octave-gui", QSettings::IniFormat); | 28 setSettings(m_homePath + "/.octave-gui"); |
10 } | 29 } |
11 | 30 |
12 ResourceManager::~ResourceManager () | 31 ResourceManager::~ResourceManager () |
13 { | 32 { |
14 delete m_settings; | 33 delete m_settings; |
23 QString | 42 QString |
24 ResourceManager::homePath () | 43 ResourceManager::homePath () |
25 { | 44 { |
26 return m_homePath; | 45 return m_homePath; |
27 } | 46 } |
47 | |
48 void | |
49 ResourceManager::setSettings (QString file) | |
50 { | |
51 delete m_settings; | |
52 m_settings = new QSettings (file, QSettings::IniFormat); | |
53 } |