diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2016-03-08 13:46:22 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2016-03-08 13:53:00 +0900 |
commit | 3c8ed6d80d5a6d6908230e1a73381ee1c2f34a74 (patch) | |
tree | 4de767bff604ff372b55746c3ef3948fbb172a13 | |
parent | 442929201a44116af918bf9d3ed58a4979eacda2 (diff) | |
download | net-popup-accepted/tizen/ivi/20160310.055224.tar.gz net-popup-accepted/tizen/ivi/20160310.055224.tar.bz2 net-popup-accepted/tizen/ivi/20160310.055224.zip |
Replace the dbus-glib to GDbussubmit/tizen/20160309.063337accepted/tizen/wearable/20160310.055159accepted/tizen/tv/20160310.055130accepted/tizen/mobile/20160310.055100accepted/tizen/ivi/20160310.055224accepted/tizen/common/20160310.081220
Change-Id: Ibd06a3ff93fb5faa2b7a504f2b6a6d686368588d
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | packaging/net.netpopup.spec | 4 | ||||
-rwxr-xr-x | src/net-popup.c | 56 |
3 files changed, 33 insertions, 30 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cc44736..e0a3043 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,9 @@ pkg_check_modules(pkgs REQUIRED syspopup notification capi-appfw-application - dbus-glib-1 glib-2.0 + gio-2.0 + gio-unix-2.0 appsvc vconf efl-extension) diff --git a/packaging/net.netpopup.spec b/packaging/net.netpopup.spec index c9646e5..67b59a3 100644 --- a/packaging/net.netpopup.spec +++ b/packaging/net.netpopup.spec @@ -1,6 +1,6 @@ Name: net.netpopup Summary: Network Notification Popup applicationa -Version: 0.2.78 +Version: 0.2.79 Release: 1 Group: App/Network License: Flora-1.1 @@ -16,8 +16,8 @@ BuildRequires: pkgconfig(evas) BuildRequires: pkgconfig(syspopup) BuildRequires: pkgconfig(syspopup-caller) BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(notification) BuildRequires: pkgconfig(appsvc) BuildRequires: pkgconfig(vconf) diff --git a/src/net-popup.c b/src/net-popup.c index 904d4d6..f066d29 100755 --- a/src/net-popup.c +++ b/src/net-popup.c @@ -32,9 +32,8 @@ #include <app_control_internal.h> #include <vconf.h> #include <vconf-keys.h> +#include <gio/gio.h> #include <dbus/dbus.h> -#include <dbus/dbus-glib.h> -#include <dbus/dbus-glib-lowlevel.h> #include <bundle_internal.h> #include <efl_extension.h> @@ -81,8 +80,8 @@ char *units[] = {"GB", "MB", "KB", "B"}; static app_control_h g_req_handle = NULL; static char * resp_popup_mode = NULL; -static DBusGConnection *conn = NULL; -static DBusGProxy *proxy = NULL; +static GDBusConnection *conn = NULL; +static GDBusProxy *proxy = NULL; static int __net_popup_show_notification(app_control_h request, void *data); static int __toast_popup_show(app_control_h request, void *data); @@ -95,20 +94,24 @@ static void __net_popup_show_popup_with_user_resp(app_control_h request, void *d static int _net_popup_send_user_resp(char *resp, Eina_Bool state); -DBusGProxy *__net_popup_init_dbus(void) +GDBusProxy *__net_popup_init_dbus(void) { GError *err = NULL; - conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &err); + conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); if (err != NULL) { g_error_free(err); return NULL; } - proxy = dbus_g_proxy_new_for_name(conn, "net.netpopup", - "/Netpopup", "net.netpopup"); + proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE, NULL, + "net.netpopup", + "/Netpopup", + "net.netpopup", + NULL, &err); + if (proxy == NULL) { - dbus_g_connection_unref(conn); + g_object_unref(conn); conn = NULL; } @@ -123,7 +126,7 @@ void __net_popup_deinit_dbus(void) } if (conn) { - dbus_g_connection_unref(conn); + g_object_unref(conn); conn = NULL; } @@ -136,32 +139,31 @@ int __net_popup_send_dbus_msg(const char *resp) return -1; } - DBusConnection *gconn = NULL; - DBusMessage *msg = NULL; + GDBusConnection *gconn = NULL; + GVariant *msg = NULL; char *module = "wifi"; + GError *err = NULL; - gconn = dbus_g_connection_get_connection(conn); - if (gconn == NULL) { + gconn = g_bus_get_sync(DBUS_BUS_SYSTEM, NULL, &err); + if (err != NULL) { + g_error_free(err); + err = NULL; return -1; } - msg = dbus_message_new_signal("/Org/Tizen/Quickpanel", - "org.tizen.quickpanel", - "ACTIVITY"); - if (!msg) { + msg = g_variant_new("(ss)", module, resp); + g_dbus_connection_emit_signal(gconn, NULL, "/Org/Tizen/Quickpanel", + "org.tizen.quickpanel", "ACTIVITY", msg, &err); + if (err) { + g_error_free(err); return -1; } - if (!dbus_message_append_args(msg, - DBUS_TYPE_STRING, &module, - DBUS_TYPE_STRING, &resp, - DBUS_TYPE_INVALID)) { - dbus_message_unref(msg); - return -1; - } + g_variant_unref(msg); + + if (gconn) + g_object_unref(gconn); - dbus_connection_send(gconn, msg, NULL); - dbus_message_unref(msg); return 0; } |