From 49aae21402262156a5f6497dc29ac777a268ea2b Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 17 May 2007 20:50:46 +0000 Subject: make sure included file is valid before saving it --- src/MenuCreator.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index d973a66..a04860f 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -466,7 +466,6 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe bool MenuCreator::createFromFile(const string &filename, FbTk::Menu &inject_into, bool require_begin) { string real_filename = FbTk::StringUtil::expandFilename(filename); - Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); FbMenuParser parser(real_filename); if (!parser.isLoaded()) @@ -476,6 +475,9 @@ bool MenuCreator::createFromFile(const string &filename, if (require_begin && !getStart(parser, label, m_stringconvertor)) return false; + // save menu filename, so we can check if it changes + Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); + startFile(); parseMenu(parser, inject_into, m_stringconvertor); endFile(); -- cgit v0.11.2