aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-05-30 16:42:52 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-05-30 16:42:52 +0800
commita01dcdae19a645ccb2924d7c1003f4186696b48e (patch)
treec7caabe71643e535dac6f67b7717967ed9c50794
parent4a8b7a6301e4b093c99329d0a16fbee6c535f312 (diff)
change start sequencesandbox/wangzhiqiang/als2019
-rw-r--r--app/app.pri2
-rw-r--r--app/main.cpp31
-rw-r--r--package/config.xml1
3 files changed, 10 insertions, 24 deletions
diff --git a/app/app.pri b/app/app.pri
index a1f6562..3bd7b93 100644
--- a/app/app.pri
+++ b/app/app.pri
@@ -5,7 +5,7 @@ qtCompileTest(qlibwindowmanager)
config_libhomescreen {
CONFIG += link_pkgconfig
- PKGCONFIG += libhomescreen
+ PKGCONFIG += qlibhomescreen
DEFINES += HAVE_LIBHOMESCREEN
}
diff --git a/app/main.cpp b/app/main.cpp
index 6194c25..05eaf31 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -13,7 +13,7 @@
#include "file_operation.h"
#ifdef HAVE_LIBHOMESCREEN
-#include <libhomescreen.hpp>
+#include <qlibhomescreen.h>
#endif
#ifdef HAVE_QLIBWINDOWMANAGER
#include <qlibwindowmanager.h>
@@ -65,28 +65,13 @@ int main(int argc, char *argv[])
#ifdef HAVE_LIBHOMESCREEN
// HomeScreen
- LibHomeScreen* hs = new LibHomeScreen();
+ QLibHomeScreen* qhs = new QLibHomeScreen();
std::string token = secret.toStdString();
- hs->init(port, token.c_str());
+ qhs->init(port, token.c_str());
// Set the event handler for Event_TapShortcut which will activate the surface for windowmanager
- hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [qwm, myname](json_object *object){
-
- json_object *appnameJ = nullptr;
- if(json_object_object_get_ex(object, "application_name", &appnameJ))
- {
- const char *appname = json_object_get_string(appnameJ);
- if(QString::compare(myname, appname, Qt::CaseInsensitive) == 0)
- {
- qDebug("Surface %s got tapShortcut\n", appname);
- json_object *para, *area;
- json_object_object_get_ex(object, "parameter", &para);
- json_object_object_get_ex(para, "area", &area);
- const char *displayArea = json_object_get_string(area);
- qDebug("Surface %s got tapShortcut area\n", displayArea);
-// qwm->activateWindow(myname, QString(QLatin1String(displayArea)));
- qwm->activateWindow(myname, "master.split.sub");
- }
- }
+ qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow, [qwm, myname](json_object *object){
+ qDebug("Surface %s got tapShortcut\n", myname);
+ qwm->activateWindow(myname);
});
#endif
qmlRegisterType<QCheapRuler>("com.mapbox.cheap_ruler", 1, 0, "CheapRuler");
@@ -98,7 +83,9 @@ int main(int argc, char *argv[])
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
-
+#ifdef HAVE_LIBHOMESCREEN
+ qhs->setQuickWindow(window);
+#endif
//make the DBus connection info
QString pathBase = "org.agl.";
QString objBase = "/org/agl/";
diff --git a/package/config.xml b/package/config.xml
index 8aaf856..c1905ec 100644
--- a/package/config.xml
+++ b/package/config.xml
@@ -11,7 +11,6 @@
<param name="homescreen" value="ws"/>
</feature>
<feature name="urn:AGL:widget:required-permission">
- <param name="urn:AGL:permission::system:run-by-default" value="required"/>
<param name="urn:AGL:permission::public:no-htdocs" value="required" />
<param name="http://tizen.org/privilege/internal/dbus" value="required"/>
</feature>