diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-07-22 23:18:26 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-07-22 23:19:37 +0200 |
| commit | a3da855cddff3c3c71311af6ce3e7629a459024d (patch) | |
| tree | 7ed8cad6256f74fb83632f608891ceeb32e1f59a /src/gui_config.cc | |
| parent | d9e1e04c09a99b2a507e071f434fd394f4781051 (diff) | |
Add application config for GUI
QT5 stored in .config/org.the_jk/tp.Monitor.conf on Linux
GTK stored in dconf
Diffstat (limited to 'src/gui_config.cc')
| -rw-r--r-- | src/gui_config.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui_config.cc b/src/gui_config.cc new file mode 100644 index 0000000..5fa5506 --- /dev/null +++ b/src/gui_config.cc @@ -0,0 +1,32 @@ +// -*- mode: c++; c-basic-offset: 2; -*- + +#include "common.hh" + +#include "gui_config.hh" + +#include <string.h> + +bool GuiConfig::load_name(std::string const& UNUSED(name)) { + return false; +} + +bool GuiConfig::load_file(std::string const& UNUSED(filename)) { + return false; +} + +bool GuiConfig::get(std::string const& key, bool fallback) { + auto ret = static_cast<Config*>(this)->get(key, nullptr); + if (!ret) return fallback; + return strcmp(ret, "true") == 0; +} + +bool GuiConfig::good() const { + return true; +} + +std::string const& GuiConfig::last_error() const { + return EMPTY; +} + +// static +std::string const GuiConfig::EMPTY; |
