summaryrefslogtreecommitdiffstats
path: root/src/plugins/networkinformation
Commit message (Collapse)AuthorAgeFilesLines
* QNI: Windows support for the isMetered APIMårten Nordheim2021-11-083-18/+36
| | | | | | | | | As a drive-by: fix some improper indentation Task-number: QTBUG-91024 Change-Id: I29e04aff3638dfb2aab9d40650c55a48baba7222 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNI NetworkManager: Extract Method primaryConnectionDevicePath()Marc Mutz2021-11-042-5/+15
| | | | | | | Avoids duplication of complex code (RB tree lookup). Change-Id: I70ac7095b05ee56cdf7c86dd1d1a7c9c3232c9d4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNI NetworkManager: Small refactorings and correctness fixMårten Nordheim2021-11-043-25/+20
| | | | | | | | | | Extract and reuse a lambda for initialization and slot object. Pass a QDBusObjectPath parameter by const-ref. Avoid implicit ascii-to-utf16 string conversion. Change-Id: I591ae6e58e010ccabcf9012db866949492e0191d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QNI: networkmanager support for the isMetered APIMårten Nordheim2021-11-043-15/+79
| | | | | | | Task-number: QTBUG-91024 Change-Id: I25ac05adbcbfa92a98fe1e9db9ac931e5c340fcd Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNI: Android support for isMeteredMårten Nordheim2021-11-044-6/+13
| | | | | | | Task-number: QTBUG-91024 Change-Id: I7a8fdcddc25fdb60390b424a888d0311afd8cef3 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNI: transportMedium support for iOSMårten Nordheim2021-10-291-1/+47
| | | | | | | | | | | | | | It can only differentiate between cellular and not cellular and then we can determine if it's disconnected or (presumably) using wifi. It is also explicitly not supported on macOS, which adds to the confusion. Task-number: QTBUG-91023 Change-Id: I1d002ba06dd9acf1a0daabfb2a4193c07871e9b4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add a QNetworkInformation backend based on GNetworkMonitorIlya Fedin2021-10-243-0/+175
| | | | | | | | | | GNetworkMonitor can get information from 3 sources: * org.freedesktop.portal.NetworkMonitor * NetworkManager * netlink Change-Id: Icfafe6af42148f26360449f1262093ffc6b0613a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNI: Add a convenience method for loading the default pluginMårten Nordheim2021-10-224-13/+27
| | | | | | | | | We have some official plugins, we may as well treat them as default and give a convenient function which loads those. Change-Id: I6251c77ac042b795bcf24b86e510e960ee4bab54 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNI: Windows: support transportMediumMårten Nordheim2021-10-204-1/+102
| | | | | | | | | | | | | Brings support for transportMedium to NetworkListManager backend. Which, with this patch, also uses winrt API because there is no equivalent API available in NLM. This API is so much nicer than NLM... Task-number: QTBUG-91023 Change-Id: I360a3a197caa2aa4848c8f768aea6a09a68b0ed5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Android: remove unused imports and fix warning on network java codeAssam Boudjelthia2021-10-121-3/+2
| | | | | | Pick-to: 6.2 Change-Id: Ifa69c04f7f2e75751b6f8a157d04f3870f0c0eb1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNI: Windows: Remove unneeded friendMårten Nordheim2021-10-081-2/+0
| | | | | | Change-Id: I5d66a67a5c16a479f62b9f43cb769d5ee5f66b60 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNI: NetworkListManager: Extract the Events classMårten Nordheim2021-10-074-186/+285
| | | | | | | Moving the class out makes it easier to navigate the code Change-Id: I8de67641512a7dbbf6446cdca9d8dea79a63c217 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNI:NetworkManager: Update dbus interface usageMårten Nordheim2021-10-072-6/+12
| | | | | | | | | | | | | | | | We were using the non-standard interface for PropertiesChanged, and support for this was dropped in a Network Manager update earlier this year[0]. Switch to using the standard interface. [0] https://networkmanager.dev/blog/networkmanager-1-32/ Pick-to: 6.2 Change-Id: Ibdf2b635ae13a3150c4d2faa028c15c70c8af5ca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
* QNetworkInformation: support transportMedium with NetworkManagerMårten Nordheim2021-10-073-6/+135
| | | | | | | Task-number: QTBUG-91023 Change-Id: Ie50e29ec321768ec6d0358d96a8c36b9b7cb10ba Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNI:Android: unify behavior of callbacksMårten Nordheim2021-10-074-46/+35
| | | | | | | | | | | | The first callback added for the android backend does not have the value as a parameter which is something the other callbacks have. Change it so it does. And promote the lambda to a real function. Change-Id: I06f10f7c79f33a5ea3154f2fc6d20d550cd7eca7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInformation: add support for transportMedium on AndroidMårten Nordheim2021-10-074-3/+124
| | | | | | | | | | | | | | | | | | | | It's part of the capabilities which we are already using. It also lets us work around a pre-existing edge-case where, if you have a VPN enabled and enable Airplane mode it will continue to tell you it is Online even when it is not. This happens because VPN is reported as a transport and when Airplane mode is enabled it may be left enabled as the _only_ transport. At the same time clear the default filters (if any), and filter out suspended connections. May not necessarily make any difference. And add a comment for why we cannot use a technically more suitable type of callback. Task-number: QTBUG-91023 Change-Id: Ic26c4d4e8da139ec8606a0b1bf5fb7157bd0beaf Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Android: Update and add missing gradle files for jar foldersAssam Boudjelthia2021-10-063-0/+60
| | | | | | | | | | | | Update the build.gradle for main Qt jar code, and add same files for network and network information backend, so the code can be managed from Android Studio. This also adds .gitignore to ignore Android Studio build artefacts. Pick-to: 6.2 Change-Id: Ic06e9d12708070fad112f17e58b8754608d184f3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkInformation: refactor NetworkManager backend a littleMårten Nordheim2021-10-051-12/+10
| | | | | | | | | Using individual booleans to track that the value had changed was not necessary. Change-Id: Ieb4712776339aa78bdc75d7608fd74f96d19bbae Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInfo(Win): cleanupsMårten Nordheim2021-09-201-4/+3
| | | | | | | | | One signal emission was not labelled emit. Removed some unnecessary braces Change-Id: I1c0adde869e559056e60671619bfca33b1966d1e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* TLS plugins: Prefix with 'q'Mårten Nordheim2021-08-304-4/+4
| | | | | | | | For consistency with other plugins. Pick-to: 6.2 Change-Id: I45507389a42e645c94f1ca3f32262a2181f282f7 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Rename qt6_add_plugin TYPE option to PLUGIN_TYPEAlexandru Croitor2021-08-064-4/+4
| | | | | | | | | | | | | The intention is to remove TYPE as a keyword completely before 6.2.0 release, but in case if that's not possible due to the large amount of repositories and examples, just print a deprecation warning for now and handle both TYPE and PLUGIN_TYPE. Task-number: QTBUG-95170 Pick-to: 6.2 Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix incorrect default plugin conditions on WindowsAlexandru Croitor2021-07-221-1/+1
| | | | | | | | | | | | | | The correct variable to check is WIN32 rather than WINDOWS. This affects which plugins get automatically linked in a static Qt build. Amends a3b58a7844f77bd416fad8307f8333ff7c0efacf Amends d385158d5213ef568b7629e2aa4a818016bbffac Pick-to: 6.1 6.2 Fixes: QTBUG-95283 Change-Id: Idf78c78a1029f4d13fb460c07bef3d2669e55b09 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Don't give plugins PUBLIC usage requirements part 2Alexandru Croitor2021-07-152-2/+2
| | | | | | | | | | | | | Plugins shouldn't have public usage requirements. Amends 434ada8dcb6132b3a597ea56b57a66c627f51728 Pick-to: 6.2 Task-number: QTBUG-90819 Change-Id: Iffb3def07ea428b1c3c5b9873e259a4d5168b7a1 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Don't give plugins PUBLIC usage requirementsJoerg Bornemann2021-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | The pro2cmake.py conversion script faithfully reproduced the .pro files for the plugins, which specified the libraries as public. But in CMake, the implications of this are that public usage requirements should then be propagated to consumers. We don't expect any consumers, since a plugin is created as a MODULE library in CMake, so for Windows we don't even have an import library to link with. The only exception to this is for static builds where plugins are created as STATIC libraries instead, but only in certain controlled situations do we then link to plugins. Even then, usage requirements are not expected to propagate to the consumers, so these relationships should always be specified as private. Pick-to: 6.2 Task-number: QTBUG-90819 Change-Id: Ibc7c2bcd3b6a9dc77df40c4c0c22ff254a80f33d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QNetworkInformation: Rename the plugins and typeMårten Nordheim2021-06-1114-0/+1609
To better match other plugins in Qt Pick-to: 6.2 Change-Id: I6ab19603f13c80a8afe4fe69f64669559a0eea15 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Yuhang Zhao <2546789017@qq.com>