diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-09-23 18:30:21 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2009-09-23 18:33:48 (GMT) |
commit | b3f3ab74f07cbadb568a5e8ad4363f1e042ea40c (patch) | |
tree | 42657c61c4dd50c0508089913c7da56020a594e9 /src/corelib | |
parent | d2180e2fc3c56d56cd073a896d8449181ca28136 (diff) | |
download | Qt-b3f3ab74f07cbadb568a5e8ad4363f1e042ea40c.zip Qt-b3f3ab74f07cbadb568a5e8ad4363f1e042ea40c.tar.gz Qt-b3f3ab74f07cbadb568a5e8ad4363f1e042ea40c.tar.bz2 |
Fix 3.1 build - move unimplemented RFs API to the S60 plugin
RFs::GetSystemDrive doesn't exist in 3.1 (even though it is in the
symbian documentation). Moved it to a new function in the S60 plugins.
For 3.1, it returns EDriveC, for all other versions the RFs API is used
Task-number: QT-805
Reviewed-by: Iain
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qcore_symbian_p.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index 5b243dc..56097bc 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -138,7 +138,8 @@ enum S60PluginFuncOrdinals S60Plugin_GetTimeFormatSpec = 2, S60Plugin_GetLongDateFormatSpec = 3, S60Plugin_GetShortDateFormatSpec = 4, - S60Plugin_LocalizedDirectoryName = 5 + S60Plugin_LocalizedDirectoryName = 5, + S60Plugin_GetSystemDrive = 6 }; Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 9a93685..61b9ee7 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -111,6 +111,11 @@ private: QMutex *mtx; }; +#ifdef Q_OS_SYMBIAN +typedef TDriveNumber (*SystemDriveFunc)(RFs&); +static SystemDriveFunc PtrGetSystemDrive=0; +#endif + #if defined(Q_WS_WIN) || defined(Q_WS_MAC) extern QString qAppFileName(); #endif @@ -1820,8 +1825,11 @@ QString QCoreApplication::applicationDirPath() } if (err != KErrNone || (driveInfo.iDriveAtt & KDriveAttRom) || (driveInfo.iMediaAtt & KMediaAttWriteProtected)) { - driveChar = fs.GetSystemDriveChar(); - drive = fs.GetSystemDrive(); + if(!PtrGetSystemDrive) + PtrGetSystemDrive = reinterpret_cast<SystemDriveFunc>(qt_resolveS60PluginFunc(S60Plugin_GetSystemDrive)); + Q_ASSERT(PtrGetSystemDrive); + drive = PtrGetSystemDrive(fs); + fs.DriveToChar(drive, driveChar); } qDriveChar = QChar(QLatin1Char(driveChar)).toUpper(); |