Changeset View
Changeset View
Standalone View
Standalone View
gemini/cloud/git/gitplugin.cpp
Show All 18 Lines | |||||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "gitplugin.h" | 22 | #include "gitplugin.h" | ||
23 | #include "gitcontroller.h" | 23 | #include "gitcontroller.h" | ||
24 | #include "gitlogmodel.h" | 24 | #include "gitlogmodel.h" | ||
25 | #include "checkoutcreator.h" | 25 | #include "checkoutcreator.h" | ||
26 | 26 | | |||
27 | #include <qdeclarative.h> | 27 | #include <QtQml/QtQml> | ||
28 | #include <QDeclarativeEngine> | 28 | #include <QQmlEngine> | ||
29 | #include <QDeclarativeContext> | 29 | #include <QQmlContext> | ||
30 | #include <QApplication> | 30 | #include <QApplication> | ||
31 | 31 | | |||
32 | void GitPlugin::registerTypes(const char* uri) | 32 | void GitPlugin::registerTypes(const char* uri) | ||
33 | { | 33 | { | ||
34 | Q_UNUSED(uri) | 34 | Q_UNUSED(uri) | ||
35 | Q_ASSERT( uri == QLatin1String( "Calligra.Gemini.Git" ) ); | 35 | Q_ASSERT( uri == QLatin1String( "Calligra.Gemini.Git" ) ); | ||
36 | qmlRegisterType<GitController>("Calligra.Gemini.Git", 1, 0, "GitController"); | 36 | qmlRegisterType<GitController>("Calligra.Gemini.Git", 1, 0, "GitController"); | ||
37 | qmlRegisterType<GitLogModel>("Calligra.Gemini.Git", 1, 0, "GitLogModel"); | 37 | qmlRegisterType<GitLogModel>("Calligra.Gemini.Git", 1, 0, "GitLogModel"); | ||
38 | qmlRegisterType<QAbstractListModel>(); | 38 | qmlRegisterType<QAbstractListModel>(); | ||
39 | } | 39 | } | ||
40 | 40 | | |||
41 | void GitPlugin::initializeEngine(QDeclarativeEngine* engine, const char* uri) | 41 | void GitPlugin::initializeEngine(QQmlEngine* engine, const char* uri) | ||
42 | { | 42 | { | ||
43 | Q_UNUSED(uri) | 43 | Q_UNUSED(uri) | ||
44 | Q_ASSERT( uri == QLatin1String( "Calligra.Gemini.Git" ) ); | 44 | Q_ASSERT( uri == QLatin1String( "Calligra.Gemini.Git" ) ); | ||
45 | 45 | | |||
46 | CheckoutCreator* ac = new CheckoutCreator(qApp); | 46 | CheckoutCreator* ac = new CheckoutCreator(qApp); | ||
47 | 47 | | |||
48 | QDeclarativeContext *context = engine->rootContext(); | 48 | QQmlContext *context = engine->rootContext(); | ||
49 | context->setContextProperty("GitCheckoutCreator", ac); | 49 | context->setContextProperty("GitCheckoutCreator", ac); | ||
50 | } | 50 | } | ||
51 | | ||||
52 | #include "gitplugin.moc" | |