From a8935efa82457dd8a137224371284776d7024f32 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 16 Mar 2015 18:13:19 +0100 Subject: Properly copy the UserScriptData UserScriptControllerHost keeps a collection of UserScripts and not the UserScriptData, which is a simple struct intended to be passed over IPC. Rely on the compiler generated copy constructor to copy that data. Change-Id: Ib5479e634f10d3646a10b644b0eaee471e48f5b8 Reviewed-by: Allan Sandfeld Jensen --- src/core/user_script.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp index 39da059d7..fb293c56a 100644 --- a/src/core/user_script.cpp +++ b/src/core/user_script.cpp @@ -55,13 +55,8 @@ UserScript::UserScript(const UserScript &other) { if (other.isNull()) return; - scriptData.reset(new UserScriptData); + scriptData.reset(new UserScriptData(*other.scriptData)); m_name = other.m_name; - scriptData->source = other.scriptData->source; - scriptData->url = other.scriptData->url; - scriptData->injectionPoint = other.scriptData->injectionPoint; - scriptData->injectForSubframes = other.scriptData->injectForSubframes; - scriptData->worldId = other.scriptData->worldId; } UserScript::~UserScript() @@ -75,13 +70,8 @@ UserScript &UserScript::operator=(const UserScript &other) m_name = QString(); return *this; } - scriptData.reset(new UserScriptData); + scriptData.reset(new UserScriptData(*other.scriptData)); m_name = other.m_name; - scriptData->source = other.scriptData->source; - scriptData->url = other.scriptData->url; - scriptData->injectionPoint = other.scriptData->injectionPoint; - scriptData->injectForSubframes = other.scriptData->injectForSubframes; - scriptData->worldId = other.scriptData->worldId; return *this; } -- cgit v1.2.3