X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreen%2Fsrc%2Fmain.cpp;h=99f98c9bdc3cd888082abe256e8b8b22f9b1dad1;hb=79714c0aa8fc461d77b75d6c5dae6a1a7d726954;hp=4d626d976541f30653a1a95590ca9c772772f6d1;hpb=dd8c90f87463d370c3076e13b7c6cc0e27c0d2f5;p=staging%2FHomeScreen.git diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp index 4d626d9..99f98c9 100644 --- a/HomeScreen/src/main.cpp +++ b/HomeScreen/src/main.cpp @@ -16,49 +16,37 @@ #include "mainwindow.h" #include -#include -//#include +#include +#include +#include + +#include "../src2/applicationlauncher.h" +#include "../src2/statusbarmodel.h" +#include "layouthandler.h" + int main(int argc, char *argv[]) { - // allow only one instance of this application - /*QSharedMemory appInstance; - appInstance.setKey("HomeScreen"); - if (!appInstance.create(1)) - { - qDebug("Only one instance of the Home Screen App allowed!"); - exit(-1); - }*/ - QApplication a(argc, argv); // used for application settings (QSettings) QCoreApplication::setOrganizationDomain("LinuxFoundation"); QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); QCoreApplication::setApplicationName("HomeScreen"); - QCoreApplication::setApplicationVersion("0.4.0"); + QCoreApplication::setApplicationVersion("0.6.0"); qDebug("%s, v%s", QCoreApplication::applicationName().toStdString().c_str(), QCoreApplication::applicationVersion().toStdString().c_str()); qDBusRegisterMetaType(); qDBusRegisterMetaType >(); - MainWindow w; - w.show(); -#ifdef __arm__ - // the WindowManager positions the surface correctly -#endif -#ifdef __i386__ - w.move(0, 0); -#endif + qmlRegisterType("HomeScreen", 1, 0, "ApplicationLauncher"); + qmlRegisterType("HomeScreen", 1, 0, "StatusBarModel"); + qmlRegisterType("HomeScreen", 1, 0, "LayoutHandler"); -#ifdef __arm__ - qDebug("Running on ARM architecture"); -#endif -#ifdef __i386__ - qDebug("Running on x86 architecture"); -#endif + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return a.exec(); }