~nick-dedekind/ubuntu-system-settings/lp1336715.check.sync

« back to all changes in this revision

Viewing changes to plugins/system-update/plugin.cpp

  • Committer: Nick Dedekind
  • Date: 2014-11-04 12:08:12 UTC
  • mfrom: (1153.1.29 ubuntu-system-settings)
  • Revision ID: nick.dedekind@canonical.com-20141104120812-xy1yrfdu4qi99ei4
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
using namespace UpdatePlugin;
31
31
 
32
 
 
33
 
static QObject *qml_update_manager(QQmlEngine *engine, QJSEngine *scriptEngine)
34
 
{
35
 
    Q_UNUSED(engine)
36
 
    Q_UNUSED(scriptEngine)
37
 
    return new UpdateManager();
38
 
}
39
 
 
40
32
void BackendPlugin::registerTypes(const char *uri)
41
33
{
42
34
    Q_ASSERT(uri == QLatin1String("Ubuntu.SystemSettings.Update"));
43
35
    
44
 
    qmlRegisterSingletonType<UpdateManager>(uri, 1, 0, "UpdateManager", qml_update_manager);
45
36
    qmlRegisterType<SystemUpdate>(uri, 1, 0, "SystemUpdate");
46
37
    qmlRegisterType<Update>(uri, 1, 0, "Update");
47
38
    qmlRegisterType<DownloadTracker>(uri, 1, 0, "DownloadTracker");
50
41
void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
51
42
{
52
43
    QQmlExtensionPlugin::initializeEngine(engine, uri);
 
44
    QQmlContext* context = engine->rootContext();
 
45
    context->setContextProperty("UpdateManager",
 
46
                                UpdateManager::instance());
53
47
}