aboutsummaryrefslogtreecommitdiff
path: root/src/MenuCreator.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-08-29 12:35:29 (GMT)
committerrathnor <rathnor>2004-08-29 12:35:29 (GMT)
commitef9565efd8431eed3f561154c58765d5a77be90a (patch)
treedc0de9202454de040cd88db5e076d1ded565a4e7 /src/MenuCreator.cc
parent92dc8d745214ac4f8c81bbad6d529a19fb4fe46c (diff)
downloadfluxbox_pavel-ef9565efd8431eed3f561154c58765d5a77be90a.zip
fluxbox_pavel-ef9565efd8431eed3f561154c58765d5a77be90a.tar.bz2
fix crash bug when windowmenu doesn't include extramenus
improve checking of existence/success of loading windowmenu file
Diffstat (limited to 'src/MenuCreator.cc')
-rw-r--r--src/MenuCreator.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index 374411d..9c3cb4f 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: MenuCreator.cc,v 1.11 2004/08/26 18:26:39 akir Exp $ 23// $Id: MenuCreator.cc,v 1.12 2004/08/29 12:35:29 rathnor Exp $
24 24
25#include "MenuCreator.hh" 25#include "MenuCreator.hh"
26 26
@@ -322,36 +322,38 @@ FbTk::Menu *MenuCreator::createFromFile(const std::string &filename, int screen_
322} 322}
323 323
324 324
325void MenuCreator::createFromFile(const std::string &filename, 325bool MenuCreator::createFromFile(const std::string &filename,
326 FbTk::Menu &inject_into) { 326 FbTk::Menu &inject_into) {
327 327
328 std::string real_filename = FbTk::StringUtil::expandFilename(filename); 328 std::string real_filename = FbTk::StringUtil::expandFilename(filename);
329 FbMenuParser parser(real_filename); 329 FbMenuParser parser(real_filename);
330 if (!parser.isLoaded()) 330 if (!parser.isLoaded())
331 return; 331 return false;
332 332
333 std::string label; 333 std::string label;
334 if (!getStart(parser, label)) 334 if (!getStart(parser, label))
335 return; 335 return false;
336 336
337 parseMenu(parser, inject_into); 337 parseMenu(parser, inject_into);
338 return true;
338} 339}
339 340
340 341
341void MenuCreator::createFromFile(const std::string &filename, 342bool MenuCreator::createFromFile(const std::string &filename,
342 FbTk::Menu &inject_into, 343 FbTk::Menu &inject_into,
343 FluxboxWindow &win) { 344 FluxboxWindow &win) {
344 std::string real_filename = FbTk::StringUtil::expandFilename(filename); 345 std::string real_filename = FbTk::StringUtil::expandFilename(filename);
345 FbMenuParser parser(real_filename); 346 FbMenuParser parser(real_filename);
346 if (!parser.isLoaded()) 347 if (!parser.isLoaded())
347 return; 348 return false;
348 349
349 std::string label; 350 std::string label;
350 351
351 if (!getStart(parser, label)) 352 if (!getStart(parser, label))
352 return; 353 return false;
353 354
354 parseWindowMenu(parser, inject_into, win); 355 parseWindowMenu(parser, inject_into, win);
356 return true;
355} 357}
356 358
357 359