all repos — fluxbox @ 23097511432d6568e11d04c276310617585b766f

custom fork of the fluxbox windowmanager

make use of FbTk-api
Mathias Gumz akira at fluxbox dot org
commit

23097511432d6568e11d04c276310617585b766f

parent

c5fd69cc9de2ed08176d655c1e46e9305c5543df

1 files changed, 26 insertions(+), 27 deletions(-)

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

@@ -49,16 +49,12 @@ #include "Debug.hh"

#include "FbTk/App.hh" #include "FbTk/MenuSeparator.hh" +#include "FbTk/FileUtil.hh" #include "FbTk/StringUtil.hh" #include "FbTk/I18n.hh" #include "FbTk/BoolMenuItem.hh" #include "FbTk/IntMenuItem.hh" #include "FbTk/RadioMenuItem.hh" - -#ifdef HAVE_SYS_STAT_H -#include <sys/types.h> -#include <sys/stat.h> -#endif // HAVE_SYS_STAT_H #include <X11/Xatom.h>

@@ -1043,10 +1039,12 @@ void Slit::toggleHidden() {

if (doAutoHide()) { if (!m_slitmenu.isVisible()) { m_timer.fireOnce(true); - } else + } else { return; - } else - if (!isHidden()) return; + } + //} else if (!isHidden()) { + // return; + } m_hidden = ! m_hidden; // toggle hidden state if (isHidden())

@@ -1063,29 +1061,30 @@ // save filename so we can save client list later

m_filename = filename; string real_filename= FbTk::StringUtil::expandFilename(filename); - struct stat buf; - if (stat(real_filename.c_str(), &buf) == 0) { - ifstream file(real_filename.c_str()); - string name; - while (! file.eof()) { - name = ""; - getline(file, name); // get the entire line - if (name.empty()) - continue; + if (!FbTk::FileUtil::isRegularFile(real_filename.c_str())) { + return; + } + + ifstream file(real_filename.c_str()); + string name; + while (! file.eof()) { + name.clear(); + getline(file, name); // get the entire line + if (name.empty()) + continue; - // remove whitespaces from start and end - FbTk::StringUtil::removeFirstWhitespace(name); + // remove whitespaces from start and end + FbTk::StringUtil::removeFirstWhitespace(name); - // the cleaned string could still be a comment, or blank - if ( name.empty() || name[0] == '#' || name[0] == '!' ) - continue; + // the cleaned string could still be a comment, or blank + if ( name.empty() || name[0] == '#' || name[0] == '!' ) + continue; - // trailing whitespace won't affect the above test - FbTk::StringUtil::removeTrailingWhitespace(name); + // trailing whitespace won't affect the above test + FbTk::StringUtil::removeTrailingWhitespace(name); - SlitClient *client = new SlitClient(name.c_str()); - m_client_list.push_back(client); - } + SlitClient *client = new SlitClient(name.c_str()); + m_client_list.push_back(client); } }