Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2542 closed enhancement (fixed)

field calculator default behaviour

Reported by: best Owned by: mhugent
Priority: minor: annoyance Milestone: Version 1.5.0
Component: Vectors Version: 1.4.0
Keywords: field calculator Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

Thank you for the field calculator it is a very welcome feature! However its default behaviour (checkbox settings) is to update all records in the first existing field. This applies to QGIS 1.4.0-2.8 (OpenSuse?).
To prevent users from corrupting their data I would expect it the other way round: update only selected records and ask for a new field.

Explanation

  • Most of the time I am using the field calculator, I want to update only selected records (graphical or logical selection). So I have to take extra care to check only update selected features. When I forget to do so, my data already being in the target field are gone. On the other hand if I want to update all records and the default would be only update selected features all I have to do is redoing the calculation after unchecking only update selected features.
  • The first existing field normally is an ID field. You do not want to update this field! But if you do not take extra care you do so. If update existing field would be unchecked the user has to do something in order to execute the calcualtion: either check update existing field and choose the field or enter a new field. Thus the risk of data corruption by accident is minimized.

I am totally aware that discarding the changes keeps the data as they are. But it is annoying to stop the edit mode, discard all(!) changes and redo all I did when I realize I made a mistake (if I realize!).

Proposal

  • If a selection exists on the table check only update selected features by default.
  • Uncheck update exisiting field by default.

Change History (5)

comment:1 in reply to:  description ; Changed 10 years ago by jef

Replying to best:

I am totally aware that discarding the changes keeps the data as they are. But it is annoying to stop the edit mode, discard all(!) changes and redo all I did when I realize I made a mistake (if I realize!).

You can also undo (and redo) field calculator changes - without leaving editing mode.

comment:2 in reply to:  1 ; Changed 10 years ago by best

Replying to jef:

You can also undo (and redo) field calculator changes - without leaving editing mode.

Didn't know that, although I was looking for it (only in the table window, though :) I still think the current default settings are more error-prone than my proposal.

comment:3 Changed 10 years ago by mhugent

Owner: changed from nobody to mhugent

The proposed changes sound good to me. I'm going to look at it.

comment:4 Changed 10 years ago by mhugent

Resolution: fixed
Status: newclosed

Fixed in r13046

comment:5 in reply to:  2 Changed 10 years ago by jef

Replying to best:

Replying to jef:

You can also undo (and redo) field calculator changes - without leaving editing mode.

Didn't know that, although I was looking for it (only in the table window, though :) I still think the current default settings are more error-prone than my proposal.

Sure. I wasn't implying that your proposal was bad. I just thought you should know about another "very welcome feature". ;)

Note: See TracTickets for help on using tickets.