diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-25 08:51:44 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-25 08:51:44 (GMT) |
commit | 8cee5b06aa0ecde7ba0a53c8a46070af3691db1b (patch) | |
tree | 4cd7f5ffb8b31af78f095c40fa6021a0331fde3b /src/corelib/kernel | |
parent | f729015e1f44065b1b1911b65ba3fddd35d5545b (diff) | |
parent | f049061a7b479c957240ec8e4fd91d1e9463b071 (diff) | |
download | Qt-8cee5b06aa0ecde7ba0a53c8a46070af3691db1b.zip Qt-8cee5b06aa0ecde7ba0a53c8a46070af3691db1b.tar.gz Qt-8cee5b06aa0ecde7ba0a53c8a46070af3691db1b.tar.bz2 |
Merge commit 'origin/master' into 4.6
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcore_symbian_p.cpp | 31 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_symbian_p.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 23 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication_p.h | 7 |
4 files changed, 35 insertions, 29 deletions
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp index a7d2694..957b92c 100644 --- a/src/corelib/kernel/qcore_symbian_p.cpp +++ b/src/corelib/kernel/qcore_symbian_p.cpp @@ -175,5 +175,36 @@ Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal) return qt_s60_plugin_resolver()->resolve(ordinal); } +/*! +\internal +Provides global access to a shared RFs. +*/ +class QS60RFsSession +{ +public: + QS60RFsSession() { + qt_symbian_throwIfError(iFs.Connect()); + qt_symbian_throwIfError(iFs.ShareProtected()); + } + + ~QS60RFsSession() { + iFs.Close(); + } + + RFs& GetRFs() { + return iFs; + } + +private: + + RFs iFs; +}; + +Q_GLOBAL_STATIC(QS60RFsSession, qt_s60_RFsSession); + +Q_CORE_EXPORT RFs& qt_s60GetRFs() +{ + return qt_s60_RFsSession()->GetRFs(); +} QT_END_NAMESPACE diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index fab7254..6d3616f 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -58,6 +58,7 @@ #include <qstring.h> #include <qrect.h> #include <qhash.h> +#include <f32file.h> QT_BEGIN_HEADER @@ -142,6 +143,8 @@ enum S60PluginFuncOrdinals Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal); +Q_CORE_EXPORT RFs& qt_s60GetRFs(); + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index ead363c..6d88d92 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -271,12 +271,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv) qt_application_thread_id = QThread::currentThreadId(); #endif -#ifdef Q_OS_SYMBIAN - if(KErrNone != fileServerSession.Connect()) - qFatal("FATAL: QCoreApplicationPrivate can't connect to file server"); - fileServerSession.ShareProtected(); //makes the handle ok for multithreading and IPC -#endif - // note: this call to QThread::currentThread() may end up setting theMainThread! if (QThread::currentThread() != theMainThread) qWarning("WARNING: QApplication was not created in the main() thread."); @@ -284,9 +278,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv) QCoreApplicationPrivate::~QCoreApplicationPrivate() { -#ifdef Q_OS_SYMBIAN - fileServerSession.Close(); -#endif if (threadData) { #ifndef QT_NO_THREAD void *data = &threadData->tls; @@ -825,18 +816,6 @@ bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event) return receiver->event(event); } -#ifdef Q_OS_SYMBIAN -/*!\internal - - Accessor for shared global file server session - */ -RFs QCoreApplicationPrivate::fileServerSession; -RFs& QCoreApplicationPrivate::fsSession() -{ - return fileServerSession; -} -#endif - /*! Returns true if an application object has not been created yet; otherwise returns false. @@ -2192,7 +2171,7 @@ QStringList QCoreApplication::libraryPaths() if (tempPath.at(tempPath.length() - 1) != QChar('\\')) { tempPath += QChar('\\'); } - RFs& fs = QCoreApplicationPrivate::fsSession(); + RFs& fs = qt_s60GetRFs(); TPtrC tempPathPtr(reinterpret_cast<const TText*> (tempPath.constData())); TFindFile finder(fs); TInt err = finder.FindByDir(tempPathPtr, tempPathPtr); diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 1adb837..6c30ce8 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -90,10 +90,6 @@ public: static QString macMenuBarName(); #endif -#ifdef Q_OS_SYMBIAN - static RFs& fsSession(); -#endif - static QThread *theMainThread; static QThread *mainThread(); static bool checkInstance(const char *method); @@ -126,9 +122,6 @@ public: static uint attribs; static inline bool testAttribute(uint flag) { return attribs & (1 << flag); } -#ifdef Q_OS_SYMBIAN - static RFs fileServerSession; //this should be moved into a symbian file engine if/when one is written -#endif }; QT_END_NAMESPACE |