diff options
author | Katja Marttila <katja.marttila@qt.io> | 2023-05-25 11:17:02 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2023-06-12 11:56:35 +0300 |
commit | c6a06cd0a9aef990b57772f4caaf1aa8832ccee0 (patch) | |
tree | ea364178fc5e53a727284d6493163057e91419c7 /src/libs/installer/packagemanagercore.cpp | |
parent | 70081ce03cac6c331ed471a7f0ab6b38b843e31e (diff) |
Omit thisObject creation in javascript code
Originally, new Component object was created for javascript so that the garbage collector would not destroy the object. This caused the
thisObject in javascript to differ from the object in packageManagerCore, which in Qt6.5 lead to warning messages when each script was evaluated:
"Warning: :1: Calling C++ methods with 'this' objects different
from the one they were retrieved from is broken, due to historical
reasons. The original object is used as 'this' object."
Fixes so that the new object creation is omitted
and QJSEngine::CppOwnership is set to Component object so that garbage
collector won't destroy it.
Task-number: QTIFW-1829
Change-Id: Ia131d88fc83122f11c5b19a431e7db45e0ba18f9
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore.cpp')
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 35fd28337..ef27f6b53 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -2138,6 +2138,18 @@ Component *PackageManagerCore::componentByName(const QString &name, const QList< } /*! + Returns an array of all components currently available. If the repository + metadata have not been fetched yet, the array will be empty. Optionally, a + \a regexp expression can be used to further filter the listed packages. + + \sa {installer::components}{installer.components} + */ +QList<Component *> PackageManagerCore::components(const QString ®exp) const +{ + return components(PackageManagerCore::ComponentType::All, regexp); +} + +/*! Returns \c true if directory specified by \a path is writable by the current user. */ |