harbour-tooter/src/harbour-tooter.cpp

46 lines
1.2 KiB
C++
Raw Normal View History

2017-06-01 17:13:51 +03:00
#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif
2017-06-01 17:13:51 +03:00
#include <sailfishapp.h>
2017-10-13 15:56:50 +03:00
#include <QQuickView>
#include <QtQml>
2017-10-25 17:30:23 +03:00
#include <QScopedPointer>
#include <QQmlEngine>
#include <QGuiApplication>
#include <QQmlContext>
#include <QCoreApplication>
#include <QtNetwork>
2018-05-24 12:14:02 +03:00
//#include <QtSystemInfo/QDeviceInfo>
2017-10-25 17:30:23 +03:00
#include "filedownloader.h"
2017-07-06 01:59:00 +03:00
#include "imageuploader.h"
2017-10-25 17:30:23 +03:00
#include "notifications.h"
2017-10-25 01:37:33 +03:00
#include "dbus.h"
2017-06-01 17:13:51 +03:00
int main(int argc, char *argv[])
{
2017-07-06 01:59:00 +03:00
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
QScopedPointer<QQuickView> view(SailfishApp::createView());
//QQmlContext *context = view.data()->rootContext();
2017-10-25 17:30:23 +03:00
QQmlEngine* engine = view->engine();
FileDownloader *fd = new FileDownloader(engine);
view->rootContext()->setContextProperty("FileDownloader", fd);
2017-07-06 01:59:00 +03:00
qmlRegisterType<ImageUploader>("harbour.tooter.Uploader", 1, 0, "ImageUploader");
2017-10-25 17:30:23 +03:00
Notifications *no = new Notifications();
view->rootContext()->setContextProperty("Notifications", no);
2017-07-06 01:59:00 +03:00
QObject::connect(engine, SIGNAL(quit()), app.data(), SLOT(quit()));
2017-06-01 17:13:51 +03:00
2017-10-25 01:37:33 +03:00
Dbus *dbus = new Dbus();
2017-10-25 17:30:23 +03:00
view->rootContext()->setContextProperty("Dbus", dbus);
2017-10-25 01:37:33 +03:00
2017-07-06 01:59:00 +03:00
view->setSource(SailfishApp::pathTo("qml/harbour-tooter.qml"));
view->show();
return app->exec();
2017-06-01 17:13:51 +03:00
}