summaryrefslogtreecommitdiffstats
path: root/src/network/bearer
Commit message (Collapse)AuthorAgeFilesLines
* Short live qt_unique_lock/qt_scoped_lock! (until C++17)Marc Mutz2019-08-132-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that QRecursiveMutex is getting split off of QMutex, QMutexLocker will stop working on QRecursiveMutex once the split has been finalized in Qt 6. Even today, QMutexLocker contains casts from QBasicMutex to QMutex that some reviewers are uncomfortable with. One way to carry QMutexLocker forward is to template it on the mutex type, possibly with aliases like QBasicMutexLocker and QRecursiveMutexLocker. C++17 code would then not require a port, thanks to CTAD. But we have the problem now, and we can't template QMutexLocker in Qt 5. The alternative is to look at std and realize that they have surpassed QMutexLocker in expressiveness already. A scoped_lock cannot be unlocked again, a unique_lock can be moved around. QMutexLocker doesn't do either. The only "problem" is that the std lock classes are already templates, but we can't, yet, rely on C++17 CTAD to make them look as if they weren't. So, prepare for a future with C++17 CTAD by writing factory functions, qt_scoped_lock and qt_unique_lock, which will later port mechanically to their C++17 equivalents (mostly). The functions are added to a new private qlocking_p.h becauee we don't want to make them public. These are for use in Qt's own implementation, or for users that don't care about compatibility and will not mind them to be removed once we depend on C++17. Originally, I planned to use qmutex_p.h instead, but that header is not self-contained and causes build errors when we started to include it into libraries other than QtCore. Regarding the return value of qt_scoped_lock: Ideally, we'd like to return a std::scoped_lock, but two things stand in the way: First, scoped_lock was only added in C++17 (we fall back to lock_guard if scoped_lock is not available). Second, returning one from a function requires C++17 guaranteed copy elision, because neither scoped_lock not lock_guard have a copy ctor. In order for code not to come to depend on a particular lock class, we return any of lock_guard, unique_lock or scoped_guard, depending on what the compiler supports, and therefore wrap the functions in the unnamed namespace to avoid running into ODR if (private) headers are used from different projects (autotests, e.g.). By the time we can drop them, however, qt_*_lock will be semantically 100% identical to their replacements. Port some initial users. Change-Id: I2a208ef2a4a533ee8e675812273986460e6b4d00 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedNetworkSessionManager: prune expired QNetworkSessionsMarc Mutz2019-07-191-0/+14
| | | | | | | | | | | | | | | | | | | | | Equality for QNetworkConfiguration is defined by identity of the Private object, so even if there are QNCs with the same properties, they will not compare equal. This probably happens when a user roams through different WLANs (e.g. from work via public transport to home and then back), and each time the home WLAN pops up, it will beget a new QNetworkConfiguration, not comparing equal to the previous one. So, over time, we might collect a sizeable amount of QNetworkConfiguration objects just sitting in the cache without ever being able to actually use an associated network session, because they all have long since expired. To fix, prune expired network sessions, and thus their associated QNetworkConfigurations, from the cache. To not run every time, prune only when this size of the cache is larger than 16 (arbitrary number). Change-Id: I11a636f45ccf67420f84b1c79a4453a144de7c5c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork: bearer: port from QMutex::Recursive to QRecursiveMutexMarc Mutz2019-07-066-8/+7
| | | | | | Change-Id: I691ecbaf9ea0796decbb48fd62b25d0a2941d979 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QBearerEngine: fix const-correctness of a loop with const-propagating QESDPMarc Mutz2019-06-271-2/+1
| | | | | | | | | | | | | | | | | | The loop iterates over a collection of QExplicitSharedDataPointer, which traditionally doesn't propagate const. In Qt 6, it will, so prepare the code for this change, by taking the loop variable by non-const reference. Since the loop is followed by container.clear(), make it a consume-loop by looping over qExchange(container, {}). Change-Id: If12ab005544183598fd76a0c486b2df1582710d5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-252-14/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/android/qandroidinputcontext.cpp src/widgets/styles/qstylesheetstyle.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
| * Fix crash when app is going to shutdown but conf manager is requestedVal Doroshchuk2019-06-122-14/+16
| | | | | | | | | | | | | | | | | | | | If the app is finished and going to shutdown, qNetworkConfigurationManagerPrivate() returns nullptr. Change-Id: I01915021d8698802b3a1d0dee43203cd3d4aba74 Task-number: QTBUG-76090 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QNetworkConfiguration: remove unused member 'serviceNetworkMembers'Marc Mutz2019-06-142-35/+1
| | | | | | | | | | | | | | | | | | It's never set anywhere, neiher in QtBase nor in any other Qt module. So, remove. Change-Id: If616d350a1c1c74f6f3e87f8cd98ccb3bff5cf70 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | QSharedNetworkSessionManager: clean upMarc Mutz2019-05-282-23/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under no circumstance must Qt code define a non-public qHash() overload of a public Qt type. If you can't provide a public qHash() for the type, you can't use QHash. Period. This is because if we don't provide a qHash() function, the user will have to provide one, and then we have an ODR violation, iow: UB. So, port away from QHash and qHash and use std::unordered_map, which allows to pass a custom hash function - just what we needed. Also fix other issues of the code: - Use a function object as the deleter of the QSharedPointer, to allow inlining the function call. - Avoid double lookup in case of a cache miss. - Don't use direct initialization syntax for pointer variables. That's just ... weird. Change-Id: Ica8bff728c1bd1cbb2fb43aa03a99bcb7ac2f7cc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-05-011-2/+0
| | | | | | | | | | | | | | | | Remove remaining handling of missing support for rvalue refs. Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-041-2/+2
| | | | | | | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | More nullptr usage in headersKevin Funk2019-03-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-121-1/+1
|/ | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QNetworkConfiguration: add missing timeout unit to setConnectTimeout docSamuel Gaist2018-12-011-0/+2
| | | | | Change-Id: I3738e989a41607244b55245222ec3c83dda68198 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-151-19/+2
| | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-023-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-303-5/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/win32-g++/qmake.conf src/corelib/global/qglobal_p.h src/corelib/global/qoperatingsystemversion_p.h src/corelib/io/qfilesystemengine_win.cpp src/network/bearer/qbearerengine.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qfusionstyle.cpp tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
| | * fix namespaced buildOswald Buddenhagen2017-12-143-6/+6
| | | | | | | | | | | | | | | Change-Id: Ibd16658ef800afe1dec01311cc4ef1a9a6d83929 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | bearermanagment: fix build for --no-feature-bearermanagementLorn Potter2017-12-191-2/+1
| | | | | | | | | | | | | | | Change-Id: I9e3f44b924e09a8d1a5095dc55d585b3cab33c15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* / Typo-fix: s/looses/loses/gEdward Welbourne2017-06-081-1/+1
|/ | | | | | | | | | | | | When an archer lets go of the bow-string, she looses an arrow; when the hounds are straining at their leashes and the handler lets go, he looses the dogs. It's archaic usage now; we'd normally say "lets loose", "lets go" or "releases". In any case what was meant here was that something got lost; a widget loses focus or a network loses its connection. Change-Id: Ic1fbe9e1f76185bcb7caf034d6be97ebfeb2e270 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-161-4/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
| * QNetworkSession - register types before connecting slotsTimur Pocheptsov2017-02-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QNetworkSession's ctor has a race condition: it 1) connects signals/slots and also 2) registers meta-types (but after these connects). Our users apparently have a lot of per-thread QNAMs in multiple threads (and implicitly many QNetworkSessions on different threads too). From error logs it appears that while one thread tries to connect signals/slots and evaluates the types of signal and slot arguments, another thread can register this type. If the first thread extracted signal argument types, then the second registered this type, we can end up in a 'type mismatch' error on the first thread with seemingly the same types in a debug message (something like "type mismatch A::Some <-> A::Some") - they have the same name, but one has type() == 0 and another - some non-zero type(). Now we call qRegisterMetaType before connect. Task-number: QTBUG-50901 Change-Id: Idbb9515573e174bbc5e5bf55dc3a7911a81646ea Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/devLiang Qi2017-01-262-4/+5
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-252-4/+5
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/common/msvc-version.conf mkspecs/common/winrt_winphone/qmake.conf mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/qt.prf mkspecs/features/uikit/default_post.prf mkspecs/features/winrt/default_pre.prf mkspecs/winphone-arm-msvc2013/qmake.conf mkspecs/winphone-x86-msvc2013/qmake.conf mkspecs/winrt-arm-msvc2013/qmake.conf mkspecs/winrt-x64-msvc2013/qmake.conf mkspecs/winrt-x86-msvc2013/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/gui/kernel/qwindowsysteminterface.cpp src/network/kernel/qhostaddress.cpp src/plugins/platforms/mirclient/qmirclientplugin.cpp src/plugins/platforms/mirclient/qmirclientplugin.h src/widgets/util/qsystemtrayicon.cpp tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp tools/configure/Makefile.mingw tools/configure/Makefile.win32 Done-with: Jake Petroules <jake.petroules@qt.io> Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
| | * Make the bearer QFactoryLoader a member variable, not a staticThiago Macieira2016-12-172-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because it was a function-level static, the QFactoryLoader was getting destroyed out-of-sync with the bearer thread stopping. Under normal conditions, the thread stopped first (~QApplication / ~QCoreApplication via qAddPostRoutine), and the static got destroyed when the process exited. However, if QApplication leaked or if the destruction order is wonky (as seen in PyQt5), the thread could still be running when the plugins were already unloaded. With the loader a member variable, it gets destroyed when the thread stops. Note: in Qt 5.7, QFactoryLoader no longer unloads the plugins (since commit 494376f980e96339b6f1eff7c41336ca4d853065), so this crash cannot happen in that version. [ChangeLog][QtNetwork][Bearer management] Fixed a bug that could cause a crash on application exit, depending on the order of destruction of the QCoreApplication object and the QtDBus manager thread. Task-number: QTBUG-56228 Task-number: QTBUG-52988 Change-Id: I33dc971f005a4848bb8ffffd147853376f82de2a Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Fix some qdoc-warnings for 5.9Friedemann Kleint2017-01-251-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/global/qoperatingsystemversion.cpp:119: warning: Cannot find 'QOperatingSystemVersion(...)' in '\fn' QOperatingSystemVersion::QOperatingSystemVersion(int maj, int min, int mic) qtbase/src/corelib/io/qdir.cpp:1852: warning: Unknown command '\p' qtbase/src/corelib/kernel/qabstracteventdispatcher.cpp:482: warning: Cannot find 'registerEventNotifier(...)' in '\fn' bool QAbstractEventDispatcher::registerEventNotifier(QWinEventNotifier *notifier); qtbase/src/corelib/kernel/qabstracteventdispatcher.cpp:495: warning: Cannot find 'unregisterEventNotifier(...)' in '\fn' bool QAbstractEventDispatcher::unregisterEventNotifier(QWinEventNotifier *notifier); qtbase/src/corelib/global/qoperatingsystemversion.cpp:268: warning: Can't link to 'macro()' qtbase/src/corelib/global/qoperatingsystemversion.cpp:296: warning: Can't link to 'typeName()' qtbase/src/corelib/io/qdir.cpp:1845: warning: Undocumented parameter 'filters' in QDir::isEmpty() qtbase/src/corelib/kernel/qobject.cpp:1636: warning: No such parameter 'interval' in QObject::startTimer() qtbase/src/network/bearer/qnetworkconfiguration.cpp:343: warning: Undocumented parameter 'timeout' in QNetworkConfiguration::setConnectTimeout() qtbase/src/gui/kernel/qoffscreensurface.cpp:337: warning: Undocumented parameter 'handle' in QOffscreenSurface::setNativeHandle() qtbase/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc:109: warning: Unknown command '\role' qtbase/src/widgets/util/qundostack.cpp:727: warning: Command '\li' outside of '\list' and '\table' ... Change-Id: I57bff895a8e1afd94b582a6a72a06771514ee27e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* / Add configurable connect timeout for QAbstractSocketSamuel Gaist2016-11-293-1/+46
|/ | | | | | | | | | | | | | The aim of this patch is to allow the configuration of the connect timeout used by QAbstractSocket that is currently hardcoded to 30 seconds. Using QNetworkConfiguration for this allows to adapt the timeout per network configuration (e.g. 2G vs wired lan) [ChangeLog][QtNetwork] The connect timeout from QAbstractSocket is now configurable through QNetworkConfiguration. Change-Id: I1dc4051be2c74f925f7a9e0a9ccef332efc2e370 Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-011-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-171-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/macx-ios-clang/features/resolve_config.prf src/testlib/qtestcase.qdoc Change-Id: Icefa63056ffb37106f35299a8f19165535571799
| | * QNetworkSession: make sure that "interface" isn't #definedThiago Macieira2016-10-131-0/+5
| | | | | | | | | | | | | | | | | | | | | Depending on #include order isn't a good idea. Change-Id: Ief935e1fcc5d40ecb510fffd147c08dffe6cba2d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Add qtnetworkglobal.h and qtnetworkglobal_p.hLars Knoll2016-07-039-1/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. That header will later on #include the configuration file for Qt Network. For now it defines the Q_NETWORK_EXPORT macro for this library. Change-Id: I9c45d425baf881c431ed71fd457c7feb2c123855 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QtNetwork: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-05-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I42c9c44d948ab1512a69d42890187bc3cf2d7e58 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtNetwork: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-04-251-25/+7
| | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I47c5308a6ad220b4c5495e55a3b0d38547bfa8d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtNetwork: eradicate Q_FOREACH loops [already const]Marc Mutz2016-04-251-9/+8
| | | | | | | | | | | | | | | | | | | | | | ... (or trivially marked const) local variables or parameters, by replacing them with C++11 range-for loops. Also ported one indexed loop. Change-Id: Idddcac48ce7527b1ea674671ceb9aaf4d31fb42e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtNetwork: replace Java-style iteratorsAnton Kudryavtsev2016-04-191-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... with STL-style iterators or with algorithms. Java-style iterators have overhead. Introduce local template separate_if algorithm from kleopatra project to simplify current code. http://api.kde.org/4.3-api/kdepim-apidocs/kleopatra/html Done-with: Marc Mutz <marc.mutz@kdab.com> Change-Id: Ib154f80f46f8041d9cafd81bed0e1982b21541cf Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-131-0/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/testlib/qtestcase.cpp src/testlib/qtestcase.qdoc Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
| * Delete the dangling generic engine object.Weng Xuetian2016-04-081-0/+2
| | | | | | | | | | | | Change-Id: I7d7531f1a678bf186e3a992091344fff64721dec Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QtNetwork: optimize container usageAnton Kudryavtsev2016-03-032-13/+17
| | | | | | | | | | | | | | | | | | Don't perform lookup twice. Just cache iterator or position. Change-Id: I454fd292614dee62167ff248fc3ddec0f79435b0 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QBearerEngine: break out repeated loops as methods.Anton Kudryavtsev2016-03-031-45/+25
| | | | | | | | | | | | | | | | | | | | Three hashes are handled similarly; so extract the loops over them as methods hasUsedConfiguration() and cleanUpConfigurations() to avoid duplicate loop code. Change-Id: I1040724c4fc98caa48913fac339c03e60b04bae2 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Drop most "#ifndef QT_NO_LIBRARY"Ulf Hermann2016-02-081-4/+0
| | | | | | | | | | | | | | | | | | As we can load plugins without QLibrary now, we don't have to #ifdef out the code that does so anymore. Change-Id: I1dc20216830a882dbd5a1b431183407e6b19c837 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-1516-224/+320
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Minimal fix for network-manager problem on plugin unload.Edward Welbourne2016-01-121-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the problem as long as we have C++ 11's semantics for in-function statics. The Q_GLOBAL_STATIC_WITH_ARGS() is a non-trivial wrapper whose destructor gets unloaded with the plugin, leading to a crash-on-exit if the global it wraps outlives the plugin. The plain (in-function) static manages to avoid this by avoiding the wrapper. As the static was only needed in one place, this proves a sufficient solution to the plugin-unload problem *in this case*. Task-number: QTBUG-45891 Change-Id: I599fbee0b55ece4dceb4bf7202db374b507f5388 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use qEnvironmentVariableIntValue() instead of qgetenv().toInt().Sérgio Martins2015-12-181-2/+2
| | | | | | | | | | | | | | It's much faster. Change-Id: I55e0a23f9086fe2e7872e81dc0f5e10105ed124a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | network: Pass types with copy-ctor or dtor by const-refSérgio Martins2015-12-133-5/+5
| | | | | | | | | | Change-Id: I7bea3e03bff6f424b02335476211dd466ce4d720 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Remove remaining support for BlackberryLouai Al-Khanji2015-11-212-114/+0
|/ | | | | | | | | The platform is no longer supported or actively maintained, and is in the way for improvements to the Unix event dispatcher and QProcess implementations. Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add an option to skip the generic bearer engineTimur Pocheptsov2015-09-221-2/+10
| | | | | | | | | Add an option to skip a generic bearer engine if needed (by testing environment variable QT_EXCLUDE_GENERIC_BEARER). Task-number: QTBUG-41866 Change-Id: I1b53ed1d22a7b34de5c6f6d0386ed242b2ca5e00 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>