summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore.h
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2023-05-25 11:17:02 +0300
committerKatja Marttila <katja.marttila@qt.io>2023-06-12 11:56:35 +0300
commitc6a06cd0a9aef990b57772f4caaf1aa8832ccee0 (patch)
treeea364178fc5e53a727284d6493163057e91419c7 /src/libs/installer/packagemanagercore.h
parent70081ce03cac6c331ed471a7f0ab6b38b843e31e (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.h')
-rw-r--r--src/libs/installer/packagemanagercore.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h
index 0c167f92c..f85e5fcae 100644
--- a/src/libs/installer/packagemanagercore.h
+++ b/src/libs/installer/packagemanagercore.h
@@ -241,7 +241,8 @@ public:
void appendUpdaterComponent(Component *components);
QList<Component *> components(ComponentTypes mask, const QString &regexp = QString()) const;
- Component *componentByName(const QString &identifier) const;
+ Q_INVOKABLE QInstaller::Component *componentByName(const QString &identifier) const;
+ Q_INVOKABLE QList<QInstaller::Component *> components(const QString &regexp = QString()) const;
Q_INVOKABLE bool calculateComponentsToInstall() const;
QList<Component*> orderedComponentsToInstall() const;