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)
return;
m_menu = MenuCreator::createFromFile(custom_menu_file,
screen->screenNumber(), true);
screen->screenNumber());
if (!m_menu.get())
return;
::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()) &&
(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",

View file

@ -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);

View file

@ -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()));
}