aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-05-12 00:22:40 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-05-12 00:22:40 (GMT)
commit93b0c5322a7482d83e38657b36e9814f8415e47b (patch)
tree0e7bfe2e975e0b9bd88334975c691e98513c1c14 /src/fluxbox.cc
parent72a45fae3c39323206e7d19913bb3ab17a691691 (diff)
downloadfluxbox-93b0c5322a7482d83e38657b36e9814f8415e47b.zip
fluxbox-93b0c5322a7482d83e38657b36e9814f8415e47b.tar.bz2
refactor menu reloading, added FbTk::AutoReloadHelper
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 7d774cc..70503a5 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -437,8 +437,6 @@ Fluxbox::~Fluxbox() {
437 delete (*it).first; 437 delete (*it).first;
438 } 438 }
439 m_atomhandler.clear(); 439 m_atomhandler.clear();
440
441 clearMenuFilenames();
442} 440}
443 441
444 442
@@ -1469,63 +1467,6 @@ BScreen *Fluxbox::findScreen(int id) {
1469 return *it; 1467 return *it;
1470} 1468}
1471 1469
1472bool Fluxbox::menuTimestampsChanged() const {
1473 list<MenuTimestamp *>::const_iterator it = m_menu_timestamps.begin();
1474 list<MenuTimestamp *>::const_iterator it_end = m_menu_timestamps.end();
1475 for (; it != it_end; ++it) {
1476
1477 time_t timestamp = FbTk::FileUtil::getLastStatusChangeTimestamp((*it)->filename.c_str());
1478
1479 if (timestamp != (*it)->timestamp)
1480 return true;
1481 }
1482
1483 // no timestamp changed
1484 return false;
1485}
1486
1487void Fluxbox::rereadMenu() {
1488 clearMenuFilenames();
1489
1490 for_each(m_screen_list.begin(),
1491 m_screen_list.end(),
1492 mem_fun(&BScreen::rereadMenu));
1493}
1494
1495void Fluxbox::saveMenuFilename(const char *filename) {
1496 if (filename == 0)
1497 return;
1498
1499 bool found = false;
1500
1501 list<MenuTimestamp *>::iterator it = m_menu_timestamps.begin();
1502 list<MenuTimestamp *>::iterator it_end = m_menu_timestamps.end();
1503 for (; it != it_end; ++it) {
1504 if ((*it)->filename == filename) {
1505 found = true;
1506 break;
1507 }
1508 }
1509
1510 if (! found) {
1511 time_t timestamp = FbTk::FileUtil::getLastStatusChangeTimestamp(filename);
1512
1513 MenuTimestamp *ts = new MenuTimestamp;
1514
1515 ts->filename = filename;
1516 ts->timestamp = timestamp;
1517
1518 m_menu_timestamps.push_back(ts);
1519 }
1520}
1521
1522void Fluxbox::clearMenuFilenames() {
1523 while(!m_menu_timestamps.empty()) {
1524 delete m_menu_timestamps.back();
1525 m_menu_timestamps.pop_back();
1526 }
1527}
1528
1529void Fluxbox::timed_reconfigure() { 1470void Fluxbox::timed_reconfigure() {
1530 if (m_reconfigure_wait) 1471 if (m_reconfigure_wait)
1531 real_reconfigure(); 1472 real_reconfigure();