all repos — fluxbox @ be03b0a3dc916cd9a320a41e38ab57555f8d2a94

custom fork of the fluxbox windowmanager

cosmetic, closes #1467926
mathias mathias
commit

be03b0a3dc916cd9a320a41e38ab57555f8d2a94

parent

a6551852bb5cc860c2ba62b4b70ec269dcd9eb40

3 files changed, 28 insertions(+), 23 deletions(-)

jump to
M ChangeLogChangeLog

@@ -3,6 +3,8 @@ Changes for 0.9.16:

*06/04/11: * Fix calculation of prevWorkspace (Mathias) Screen.cc + * Cosmetic, close #1467926 (thanx Jonas Koelker) + Keys.hh/cc *06/04/09: * Fix label background update with external tabs (Simon) FbWinFrame.cc
M src/Keys.ccsrc/Keys.cc

@@ -111,11 +111,11 @@ }

/// Destroys the keytree void Keys::deleteTree() { - while (!m_keylist.empty()) { - if (m_keylist.back()) - delete m_keylist.back(); - m_keylist.pop_back(); - } + keylist_t::iterator it = m_keylist.begin(); + const keylist_t::iterator end = m_keylist.end(); + for ( ; it != end; it++) + delete *it; + m_keylist.clear(); } /**
M src/Keys.hhsrc/Keys.hh

@@ -75,40 +75,43 @@ private:

void deleteTree(); void bindKey(unsigned int key, unsigned int mod); - - std::string m_filename; - - class t_key { + + std::string m_filename; + + class t_key; + typedef std::vector<t_key*> keylist_t; + + class t_key { public: - t_key(unsigned int key, unsigned int mod, + t_key(unsigned int key, unsigned int mod, FbTk::RefCount<FbTk::Command> command = FbTk::RefCount<FbTk::Command>(0)); t_key(t_key *k); ~t_key(); - - inline t_key *find(unsigned int key_, unsigned int mod_) { + + t_key *find(unsigned int key_, unsigned int mod_) { for (size_t i = 0; i < keylist.size(); i++) { if (keylist[i]->key == key_ && keylist[i]->mod == FbTk::KeyUtil::instance().isolateModifierMask(mod_)) - return keylist[i]; - } + return keylist[i]; + } return 0; } - inline t_key *find(XKeyEvent &ke) { + t_key *find(XKeyEvent &ke) { for (size_t i = 0; i < keylist.size(); i++) { - if (keylist[i]->key == ke.keycode && + if (keylist[i]->key == ke.keycode && keylist[i]->mod == FbTk::KeyUtil::instance().isolateModifierMask(ke.state)) - return keylist[i]; - } + return keylist[i]; + } return 0; } - - inline bool operator == (XKeyEvent &ke) const { + + bool operator == (XKeyEvent &ke) const { return (mod == FbTk::KeyUtil::instance().isolateModifierMask(ke.state) && key == ke.keycode); } - + FbTk::RefCount<FbTk::Command> m_command; unsigned int key; unsigned int mod; - std::vector<t_key *> keylist; + keylist_t keylist; }; /**

@@ -117,7 +120,7 @@ @return true on success, else false

*/ bool mergeTree(t_key *newtree, t_key *basetree=0); - std::vector<t_key *> m_keylist; + keylist_t m_keylist; Display *m_display; ///< display connection unsigned int m_current_line;