45 Commits

Author SHA1 Message Date
Nyall Dawson
75355386c2 Add helper methods to get filename from content disposition headers 2022-06-20 13:01:55 +10:00
Nyall Dawson
0f4f5cd2cc Description for QgsNetworkContentFetcherTask can be customised 2022-06-20 13:01:55 +10:00
bdm-oslandia
9b0bb2ffb5 add tests and fix spellcheck (compatiblity by compatibility) 2022-06-09 10:05:15 +10:00
bdm-oslandia
60db820f19 Replace all use of 'referer' http header as single var by QgsHttpHeader class
* add wrappers in QgsHttpHeader to read from/write to QMap, QUrlQuery, DomElement
* add QgsHttpHeader in QgsDataSoureUri, QgsXyzConnection, QgsVectorTileProviderConnection::Data, QgsWmsAuthorization
* fix tests
2022-06-09 10:05:15 +10:00
bdm-oslandia
cb436fe3d6 Fixes for bad key names
* fix QgsHttpHeaders:
  * when key contains double //
  * clean old sub group before adding new key to avoid duplicate

* fix QgsHttpHeaderWidget:
  * QTableWidgetItem flags for value was not set
  * call to QTableWidget edit function fail
  * table was not cleaned properly when adding entries

* fix QgsHttpHeaders test
2022-06-09 10:05:15 +10:00
bdm-oslandia
ed0236782d Fix issue #48532
* add constructor without QgsSettings, using default
* add new const QgsHttpHeaders::KEY_REFERER
* add test for QgsOwsConnection
* QgsOwsConnection:
  * fix usage of "referer" by using QgsHttpHeaders
  * replace "qgis/" prefix by QgsSettings::Prefix::QGIS
2022-06-09 10:05:15 +10:00
uclaros
bb767336e7 fix docstrings 2022-06-08 09:41:57 +10:00
Nyall Dawson
eeb444948f Add mechanism for python clients to setup custom QNetworkReply
preprocessors

Since it's not possible to overwrite
QgsNetworkAccessManager::createRequest, the normal Qt approach for
adding custom handling for replies is not possible. This new API
adds a QgsNetworkAccessManager.setReplyPreprocessor() method
which allows clients to add a custom reply preprocessor for implementing
their own logic for replies.

For example:

    def _on_ready_read(reply):
        print(reply.peek(reply.bytesAvailable()))

    def _my_preprocessor(request, reply):
        if reply.operation() == QNetworkAccessManager.PutOperation:
            reply.readyRead.connect(partial(_on_ready_read, reply))

    QgsNetworkAccessManager.setReplyPreprocessor(_my_preprocessor)

Fixes #48169
2022-05-02 12:31:42 +10:00
bdm-oslandia
61519ec834 remove dead code, fix comment, fixes from review
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2021-12-02 11:16:53 +10:00
bdm-oslandia
c1582ce1c3 fix: indent, doc, typo 2021-12-02 11:16:53 +10:00
bdm-oslandia
345dd4dd87 fix: replace referer http header by dedicated class QgsHttpHeader 2021-12-02 11:16:53 +10:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
ef84e48a09 Run sipify_all.sh 2021-10-12 16:34:05 +10:00
Denis Rouzaud
ec16736306 run sipify 2021-10-12 16:34:05 +10:00
Etienne Trimaille
8b18399704 Add a POST parameter in the FileDownloader processing algorithm 2021-09-03 11:35:46 +10:00
Julien Cabieces
ff08ad4733 adds finished signal and deprecates downloadFinished 2021-08-24 11:04:26 +02:00
Julien Cabieces
0034f4922d fix spellcheck typos 2021-08-23 17:35:54 +02:00
Julien Cabieces
96eb75a118 [ExternalStorage] add WebDAV external storage implementation 2021-08-23 17:35:52 +02:00
Julien Cabieces
56acee931d Add enum ActionStart 2021-07-30 10:18:38 +02:00
Denis Rouzaud
6967406aca
move QgsNetworkContentFetcherRegistry::FetchingMode to Qgis (#44397) 2021-07-27 08:19:41 +00:00
Marco Hugentobler
2b97162c23 Since QGIS 3.22 2021-06-21 11:31:48 +02:00
Marco Hugentobler
a7739d9727 Add doc 2021-06-21 11:31:48 +02:00
Marco Hugentobler
7ec671a88e Spell check 2021-06-21 11:31:48 +02:00
Marco Hugentobler
ee17ca8ef1 Fix sip code 2021-06-21 11:31:48 +02:00
Marco Hugentobler
6221754e6c Use preprocessed URLs for QgsTileCache tile keys and add unit test for QgsNetworkAccessManager::setRequestPreprocessor 2021-06-21 11:31:48 +02:00
Marco Hugentobler
307bce8f0d Add QgsNetworkAccessManager::setRequestPreprocessor 2021-06-21 11:26:14 +02:00
Sandro Mani
d17071070f Synchronize cookie jar between all running QgsNetworkAccessManager instances 2021-06-20 07:59:26 +10:00
nirvn
8647ec54d6 Address review 2021-05-15 15:40:19 +07:00
nirvn
1e47ca1a6c [network access manager] handle abortion of browser login request 2021-05-15 13:59:06 +07:00
Damiano
810af987d3 Removed setting entries from the python api 2021-04-29 11:18:55 +02:00
Damiano
1def5e7b94 Python QgsSettingsEnum and Flag unified in QgsSettingsEnumFlag 2021-04-26 15:10:53 +02:00
Damiano
95dfe0f45c Removed settings struct 2021-04-26 15:07:21 +02:00
Damiano
00a7936389 Moved most core settings to SettingsEntry 2021-04-26 15:04:07 +02:00
Mathieu Pellerin
0a76d70e9c Address comments 2021-04-22 09:40:17 +07:00
nirvn
584283ddaa [oauth2] Handle the opening and closing of browser through the network authentication
handler
2021-04-22 09:32:01 +07:00
NEDJIMAbelgacem
b01deeb156 revert qgsfiledownloader changes 2021-04-08 14:26:31 -07:00
NEDJIMAbelgacem
e870065342 initial implementation of remote ept 2021-04-08 14:26:31 -07:00
Matthias Kuhn
1a59efb177 [qt6] Qt6 uses utf-8 by default
for QTextStream and QSettings
2021-03-28 06:28:35 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
c6370c7f52
Speed up QGIS compilation by removing all Qt Module-wide includes
Refs https://www.kdab.com/beware-of-qt-module-wide-includes/
2021-03-05 11:23:15 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
36f68e4fc9 Add mechanism for temporarily disabling all network caching
to QgsNetworkAccessManager, and add a checkbox in the network
logger panel to allow users to temporarily disable the network cache

This can be VERY useful when debugging QGIS network activity, or when
using QGIS to test server side changes.

This is a transient setting only, and is forgotten as soon as QGIS
is closed. That's by design -- we don't want users to accidentally
leave this enabled and cause unnecessary server load.
2021-01-20 09:28:16 +10:00
nirvn
a84647cf30 follow up ab0eba2 : crash-free implementation 2021-01-19 14:53:53 +07:00
nirvn
ab0eba218c [processing] Fix file download algorithm's temporary file missing proper extension 2021-01-18 08:35:05 +10:00
Nyall Dawson
a9c80e5740 Code shuffle
Move vector, project and network related core .cpp/.h files into
dedicated subdirectories.

An attempt to organise src/core better to make things easier to find.
2020-12-29 11:38:11 +10:00