@@ -106,7 +106,7 @@ void QgsColorSchemeList::pasteColors()
106106 QgsNamedColorList::const_iterator colorIt = pastedColors.constBegin ();
107107 for ( ; colorIt != pastedColors.constEnd (); ++colorIt )
108108 {
109- mModel ->addColor (( *colorIt ).first , ( *colorIt ).second );
109+ mModel ->addColor (( *colorIt ).first , ! ( *colorIt ).second . isEmpty () ? ( *colorIt ). second : QgsSymbolLayerV2Utils::colorToName (( *colorIt ). first ) );
110110 }
111111}
112112
@@ -151,7 +151,7 @@ bool QgsColorSchemeList::importColorsFromGpl( QFile &file )
151151 QgsNamedColorList::const_iterator colorIt = importedColors.constBegin ();
152152 for ( ; colorIt != importedColors.constEnd (); ++colorIt )
153153 {
154- mModel ->addColor (( *colorIt ).first , ( *colorIt ).second );
154+ mModel ->addColor (( *colorIt ).first , ! ( *colorIt ).second . isEmpty () ? ( *colorIt ). second : QgsSymbolLayerV2Utils::colorToName (( *colorIt ). first ) );
155155 }
156156
157157 return true ;
@@ -422,7 +422,7 @@ bool QgsColorSchemeModel::dropMimeData( const QMimeData *data, Qt::DropAction ac
422422 QModelIndex colorIdx = index ( beginRow, 0 , QModelIndex () );
423423 setData ( colorIdx, QVariant (( *colorIt ).first ) );
424424 QModelIndex labelIdx = index ( beginRow, 1 , QModelIndex () );
425- setData ( labelIdx, QVariant (( *colorIt ).second ) );
425+ setData ( labelIdx, !( *colorIt ). second . isEmpty () ? ( *colorIt ).second : QgsSymbolLayerV2Utils::colorToName (( *colorIt ). first ) );
426426 beginRow++;
427427 }
428428
0 commit comments