Changeset 21481 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 10, 2009 2:14:36 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49920
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r20078 r21481 266 266 bool isValid() { return mValid; } 267 267 268 static QString qtRTVersionString(); 269 static uint qtRTVersion(); 270 static QString qtCTVersionString(); 271 static uint qtCTVersion(); 272 268 273 QString versionString() { return mVerString; } 269 274 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r21479 r21481 646 646 qDeleteAll (mVMStateIcons); 647 647 qDeleteAll (mVMStateColors); 648 } 649 650 /* static */ 651 QString VBoxGlobal::qtRTVersionString() 652 { 653 return QString::fromLatin1 (qVersion()); 654 } 655 656 /* static */ 657 uint VBoxGlobal::qtRTVersion() 658 { 659 QString rt_ver_str = VBoxGlobal::qtRTVersionString(); 660 return (rt_ver_str.section ('.', 0, 0).toInt() << 16) + 661 (rt_ver_str.section ('.', 1, 1).toInt() << 8) + 662 rt_ver_str.section ('.', 2, 2).toInt(); 663 } 664 665 /* static */ 666 QString VBoxGlobal::qtCTVersionString() 667 { 668 return QString::fromLatin1 (QT_VERSION_STR); 669 } 670 671 /* static */ 672 uint VBoxGlobal::qtCTVersion() 673 { 674 QString ct_ver_str = VBoxGlobal::qtCTVersionString(); 675 return (ct_ver_str.section ('.', 0, 0).toInt() << 16) + 676 (ct_ver_str.section ('.', 1, 1).toInt() << 8) + 677 ct_ver_str.section ('.', 2, 2).toInt(); 648 678 } 649 679 -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r21480 r21481 324 324 /* scope the QIApplication variable */ 325 325 { 326 #if defined(Q_WS_X11) && (QT_VERSION >= 0x040500)326 #ifdef Q_WS_X11 327 327 /* There are some buggy/strange driver/compiz combinations which lead 328 328 * to transparent backgrounds on ARGB visuals. Try to fix it by not … … 330 330 * restore the original environment, so that others like the OpenGL 331 331 * service will proper work. */ 332 RTENV env = NIL_RTENV;333 char envval[1024];334 bool found = false;335 int rc = RTEnvClone (&env, RTENV_DEFAULT);336 if (RT_SUCCESS (rc))337 {338 found = RTEnvGetEx (env, "XLIB_SKIP_ARGB_VISUALS", envval, sizeof(envval), NULL) == VINF_SUCCESS;339 RTEnvSet Ex (env,"XLIB_SKIP_ARGB_VISUALS", "1");332 char *pchOldVar = NULL; 333 if (!RTEnvExist ("VBOX_NO_ARGB_VISUALS_HACK") && 334 VBoxGlobal::qtRTVersion() >= 0x040500) 335 { 336 const char *pchVar = RTEnvGet ("XLIB_SKIP_ARGB_VISUALS"); 337 if (pchVar) 338 pchOldVar = RTStrDup (pchVar); 339 RTEnvSet ("XLIB_SKIP_ARGB_VISUALS", "1"); 340 340 } 341 341 /* Now create the application object */ 342 342 QIApplication a (argc, argv); 343 343 /* Restore previous environment */ 344 if (env != NIL_RTENV) 345 { 346 if (found) 347 RTEnvSetEx (env, "XLIB_SKIP_ARGB_VISUALS", envval); 348 else 349 RTEnvUnsetEx (env, "XLIB_SKIP_ARGB_VISUALS"); 350 RTEnvDestroy (env); 344 if (pchOldVar) 345 { 346 RTEnvSet ("XLIB_SKIP_ARGB_VISUALS", pchOldVar); 347 RTStrFree (pchOldVar); 351 348 } 352 349 #else /* defined(Q_WS_X11) && (QT_VERSION >= 0x040500) */ … … 422 419 #ifdef Q_WS_X11 423 420 /* version check (major.minor are sensitive, fix number is ignored) */ 424 QString ver_str = QString::fromLatin1 (QT_VERSION_STR); 425 QString ver_str_base = ver_str.section ('.', 0, 1); 426 QString rt_ver_str = QString::fromLatin1 (qVersion()); 427 uint ver = 428 (ver_str.section ('.', 0, 0).toInt() << 16) + 429 (ver_str.section ('.', 1, 1).toInt() << 8) + 430 ver_str.section ('.', 2, 2).toInt(); 431 uint rt_ver = 432 (rt_ver_str.section ('.', 0, 0).toInt() << 16) + 433 (rt_ver_str.section ('.', 1, 1).toInt() << 8) + 434 rt_ver_str.section ('.', 2, 2).toInt(); 435 if (rt_ver < (ver & 0xFFFF00)) 421 if (VBoxGlobal::qtRTVersion() < (VBoxGlobal::qtCTVersion() & 0xFFFF00)) 436 422 { 437 423 QString msg = 438 424 QApplication::tr ("Executable <b>%1</b> requires Qt %2.x, found Qt %3.") 439 425 .arg (qAppName()) 440 .arg ( ver_str_base)441 .arg ( rt_ver_str);426 .arg (VBoxGlobal::qtCTVersionString().section ('.', 0, 1)) 427 .arg (VBoxGlobal::qtRTVersionString()); 442 428 QMessageBox::critical ( 443 429 0, QApplication::tr ("Incompatible Qt Library Error"),
Note:
See TracChangeset
for help on using the changeset viewer.