Commit d0647420 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix bug when reload a different palette

parent ec832e40
......@@ -251,14 +251,15 @@ Palette *Session::get_palette(const std::string type, const std::string &palette
QSettings settings(ORG_NAME, APP_NAME);
QMap <QString, QVariant> qmap = settings.value(QString::fromStdString(type+"/"+palette_name+"/map")).toMap();
Palette* p;
else if(type=="link_types")p=_link_types;
else if(type=="event_types")p=_event_types;
Palette *p, **where_from;
if(type=="palette") {p = _palette; where_from = &_palette;}
else if(type=="link_types") { p=_link_types; where_from = &_link_types;}
else if(type=="event_types") { p=_event_types; where_from = &_event_types;}
if(!p || p->get_name() != palette_name) {
delete p;
p = new Palette(string(type+"/"+palette_name));
*where_from = p;
for(QMap<QString, QVariant>::const_iterator it = qmap.begin() ;
it != qmap.end() ; ++ it) {
const QColor qc = it.value().value<QColor>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment