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() {
|
||||
if (FbTk::ThemeManager::instance().load(m_filename,
|
||||
Fluxbox::instance()->getStyleOverlayFilename())) {
|
||||
Fluxbox::instance()->saveStyleFilename(m_filename.c_str());
|
||||
Fluxbox::instance()->save_rc();
|
||||
FbTk::ThemeManager::instance().load(m_filename,
|
||||
Fluxbox::instance()->getStyleOverlayFilename());
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_COMMAND_WITH_ARGS(keymode, FbCommands::KeyModeCmd, void);
|
||||
|
|
|
@ -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())) {
|
||||
|
|
Loading…
Reference in a new issue