4548 Commits

Author SHA1 Message Date
Alessandro Pasotti
40b7f7914a [auth] Added tests for updateNetworkProxy 2017-09-27 15:15:01 +02:00
Nyall Dawson
6ce8b4c83e Merge pull request #5259 from nyalldawson/modernize
Modernize initializers
2017-09-27 09:34:07 +10:00
lbartoletti
6602855ae4 Merge branch 'master' into regularShape_gui 2017-09-26 21:31:01 +02:00
lbartoletti
79fb064c99 resolve conflicts 2017-09-26 21:23:53 +02:00
Nyall Dawson
a87d352bd7 Run clang-tidy modernize-use-default-member-init to move member
initialization to headers (c++11 style)
2017-09-27 05:02:34 +10:00
Matthias Kuhn
e604460a15 Add unit tests for represent_value 2017-09-26 14:28:44 +02:00
Nyall Dawson
9d8854fc10 Add an empty line
Because the world will explode if not
2017-09-26 16:05:02 +10:00
Nyall Dawson
bcb3e5f425 [FEATURE] Add 'materialize' method to QgsFeatureSource
When called, materialize takes a QgsFeatureRequest argument
and runs it over the source. The resultant features
are saved into a new memory provider based QgsVectorLayer, which
is returned by the function (along with ownership of the layer)

This makes it easy to create a new layer from a subset of an
existing one.

Materialize also considers subsets of attributes, so that the
returned layer only contains fetched fields (and not blank
fields filled with NULL values).
2017-09-26 14:27:40 +10:00
Nyall Dawson
270c45d12b Merge pull request #5254 from nyalldawson/geometry_coverage
Geometry unit test coverage
2017-09-26 13:39:27 +10:00
Nyall Dawson
cc4fb3928d Boost test coverage of multipolygons 2017-09-26 12:06:20 +10:00
Nyall Dawson
02493104b0 Boost test coverage for multisurface 2017-09-26 11:34:39 +10:00
Nyall Dawson
6505104074 Boost test coverage of geometry classes 2017-09-26 09:33:17 +10:00
Nyall Dawson
307efe3bce Boost test coverage for multilinestrings 2017-09-26 08:38:21 +10:00
Sandro Mani
7705179a6c Merge pull request #5250 from manisandro/ogr_orig_fid
[OGR] orig_ogc_fid followups
2017-09-25 15:21:41 +02:00
Sandro Mani
992a759caa Merge pull request #5231 from manisandro/ogr_repack
[OGR] Defer repacking while in explicit updateMode
2017-09-25 14:09:48 +02:00
Sandro Mani
15eaafdf0c [OGR] Ensure orig_ogc_fid is never set as ignored field 2017-09-25 13:34:06 +02:00
Nyall Dawson
57108f9b61 Boost test coverage for geometry collections 2017-09-25 17:20:36 +10:00
Nyall Dawson
20cc7a7332 Boost test coverage for QgsRectangle 2017-09-25 17:20:36 +10:00
Nyall Dawson
d704163884 Rename QgsRectangle::buffer to buffered and mark as const 2017-09-25 17:20:36 +10:00
Nyall Dawson
7d6034dec8 Boost test coverage for compound curve 2017-09-25 17:20:36 +10:00
Nyall Dawson
31c1ae1c6a Add missing QStringLiterals 2017-09-25 17:12:03 +10:00
Nyall Dawson
d72309e42b Fix transform of extent parameter set to match layer's extent 2017-09-24 13:46:02 +10:00
Nyall Dawson
fb08b0a6e2 [processing] Allow encoding crs into text definitions of extents 2017-09-24 13:46:01 +10:00
Nyall Dawson
ec44e60308 [processing] Allow encoding crs into text definitions of points 2017-09-24 12:46:32 +10:00
Nyall Dawson
e1eef7ed19 Allow use of QgsPointXY/QgsReferencedPointXY for point parameter values 2017-09-24 12:09:38 +10:00
Nyall Dawson
8902d5f48f Merge pull request #5244 from nyalldawson/proc_misc
[processing] Misc test related fixes
2017-09-24 10:37:06 +10:00
Nyall Dawson
fe98fe1131 Merge pull request #5236 from nyalldawson/field_default
[processing] Allow setting default values for field parameters in models
2017-09-24 07:58:39 +10:00
Alexander Bruy
f60d8885c9 [processing] more fixes for tests creation 2017-09-24 07:49:55 +10:00
Nyall Dawson
92e481e7c3 Fix creation of SAGA tests 2017-09-24 07:48:46 +10:00
Juergen E. Fischer
9e36fd9c6d remove app startup tests depending on removed options configpath and --optionspath 2017-09-23 19:38:42 +02:00
Nyall Dawson
e3f128b55f Expand test coverage of compound curves 2017-09-23 16:16:13 +10:00
Vincent Mora
02e3916bf5 [FEATURE] layer refresh and trigger actions on provider notification
[needs-docs]

In vector layer properties (only usefull for postgres datasources)

**in the rendering tab**

A "Refresh layer on notification" checkbox has been added to refresh layer
on provider notification.

For a postgres datasource, if a `NOTIFY qgis;` command is issued by one of the database clients,
a refresh of the layer will occur.

If the "Only if message is" checkbox is checked, the notification will trigger the refresh only
if the message contend is the one specified, e.g. if the user enters
"refresh" in the box right next to the "Only if message is" checkbox,
then a `NOTIFY qgis, 'refresh';` command in the datatabase will trigger
a layer refresh, but `NOTIFY qgis;` or `NOTIFY qgis, 'something else';`
won't.

**in the actions tab**

A column "On notification" has been added, the action editor widget
a has text field "Execute if notification message matches" to
specify a filter for notification from the provider. The filter is a
Perl-type regex.

Note that, as opposed to the "layer refresh" that

Exemple:
  - QGIS side "Execute if notification message matches" `^trigger my action`
  - Postgres side: `NOTIFY qgis, 'trigger my action'` will trigger the action
  - Postgres side: `NOTIFY qgis, 'trigger my action some additional data'` will trigger the action
  - Postgres side: `NOTIFY qgis, 'do not trigger my action some additional data'` will NOT trigger the action

Please note that if the `^`, which means "starts with",  in `^trigger my action` had been ommited,
the last notification would have triggered the action because the
notification message contains the `trigger my action`

A new qgis variable `notification_message` is available for use in
actions, it holds the contend of the notification message. To continue
with the previous exemple, if the action is of python type with the code:

```python
print('[% @notification_message %]')
```

The three notifictions above will result in two printed lines
```
trigger my action
trigger my action some additional data
```

User Warning:

For postgres providers, if the "Refresh layer on notification" is checked, or if one layer action has
"On notification" specified, a new connection to the database is made to
listen to postgres notifications. This olds even if transaction groups
are enabled at the project level.

Note that once the notification mechanism is started in a QGIS
session, it will not stop, even if there is no more need for it (Refresh
layer on notification" unchecked and no "On notification" in any
action). Consequently the connection listening to notification will
remain open.

IMPLEMENTATION DETAILS:

A notify signal has been added to the abstract QgsVectorDataProvider
along with a setListening function that enables/disble the notification
mechanism.

For the moment only the postgres provider implements the notification.

QgsAction has a notificationMessage member function that holds the regex
to match to trigger action

QgsActionManager becomes a QObject and is doing the filtering and execute actions on
notifications.

The notification notion extends beyond SRGBD servers (postgres and oracle at
least have the notify) and the "watch file" in the delimitedtext
provider could also benefit from this interface.

For the postgres provider a thread is created with a second connection
to the database. This thread is responsible for listening postgres
notifications.

It would be nice to avoid the creation of one listening chanel per
provider in the case transaction groups are enabled.

Please note that when listening starts (a thread and connection is
created in the postgres provider) it cannot be stopped by removing the
connected actions or unchecking the refresh check box. Indeed, since we
don't know who needs the signals, we dont't want to stop the service.

The service will not restart in the next qgis session though.

If this behavior is not deemed appropriate, we could use
```
int QObject::receivers ( const char * signal ) const
```
and have QgsDataProvider::setListening return a bool to tell the caller
if the signal has actually been closed.
2017-09-22 12:51:51 +02:00
Nyall Dawson
22eddfd4c0 Merge pull request #5238 from nyalldawson/geometry_coverage
Geometry unit test coverage + fixes
2017-09-22 17:18:39 +10:00
Nyall Dawson
cbca7c97bc Boost test coverage of geometry classes 2017-09-22 15:41:41 +10:00
Nyall Dawson
c41dca937c Port processing combineFields to c++ 2017-09-22 15:19:32 +10:00
Nyall Dawson
b4a798e892 Setting field for QgsFieldComboBox should be case-insensitive 2017-09-22 11:39:17 +10:00
Larry Shaffer
559973739c Merge pull request #5202 from dmarteau/fix_ln_option_OSX
Execute ln command with GNU compatible options in install phase
2017-09-21 19:37:42 -06:00
Nyall Dawson
9d6d60727a Expand unit tests for compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
f268ccc837 Expand test coverage for compound curves 2017-09-22 09:54:23 +10:00
Nyall Dawson
e7b08d520e Expand geometry test coverage 2017-09-22 09:54:23 +10:00
Nyall Dawson
c77afeda9a Expand geometry unit test coverage 2017-09-22 09:54:23 +10:00
Matthias Kuhn
9caa7224cd Merge pull request #5230 from m-kuhn/taskWaitForFinished
QgsTask::waitForFinished without event loop
2017-09-21 18:35:43 +02:00
Matthias Kuhn
8f2c885436
[travis] Disable flaky test
See https://travis-ci.org/qgis/QGIS/jobs/278224577
https://github.com/qgis/QGIS/pull/5230#issuecomment-331189552
2017-09-21 18:00:46 +02:00
Sandro Mani
59ed19fff0 [OGR] Defer repacking while in explicit updateMode 2017-09-21 14:07:39 +02:00
Sandro Mani
a67194df77 [OGR] Add orig_ogc_fid as last field to avoid changing field order 2017-09-21 11:17:12 +02:00
Sandro Mani
4ce2cf1744 [OGR] Add workaround for OGRSQL not recognizing the column name returned by OGR_L_GetFIDColumn 2017-09-21 10:50:39 +02:00
Nyall Dawson
20e1d72007 Merge pull request #5209 from nyalldawson/geometry_coverage
[WIP] Extend geometry classes unit test coverage
2017-09-19 22:15:14 +10:00
Nyall Dawson
38cc5703d7 Improve test cases 2017-09-19 21:18:06 +10:00
Matthias Kuhn
8d34023d6e Merge pull request #5216 from m-kuhn/vectorFileWriter
Make error message accessible for python in vector file writer
2017-09-19 13:17:09 +02:00
Nyall Dawson
6f5d9c94a6 Fix some leaks in geometry tests (valgrind noise) 2017-09-19 20:36:16 +10:00