don't save rc in SetStyle command if loading the style fails
This commit is contained in:
parent
7f45bae462
commit
af0f241954
2 changed files with 7 additions and 4 deletions
|
@ -274,10 +274,11 @@ SetStyleCmd::SetStyleCmd(const string &filename):m_filename(filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStyleCmd::execute() {
|
void SetStyleCmd::execute() {
|
||||||
Fluxbox::instance()->saveStyleFilename(m_filename.c_str());
|
if (FbTk::ThemeManager::instance().load(m_filename,
|
||||||
Fluxbox::instance()->save_rc();
|
Fluxbox::instance()->getStyleOverlayFilename())) {
|
||||||
FbTk::ThemeManager::instance().load(m_filename,
|
Fluxbox::instance()->saveStyleFilename(m_filename.c_str());
|
||||||
Fluxbox::instance()->getStyleOverlayFilename());
|
Fluxbox::instance()->save_rc();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void);
|
REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void);
|
||||||
|
|
|
@ -117,6 +117,8 @@ bool ThemeManager::unregisterTheme(Theme &tm) {
|
||||||
bool ThemeManager::load(const string &filename,
|
bool ThemeManager::load(const string &filename,
|
||||||
const string &overlay_filename, int screen_num) {
|
const string &overlay_filename, int screen_num) {
|
||||||
string location = FbTk::StringUtil::expandFilename(filename);
|
string location = FbTk::StringUtil::expandFilename(filename);
|
||||||
|
StringUtil::removeTrailingWhitespace(location);
|
||||||
|
StringUtil::removeFirstWhitespace(location);
|
||||||
string prefix = "";
|
string prefix = "";
|
||||||
|
|
||||||
if (FileUtil::isDirectory(filename.c_str())) {
|
if (FileUtil::isDirectory(filename.c_str())) {
|
||||||
|
|
Loading…
Reference in a new issue