Bug #6229

changing existing symbol or color ramp does not work in new style manager

Added by Etienne Tourigny 9 months ago. Updated 9 months ago.

Status:Closed Start Date:08/20/2012
Priority:Normal Due date:
Assigned to:Arunmozhi P % Done:

100%

Category:StyleV2
Target version:-
Platform: Patch supplied:Yes
Platform version: Affected version:master
Status info:Fix in Patch Causes crash or corruption:No
Resolution:fixed

Description

Title says it all - existing items (either symbol or color ramp) can be modified in the new style manager, but this is not saved, therefore lost when qgis is restarted.

related issue: 6222

style-fix.patch (20.7 kB) Arunmozhi P, 08/22/2012 10:34 am


Related issues

related to Quantum GIS Desktop - Bug #6222: implement QgsStyleV2::save() New 08/19/2012

History

Updated by Arunmozhi P 9 months ago

  • % Done changed from 0 to 10
  • Status info set to Working on fix

Updated by Arunmozhi P 9 months ago

  • File save_symbols_colorramps.patch added
  • % Done changed from 10 to 90
  • Status info changed from Working on fix to Fix in Patch
  • Patch supplied changed from No to Yes

Patch added.

Updated by Etienne Tourigny 9 months ago

looks nice - I'll test it out tonight and commit. thanks

Updated by Etienne Tourigny 9 months ago

This patch doesn't work, because new symbols are not saved.

Here is what happens:

- addSymbol() adds the symbol name to the style symbol list
- saveSymbol() detects the name already present, so it creates the sql query with UPDATE - this does nothing because symbol is not yet in the DB.

Some reworking has to be done in the db handling, with one solution of the following:

1) any add/modify/delete operations should sync with DB immediately (e.g. addSymbol() also adds to the DB)
2) any DB operations are done when dialog closes with a new function syncDB() - this loops through all symbols

1) former is easier, 2) is on par with previous behaviour

cheers
Etienne

Updated by Arunmozhi P 9 months ago

Hi,

Sorry for that buggy patch. I am attaching a new one. This contains two commits of data, one commit has a lot of doc about the functions in QgsStyleV2 (sorry for issue-jacking here). The second one has the extra function updateSymbol and necessary flag params in the addSymbol and addColorRamp.

I thought of issuing a github pull request when I wrote the docs, since the issue added up I am putting it up as patch.

I tested, it safely adds as well as updates. Kindly test and add it to master if found OK.

Updated by Arunmozhi P 9 months ago

  • File deleted (save_symbols_colorramps.patch)

Updated by Etienne Tourigny 9 months ago

can yoou file this a pull request in 2 separate commits? That way credit goes to you!
Etienne

Updated by Etienne Tourigny 9 months ago

  • % Done changed from 90 to 100
  • Resolution set to fixed

Fixed in trunk, b145998078 (by me) and 447c0d1 (by Arun). Creating new ramps did not work, so I updated addSymbol() and addColorRamp().

Updated by Etienne Tourigny 9 months ago

  • Status changed from New to Closed

Updated by Etienne Tourigny 9 months ago

Found issue that new entry was added to db instead of changing old entry, fixed in 2ab844abf8302a489abe86a25a99b54f49ffd91e

Also available in: Atom PDF