53555 Commits

Author SHA1 Message Date
Nyall Dawson
54d6a6cffe Review comments 2019-01-28 15:21:40 +11:00
Nyall Dawson
0f0ee9bd51 More SSL error handling tests 2019-01-28 15:21:40 +11:00
Nyall Dawson
b23f08f270 Test ssl errors in background thread 2019-01-28 15:21:40 +11:00
Nyall Dawson
c707df7d15 Improve QgsNetworkAccessManager tests 2019-01-28 15:21:40 +11:00
Nyall Dawson
2e3a717e44 Make SSL error handling thread safe, avoid races and crashes when
SSL error occurs in non-main thread

This commit reworks how SSL errors are handled in QGIS. Previously,
ssl errors emitted by non-main thread QgsNetworkAccessManager instances
were handled by the main thread in QgisApp on next event loop. But
app (in the main thread) tried to pause the timeout timer for the
QNetworkReply containing the error, which doesn't work, because you
can't stop a timer in the main thread for a timer object created
in another thread. This meant that the reply could get deleted in
the background thread while the main thread was still using it
and waiting for users to respond to the SSL error. Now the timer
handling is done in the background thread's network access manager
instance, so in the thread matching the reply's timeout timer. We
then have to do some fancy thread locking using QWaitCondition,
because we need to "pause" that thread until the SSL error
is handled in the main thread -- if we don't pause the background
thread, Qt immediately resumes the QNetworkReply without ever
giving us the change to ignore ssl errors in the reply. Phew!

Additionally, the previous approach had a shortcoming in that
there was no way to notify background threads that ssl errors
had actually be handled. To do this we need a new signal which
can be fired after app has shown the ssl dialog and given users
a chance to respond. BUT... we can't safely do this -- if we
add a method to notify background threads when ssl errors have
been handled, then it CANNOT safely reside in app -- doing so
would break for QGIS server and QField etc, where theres no
app instance around to provide this notification. As a result
I've abstracted out the ssl error handling. By default there's
a simple error handler which just logs errors and returns
without ignoring them (i.e. default Qt behavior, an ssl error
cancels the request). App has a specific subclass of the ssl
error handler which presents the nice dialog and asks users to
choose what to do. Potentially server could decide to make
its own subclass too, which could e.g. ignore SSL warnings
if an environment variable is present (but at the moment
the behavior is effectively unchanged for server).

The end result is that SSL error handling should now be
totally thread safe, and we shouldn't hit any more deadlocks
and crashes when ssl errors occur in background threads.

I've also taken the opportunity to add a new signal which
is always emitted by the main thread QgsNetworkAccessManager
instance, which is emitted whenever ANY request on any
thread encounters an SSL error, and contains the requestId
so that the ssl error can be linked back to the originating
request. This is for debugging, and for use by the
network monitoring plugin to show ssl errors encountered
by requests.
2019-01-28 15:21:40 +11:00
Nyall Dawson
c44f8f0a15 Fix build 2019-01-28 07:16:33 +11:00
Nyall Dawson
9b2e39cef8 Fix more icon sizes on hidpi 2019-01-28 07:16:33 +11:00
Nyall Dawson
7b739f196d Fix some clazy warnings 2019-01-28 07:16:33 +11:00
Nyall Dawson
27bb2c156f Fix undersized layertree icons on hidpi displays 2019-01-28 07:16:33 +11:00
Alexander Bruy
fc9796f52a fix saving/restoring proxy excluded URLs (fix #20933) 2019-01-28 07:14:57 +11:00
Alexander Bruy
3c2a20a948 show pixel size in the raster layer properties with 19 significant
digits (fix #21023)
2019-01-28 07:14:21 +11:00
Alessandro Pasotti
6be9f14f0f Better UX when loading remote layers in the main thread
"loading ..." message and busy cursor
2019-01-27 18:23:53 +01:00
Alessandro Pasotti
65bf2ceb9d Size hints for the embedded message bar widget 2019-01-27 18:23:18 +01:00
Alessandro Pasotti
611eb70226 Code Layout 2019-01-27 18:22:51 +01:00
Juergen E. Fischer
febbc4f0b9 osgeo4w: handle grass svn versions (fixes #21114) 2019-01-27 17:37:39 +01:00
Martin Dobias
dd97201d1b [vertex tool] Fix issue with hidden layers being editable (fixes #18434)
The problem was that QgsSnappingConfig when initialized from a project
loads global settings from QgsSettings and sets individual layer configs
based on that.

The issue was showing up only in "current layer" mode of vertex tool
because for "all layers" mode all individual layer configs were overwritten.
2019-01-27 11:46:11 +01:00
Alessandro Pasotti
dd69421486 Add a message bar to the datasource manager dialog
... and forward all app's message bar messages to
the dialog's message bar in case it is modal and
visible.

Also adds a question dialog when a /vsicurl/
add layer operation failed and offers a chance
to try the "normal" opening mode.
2019-01-26 23:18:28 +01:00
Alessandro Pasotti
45ef886173 Revert "OGR: add a download option to the protocol data source"
This reverts commit cf0d45e5adfc263df858ff41fb0958ccdc2acaad.
2019-01-26 19:25:59 +01:00
Alessandro Pasotti
1ae1e72f7c Check for libOpenCL.so at runtime
This should avoid a crash if the user
enables opencl and the library is not
found.
2019-01-25 22:32:36 +01:00
Denis Rouzaud
bba67ae65d
followup PR #8961 fix missing include 2019-01-25 12:01:06 -05:00
Alessandro Pasotti
57d3293936 Field calculator: provide a list of default field types
in case the provider does not (WFS is one of them).

Rationale: consider that there is not such
a thing like a list of supported types for WFS
and parsing the particular describeFeatureType
for the layer would restrict the types to only
those actually existing in the layer, but
we are dealing with virtual fields here (because
WFS has no column add capabilities) so
let's give the users a minimal set of useful
types to play with.

Fixes #21086
2019-01-25 17:24:57 +01:00
Alessandro Pasotti
cf0d45e5ad OGR: add a download option to the protocol data source
Fixes #21091

The issue was due to the /vsicurl/ not
being able to open a streaming endpoint.

“Things are not always what they seem; the first appearance
deceives many; [...]”

― Phaedrus
2019-01-25 15:54:08 +01:00
Nyall Dawson
acafa744a8 Typo 2019-01-25 23:47:05 +11:00
Nyall Dawson
ca06d407a0 Add custom QNetworkRequest::Attributes for initiator network request class name and internal id
And allow these to be retrieved from QgsNetworkRequestParameters.
This allows logging code to identify the area of code where a request
originated from, making debugging much easier!

Tag all requests created with appropriate class name and IDs
2019-01-25 23:47:05 +11:00
Nyall Dawson
a491e90a04 Add QgsNetworkAccessManager signal for reply download progress
This signal is propagated to the main thread QgsNetworkAccessManager
instance, so it is necessary only to connect to the main thread's signal
in order to receive notifications about requests created in any thread.

Also includes the original requestId to allow linked download progress
to original request
2019-01-25 23:47:05 +11:00
Mathieu Pellerin
df1d47b86a
[gui] Fix style manager's add button when the 'all' tab is selected 2019-01-25 19:38:28 +07:00
Nyall Dawson
4022c5fc38 Make QgsSymbolLayerUtils::symbolPreview* methods const, and utilise
internal symbol clones

Rendering symbols is a NON-CONST operation, which can permanently
alter the symbol instance (e.g. via changes made by the symbol
or symbol layer's startRender methods.).

This makes debugging super complex - because methods which look
like they are just generating previews of symbols can actually
change the original symbol instances, resulting in permanent changes
to a layer's style.

Refs #19910 (specifically, me pulling my hair out trying to deduce
seemingly random changes to layer's symbols)
2019-01-25 23:27:52 +11:00
Nyall Dawson
431861a468 [processing] Add a better API for specifying that outputs are temporary
Instead of requiring clients to generate temporary file names themselves,
(or use the cryptic "memory:" string!), this PR adds a static constant

    QgsProcessing.TEMPORARY_OUTPUT

If a layer/sink output parameter is set to QgsProcessing.TEMPORARY_OUTPUT,
then the temporary output filename will be generated automatically at
algorithm run time. This means callers don't need to mess around with
finding appropriate temporary folders and paths.

Another benefit is that TEMPORARY_OUTPUT is stored in the processing
history, so if you re-run a previous algorithm which was set to
output to a temporary file, it no longer tries to use that same
previous temporary path and instead generates a new one.
2019-01-25 23:27:08 +11:00
Alexander Bruy
a90fb87c8e
Merge pull request #8973 from alexbruy/grass-buffer
[processing] fix GRASS v.buffer algorithm for variable buffer case (fix #19377)
2019-01-25 12:49:12 +02:00
Alessandro Pasotti
be0abb3d8e
Merge pull request #8971 from elpaso/bugfix-21068-database-styles-button-order
Fix button order in DB styles dialog and add GPKG delete support
2019-01-25 09:38:50 +01:00
Alessandro Pasotti
ee0e0e1d5d
Merge pull request #8970 from elpaso/bugfix-21077-value-relation-wfs
Fix WFS context fields variable
2019-01-25 09:38:26 +01:00
Alexander Bruy
ab3adc663c [gui] enable deselect feature and create rectangle action only when
there is a vector layer in the project (fix #18141, #20333)
2019-01-25 10:00:47 +02:00
Nyall Dawson
a9553c906d
Update src/app/qgsvectorlayerloadstyledialog.cpp
Co-Authored-By: elpaso <elpaso@itopen.it>
2019-01-25 08:46:00 +01:00
Nyall Dawson
29288c2abd
Update src/app/qgsvectorlayerloadstyledialog.cpp
Co-Authored-By: elpaso <elpaso@itopen.it>
2019-01-25 08:45:54 +01:00
Alessandro Pasotti
4d134b391b Indentation 2019-01-25 08:18:50 +01:00
Nyall Dawson
3cb6a40ef2 [processing] Add API to get an import statement and classname for a parameter type 2019-01-25 18:12:11 +11:00
Nyall Dawson
60f252c2f2 [layouts] Fix attribute table filtering not utilising expression context
Fixes #21078
2019-01-25 17:02:25 +11:00
Nyall Dawson
009ee572d8 Allow access to content of POST requests in QgsNetworkReplyContent 2019-01-25 11:06:31 +11:00
Andrea Giudiceandrea
8120e4a54f Allow new shapefile MultiPoint layer creation
Just add the missing MultiPoint geometry type in the "New Shapefile Layer" dialog
2019-01-25 11:04:20 +11:00
Alexander Bruy
8919d604a8 [processing] use background color from the project settings in the rasterize algorithm (fix #19866) 2019-01-25 10:06:12 +11:00
Alexander Bruy
32f6034be7 [processing][needs-docs] force multipart output from GDAL-based dissolve
algorithm (fix #20025)
2019-01-25 09:57:31 +11:00
Alexander Bruy
bfb60e4dc7 [processing] fix GRASS v.buffer algorithm for case when buffer distance
is taken from the field (fix #19377)
2019-01-24 21:01:12 +02:00
Matthias Kuhn
7482f7a448
Merge pull request #8957 from volaya/#19607
[processing] do not allow editing model if it's missing algorithms
2019-01-24 19:53:12 +01:00
Alessandro Pasotti
38f05b5974 Fix WFS context fields variable
because the fields in the (spatialite) cached
iterator are not the same as the main iterator.

Fix #21077 - Form Value relation based on WFS layer (nothing to do with
value relations)
2019-01-24 17:48:55 +01:00
Alessandro Pasotti
861a8b7105
Merge pull request #8958 from elpaso/bugfix-20961-wfs-null-transactions
Fix NULL support in WFS server and client
2019-01-24 17:43:27 +01:00
Alessandro Pasotti
90a9852b69 Fix button order in DB styles dialog and add GPKG delete support
Fixes #21068
2019-01-24 17:38:08 +01:00
Pierre-Eric Pelloux-Prayer
25f2aba44d Include qgis_sip.h instead of qgis.h where possible (#8961)
This PR continues the work started in PR #8951.

This commit replaces occurences of #include "qgis.h" by #include "qgis_sip.h",
where possible = when files only depends on SIP_XXX features.
2019-01-24 11:33:22 -05:00
Denis Rouzaud
ff20d1800e
Merge pull request #8925 from signedav/basic-values
Enable/disable value relation widget
2019-01-24 11:31:25 -05:00
mhugent
b5febe5189
Merge pull request #8922 from mhugent/server_datasource_error
Server: catch datasource error
2019-01-24 17:27:13 +01:00
Peter Petrik
c90905bd65 fix travis 2019-01-24 16:24:46 +01:00