diff --git a/src/FbCommands.cc b/src/FbCommands.cc index e0d07681..49f727c1 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -274,10 +274,11 @@ SetStyleCmd::SetStyleCmd(const string &filename):m_filename(filename) { } void SetStyleCmd::execute() { - Fluxbox::instance()->saveStyleFilename(m_filename.c_str()); - Fluxbox::instance()->save_rc(); - FbTk::ThemeManager::instance().load(m_filename, - Fluxbox::instance()->getStyleOverlayFilename()); + if (FbTk::ThemeManager::instance().load(m_filename, + Fluxbox::instance()->getStyleOverlayFilename())) { + Fluxbox::instance()->saveStyleFilename(m_filename.c_str()); + Fluxbox::instance()->save_rc(); + } } REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void); diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc index 46c9a56f..cd478fc2 100644 --- a/src/FbTk/Theme.cc +++ b/src/FbTk/Theme.cc @@ -117,6 +117,8 @@ bool ThemeManager::unregisterTheme(Theme &tm) { bool ThemeManager::load(const string &filename, const string &overlay_filename, int screen_num) { string location = FbTk::StringUtil::expandFilename(filename); + StringUtil::removeTrailingWhitespace(location); + StringUtil::removeFirstWhitespace(location); string prefix = ""; if (FileUtil::isDirectory(filename.c_str())) {