24 Commits

Author SHA1 Message Date
Denis Rouzaud
c604d2dda6 run sipify 2017-12-15 22:13:44 -04:00
Denis Rouzaud
f2b3ed0a9b run sipify 2017-12-15 11:12:19 -04:00
Denis Rouzaud
e48cf98edb run sipify 2017-12-06 07:19:50 -04:00
Nyall Dawson
2e6d125a6f Use =default, =delete where possible 2017-11-11 15:22:19 +10:00
Vincent Mora
f63c302420 [FEATURE] Add undo and redo on transaction groups (#4765)
* [FEATURE] adds undo/redo for transaction groups

[needs-docs] the undo/redo now works with transcation groups. Just check
that there is no restriction in the transaction groups doc concerning
undo.

related to #14799

The undo/redo is implemented using SAVEPOINT.

The QgsTransaction interface has been enlarged to allow savepoints
creation and management. The savepoint is destroyed on
rollbackToSavepoint to have the same behavior has the sql ROLLBACK TO
SAVEPPOINT.

To avoid the creation of a savepoint for each feature modified in bulk
editing (e.g. paste, field calculator) the logic is a bit complicated: the
savepoint is created on QgsVectorLayer::editCommandStarted and the first
actual undo command (QgsVectorLayerUndoPassthroughCommand) is
responsible for the re-creation of the savepoint in case of undo-redo.
Since the behavior must be different in case edition doesn't take place
inside an edit command, a member function has been added to
QgsVectorLayer to expose the mEditCommandActive state.

Another (commented) tricky bit is the modification of the database
structure on add/delete attributes. On undo, the attribute is removed
before the rollback to savepoint, i.e. there is a useless ALTER TABLE
issued to restore the structure just before restoring it with the
ROLLBACK TO SAVEPOINT. This is necessary to make the provider
aware of the change of structure. It could be nicer/cleaner to have a way
to reload providers metadata.

The editPaste function has also been modified to use addFeatures instead of
addFeature (plural/singular), this is at the expense of an additional "cpy"
of the clipboard in memory, but it should improve perf with postgis provider.

* fixup operator aliases
2017-09-15 14:55:43 +02:00
Denis Rouzaud
1df3c51606 sipify batch 2017-05-22 10:12:08 +02:00
Denis Rouzaud
93971d5ed3 [sip] align pointer and reference in blacklisted files
this will facilitate sip diff checking
2017-05-01 17:49:43 +02:00
Nyall Dawson
b55e4b9abd Add qgsi->qgis to spell check 2017-04-03 08:55:07 +10:00
Nyall Dawson
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +10:00
Nyall Dawson
d075b128a8 Add missing docs 2016-08-02 07:26:11 +10:00
Nyall Dawson
aceddae65a QgsFeature cleanup, part 1
Deprecate some QgsFeature methods which take or return pointers,
update other classes as required
2016-07-31 21:23:07 +10:00
Nyall Dawson
0736bf726d Rename edit buffer methods to is..., add tests 2016-07-15 07:58:21 +10:00
Nyall Dawson
fe4fa419f8 Make QgsVectorLayerEditBuffer methods const correct
Also add some optimisations to avoid iterations over all
contents of the buffers
2016-07-15 06:06:14 +10:00
Nyall Dawson
0e03115d33 Add support for field renaming in QgsVectorLayer and edit buffer 2016-06-02 17:09:46 +10:00
Nyall Dawson
c3a57434d9 Fix clazy 'pass small and trivially-copyable type by value' warnings 2016-02-02 19:47:21 +11:00
Matthias Kuhn
68a01c9ab1 Add QgsVectorLayer::deleteFeatures() method 2015-11-30 21:33:35 +01:00
Juergen E. Fischer
9752c468c1 indentation update 2015-07-29 11:52:14 +02:00
Juergen E. Fischer
9ceb5ceab6 sip sync 2014-11-21 01:17:21 +01:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Juergen E. Fischer
52616b6549 vector layer: save old attribute values where available to speedup undo (and rollback) (fixes #9509)
field calculator & app: use wait cursor while calculating and committing or rolling back
2014-02-08 23:28:52 +01:00
Juergen E. Fischer
74e7314c36 update sip bindings II 2014-01-27 09:22:53 +01:00
Juergen E. Fischer
4cbec1811c fix warnings, add copyright headers, cosmetics 2013-01-28 01:39:58 +01:00
Martin Dobias
31f6ce07c3 Changed data structure for added features from list to map to allow efficient lookups 2012-12-19 00:28:04 +01:00
Martin Dobias
81b0930498 QgsVectorLayer: large internal refactoring
Most important changes:
- introduced feature iterator for QgsVectorLayer
- vector editing moved to QgsVectorEditBuffer
- complete rework of undo/redo commands for vector layers
- geometry cache separated from editing (QgsVectorLayerCache)
- non-essential editing functionality moved to QgsVectorLayerEditUtils
2012-12-17 21:22:42 +01:00