Detach before setting the d pointer

Authored by apol on Aug 7 2017, 4:31 PM.

Description

Detach before setting the d pointer

Summary:
Otherwise some objects have their information changed even though they
weren't modified

Reviewers: leinir

Reviewed By: leinir

Subscribers: broulik, Frameworks

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D7194