all repos — fluxbox @ af0f2419541aa7edccce74267c839b830f14d381

custom fork of the fluxbox windowmanager

don't save rc in SetStyle command if loading the style fails
Matteo Galiazzo matteo@maltesenarrazioni.it
commit

af0f2419541aa7edccce74267c839b830f14d381

parent

7f45bae4629f345906e96c1fcb3a3d1e49c36382

2 files changed, 7 insertions(+), 4 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -274,10 +274,11 @@

} 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);
M src/FbTk/Theme.ccsrc/FbTk/Theme.cc

@@ -117,6 +117,8 @@

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())) {