From 6b3a626cbef1f50696c15937f77735ed1c916eb3 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 20 Feb 2004 09:29:07 +0000 Subject: filename fix, patch from Mathias Gumz --- src/Keys.cc | 4 ++-- src/Slit.cc | 13 +++++++------ src/Workspace.cc | 4 ++-- src/fluxbox.cc | 13 ++----------- 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/Keys.cc b/src/Keys.cc index 96a12c9..41af901 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Keys.cc,v 1.41 2003/12/30 18:14:33 fluxgen Exp $ +//$Id: Keys.cc,v 1.42 2004/02/20 09:29:07 fluxgen Exp $ #include "Keys.hh" @@ -158,7 +158,7 @@ bool Keys::addBinding(const std::string &linebuffer) { if (val.size() <= 0) return true; // empty lines are valid. - if (val[0][0] == '#') //the line is commented + if (val[0][0] == '#' || val[0][0] == '!' ) //the line is commented return true; // still a valid line. unsigned int key = 0, mod = 0; diff --git a/src/Slit.cc b/src/Slit.cc index 3802d07..08378ed 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.91 2004/02/12 10:29:24 rathnor Exp $ +// $Id: Slit.cc,v 1.92 2004/02/20 09:29:06 fluxgen Exp $ #include "Slit.hh" @@ -1129,11 +1129,12 @@ void Slit::loadClientList(const char *filename) { return; // save filename so we can save client list later - m_filename = FbTk::StringUtil::expandFilename(filename); + m_filename = filename; + std::string real_filename= FbTk::StringUtil::expandFilename(filename); struct stat buf; - if (stat(m_filename.c_str(), &buf) == 0) { - std::ifstream file(m_filename.c_str()); + if (stat(real_filename.c_str(), &buf) == 0) { + std::ifstream file(real_filename.c_str()); std::string name; while (! file.eof()) { name = ""; @@ -1170,7 +1171,7 @@ void Slit::updateClientmenu() { m_clientlist_menu.insert("Cycle Up", cycle_up); m_clientlist_menu.insert("Cycle Down", cycle_down); - FbTk::MenuItem *separator = new FbTk::MenuItem("-------"); + FbTk::MenuItem *separator = new FbTk::MenuItem("---"); separator->setEnabled(false); m_clientlist_menu.insert(separator); @@ -1186,7 +1187,7 @@ void Slit::updateClientmenu() { void Slit::saveClientList() { - std::ofstream file(m_filename.c_str()); + std::ofstream file(FbTk::StringUtil::expandFilename(m_filename).c_str()); SlitClients::iterator it = m_client_list.begin(); SlitClients::iterator it_end = m_client_list.end(); std::string prevName; diff --git a/src/Workspace.cc b/src/Workspace.cc index 304b3c7..66de402 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.90 2004/01/21 14:14:40 fluxgen Exp $ +// $Id: Workspace.cc,v 1.91 2004/02/20 09:29:07 fluxgen Exp $ #include "Workspace.hh" @@ -339,7 +339,7 @@ bool Workspace::checkGrouping(FluxboxWindow &win) { } bool Workspace::loadGroups(const std::string &filename) { - string real_filename = filename; + string real_filename = FbTk::StringUtil::expandFilename(filename); FbTk::StringUtil::removeTrailingWhitespace(real_filename); ifstream infile(real_filename.c_str()); if (!infile) diff --git a/src/fluxbox.cc b/src/fluxbox.cc index b45408a..b2a1dbb 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.230 2004/02/10 18:51:08 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.231 2004/02/20 09:29:05 fluxgen Exp $ #include "fluxbox.hh" @@ -569,7 +569,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile } // setup theme manager to have our style file ready to be scanned - FbTk::ThemeManager::instance().load(getStyleFilename()); + FbTk::ThemeManager::instance().load(FbTk::StringUtil::expandFilename(getStyleFilename())); XSynchronize(disp, False); sync(false); @@ -1642,16 +1642,7 @@ void Fluxbox::load_rc() { if (m_rc_stylefile->empty()) *m_rc_stylefile = DEFAULTSTYLE; - else // expand tilde - *m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile); - - - // expand tilde - *m_rc_groupfile = StringUtil::expandFilename(*m_rc_groupfile); -#ifdef DEBUG - cerr<<__FILE__<<": Loading groups ("<<*m_rc_groupfile<<")"<