From 62cf969c09ef821a0f8153e2fd9538c6664e8bef Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 6 Oct 2014 15:58:43 +0200 Subject: 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 --- src/libs/installer/scriptengine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libs/installer/scriptengine.cpp') 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 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 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)); } -- cgit v1.2.3