mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 19:12:28 -04:00
Retroshare QML App: Implemesh some basic stuff
Implement location creation, selection and login Implement people listing Implement firends adding (not working yet) Depend on androidextra qt module only if compiling for android LibresapiLocalClient parse one line at time to avoid error if two requests are sent rapidly one after another LibresapiLocalClient socket path now is a parameter of openConnection() to use it as qml type constructor without parameter must be useful Added JSONListModel for JASON based MVC pattern
This commit is contained in:
parent
ad21d7202a
commit
8d6d3d1894
15 changed files with 565 additions and 99 deletions
|
@ -22,7 +22,10 @@
|
|||
#include <QQmlComponent>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QtAndroidExtras>
|
||||
#ifdef __ANDROID__
|
||||
# include <QtAndroidExtras>
|
||||
#endif
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDateTime>
|
||||
|
||||
|
@ -35,20 +38,28 @@ int main(int argc, char *argv[])
|
|||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
qmlRegisterType<LibresapiLocalClient>(
|
||||
"org.retroshare.qml_components.LibresapiLocalClient", 1, 0,
|
||||
"LibresapiLocalClient");
|
||||
|
||||
QString sockPath = QString::fromStdString(RsAccounts::ConfigDirectory());
|
||||
sockPath.append("/libresapi.sock");
|
||||
LibresapiLocalClient llc(sockPath);
|
||||
qmlRegisterType<LibresapiLocalClient>("LibresapiLocalClientQml", 1, 0, "LibresapiLocalClientComm");
|
||||
|
||||
engine.rootContext()->setContextProperty("llc", &llc);
|
||||
engine.load(QUrl(QLatin1String("qrc:/qml/main.qml")));
|
||||
#ifndef __ANDROID__
|
||||
sockPath = "/home/gio/.retroshare/LOC06_8730499b55bb946424d537b180bee10a/libresapi.sock";
|
||||
#endif
|
||||
|
||||
QFileInfo fileInfo(sockPath);
|
||||
engine.rootContext()->setContextProperty("apiSocketPath", sockPath);
|
||||
engine.load(QUrl(QLatin1String("qrc:/qml/main.qml")));
|
||||
|
||||
QFileInfo fileInfo(sockPath);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
qDebug() << "Is main.cpp running as a service?" << QtAndroid::androidService().isValid();
|
||||
qDebug() << "Is main.cpp running as an activity?" << QtAndroid::androidActivity().isValid();
|
||||
qDebug() << "QML APP:" << sockPath << fileInfo.exists() << fileInfo.lastModified().toString();
|
||||
#endif
|
||||
|
||||
qDebug() << "QML APP:" << sockPath << fileInfo.exists() << fileInfo.lastModified().toString();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue