diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-05 13:46:47 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-05 13:46:47 (GMT) |
commit | ad04d96fdac0fea252096d5144abf684516cbb10 (patch) | |
tree | 50e9defb39955db39116677f2eef3d72e8053a26 /src/corelib/global | |
parent | 1200bf9f82860d2f391a4b68ce25c606eb9a0831 (diff) | |
parent | bbaf34b1f5ac4e6d425eab183112b504b9ed4e83 (diff) | |
download | Qt-ad04d96fdac0fea252096d5144abf684516cbb10.zip Qt-ad04d96fdac0fea252096d5144abf684516cbb10.tar.gz Qt-ad04d96fdac0fea252096d5144abf684516cbb10.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Conflicts:
src/gui/painting/qpdf.cpp
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/global.pri | 3 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 81 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 5 |
3 files changed, 57 insertions, 32 deletions
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index dbbabf4..ce43ea3 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -28,3 +28,6 @@ linux*:!static:!linux-armcc:!linux-gcce { prog=$$quote(if (/program interpreter: (.*)]/) { print $1; }) DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\" } + +# Compensate for lack of platform defines in Symbian3 and Symbian4 +symbian: DEFINES += SYMBIAN_VERSION_$$upper($$replace(SYMBIAN_VERSION,\\.,_)) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 0d71815..80df42d 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -86,7 +86,8 @@ # include "private/qcore_symbian_p.h" _LIT(qt_S60Filter, "Series60v?.*.sis"); -_LIT(qt_S60SystemInstallDir, "z:\\system\\install\\"); +_LIT(qt_symbianFilter, "Symbianv*.sis"); +_LIT(qt_symbianSystemInstallDir, "z:\\system\\install\\"); #endif QT_BEGIN_NAMESPACE @@ -1822,12 +1823,12 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() #endif #ifdef Q_OS_SYMBIAN -static QSysInfo::S60Version cachedS60Version = QSysInfo::S60Version(-1); +static QSysInfo::SymbianVersion cachedSymbianVersion = QSysInfo::SymbianVersion(-1); -QSysInfo::S60Version QSysInfo::s60Version() +QSysInfo::SymbianVersion QSysInfo::symbianVersion() { - if (cachedS60Version != -1) - return cachedS60Version; + if (cachedSymbianVersion != -1) + return cachedSymbianVersion; // Use pure Symbian code, because if done using QDir, there will be a call back // to this method, resulting doing this expensive operation twice before the cache kicks in. @@ -1835,7 +1836,22 @@ QSysInfo::S60Version QSysInfo::s60Version() RFs rfs = qt_s60GetRFs(); TFindFile fileFinder(rfs); CDir* contents; - TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_S60SystemInstallDir, contents); + + // Check for Symbian4 + TInt err = fileFinder.FindWildByDir(qt_symbianFilter, qt_symbianSystemInstallDir, contents); + if (err == KErrNone) { + QScopedPointer<CDir> contentsDeleter(contents); + err = contents->Sort(EDescending|ESortByName); + if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 9) { + TInt major = (*contents)[0].iName[8] - '0'; + if (major == 4) { + return cachedSymbianVersion = SV_SF_4; + } + } + } + + // Check for S60 and Symbian3 platforms, which use older .sis naming scheme + err = fileFinder.FindWildByDir(qt_S60Filter, qt_symbianSystemInstallDir, contents); if (err == KErrNone) { QScopedPointer<CDir> contentsDeleter(contents); err = contents->Sort(EDescending|ESortByName); @@ -1844,19 +1860,19 @@ QSysInfo::S60Version QSysInfo::s60Version() TInt minor = (*contents)[0].iName[11] - '0'; if (major == 3) { if (minor == 1) { - return cachedS60Version = SV_S60_3_1; + return cachedSymbianVersion = SV_9_2; } else if (minor == 2) { - return cachedS60Version = SV_S60_3_2; + return cachedSymbianVersion = SV_9_3; } } else if (major == 5) { if (minor == 0) { - return cachedS60Version = SV_S60_5_0; + return cachedSymbianVersion = SV_9_4; } else if (minor == 1) { - return cachedS60Version = SV_S60_5_1; + return cachedSymbianVersion = SV_SF_2; } else if (minor == 2) { - return cachedS60Version = SV_S60_5_2; + return cachedSymbianVersion = SV_SF_3; } } } @@ -1864,33 +1880,40 @@ QSysInfo::S60Version QSysInfo::s60Version() # ifdef Q_CC_NOKIAX86 // Some emulator environments may not contain the version specific .sis files, so - // simply hardcode the version on those environments. + // simply hardcode the version on those environments. Note that can't use + // SYMBIAN_VERSION_* defines for S60 3.x/5.0 platforms, as they do not define them + // right anyway in case .sis files are not found. # if defined(__SERIES60_31__) - return cachedS60Version = SV_S60_3_1; + return cachedSymbianVersion = SV_9_2; # elif defined(__S60_32__) - return cachedS60Version = SV_S60_3_2; + return cachedSymbianVersion = SV_9_3; # elif defined(__S60_50__) - return cachedS60Version = SV_S60_5_0; + return cachedSymbianVersion = SV_9_4; +# elif defined(SYMBIAN_VERSION_SYMBIAN3) + return cachedSymbianVersion = SV_SF_3; +# elif defined(SYMBIAN_VERSION_SYMBIAN4) + return cachedSymbianVersion = SV_SF_4; # endif # endif //If reaching here, it was not possible to determine the version - return cachedS60Version = SV_S60_Unknown; + return cachedSymbianVersion = SV_Unknown; } -QSysInfo::SymbianVersion QSysInfo::symbianVersion() + +QSysInfo::S60Version QSysInfo::s60Version() { - switch (s60Version()) { - case SV_S60_3_1: - return SV_9_2; - case SV_S60_3_2: - return SV_9_3; - case SV_S60_5_0: - return SV_9_4; - case SV_S60_5_1: - return SV_SF_2; - case SV_S60_5_2: - return SV_SF_3; + switch (symbianVersion()) { + case SV_9_2: + return SV_S60_3_1; + case SV_9_3: + return SV_S60_3_2; + case SV_9_4: + return SV_S60_5_0; + case SV_SF_2: + return SV_S60_5_1; + case SV_SF_3: + return SV_S60_5_2; default: - return SV_Unknown; + return SV_S60_Unknown; } } #endif // ifdef Q_OS_SYMBIAN diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1bf2dd3..4866222 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1538,7 +1538,7 @@ public: #endif #ifdef Q_OS_SYMBIAN enum SymbianVersion { - SV_Unknown = 0x0000, + SV_Unknown = 1000000, // Assume unknown is something newer than what is supported //These are the Symbian Ltd versions 9.2-9.4 SV_9_2 = 10, SV_9_3 = 20, @@ -1552,7 +1552,7 @@ public: static SymbianVersion symbianVersion(); enum S60Version { SV_S60_None = 0, - SV_S60_Unknown = 1, + SV_S60_Unknown = SV_Unknown, SV_S60_3_1 = SV_9_2, SV_S60_3_2 = SV_9_3, SV_S60_5_0 = SV_9_4, @@ -2441,7 +2441,6 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #endif #endif - //Symbian does not support data imports from a DLL #define Q_NO_DATA_RELOCATION |