aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-05-11 17:17:21 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-05-11 17:17:21 (GMT)
commit72a45fae3c39323206e7d19913bb3ab17a691691 (patch)
treef920a884d39c8d5d161e0fa7a3c8a6296f7a3d71 /src/Screen.cc
parent85d8ac754974aae0a513b585e4f1810007cb157c (diff)
downloadfluxbox-72a45fae3c39323206e7d19913bb3ab17a691691.zip
fluxbox-72a45fae3c39323206e7d19913bb3ab17a691691.tar.bz2
reuse some menu pointers instead of using delete/new
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 1708a69..8b00186 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1498,21 +1498,18 @@ void BScreen::initMenus() {
1498void BScreen::initMenu() { 1498void BScreen::initMenu() {
1499 1499
1500 if (m_rootmenu.get()) { 1500 if (m_rootmenu.get()) {
1501 while (m_rootmenu->numberOfItems()) 1501 m_rootmenu->removeAll();
1502 m_rootmenu->remove(0); 1502 m_rootmenu->setLabel("");
1503 } else 1503 } else
1504 m_rootmenu.reset(createMenu("")); 1504 m_rootmenu.reset(createMenu(""));
1505 1505
1506 Fluxbox * const fb = Fluxbox::instance(); 1506 Fluxbox * const fb = Fluxbox::instance();
1507 if (!fb->getMenuFilename().empty()) { 1507 if (!fb->getMenuFilename().empty())
1508 m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(), 1508 MenuCreator::createFromFile(fb->getMenuFilename(), *m_rootmenu);
1509 screenNumber()));
1510
1511 }
1512 1509
1513 if (m_rootmenu.get() == 0 || m_rootmenu->numberOfItems() == 0) { 1510 if (m_rootmenu->numberOfItems() == 0) {
1514 _FB_USES_NLS; 1511 _FB_USES_NLS;
1515 m_rootmenu.reset(createMenu(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); 1512 m_rootmenu->setLabel(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"));
1516 FbTk::RefCount<FbTk::Command<void> > restart_fb(FbTk::CommandParser<void>::instance().parse("restart")); 1513 FbTk::RefCount<FbTk::Command<void> > restart_fb(FbTk::CommandParser<void>::instance().parse("restart"));
1517 FbTk::RefCount<FbTk::Command<void> > exit_fb(FbTk::CommandParser<void>::instance().parse("exit")); 1514 FbTk::RefCount<FbTk::Command<void> > exit_fb(FbTk::CommandParser<void>::instance().parse("exit"));
1518 FbTk::RefCount<FbTk::Command<void> > execute_xterm(FbTk::CommandParser<void>::instance().parse("exec xterm")); 1515 FbTk::RefCount<FbTk::Command<void> > execute_xterm(FbTk::CommandParser<void>::instance().parse("exec xterm"));