Changeset 45448 in vbox
- Timestamp:
- Apr 10, 2013 7:59:40 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84880
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r45439 r45448 304 304 LogFlowFuncEnter(); 305 305 306 # ifdef RT_OS_DARWIN 307 ShutUpAppKit(); 308 # endif /* RT_OS_DARWIN */ 309 310 /* Console help preprocessing: */ 311 for (int i=0; i<argc; i++) 312 if ( !strcmp(argv[i], "-h") 313 || !strcmp(argv[i], "-?") 314 || !strcmp(argv[i], "-help") 315 || !strcmp(argv[i], "--help")) 316 { 317 showHelp(); 318 return 0; 306 /* Failed result initially: */ 307 int iResultCode = 1; 308 309 /* Simulate try-catch block: */ 310 do 311 { 312 #ifdef RT_OS_DARWIN 313 ShutUpAppKit(); 314 #endif /* RT_OS_DARWIN */ 315 316 /* Console help preprocessing: */ 317 bool fHelpShown = false; 318 for (int i = 0; i < argc; ++i) 319 { 320 if ( !strcmp(argv[i], "-h") 321 || !strcmp(argv[i], "-?") 322 || !strcmp(argv[i], "-help") 323 || !strcmp(argv[i], "--help")) 324 { 325 showHelp(); 326 fHelpShown = true; 327 break; 328 } 329 } 330 if (fHelpShown) 331 { 332 iResultCode = 0; 333 break; 319 334 } 320 335 321 336 #if defined(DEBUG) && defined(Q_WS_X11) && defined(RT_OS_LINUX) 322 /* Install our signal handler to backtrace the call stack: */323 struct sigaction sa;324 sa.sa_sigaction = bt_sighandler;325 sigemptyset(&sa.sa_mask);326 sa.sa_flags = SA_RESTART | SA_SIGINFO;327 sigaction(SIGSEGV, &sa, NULL);328 sigaction(SIGBUS, &sa, NULL);329 sigaction(SIGUSR1, &sa, NULL);337 /* Install our signal handler to backtrace the call stack: */ 338 struct sigaction sa; 339 sa.sa_sigaction = bt_sighandler; 340 sigemptyset(&sa.sa_mask); 341 sa.sa_flags = SA_RESTART | SA_SIGINFO; 342 sigaction(SIGSEGV, &sa, NULL); 343 sigaction(SIGBUS, &sa, NULL); 344 sigaction(SIGUSR1, &sa, NULL); 330 345 #endif 331 346 332 347 #ifdef QT_MAC_USE_COCOA 333 /* Instantiate our NSApplication derivative before QApplication334 * forces NSApplication to be instantiated. */335 UICocoaApplication::instance();348 /* Instantiate our NSApplication derivative before QApplication 349 * forces NSApplication to be instantiated. */ 350 UICocoaApplication::instance(); 336 351 #endif /* QT_MAC_USE_COCOA */ 337 352 338 qInstallMsgHandler(QtMessageOutput); 339 340 int rc = 1; /* failure */ 341 342 /* Scope the QApplication variable: */ 343 { 353 /* Install Qt console message handler: */ 354 qInstallMsgHandler(QtMessageOutput); 355 344 356 #ifdef Q_WS_X11 345 357 /* Qt has a complex algorithm for selecting the right visual which … … 371 383 : "Failed to open the X11 display!\n", 372 384 pszDisplay); 373 return 0;385 break; 374 386 } 375 387 Visual *pVisual = useDefaultVisual … … 450 462 break; 451 463 452 /* Exit if VBoxGlobal unable toprocess arguments: */464 /* Exit if VBoxGlobal was able to pre-process arguments: */ 453 465 if (vboxGlobal().processArgs()) 454 return 0;466 break; 455 467 456 468 #ifdef RT_OS_LINUX … … 470 482 471 483 /* Start application: */ 472 rc= a.exec();484 iResultCode = a.exec(); 473 485 } 486 /* VM selector process: */ 474 487 else 475 488 { … … 501 514 502 515 /* Start application: */ 503 rc= a.exec();516 iResultCode = a.exec(); 504 517 } 505 518 } 506 519 while (0); 507 520 508 /* Createmodal-window manager: */521 /* Destroy modal-window manager: */ 509 522 UIModalWindowManager::destroy(); 510 523 } 524 while (0); 511 525 512 526 /* Finish logging: */ 513 LogFlowFunc(("rc=%d\n", rc));527 LogFlowFunc(("rc=%d\n", iResultCode)); 514 528 LogFlowFuncLeave(); 515 529 516 530 /* Return result: */ 517 return rc;531 return iResultCode; 518 532 } 519 533
Note:
See TracChangeset
for help on using the changeset viewer.