remove some unnecessary arguments

This commit is contained in:
Mark Tiefenbruck 2008-05-02 03:44:27 -07:00
parent 50024d32bc
commit d7afd7b39e
4 changed files with 13 additions and 22 deletions

View file

@ -348,7 +348,7 @@ void ShowCustomMenuCmd::execute() {
if (screen == 0) if (screen == 0)
return; return;
m_menu = MenuCreator::createFromFile(custom_menu_file, m_menu = MenuCreator::createFromFile(custom_menu_file,
screen->screenNumber(), true); screen->screenNumber());
if (!m_menu.get()) if (!m_menu.get())
return; return;
::showMenu(*screen, **m_menu); ::showMenu(*screen, **m_menu);

View file

@ -255,13 +255,13 @@ void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::StringConver
if (FbTk::FileUtil::isRegularFile(thisfile.c_str()) && if (FbTk::FileUtil::isRegularFile(thisfile.c_str()) &&
(filelist[file_index][0] != '.') && (filelist[file_index][0] != '.') &&
(thisfile[thisfile.length() - 1] != '~')) { (thisfile[thisfile.length() - 1] != '~')) {
MenuCreator::createFromFile(thisfile, menu, false); MenuCreator::createFromFile(thisfile, menu);
} }
} }
} else { } else {
// inject this file into the current menu // inject this file into the current menu
MenuCreator::createFromFile(newfile, menu, false); MenuCreator::createFromFile(newfile, menu);
} }
safe_counter--; safe_counter--;
@ -394,7 +394,7 @@ FbTk::Menu *MenuCreator::createMenu(const string &label, int screen_number) {
return menu; 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); string real_filename = FbTk::StringUtil::expandFilename(filename);
Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
@ -404,7 +404,7 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe
startFile(); startFile();
string label; string label;
if (require_begin && !getStart(parser, label, m_stringconvertor)) { if (!getStart(parser, label, m_stringconvertor)) {
endFile(); endFile();
return 0; return 0;
} }
@ -420,7 +420,7 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe
bool MenuCreator::createFromFile(const string &filename, bool MenuCreator::createFromFile(const string &filename,
FbTk::Menu &inject_into, bool require_begin) { FbTk::Menu &inject_into) {
string real_filename = FbTk::StringUtil::expandFilename(filename); string real_filename = FbTk::StringUtil::expandFilename(filename);
FbMenuParser parser(real_filename); FbMenuParser parser(real_filename);
@ -428,11 +428,6 @@ bool MenuCreator::createFromFile(const string &filename,
return false; return false;
startFile(); startFile();
string label;
if (require_begin && !getStart(parser, label, m_stringconvertor)) {
endFile();
return false;
}
// save menu filename, so we can check if it changes // save menu filename, so we can check if it changes
Fluxbox::instance()->saveMenuFilename(real_filename.c_str()); Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
@ -445,8 +440,7 @@ bool MenuCreator::createFromFile(const string &filename,
bool MenuCreator::createWindowMenuFromFile(const string &filename, bool MenuCreator::createWindowMenuFromFile(const string &filename,
FbTk::Menu &inject_into, FbTk::Menu &inject_into) {
bool require_begin) {
string real_filename = FbTk::StringUtil::expandFilename(filename); string real_filename = FbTk::StringUtil::expandFilename(filename);
FbMenuParser parser(real_filename); FbMenuParser parser(real_filename);
if (!parser.isLoaded()) if (!parser.isLoaded())
@ -455,7 +449,7 @@ bool MenuCreator::createWindowMenuFromFile(const string &filename,
string label; string label;
startFile(); startFile();
if (require_begin && !getStart(parser, label, m_stringconvertor)) { if (!getStart(parser, label, m_stringconvertor)) {
endFile(); endFile();
return false; return false;
} }
@ -481,7 +475,7 @@ FbTk::Menu *MenuCreator::createMenuType(const string &type, int screen_num) {
menu->disableTitle(); // not titlebar menu->disableTitle(); // not titlebar
if (screen->windowMenuFilename().empty() || if (screen->windowMenuFilename().empty() ||
! createWindowMenuFromFile(screen->windowMenuFilename(), *menu, true)) { ! createWindowMenuFromFile(screen->windowMenuFilename(), *menu)) {
const char *default_menu[] = { const char *default_menu[] = {
"shade", "shade",
"stick", "stick",

View file

@ -36,13 +36,10 @@ class FluxboxWindow;
class MenuCreator { class MenuCreator {
public: public:
static FbTk::Menu *createMenu(const std::string &label, int screen_num); static FbTk::Menu *createMenu(const std::string &label, int screen_num);
static FbTk::Menu *createFromFile(const std::string &filename, int screen_num, static FbTk::Menu *createFromFile(const std::string &filename, int screen_num);
bool require_begin);
static FbTk::Menu *createMenuType(const std::string &label, 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, 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);
static bool createWindowMenuFromFile(const std::string &filename, FbTk::Menu &inject_into,
bool require_begin);
static bool createWindowMenuItem(const std::string &type, const std::string &label, static bool createWindowMenuItem(const std::string &type, const std::string &label,
FbTk::Menu &inject_into); FbTk::Menu &inject_into);

View file

@ -1518,7 +1518,7 @@ void BScreen::initMenu() {
Fluxbox * const fb = Fluxbox::instance(); Fluxbox * const fb = Fluxbox::instance();
if (!fb->getMenuFilename().empty()) { if (!fb->getMenuFilename().empty()) {
m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(), m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(),
screenNumber(), true)); screenNumber()));
} }