diff options
author | Robin Burchell <robin.burchell@theqtcompany.com> | 2015-03-10 13:29:27 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2015-03-12 10:26:00 +0000 |
commit | 2cf54e48922a7d379fb7e212966d05bc402e475d (patch) | |
tree | a7668dbe5cfa7f58a87a9fc256f2ff8870891f5e /src/core | |
parent | d3905d85925a950ca32aa78eead6db7228be1330 (diff) |
UserScript: Rename source property to sourceCode.
The name 'source' is unclear, and doesn't match current conventions in QtQuick
(e.g. Image::source). Furthermore, such a property inhibits adding convenience
API to fetch a user script from an external URI.
Change-Id: I518b3963f64f0986f9e2d08fe7c5f69122372e0c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/user_script.cpp | 8 | ||||
-rw-r--r-- | src/core/user_script.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp index a94b8f16d..39da059d7 100644 --- a/src/core/user_script.cpp +++ b/src/core/user_script.cpp @@ -97,14 +97,14 @@ void UserScript::setName(const QString &name) scriptData->url = GURL(QStringLiteral("userScript:%1").arg(name).toStdString()); } -QString UserScript::source() const +QString UserScript::sourceCode() const { if (isNull()) return QString(); return toQt(scriptData->source); } -void UserScript::setSource(const QString &source) +void UserScript::setSourceCode(const QString &source) { initData(); scriptData->source = source.toStdString(); @@ -158,7 +158,7 @@ bool UserScript::operator==(const UserScript &other) const return worldId() == other.worldId() && runsOnSubFrames() == other.runsOnSubFrames() && injectionPoint() == other.injectionPoint() - && name() == other.name() && source() == other.source(); + && name() == other.name() && sourceCode() == other.sourceCode(); } void UserScript::initData() @@ -184,7 +184,7 @@ uint qHash(const QtWebEngineCore::UserScript &script, uint seed) { if (script.isNull()) return 0; - return qHash(script.source(), seed) ^ qHash(script.name(), seed) + return qHash(script.sourceCode(), seed) ^ qHash(script.name(), seed) ^ (script.injectionPoint() | (script.runsOnSubFrames() << 4)) ^ script.worldId(); } diff --git a/src/core/user_script.h b/src/core/user_script.h index a20ac1898..7aeba9131 100644 --- a/src/core/user_script.h +++ b/src/core/user_script.h @@ -68,8 +68,8 @@ public: QString name() const; void setName(const QString &); - QString source() const; - void setSource(const QString &); + QString sourceCode() const; + void setSourceCode(const QString &); InjectionPoint injectionPoint() const; void setInjectionPoint(InjectionPoint); |