fix db handling when modifying existing color ramp (#6229)

This commit is contained in:
Etienne Tourigny 2012-08-31 08:54:56 -03:00
parent 4b4ac5a5ac
commit 2ab844abf8
3 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -36,7 +36,7 @@ _symbol = "CREATE TABLE symbol("\
_colorramp = "CREATE TABLE colorramp("\ _colorramp = "CREATE TABLE colorramp("\
"id INTEGER PRIMARY KEY,"\ "id INTEGER PRIMARY KEY,"\
"name TEXT,"\ "name TEXT UNIQUE,"\
"xml TEXT,"\ "xml TEXT,"\
"groupid INTEGER)" "groupid INTEGER)"

View File

@ -187,8 +187,8 @@ bool QgsStyleV2::addColorRamp( QString name, QgsVectorColorRampV2* colorRamp, bo
if ( !colorRamp || name.isEmpty() ) if ( !colorRamp || name.isEmpty() )
return false; return false;
// delete previous symbol (if any) // delete previous color ramps (if any)
if ( mSymbols.contains( name ) ) if ( mColorRamps.contains( name ) )
{ {
// TODO remove groups and tags? // TODO remove groups and tags?
delete mColorRamps.value( name ); delete mColorRamps.value( name );