aboutsummaryrefslogtreecommitdiff
path: root/src/Remember.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-10 12:55:53 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-17 09:36:39 (GMT)
commit6a701da32042b61a23fdd95c7bdfa84c2fb20e3e (patch)
tree3ecc5db6eb07541cf1ad9412bb574709d9335615 /src/Remember.cc
parentd418cf3631286c146dd7fae5176eb834dcd69aa4 (diff)
downloadfluxbox_pavel-6a701da32042b61a23fdd95c7bdfa84c2fb20e3e.zip
fluxbox_pavel-6a701da32042b61a23fdd95c7bdfa84c2fb20e3e.tar.bz2
Attach a modifiedSig handler to the session.appsFile resource
Diffstat (limited to 'src/Remember.cc')
-rw-r--r--src/Remember.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index 6364f37..594a8b0 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -653,7 +653,9 @@ Remember::Remember():
653 enableUpdate(); 653 enableUpdate();
654 654
655 m_reloader->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<Remember>(*this, &Remember::reload))); 655 m_reloader->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<Remember>(*this, &Remember::reload)));
656 reconfigure(); 656 m_reloader->setMainFile(*Fluxbox::instance()->getAppsResource());
657 join(Fluxbox::instance()->getAppsResource().modifiedSig(),
658 FbTk::MemFun(*m_reloader, &FbTk::AutoReloadHelper::setMainFile));
657} 659}
658 660
659Remember::~Remember() { 661Remember::~Remember() {
@@ -720,19 +722,12 @@ Application * Remember::add(WinClient &winclient) {
720 return app; 722 return app;
721} 723}
722 724
723
724
725
726void Remember::reconfigure() {
727 m_reloader->setMainFile(Fluxbox::instance()->getAppsFilename());
728}
729
730void Remember::checkReload() { 725void Remember::checkReload() {
731 m_reloader->checkReload(); 726 m_reloader->checkReload();
732} 727}
733 728
734void Remember::reload() { 729void Remember::reload() {
735 string apps_string = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getAppsFilename()); 730 const string &apps_string = FbTk::StringUtil::expandFilename(*Fluxbox::instance()->getAppsResource());
736 731
737 732
738 fbdbg<<"("<<__FUNCTION__<<"): Loading apps file ["<<apps_string<<"]"<<endl; 733 fbdbg<<"("<<__FUNCTION__<<"): Loading apps file ["<<apps_string<<"]"<<endl;
@@ -878,7 +873,7 @@ void Remember::reload() {
878 873
879void Remember::save() { 874void Remember::save() {
880 875
881 string apps_string = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getAppsFilename()); 876 const string &apps_string = FbTk::StringUtil::expandFilename(*Fluxbox::instance()->getAppsResource());
882 877
883 fbdbg<<"("<<__FUNCTION__<<"): Saving apps file ["<<apps_string<<"]"<<endl; 878 fbdbg<<"("<<__FUNCTION__<<"): Saving apps file ["<<apps_string<<"]"<<endl;
884 879
@@ -1062,7 +1057,7 @@ void Remember::save() {
1062 } 1057 }
1063 apps_file.close(); 1058 apps_file.close();
1064 // update timestamp to avoid unnecessary reload 1059 // update timestamp to avoid unnecessary reload
1065 m_reloader->addFile(Fluxbox::instance()->getAppsFilename()); 1060 m_reloader->addFile(*Fluxbox::instance()->getAppsResource());
1066} 1061}
1067 1062
1068bool Remember::isRemembered(WinClient &winclient, Attribute attrib) { 1063bool Remember::isRemembered(WinClient &winclient, Attribute attrib) {