From 9d3d6b7c4ee891e28280af1651d8edb9357df643 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 28 Sep 2015 17:31:34 +0200 Subject: Refactored GUI::Config. --- plugingui/pluginconfig.cc | 33 +++++++++++++++++++-------------- plugingui/pluginconfig.h | 21 +++++++++++---------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/plugingui/pluginconfig.cc b/plugingui/pluginconfig.cc index d4c4477..77cb4ba 100644 --- a/plugingui/pluginconfig.cc +++ b/plugingui/pluginconfig.cc @@ -1,6 +1,6 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** - * config.cc + * pluginconfig.cc * * Tue Jun 3 13:54:05 CEST 2014 * Copyright 2014 Jonas Suhr Christensen @@ -27,11 +27,13 @@ #include "pluginconfig.h" #include - + #define CONFIGFILENAME "plugingui.conf" +namespace GUI { + Config::Config() - : ConfigFile(CONFIGFILENAME) + : ConfigFile(CONFIGFILENAME) { } @@ -41,23 +43,26 @@ Config::~Config() bool Config::load() { - lastkit.clear(); - lastmidimap.clear(); + lastkit.clear(); + lastmidimap.clear(); - if(!ConfigFile::load()) { - return false; - } + if(!ConfigFile::load()) + { + return false; + } - lastkit = getValue("lastkit"); - lastmidimap = getValue("lastmidimap"); + lastkit = getValue("lastkit"); + lastmidimap = getValue("lastmidimap"); - return true; + return true; } bool Config::save() { - setValue("lastkit", lastkit); - setValue("lastmidimap", lastmidimap); + setValue("lastkit", lastkit); + setValue("lastmidimap", lastmidimap); - return ConfigFile::save(); + return ConfigFile::save(); } + +} // GUI:: diff --git a/plugingui/pluginconfig.h b/plugingui/pluginconfig.h index 9bef1f0..a249eb2 100644 --- a/plugingui/pluginconfig.h +++ b/plugingui/pluginconfig.h @@ -1,6 +1,6 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** - * config.h + * pluginconfig.h * * Tue Jun 3 13:51:29 CEST 2014 * Copyright 2014 Jonas Suhr Christensen @@ -24,21 +24,22 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_CONFIG_H__ -#define __DRUMGIZMO_CONFIG_H__ +#pragma once #include +namespace GUI { + class Config : public ConfigFile { public: - Config(); - ~Config(); + Config(); + ~Config(); - bool load(); - bool save(); + bool load(); + bool save(); - std::string lastkit; - std::string lastmidimap; + std::string lastkit; + std::string lastmidimap; }; -#endif/*__DRUMGIZMO_CONFIG_H__*/ +} // GUI:: -- cgit v1.2.3