Bug report #16752

Function Editor "New File" reset previous functions

Added by Klas Karlsson over 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Expressions
Affected QGIS version:2.18.9 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:24651

Description

It seems like a click on the "New File" button (actually when you set the new file name), the function that is currently "selected" will be reset!
By this I mean any edited code will be erased and replaced with the default startup code.

There doesn't seem to be a way to undo this, so if you have written a lot of code in a function that has been reset, the code will be lost.

The workaround is to create a "dummy" function that I select before I add a new file.

Example:

Add new file, name it, press ok:

Skärmbild_2017-06-25_09-35-04.png (52.2 KB) Klas Karlsson, 2017-06-25 09:35 AM

Skärmbild_2017-06-25_09-34-04.png (66.2 KB) Klas Karlsson, 2017-06-25 09:35 AM

Associated revisions

Revision d8398400
Added by Alexander Bruy about 7 years ago

correctly create new function file (fix #16752)

Revision 26e4d4f4
Added by Alexander Bruy about 7 years ago

correctly create new function file (fix #16752)

(cherry picked from commit d8398400f989147e8b9c89bf3c4beb87e2f8f97f)

History

#1 Updated by Harrissou Santanna over 7 years ago

  • Operating System deleted (Linux Ubuntu 16.04)

I can confirm too (with master). Very embarrassing when you spent time to have a working code.
Also, The old file loses its icon in the list...
I Had it on windows so I removed the OS indication.

#2 Updated by Alexander Bruy about 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF