- Timestamp:
- Nov 1, 2013 1:07:23 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r48826 r49363 209 209 using namespace UIDefs /* globally */; 210 210 211 #ifdef Q_WS_MAC 212 /** Known MacOS X releases. */ 213 enum MacOSXRelease 214 { 215 MacOSXRelease_Unknown, 216 MacOSXRelease_SnowLeopard, 217 MacOSXRelease_Lion, 218 MacOSXRelease_MountainLion, 219 MacOSXRelease_Mavericks 220 }; 221 #endif /* Q_WS_MAC */ 222 211 223 struct StorageSlot 212 224 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r49341 r49363 135 135 #endif /* Q_WS_X11 */ 136 136 137 #ifdef Q_WS_MAC 138 #include <sys/utsname.h> 139 #endif /* Q_WS_MAC */ 140 137 141 /* External includes: */ 138 142 #include <math.h> … … 315 319 return mVBox.GetVersion().contains("BETA", Qt::CaseInsensitive); 316 320 } 321 322 #ifdef Q_WS_MAC 323 /** Returns #MacOSXRelease determined using <i>uname</i> call. */ 324 MacOSXRelease VBoxGlobal::osRelease() 325 { 326 /* Prepare 'utsname' struct: */ 327 utsname info; 328 if (uname(&info) != -1) 329 { 330 /* Parse known .release types: */ 331 if (QString(info.release).startsWith("13.")) 332 return MacOSXRelease_Mavericks; 333 else 334 if (QString(info.release).startsWith("12.")) 335 return MacOSXRelease_MountainLion; 336 else 337 if (QString(info.release).startsWith("11.")) 338 return MacOSXRelease_Lion; 339 else 340 if (QString(info.release).startsWith("10.")) 341 return MacOSXRelease_SnowLeopard; 342 } 343 /* Unknown by default: */ 344 return MacOSXRelease_Unknown; 345 } 346 #endif /* Q_WS_MAC */ 317 347 318 348 /** -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r49333 r49363 85 85 QString versionString() const { return mVerString; } 86 86 bool isBeta() const; 87 88 #ifdef Q_WS_MAC 89 static MacOSXRelease osRelease(); 90 #endif /* Q_WS_MAC */ 87 91 88 92 CVirtualBox virtualBox() const { return mVBox; }
Note:
See TracChangeset
for help on using the changeset viewer.