after detaching, fetch the item from the collection again

fixes setting these values on a copy of the package
This commit is contained in:
Aaron Seigo 2014-08-08 01:31:47 +02:00
parent fad59eb01a
commit 402825b301

View File

@ -636,6 +636,8 @@ void Package::setRequired(const char *key, bool required)
} }
d.detach(); d.detach();
// have to find the item again after detaching: d->contents is a different object now
it = d->contents.find(key);
it.value().required = required; it.value().required = required;
} }
@ -656,6 +658,8 @@ void Package::setMimeTypes(const char *key, QStringList mimeTypes)
} }
d.detach(); d.detach();
// have to find the item again after detaching: d->contents is a different object now
it = d->contents.find(key);
it.value().mimeTypes = mimeTypes; it.value().mimeTypes = mimeTypes;
#endif #endif
} }