summaryrefslogtreecommitdiffstats
path: root/src/core/user_script.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-03-16 18:13:19 +0100
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-03-18 15:41:47 +0000
commita8935efa82457dd8a137224371284776d7024f32 (patch)
treeeb79e4cbda6ea644727bda2b77f2f1c61869e3dd /src/core/user_script.cpp
parente25dc2f3181548540b858436683a594515d7270a (diff)
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 <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/user_script.cpp')
-rw-r--r--src/core/user_script.cpp14
1 files changed, 2 insertions, 12 deletions
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;
}