summaryrefslogtreecommitdiffstats
path: root/src/network/bearer
Commit message (Collapse)AuthorAgeFilesLines
* QtNetwork: declare some classes as sharedMarc Mutz2012-08-231-0/+2
| | | | | Change-Id: Ib3eaba59836529ad0cf8e4353b54dd0cd31fd1ad Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* QtNetwork: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-253-2/+7
| | | | | | | | | | | | | | | | | Using the nullary version has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. It also ensures that Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T") will happily register anything. So I've added the macro where it was missing, or moved it to a central place when it existed hidden. In tst_qnetworkreply, this became a bit tricky, because a private header is conditionally included, so moved the Q_DECLARE_METATYPE() into a conditional section, too. Change-Id: I71484523e4277f4697b7d4b2ddc3505375162727 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove obsolete or commented use of Q_DECLARE_METATYPE.Stephen Kelly2012-07-241-2/+0
| | | | | Change-Id: I15bc845801b9f84a9252a0092fbd69f0e1b3f4ea Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Avoid loading multiple bearer plugins of the same keyJiang Jiang2012-07-111-0/+5
| | | | | | | | There may be duplicated debug plugins, loading both will cause crash. Change-Id: Icc2a3643c318844bc7f2e149a6434e95de2449b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: add member-swap to shared classesMarc Mutz2012-07-062-0/+10
| | | | | | | | Implemented as in other shared classes (e.g. QPen). Change-Id: Ib3d87ff99603e617cc8810489f9f5e9fe054cd2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove QFactoryInterface from bearer pluginsLars Knoll2012-06-081-10/+1
| | | | | Change-Id: I8d6736e56f34f49041fff409d040634475eb0bf5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge branch 'docs-refactoring' into masterMarius Storm-Olsen2012-05-101-1/+1
|\ | | | | | | Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
| * Doc: Modularize QtNetwork documentation.Casper van Donderen2012-05-091-1/+1
| | | | | | | | | | | | | | This change moves the snippets and imagesto the modularized directories. Change-Id: If14912692a7f72d7de345eaf88d9ec9752310fca Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* | No longer use deprecated methods for plugin loading.Friedemann Kleint2012-05-091-8/+9
| | | | | | | | | | Change-Id: I19c66b1c41ea4dd236726c86d7d071b210ec9244 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Connect bearer engines to manager with QueuedConnectionShane Kearns2012-05-091-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to avoid a deadlock that happens when a user thread is accessing the QNetworkConfigurationManager at the same time the plugin emits a signal. i.e. plugin is holding engine lock user thread is holding manager lock and blocked trying to acquire the engine lock In the manager slot, it tries to acquire the manager lock. By using queued connection, there are no locks held at the time the manager slot is called. Change-Id: I95f28028b5e77f77b2b9b7e31cbd1b78a8fe3097 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* | The \enum should use the enum name not the flags.Richard Moore2012-05-081-1/+1
|/ | | | | | | Fixes a qdoc warning. Change-Id: Ia8cbad00902a27c24e14910cdc3a87a66839716b Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Document new APIs in 5.0Shane Kearns2012-05-031-0/+2
| | | | | | | | The \since 5.0 directive was missing from many places. Task-number: QTBUG-24001 Change-Id: I191ba8891ae66d78f923164bcab2fccb16eabef9 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Port QNetworkSession to QMetaMethod-based connectNotify()Kent Hansen2012-05-012-6/+11
| | | | | | | | The const char *-based API is deprecated and will be removed in Qt5. Change-Id: I36f6dc761e3b5a087e38db29b761c3e9237958b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Define usagePolicies API in QNetworkSessionShane Kearns2012-04-113-1/+57
| | | | | | | | | | | | | This allows the system to publish usage restrictions to applications related to the network in use. Currently there is only one restriction defined: NoBackgroundTrafficPolicy, which means that non user initiated traffic should be avoided (e.g. background downloads). For example this policy could be applied to save battery or data transfer charges. Change-Id: I49e26c0f3650d2b92f4ec51981aae9435b717b49 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-022-30/+30
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Name threads properlymae2012-03-021-0/+2
| | | | | | | | When there is no QObject subclass with Q_OBJECT macro, we must at least set an object name Change-Id: Ib429a9b246d9d6b4b4cfb11593e4f358850677f2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Use QBasicMutex instead of Q_GLOBAL_STATIC QMutexOlivier Goffart2012-02-011-2/+2
| | | | | | | | | | | | | | QBasicMutex is a POD and can be used as a static global object. in qpicture.cpp factoryLoader is used only once, and under the mutex, so there is no need for Q_GLOBAL_STATIC for it, it can be a function static in qhostinfo_unix.cpp the code seemed wrong while compiled with namespace and QT_NO_GETADDRINFO. I also could get rid of one include because it was included earlier. Change-Id: I3c700203c3e067266c20733f4bda8031446dbb86 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3016-16/+16
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* bearer: run the bearer engines in their own worker threadShane Kearns2012-01-253-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | The original architecture of the QtNetwork bearer support hosted the engines in the application's main thread, but this causes some problems. If the QNetworkConfigurationManager is constructed in a worker thread, then it is populated asynchronously without any notification when it is done (the app gets incomplete or missing results) Fixing that by restoring the earlier behaviour of using blocking queued connections to wait for the lists to be populated caused a regression, as some applications deadlock because the main thread is waiting on the worker thread at this time. By introducing a dedicated worker thread for the bearer engines, QNetworkConfigurationManager can be safely constructed in any thread while using blocking queued connections internally. Task-number: QTBUG-18795 Change-Id: Iaa1706d44b02b42057c100b0b399364175af2ddb Reviewed-by: mread (cherry picked from commit 5f879c55e531165cc2569b03c3796d0f33d0a0b7) Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Murray Read <ext-murray.2.read@nokia.com> Reviewed-by: Alex <alex.blasche@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-254-4/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove reference to Symbian in QtNetwork.Xizhi Zhu2012-01-241-2/+0
| | | | | | | Change-Id: Iae377505e36ae1239be7ce52c773dc2a4f4a9767 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2316-16/+16
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove the useless connManager() function.Xizhi Zhu2012-01-191-13/+8
| | | | | | Change-Id: Ifac0796ec22d0656ccfcf31b8d45b2342c2ee646 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: hjk <qthjk@ovi.com>
* Rename all our interfaces from com.trolltech to org.qt-projectLars Knoll2012-01-191-1/+1
| | | | | | Change-Id: I6db7211fcf6b24bd75e360645bbb2fdf1ef8a8bc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fix compiler warnings in Qt Network.Friedemann Kleint2012-01-191-2/+3
| | | | | | | | - Missing return value - Wrong format for qint64 Change-Id: Id0de58c85b7c8ed2a62f7237fd23e6c5a5ac92ec Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove QNetworkConfigurationPrivate::bearerTypeName().Xizhi Zhu2012-01-192-16/+9
| | | | | | | | | Also, use QStringLiteral instead of QLatin1String. Change-Id: I232fc02a56261929864c2ea66993ef1c74bc1237 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
* Remove the useless undef for "interface".Xizhi Zhu2012-01-191-4/+0
| | | | | | | | "interface" is not used by QNetworkConfiguration. Change-Id: I742fe179d415ab1424bfddb1f6c034fc98c55e61 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Add the missing Q_DISABLE_COPY for public bearer classes.Xizhi Zhu2012-01-192-0/+4
| | | | | | | | | | | QNetworkConfigurationManager and QNetworkSession are QObject, which should not be thought of as values that can be copied or assigned, but as unique identities. Change-Id: I6ff0124a613862c2b411da2df31f03d5033315a9 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove QNetworkConfiguration::bearerName().Xizhi Zhu2012-01-182-12/+0
| | | | | | | | | It was added only to maintain source compatibility with Qt Mobility. Change-Id: Iea8d40e401bd1f8d5115268e09b256eacca69ea0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0516-16/+16
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* network: remove Symbian specific codePeter Hartmann2011-11-143-62/+2
| | | | | | | | removes several files and cleans up the code, removing all Symbian specific #ifdef's etc. Change-Id: Ie457e54cb4b3a992f251383320d47822259c38f1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-271-3/+3
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the QNetworkConnectionManagerPrivate initialisation code.Thiago Macieira2011-10-062-22/+46
| | | | | | | | | | | | | | | | | | | | | | | | The current code was meant to be a thread-safe initialisation that also ran a couple of extra steps. But it wasn't. While it's ok to call qAddPostRoutine(), the call to updateConfigurations() was thread-unsafe. It is possible that another thread got the pointer to the Private before updateConfigurations() finished. So instead protect the initialisation with a mutex. It's possible that the value of the pointer becomes visible to other processors before the other contained values, so use atomics here. To call qAddPostRoutine safely from the main thread, use the trick of deleteLater() (which is thread-safe) in another thread connecting to a slot. Change-Id: If9bab88138755df95a791f34b0be8684207979d7 Reviewed-on: http://codereview.qt-project.org/5028 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Clean-up the macros about Qt Mobility in bearerLiang Qi2011-06-203-48/+3
| | | | | | | | | Remove the usages of QT_MOBILITY_BEARER, QTM_BEGIN_NAMESPACE and etc. Change-Id: I68e335c5caa65aa0aebe1a0db82d9633f1724556 Reviewed-on: http://codereview.qt.nokia.com/513 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix thread safety regression of QNetworkConfigurationManagerShane Kearns2011-05-262-2/+2
| | | | | | | | | | | | | Changes in 4.8 led to a timer being created in the wrong thread. I have restored the invokeMethod used to call startPolling() to solve this problem. Reviewed-By: mread (cherry picked from commit e9e95f75e7c1e8325c2acce0087ff8677d773779) Change-Id: I8b89fa89766679beb2d469f9bbd1f5e2233f061b Reviewed-on: http://codereview.qt.nokia.com/138 Reviewed-by: Markus Goetz
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-2416-273/+273
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Doc: Fixed qdoc warning.David Boddie2011-05-231-1/+1
|
* Fix QNetworkConfigurationManager usage outside main thread firstShane Kearns2011-05-091-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | QNetworkConfigurationManager creates the engines loaded from plugins as objects in the main thread. If a QNetworkConfigurationManager instance is created in a worker thread without any instance previously existing in the main thread, then it is uninitialised until the main thread has run. This causes allConfigurations() to return an empty list if called immediately after instantiation, for example. This fix initialises the plugins using blocking queued connections, which causes the worker thread to block until the initialisation function has been called in the context of the main thread. Deadlock is possible if the main thread is for some reason waiting on the worker thread, but it will not deadlock on QNetworkConfigurationManager's mutex. If this is a problem for an application, it should use QNetworkConfigurationManager from the main thread first to preload the plugins. Task-number: QTBUG-18795 Task-number: QTBUG-18799 Reviewed-by: Cristiano Di Flora
* QNetworkConfigurationManager: Fix network polling.Martin Petersson2011-05-022-2/+14
| | | | | | | | | | | | startPolling() is called by each engine, so before it would start multiple singleshot timers. So I moved the timer to the class and check if it has already been started before it is activated again. So that we just use one timer. Task-number: QTBUG-17219 Reviewed-by: Iiro Kause Reviewed-by: Kranthi Kuntala (cherry picked from commit 2506b86828ca8140c2f22d85a4378df40899b132)
* Initial import from the monolithic Qt.Qt by Nokia2011-04-2717-0/+3530
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12