~josharenson/unity8/fix-greeter-password-focus

« back to all changes in this revision

Viewing changes to tests/mocks/Wizard/mockplugin.cpp

  • Committer: Josh Arenson
  • Date: 2016-03-25 19:53:42 UTC
  • mfrom: (1978.1.6 sessions-model)
  • mto: This revision was merged to the branch mainline in revision 1986.
  • Revision ID: joshua.arenson@canonical.com-20160325195342-ibax564aavo3lk2i
merge prereq

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include "mockplugin.h"
18
18
#include "MockSystem.h"
19
19
#include "PageList.h"
 
20
#include "timezonemodel.h"
 
21
#include "LocalePlugin.h"
 
22
#include "Status.h"
20
23
 
21
24
#include <QtQml/qqml.h>
22
25
 
23
 
static QObject *system_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
24
 
{
25
 
    Q_UNUSED(engine)
26
 
    Q_UNUSED(scriptEngine)
27
 
    return new MockSystem();
28
 
}
29
 
 
30
26
void MockWizardPlugin::registerTypes(const char *uri)
31
27
{
32
28
    Q_ASSERT(uri == QLatin1String("Wizard"));
33
29
    qmlRegisterType<PageList>(uri, 0, 1, "PageList");
34
 
    qmlRegisterSingletonType<MockSystem>(uri, 0, 1, "System", system_provider);
 
30
    qmlRegisterSingletonType<MockSystem>(uri, 0, 1, "System", [](QQmlEngine*, QJSEngine*) -> QObject* { return new MockSystem; });
 
31
    qmlRegisterSingletonType<Status>(uri, 0, 1, "Status", [](QQmlEngine*, QJSEngine*) -> QObject* { return new Status; });
 
32
    qmlRegisterType<TimeZoneLocationModel>(uri, 0, 1, "TimeZoneModel");
 
33
    qmlRegisterType<LocalePlugin>(uri, 0, 1, "LocalePlugin");
35
34
}