diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-12-07 16:03:09 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-12-07 16:35:19 (GMT) |
commit | 8adba785c8b68b9fdc98b51ecf317e17ad145d13 (patch) | |
tree | d955f0e48ec66811fbbe85239d7f71bd2018707a /src/corelib | |
parent | 443d9e8a951ead746bd92ddb3835cd9cd63a063b (diff) | |
download | Qt-8adba785c8b68b9fdc98b51ecf317e17ad145d13.zip Qt-8adba785c8b68b9fdc98b51ecf317e17ad145d13.tar.gz Qt-8adba785c8b68b9fdc98b51ecf317e17ad145d13.tar.bz2 |
default RConnection for sockets
Bearer pushes RConnection into QtCore.
QSocket can pull this RConnection back out when it needs to open an RSocket
(potentially this can be removed again later if QSocket is made
QNetworkSession aware)
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qcore_symbian_p.cpp | 12 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_symbian_p.h | 16 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp index b6688f7..ede8464 100644 --- a/src/corelib/kernel/qcore_symbian_p.cpp +++ b/src/corelib/kernel/qcore_symbian_p.cpp @@ -217,7 +217,7 @@ Q_CORE_EXPORT RFs& qt_s60GetRFs() } QSymbianSocketManager::QSymbianSocketManager() : - iNextSocket(0) + iNextSocket(0), iDefaultConnection(0) { TSessionPref preferences; // ### In future this could be changed to KAfInet6 when that is more common than IPv4 @@ -290,6 +290,16 @@ bool QSymbianSocketManager::lookupSocket(int fd, RSocket& socket) const { return true; } +void QSymbianSocketManager::setDefaultConnection(RConnection* con) +{ + iDefaultConnection = con; +} + +RConnection* QSymbianSocketManager::defaultConnection() const +{ + return iDefaultConnection; +} + Q_GLOBAL_STATIC(QSymbianSocketManager, qt_symbianSocketManager); QSymbianSocketManager& QSymbianSocketManager::instance() diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index 8ffa247..d5d10ef 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -172,7 +172,7 @@ public: } bool operator<(const QHashableSocket &other) const { - if(Session().Handle() == other.Session().Handle()) + if (Session().Handle() == other.Session().Handle()) return SubSessionHandle() < other.SubSessionHandle(); return Session().Handle() < other.Session().Handle(); } @@ -230,6 +230,19 @@ public: /*! \internal + Set the default connection to use for new sockets + \param an open connection + */ + void setDefaultConnection(RConnection* con); + /*! + \internal + Get the default connection to use for new sockets + \return the connection, or null pointer if there is none set + */ + RConnection *defaultConnection() const; + + /*! + \internal Gets a reference to the singleton socket manager */ static QSymbianSocketManager& instance(); @@ -243,6 +256,7 @@ private: QHash<int, RSocket> reverseSocketMap; mutable QMutex iMutex; RSocketServ iSocketServ; + RConnection *iDefaultConnection; }; QT_END_NAMESPACE |