46877 Commits

Author SHA1 Message Date
Nyall Dawson
3bfcbaa163 Update unit tests 2018-04-09 12:43:05 +10:00
Nyall Dawson
2e6a69bdfd Update symbol selector when svg cache fetches remote images 2018-04-09 12:43:05 +10:00
Nyall Dawson
969b129b6e Also update symbol previews when a remote SVG is fetched 2018-04-09 12:43:05 +10:00
Nyall Dawson
45c400c25c QgsSvgCache fetches remote SVG files in a background task
Previously QgsSvgCache would often try to fetch remote images
using a network request on the main thread, by calling
processEvents repeatedly until the request was complete.

This caused lots of bugs, since the main thread processEvents
would proceed with all kinds of stuff assuming that the
svg fetch operation was complete, leading to frequent crashes
and deadlocks and making remote svg use impossible (it's
likely that the SVG cache remote fetching code was written
in the pre-multi-threaded rendering era).

There's no way to fix this with async svg fetching - we
HAVE to remove the processEvents call, and a QEventLoop
won't help either (since the method may be called on the
main thread). Accordingly the only solution is to
fetch the requested svg in the background, and return
a temporary "downloading" svg for use in the meantime.
We use a QgsNetworkContentFetcherTask to do this, so it's
nicely integrated with task manager.

A request task is fired up when a remote svg is requested
for the first time, with the temporary downloading svg
returned for use by the caller asynchronously. QgsSvgCache
then emits the remoteSvgFetched signal when a previously
requested remote SVG has been successfully fetched,
triggering a map canvas redraw with the correct SVG
graphic.

Fixes #18504
2018-04-09 12:43:05 +10:00
Nyall Dawson
3dec1755b6 [processing][grass] Allow operation on only selected vector features
Fixes #18218
2018-04-09 10:58:41 +10:00
Nyall Dawson
92634a9d92 [processing][grass] Allow use of feature sources as vector inputs 2018-04-09 10:58:41 +10:00
Nyall Dawson
b28e580a79 Indentation 2018-04-09 10:58:41 +10:00
Nyall Dawson
8b04188230 Don't use hardcoded paths in test 2018-04-09 10:58:41 +10:00
Nyall Dawson
aca75cfa6e [processing][grass] Fix use of v.external with ogr layers which
do not support random read

These layers are not compatible with v.external, so we have to
use v.in.ogr for them
2018-04-09 10:58:41 +10:00
Nyall Dawson
8ba762a630 [processing][grass] Fix grass vector algs don't work with memory layers
Fixes broken grass algs inside models (fixes #18662)
2018-04-09 10:58:41 +10:00
Nyall Dawson
f928e3dde9 [processing][grass] Add some missing imports 2018-04-09 10:58:41 +10:00
Nyall Dawson
c50a039745 [processing][grass] Push feedback object to algorithm methods 2018-04-09 10:58:41 +10:00
Nyall Dawson
ccccad54c0 [processing] Fix exception in processing.run when feedback
object is not specified
2018-04-09 09:18:04 +10:00
Nyall Dawson
4c8b1595a9 [processing] Fix GDAL algorithms do not run with memory layer inputs
Breaks execution of mixed QGIS/GDAL algorithms
2018-04-07 15:36:21 +10:00
Martin Dobias
ce72536bcc Fix a crash in the puzzle when not properly initialized 2018-04-06 19:06:35 +02:00
Blottiere Paul
1a515c923d
Merge pull request #6717 from pblottiere/remove_qgd
Do not save .qgd file alongside .qgs when it's not used
2018-04-06 13:50:15 +01:00
Blottiere Paul
5014d95d6e
Merge pull request #6450 from tudorbarascu/filter_test
add GetMap FILTER test with multiple filters
2018-04-06 11:07:17 +01:00
Salvatore Larosa
747955ae47
Merge pull request #6721 from slarosa/zoom_selected_cm
[needs-docs] add zoom to selection action to contextual menu of the layer
2018-04-06 12:01:33 +02:00
Blottiere Paul
ff1bc0b8f7 Add unit tests 2018-04-06 11:00:08 +01:00
Blottiere Paul
c47a6457b8 Do not save .qgd file alongside .qgs when it's not used 2018-04-06 11:00:08 +01:00
Nyall Dawson
62ba263f38 Optimise args 2018-04-06 17:53:01 +10:00
Nyall Dawson
0f1c8df941 Utilise expression context cache to store some more expensive
expression calculation results
2018-04-06 17:53:01 +10:00
Nyall Dawson
222977f23b Add unit tests for loading projects with custom layer order
Refs #18620
2018-04-06 15:55:40 +10:00
Nyall Dawson
1942854166 [processing] Port Explode Lines to c++
Aside from the performance benefits, the Python version of this
algorithm occasionally fails on Travis with odd errors. Hopefully
by porting to c++ it will fix these, or at least give useful
debug information in the event of a fail.

Also add support for curved input geometries.
2018-04-06 15:34:52 +10:00
Nyall Dawson
fa051d5f2d Add qgis::overload method for new-style Qt connects
Used for new-style Qt connects to overloaded signals,
avoiding the usual horrible connect syntax required in
these circumstances.

Example usage:

connect( mSpinBox, qgis::overload< int >::of( &QSpinBox::valueChanged ),
    this, &MyClass::mySlot );

This is an alternative to qOverload, which was implemented in Qt 5.7.

See https://stackoverflow.com/a/16795664/1861260
2018-04-06 12:45:52 +10:00
Nyall Dawson
ebab649438 Fix some locator filters show results when no string is entered
and filter prefix is not used
2018-04-06 12:44:56 +10:00
Nyall Dawson
ccb72ebce2 [processing] Fixes for Service Area algorithms
- Output interpolated points when travel cost falls mid-way along
an edge
- Output all intermediate reachable points also
- Make outputting upper/lower bound points optional, and non-default.
Now by default we just output all definitely reachable points and
the interpolated points along edges which correspond to the travel cost.
This allows the output to be used to correctly generate service areas
e.g. by concave/convex polygons and all reachable nodes will be
included in the area.
- Allow algorithm to optionally output a line layer (and make the
point layer optional too, and default to just the line layer output)
containing all reachable line segments (including interpolated
segments of lines when the travel cost sits midway along that
edge). This output is more easily understandably for users.
2018-04-06 12:43:52 +10:00
Nyall Dawson
2e7455c180 Add some geometry utils for interpolating points on lines 2018-04-06 12:43:52 +10:00
Nyall Dawson
78a6118ba4 [processing] Fix broken Densify by Interval algorithm, add test
Fix #18640
2018-04-06 11:50:23 +10:00
Nyall Dawson
6a925f9e87 Don't set cleared data defined properties to NULL in expression editor
Fixes #18638
2018-04-06 11:40:28 +10:00
Nyall Dawson
3c08e2d96f [layouts] Fix data defined buttons do not update when clicking
between items of same type

Fixes #18637, #18639
2018-04-06 11:31:18 +10:00
Nyall Dawson
3b8d8434af [locator] Set correct parent for filter configuration widgets 2018-04-06 10:57:39 +10:00
Nyall Dawson
25a9929dea Fix Coverity uninitialized member warning 2018-04-06 09:41:10 +10:00
Nyall Dawson
0ef9c729c0 Fix Coverity unreachable code warning 2018-04-06 09:41:01 +10:00
Salvatore Larosa
bcf9a97c4a fix tab index in project properties when clicking on crs toolbutton from statusbar 2018-04-05 16:55:48 +02:00
Alessandro Pasotti
16e18ba623
Merge pull request #6751 from elpaso/bugfix-18620-layer-custom-order
[bugfix] Layer rendering order broken in QGIS 3x
2018-04-05 12:08:22 +02:00
Alessandro Pasotti
958cb3dd15 [bugfix] Layer rendering order broken in QGIS 3x
Fixes #18620
2018-04-05 11:41:50 +02:00
Martin Dobias
63130d410d Another piece of random useless code in QGIS. Happy April 1st!
Type "bored" into the coordinates box (best results with a map loaded in canvas)

Click on tiles to move them to the empty space.
Click on the empty tile to toggle tile numbers.
2018-04-05 10:13:58 +02:00
MieWinstrup
7d65ee9fa4 Added tests for moving group to the top 2018-04-05 11:49:11 +10:00
MieWinstrup
44df14d941 Add test for move to top action 2018-04-05 11:49:11 +10:00
MieWinstrup
b57a154b4d Changed itemorder in menu to match the changes in #6665 2018-04-05 11:49:11 +10:00
MieWinstrup
40abe1430f Replaced deprecated Q_FOREACH with for loop 2018-04-05 11:49:11 +10:00
MieWinstrup
98621d7cd0 Added documentationstrings to new methods 2018-04-05 11:49:11 +10:00
MieWinstrup
924e2ec854 [FEATURE][Needs-docs] Move layer or group to top of layer panel
A feature that moves the layer(s) or group(s) to the top of the layer panel.
2018-04-05 11:49:11 +10:00
Nyall Dawson
cae5f81ed1 Add missing expression help 2018-04-05 06:35:13 +10:00
Nyall Dawson
f9783ea560 [FEATURE] Add flip_coordinates expression function
Returns a copy of the geometry with the x and y coordinates
swapped. Useful for repairing geometries which have had their
latitude and longitude values reversed.
2018-04-05 06:35:13 +10:00
Nyall Dawson
8aa9a82d28 [FEATURE][processing] Add algorithm to swap x/y coordinate values
This algorithm swaps the X and Y coordinate values in input
geometries. It can be used to repair geometries which have
accidentally had their latitude and longitude values reversed.
2018-04-05 06:35:13 +10:00
Nyall Dawson
63c5e74946 Fix clazy pass small and trivially copyable object by value warnings 2018-04-05 06:35:13 +10:00
Nyall Dawson
8cc715389e Fix warnings 2018-04-05 06:35:13 +10:00
Nyall Dawson
1ea20a4b35 Add method to swap x/y coordinates in geometries
This can be used to repair geometries which have
accidentally had their latitude and longitude coordinates
reversed.
2018-04-05 06:35:13 +10:00