1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /***************************************************************************
3  *            pluginconfig.cc
4  *
5  *  Tue Jun  3 13:54:05 CEST 2014
6  *  Copyright 2014 Jonas Suhr Christensen
7  *  jsc@umbraculum.org
8  ****************************************************************************/
9 
10 /*
11  *  This file is part of DrumGizmo.
12  *
13  *  DrumGizmo is free software; you can redistribute it and/or modify
14  *  it under the terms of the GNU Lesser General Public License as published by
15  *  the Free Software Foundation; either version 3 of the License, or
16  *  (at your option) any later version.
17  *
18  *  DrumGizmo is distributed in the hope that it will be useful,
19  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  *  GNU Lesser General Public License for more details.
22  *
23  *  You should have received a copy of the GNU Lesser General Public License
24  *  along with DrumGizmo; if not, write to the Free Software
25  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
26  */
27 #include "pluginconfig.h"
28 
29 #include <hugin.hpp>
30 
31 #define CONFIGFILENAME "plugingui.conf"
32 
33 namespace GUI
34 {
35 
Config()36 Config::Config()
37 	: ConfigFile(CONFIGFILENAME)
38 {
39 	load();
40 }
41 
~Config()42 Config::~Config()
43 {
44 	save();
45 }
46 
load()47 bool Config::load()
48 {
49 	defaultKitPath.clear();
50 
51 	if(!ConfigFile::load())
52 	{
53 		return false;
54 	}
55 
56 	defaultKitPath = getValue("defaultKitPath");
57 
58 	return true;
59 }
60 
save()61 bool Config::save()
62 {
63 	setValue("defaultKitPath", defaultKitPath);
64 
65 	return ConfigFile::save();
66 }
67 
68 } // GUI::
69