From be7d563ba1e0b20cfe397f2cf4da6f7e3df78d22 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Oct 2012 14:37:36 +0300 Subject: Simplify reading values from config. --- src/gui/ministatuswindow.cpp | 2 +- src/gui/setup_theme.cpp | 7 +++---- src/gui/theme.cpp | 8 ++------ 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index 5aa22800b..6309f10c1 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -421,7 +421,7 @@ void MiniStatusWindow::showBar(const std::string &name, const bool visible) void MiniStatusWindow::loadBars() { - if (!config.getValue("ministatussaved", 0)) + if (!config.getIntValue("ministatussaved")) { if (mWeightBar) mWeightBar->setVisible(false); diff --git a/src/gui/setup_theme.cpp b/src/gui/setup_theme.cpp index 5d34066e1..1886405be 100644 --- a/src/gui/setup_theme.cpp +++ b/src/gui/setup_theme.cpp @@ -163,7 +163,7 @@ Setup_Theme::Setup_Theme() : mThemeLabel(new Label(_("Gui theme"))), mThemesModel(new ThemesModel), mThemeDropDown(new DropDown(mThemesModel)), - mTheme(config.getValue("theme", config.getValue("selectedSkin", ""))), + mTheme(config.getStringValue("theme")), mFontsModel(new FontsModel), mFontLabel(new Label(_("Main Font"))), mFontDropDown(new DropDown(mFontsModel)), @@ -344,7 +344,7 @@ void Setup_Theme::action(const gcn::ActionEvent &event) void Setup_Theme::cancel() { - mTheme = config.getValue("theme", config.getValue("selectedSkin", "")); + mTheme = config.getStringValue("theme"); mLang = config.getStringValue("lang"); mFont = getFileName(config.getStringValue("font")); mBoldFont = getFileName(config.getStringValue("boldFont")); @@ -356,8 +356,7 @@ void Setup_Theme::cancel() void Setup_Theme::apply() { - if (config.getValue("theme", - config.getValue("selectedSkin", "")) != mTheme) + if (config.getStringValue("theme") != mTheme) { new OkDialog(_("Theme Changed"), _("Restart your client for " "the change to take effect.")); diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index d13f04656..4abf76eb6 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -632,15 +632,11 @@ void Theme::prepareThemePath() mThemeName = ""; // Try theme from settings - if (tryThemePath(config.getValue("selectedSkin", ""))) - return; - - // Try theme from settings - if (tryThemePath(config.getValue("theme", ""))) + if (tryThemePath(config.getStringValue("theme"))) return; // Try theme from branding - if (tryThemePath(branding.getValue("theme", ""))) + if (tryThemePath(branding.getStringValue("theme"))) return; if (mThemePath.empty()) -- cgit v1.2.3-60-g2f50