summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/scriptengine.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-10-06 15:58:43 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-10-06 16:05:51 +0200
commit62cf969c09ef821a0f8153e2fd9538c6664e8bef (patch)
tree6f07ab78f708e230b80b8f0393817a8702c5216b /src/libs/installer/scriptengine.cpp
parent0d529d9a8920ba308897c2ca3c69ac98109b0340 (diff)
Rewrite the component getter mess, remove superfluous methods.
Now we can combine some enum values to achieve the same as before with the several getter functions, removes the clutter from the API. Change-Id: I6368b0ff77821ac95d1defaec4af27dd7d383396 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/libs/installer/scriptengine.cpp')
-rw-r--r--src/libs/installer/scriptengine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/installer/scriptengine.cpp b/src/libs/installer/scriptengine.cpp
index 37610cfc9..2c66f389c 100644
--- a/src/libs/installer/scriptengine.cpp
+++ b/src/libs/installer/scriptengine.cpp
@@ -82,10 +82,10 @@ ScriptEngine::ScriptEngine(PackageManagerCore *core)
global.setProperty(QLatin1String("installer"), m_engine.newQObject(core));
connect(core, SIGNAL(guiObjectChanged(QObject*)), this, SLOT(setGuiQObject(QObject*)));
- const QList<Component*> components = core->availableComponents();
- QJSValue scriptComponentsObject = m_engine.newArray(components.count());
- for (int i = 0; i < components.count(); ++i) {
- Component *const component = components.at(i);
+ const QList<Component*> all = core->components(PackageManagerCore::ComponentType::All);
+ QJSValue scriptComponentsObject = m_engine.newArray(all.count());
+ for (int i = 0; i < all.count(); ++i) {
+ Component *const component = all.at(i);
QQmlEngine::setObjectOwnership(component, QQmlEngine::CppOwnership);
scriptComponentsObject.setProperty(i, newQObject(component));
}