From 3bf3d3fe7bcfa7933ecc2ec2f1607f586b2b00d8 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 26 Aug 2020 16:25:00 +0200 Subject: Cleanup qwebenginescript and qwebenginescriptcollection api This patch cleans up script and collection apis: * do not allocate user_script on heap, there is no need for that. * remove isNull(), which was used by collection.findScript(name) * remove collection.size(), there is already collection.count() * remove collection.findScript(name), user can use findScripts(name) which returns list of scripts or empty list if not found * collection.findScripts(name) is simply collection.find(name) [ChangeLog] Removed QWebEngineScriptCollection::findScript(name), use QWebEngineScriptCollection::find(name) instead. Change-Id: Iecf8f1d7c26275b9ce3a1ea97cf4bd74b17f681e Reviewed-by: Allan Sandfeld Jensen --- src/core/api/qwebenginescript.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/core/api/qwebenginescript.cpp') diff --git a/src/core/api/qwebenginescript.cpp b/src/core/api/qwebenginescript.cpp index e3917566a..650ad5c53 100644 --- a/src/core/api/qwebenginescript.cpp +++ b/src/core/api/qwebenginescript.cpp @@ -145,14 +145,6 @@ QWebEngineScript &QWebEngineScript::operator=(const QWebEngineScript &other) return *this; } -/*! - Returns \c true is the script is null; otherwise returns \c false. -*/ -bool QWebEngineScript::isNull() const -{ - return d->isNull(); -} - /*! * Returns the name of the script. Can be useful to retrieve a particular script from a * QWebEngineScriptCollection. @@ -305,9 +297,6 @@ QWebEngineScript::QWebEngineScript(const UserScript &coreScript) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug d, const QWebEngineScript &script) { - if (script.isNull()) - return d.maybeSpace() << "QWebEngineScript()"; - d.nospace() << "QWebEngineScript(" << script.name() << ", "; switch (script.injectionPoint()) { case QWebEngineScript::DocumentCreation: -- cgit v1.2.1