summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatteo Galiazzo <matteo@maltesenarrazioni.it>2008-05-14 08:40:53 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-05-14 08:40:53 (GMT)
commitaf0f2419541aa7edccce74267c839b830f14d381 (patch)
tree1a4a97c6badf7fd4b783f6ccf1e0228169803a68 /src
parent7f45bae4629f345906e96c1fcb3a3d1e49c36382 (diff)
downloadfluxbox_lack-af0f2419541aa7edccce74267c839b830f14d381.zip
fluxbox_lack-af0f2419541aa7edccce74267c839b830f14d381.tar.bz2
don't save rc in SetStyle command if loading the style fails
Diffstat (limited to 'src')
-rw-r--r--src/FbCommands.cc9
-rw-r--r--src/FbTk/Theme.cc2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index e0d0768..49f727c 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -274,10 +274,11 @@ SetStyleCmd::SetStyleCmd(const string &filename):m_filename(filename) {
274} 274}
275 275
276void SetStyleCmd::execute() { 276void SetStyleCmd::execute() {
277 Fluxbox::instance()->saveStyleFilename(m_filename.c_str()); 277 if (FbTk::ThemeManager::instance().load(m_filename,
278 Fluxbox::instance()->save_rc(); 278 Fluxbox::instance()->getStyleOverlayFilename())) {
279 FbTk::ThemeManager::instance().load(m_filename, 279 Fluxbox::instance()->saveStyleFilename(m_filename.c_str());
280 Fluxbox::instance()->getStyleOverlayFilename()); 280 Fluxbox::instance()->save_rc();
281 }
281} 282}
282 283
283REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void); 284REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void);
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index 46c9a56..cd478fc 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -117,6 +117,8 @@ bool ThemeManager::unregisterTheme(Theme &tm) {
117bool ThemeManager::load(const string &filename, 117bool ThemeManager::load(const string &filename,
118 const string &overlay_filename, int screen_num) { 118 const string &overlay_filename, int screen_num) {
119 string location = FbTk::StringUtil::expandFilename(filename); 119 string location = FbTk::StringUtil::expandFilename(filename);
120 StringUtil::removeTrailingWhitespace(location);
121 StringUtil::removeFirstWhitespace(location);
120 string prefix = ""; 122 string prefix = "";
121 123
122 if (FileUtil::isDirectory(filename.c_str())) { 124 if (FileUtil::isDirectory(filename.c_str())) {