v.0.5
This commit is contained in:
parent
63dfb9b197
commit
d48847d183
135 changed files with 8879 additions and 3693 deletions
|
@ -1,5 +1,5 @@
|
|||
// This file is part of Friendiqa
|
||||
// https://git.friendi.ca/lubuwest/Friendiqa
|
||||
// https://github.com/lubuwest/Friendiqa
|
||||
// Copyright (C) 2017 Marco R. <thomasschmidt45@gmx.net>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
@ -31,19 +31,21 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QtQml/QQmlEngine>
|
||||
//#include <QAndroidService>
|
||||
//#include <QtAndroid>
|
||||
#include <QtQuick>
|
||||
#include <QtWebView>
|
||||
#include "xhr.h"
|
||||
#include "filesystem.h"
|
||||
#include "updatenews.h"
|
||||
#include "filesystem.h"
|
||||
#include "remoteauthasyncimageprovider.h"
|
||||
//#include "alarm.h"
|
||||
//#include "AndroidNative/systemdispatcher.h"
|
||||
//#include "AndroidNative/environment.h"
|
||||
//#include "AndroidNative/debug.h"
|
||||
//#include "AndroidNative/mediascannerconnection.h"
|
||||
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include <QtAndroidExtras/QAndroidJniObject>
|
||||
#include <QtAndroidExtras/QAndroidJniEnvironment>
|
||||
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
|
||||
|
@ -57,26 +59,39 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
|
|||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
//qDebug()<< "argv Friendiqa"<< argv[0] <<" argv2" <<argv[1];
|
||||
if (qstrcmp(argv[1],"-service")==0){
|
||||
//qDebug()<<"FriendiqaMain Service";
|
||||
//QAndroidService app(argc, argv);
|
||||
UPDATENEWS* updatenews= UPDATENEWS::instance();
|
||||
updatenews->setDatabase();
|
||||
updatenews->login();
|
||||
updatenews->startsync();
|
||||
//app.connect (updatenews,SIGNAL(quitapp()),&app,SLOT(quit()));
|
||||
//QtAndroid::androidService().callMethod<void>("stopSelf");
|
||||
//return app.exec();
|
||||
}
|
||||
else{
|
||||
QApplication app(argc, argv);
|
||||
QQuickView view;
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load("friendiqa-" + QLocale::system().name(),":/translations");
|
||||
app.installTranslator(&qtTranslator);
|
||||
QtWebView::initialize();
|
||||
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
|
||||
RemoteAuthAsyncImageProvider *imageProvider = new RemoteAuthAsyncImageProvider;
|
||||
view.engine()->addImageProvider("remoteauthimage",imageProvider);
|
||||
view.rootContext()->setContextProperty("remoteauth", imageProvider);
|
||||
auto offlineStoragePath=QUrl::fromLocalFile(view.engine()->offlineStorageDatabaseFilePath("Friendiqa"));
|
||||
view.rootContext()->setContextProperty("offlineStoragePath", offlineStoragePath);
|
||||
// XHR* xhr = XHR::instance();
|
||||
// view.rootContext()->setContextProperty("xhr", xhr);
|
||||
XHR* xhr = XHR::instance();
|
||||
view.rootContext()->setContextProperty("xhr", xhr);
|
||||
FILESYSTEM* filesystem = FILESYSTEM::instance();
|
||||
view.rootContext()->setContextProperty("filesystem", filesystem);
|
||||
ALARM* alarm = ALARM::instance();
|
||||
view.rootContext()->setContextProperty("alarm", alarm);
|
||||
UPDATENEWS* updatenews = UPDATENEWS::instance();
|
||||
view.rootContext()->setContextProperty("updatenews", updatenews);
|
||||
view.setSource(QUrl("qrc:/qml/friendiqa.qml"));
|
||||
view.show();
|
||||
view.connect(view.rootContext()->engine(), SIGNAL(quit()), &app, SLOT(quit()));
|
||||
return app.exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue