Bug report #6229
changing existing symbol or color ramp does not work in new style manager
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||15538|
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
#4 Updated by Etienne Tourigny about 9 years 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
#5 Updated by Arunmozhi P about 9 years ago
- File style-fix.patch added
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.