From 50024d32bc40541f128d80139e58494663f955b4 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Thu, 1 May 2008 01:22:16 -0700 Subject: save timestamp for non-existent menu file, in case user creates one --- ChangeLog | 3 +++ src/Screen.cc | 3 +++ src/fluxbox.cc | 15 +++++---------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6056785..b6b1f19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0.1: +*08/04/31: + * Notice when user replaces a non-existent menu file (Mark) + fluxbox.cc Screen.cc *08/04/30: * Don't allow empty root menu (Mark) Screen.cc diff --git a/src/Screen.cc b/src/Screen.cc index cb6faf2..f06fc43 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1536,6 +1536,9 @@ void BScreen::initMenu() { restart_fb); m_rootmenu->insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit command"), exit_fb); + // still save the menu filename, in case it becomes valid later + if (!fb->getMenuFilename().empty()) + fb->saveMenuFilename(fb->getMenuFilename().c_str()); } m_rootmenu->updateMenu(); diff --git a/src/fluxbox.cc b/src/fluxbox.cc index a6ce035..300d683 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -1476,10 +1476,7 @@ bool Fluxbox::menuTimestampsChanged() const { time_t timestamp = FbTk::FileUtil::getLastStatusChangeTimestamp((*it)->filename.c_str()); - if (timestamp >= 0) { - if (timestamp != (*it)->timestamp) - return true; - } else + if (timestamp != (*it)->timestamp) return true; } @@ -1529,14 +1526,12 @@ void Fluxbox::saveMenuFilename(const char *filename) { if (! found) { time_t timestamp = FbTk::FileUtil::getLastStatusChangeTimestamp(filename); - if (timestamp >= 0) { - MenuTimestamp *ts = new MenuTimestamp; + MenuTimestamp *ts = new MenuTimestamp; - ts->filename = filename; - ts->timestamp = timestamp; + ts->filename = filename; + ts->timestamp = timestamp; - m_menu_timestamps.push_back(ts); - } + m_menu_timestamps.push_back(ts); } } -- cgit v0.11.2