From d7afd7b39e8e539b873ece690dd1fae76296d09c Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Fri, 2 May 2008 03:44:27 -0700 Subject: remove some unnecessary arguments --- src/FbCommands.cc | 2 +- src/MenuCreator.cc | 22 ++++++++-------------- src/MenuCreator.hh | 9 +++------ src/Screen.cc | 2 +- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 059031c..cb55469 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -348,7 +348,7 @@ void ShowCustomMenuCmd::execute() { if (screen == 0) return; m_menu = MenuCreator::createFromFile(custom_menu_file, - screen->screenNumber(), true); + screen->screenNumber()); if (!m_menu.get()) return; ::showMenu(*screen, **m_menu); diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 9f20155..b420d3f 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -255,13 +255,13 @@ void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::StringConver if (FbTk::FileUtil::isRegularFile(thisfile.c_str()) && (filelist[file_index][0] != '.') && (thisfile[thisfile.length() - 1] != '~')) { - MenuCreator::createFromFile(thisfile, menu, false); + MenuCreator::createFromFile(thisfile, menu); } } } else { // inject this file into the current menu - MenuCreator::createFromFile(newfile, menu, false); + MenuCreator::createFromFile(newfile, menu); } safe_counter--; @@ -394,7 +394,7 @@ FbTk::Menu *MenuCreator::createMenu(const string &label, int screen_number) { return menu; } -FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_number, bool require_begin) { +FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_number) { string real_filename = FbTk::StringUtil::expandFilename(filename); Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); @@ -404,7 +404,7 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe startFile(); string label; - if (require_begin && !getStart(parser, label, m_stringconvertor)) { + if (!getStart(parser, label, m_stringconvertor)) { endFile(); return 0; } @@ -420,7 +420,7 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe bool MenuCreator::createFromFile(const string &filename, - FbTk::Menu &inject_into, bool require_begin) { + FbTk::Menu &inject_into) { string real_filename = FbTk::StringUtil::expandFilename(filename); FbMenuParser parser(real_filename); @@ -428,11 +428,6 @@ bool MenuCreator::createFromFile(const string &filename, return false; startFile(); - string label; - if (require_begin && !getStart(parser, label, m_stringconvertor)) { - endFile(); - return false; - } // save menu filename, so we can check if it changes Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); @@ -445,8 +440,7 @@ bool MenuCreator::createFromFile(const string &filename, bool MenuCreator::createWindowMenuFromFile(const string &filename, - FbTk::Menu &inject_into, - bool require_begin) { + FbTk::Menu &inject_into) { string real_filename = FbTk::StringUtil::expandFilename(filename); FbMenuParser parser(real_filename); if (!parser.isLoaded()) @@ -455,7 +449,7 @@ bool MenuCreator::createWindowMenuFromFile(const string &filename, string label; startFile(); - if (require_begin && !getStart(parser, label, m_stringconvertor)) { + if (!getStart(parser, label, m_stringconvertor)) { endFile(); return false; } @@ -481,7 +475,7 @@ FbTk::Menu *MenuCreator::createMenuType(const string &type, int screen_num) { menu->disableTitle(); // not titlebar if (screen->windowMenuFilename().empty() || - ! createWindowMenuFromFile(screen->windowMenuFilename(), *menu, true)) { + ! createWindowMenuFromFile(screen->windowMenuFilename(), *menu)) { const char *default_menu[] = { "shade", "stick", diff --git a/src/MenuCreator.hh b/src/MenuCreator.hh index c5d85ad..4494dc7 100644 --- a/src/MenuCreator.hh +++ b/src/MenuCreator.hh @@ -36,13 +36,10 @@ class FluxboxWindow; class MenuCreator { public: static FbTk::Menu *createMenu(const std::string &label, int screen_num); - static FbTk::Menu *createFromFile(const std::string &filename, int screen_num, - bool require_begin); + static FbTk::Menu *createFromFile(const std::string &filename, int screen_num); static FbTk::Menu *createMenuType(const std::string &label, int screen_num); - static bool createFromFile(const std::string &filename, FbTk::Menu &inject_into, - bool require_begin); - static bool createWindowMenuFromFile(const std::string &filename, FbTk::Menu &inject_into, - bool require_begin); + static bool createFromFile(const std::string &filename, FbTk::Menu &inject_into); + static bool createWindowMenuFromFile(const std::string &filename, FbTk::Menu &inject_into); static bool createWindowMenuItem(const std::string &type, const std::string &label, FbTk::Menu &inject_into); diff --git a/src/Screen.cc b/src/Screen.cc index f06fc43..7950b83 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1518,7 +1518,7 @@ void BScreen::initMenu() { Fluxbox * const fb = Fluxbox::instance(); if (!fb->getMenuFilename().empty()) { m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(), - screenNumber(), true)); + screenNumber())); } -- cgit v0.11.2