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("\
"id INTEGER PRIMARY KEY,"\
"name TEXT,"\
"name TEXT UNIQUE,"\
"xml TEXT,"\
"groupid INTEGER)"

View File

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