From 402825b3011b931d5893a399a963518b856d12e2 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 8 Aug 2014 01:31:47 +0200 Subject: [PATCH] after detaching, fetch the item from the collection again fixes setting these values on a copy of the package --- src/plasma/package.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plasma/package.cpp b/src/plasma/package.cpp index 6acdeea3c..0c881db9d 100644 --- a/src/plasma/package.cpp +++ b/src/plasma/package.cpp @@ -636,6 +636,8 @@ void Package::setRequired(const char *key, bool required) } 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; } @@ -656,6 +658,8 @@ void Package::setMimeTypes(const char *key, QStringList mimeTypes) } 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; #endif }