aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Keys.cc')
-rw-r--r--src/Keys.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/Keys.cc b/src/Keys.cc
index 79c273b..64eb05d 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -201,7 +201,11 @@ Keys::Keys():
201 m_reloader(new FbTk::AutoReloadHelper()), 201 m_reloader(new FbTk::AutoReloadHelper()),
202 m_keylist(0), 202 m_keylist(0),
203 next_key(0), saved_keymode(0) { 203 next_key(0), saved_keymode(0) {
204
204 m_reloader->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<Keys>(*this, &Keys::reload))); 205 m_reloader->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<Keys>(*this, &Keys::reload)));
206 m_reloader->setMainFile(*Fluxbox::instance()->getKeysResource());
207 join(Fluxbox::instance()->getKeysResource().modifiedSig(),
208 MemFun(*m_reloader, &FbTk::AutoReloadHelper::setMainFile));
205} 209}
206 210
207Keys::~Keys() { 211Keys::~Keys() {
@@ -295,8 +299,9 @@ void Keys::grabWindow(Window win) {
295void Keys::reload() { 299void Keys::reload() {
296 // an intentionally empty file will still have one root mapping 300 // an intentionally empty file will still have one root mapping
297 bool firstload = m_map.empty(); 301 bool firstload = m_map.empty();
302 const std::string filename = FbTk::StringUtil::expandFilename(*Fluxbox::instance()->getKeysResource());
298 303
299 if (m_filename.empty()) { 304 if (filename.empty()) {
300 if (firstload) 305 if (firstload)
301 loadDefaults(); 306 loadDefaults();
302 return; 307 return;
@@ -304,12 +309,12 @@ void Keys::reload() {
304 309
305 FbTk::App::instance()->sync(false); 310 FbTk::App::instance()->sync(false);
306 311
307 if (! FbTk::FileUtil::isRegularFile(m_filename.c_str())) { 312 if (! FbTk::FileUtil::isRegularFile(filename.c_str())) {
308 return; 313 return;
309 } 314 }
310 315
311 // open the file 316 // open the file
312 ifstream infile(m_filename.c_str()); 317 ifstream infile(filename.c_str());
313 if (!infile) { 318 if (!infile) {
314 if (firstload) 319 if (firstload)
315 loadDefaults(); 320 loadDefaults();
@@ -619,16 +624,6 @@ void Keys::unregisterWindow(Window win) {
619 m_window_map.erase(win); 624 m_window_map.erase(win);
620} 625}
621 626
622/**
623 deletes the tree and load configuration
624 returns true on success else false
625*/
626void Keys::reconfigure() {
627 m_filename = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getKeysFilename());
628 m_reloader->setMainFile(m_filename);
629 m_reloader->checkReload();
630}
631
632void Keys::regrab() { 627void Keys::regrab() {
633 setKeyMode(m_keylist); 628 setKeyMode(m_keylist);
634} 629}