Bug report #14161

Remove Current style can corrupt another style

Added by Harrissou Santanna almost 9 years ago. Updated over 8 years ago.

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

Description

Create for a layer two different styles.
Then reopen the Layer Properties dialog and remove one (it should be the current)
The other style is set to "Current" but with the properties of the one you just delete.
If you hit "OK" for the dialog, you end up with a style that is no more the one you designed but the one you just removed. That can be really painful when you took time to find the right rendering of your layer and just get it lost so easily (symbology is corrupted and lost if you didn't save it elsewhere, reason why I set it "High").

When removing a style, options in the layer properties dialog should be updated with the landing style and not the inverse

History

#1 Updated by Martin Dobias almost 9 years ago

Hmm I cannot replicate - I have just tried it and for me right after removal of the current style the dialog is updated to contain the newly selected style.

Maybe a screencast would be helpful to understand if you do something in a slightly different manner than I did...

#2 Updated by Sebastian Dietrich almost 9 years ago

  • Status changed from Open to Feedback

#3 Updated by Sebastian Dietrich almost 9 years ago

@Harrissou
I can not reproduce either. But I noticed a probably related misbehaviour when working with named styles:
  • Create a new project
  • Create a new memory layer
  • Open the layer properties dialog
  • Change the symbol, e.g. to the airplane
  • Select Rename current from the style menu and enter a name, e.g. airplanes
  • Select Add... from the style menu and enter a name, e.g. arrows
  • Change the symbol, e.g. to the arrow
  • Open the style menu and verify both styles are there, airplanes and arrows
  • Select the airplanes style -> your airplane is gone, you end up with the default style
  • Select the arrows style -> your arrow is gone, you end up with another default style

Maybe your delete operation triggered that issue?

Create for a layer two different styles.

This only works if you Apply your changes before creating the second style, otherwise your first style will be lost and replaced by the default.

If it is in fact the same it can be dealt with here, if not I would open a new ticket.

#4 Updated by Harrissou Santanna almost 9 years ago

Sorry for the late reply.
I retry it and surprisingly it works as expected. I was pretty sure I had the second style changed.

Sebastian, not 100% sure but it may be related (didn't try again). For the Documentation purpose, I was trying the behaviour of the Add, Rename and Remove tools and had used the Apply button to avoid dialog closure. But I can't tell if it was the same sequence.
I don't think you should open a new issue. You narrowed my report. Now the most important is to get it fixed.
Thanks.

#5 Updated by Giovanni Manghi over 8 years ago

  • Resolution set to worksforme
  • Status changed from Feedback to Closed

I retry it and surprisingly it works as expected.

Also available in: Atom PDF