Removed WFD_DBUS_LAUNCH because now wifi-direct library takes care of wfd-manager...
[apps/native/ug-wifi-direct.git] / ug-wifidirect / src / wfd_ug.c
index ee0ef80..b8a1691 100644 (file)
@@ -230,23 +230,8 @@ void wfd_destroy_ug(void *data)
        __FUNC_ENTER__;
        struct ug_data *ugd = (struct ug_data *) data;
 
-#ifdef WFD_DBUS_LAUNCH
-       if (ugd->dbus_cancellable != NULL) {
-               g_cancellable_cancel(ugd->dbus_cancellable);
-               g_object_unref(ugd->dbus_cancellable);
-               ugd->dbus_cancellable = NULL;
-               if (ugd->conn) {
-                       g_object_unref(ugd->conn);
-                       ugd->conn = NULL;
-               }
-               DBG(LOG_INFO, "Cancelled dbus call");
-               return;
-       } else
-#endif
-       {
-               DBG(LOG_INFO, "dbus_cancellable is NULL");
-               ug_destroy_me(ugd->ug);
-       }
+       DBG(LOG_INFO, "dbus_cancellable is NULL");
+       ug_destroy_me(ugd->ug);
 
        __FUNC_EXIT__;
        return;
@@ -269,33 +254,6 @@ static void wfd_ug_layout_del_cb(void *data , Evas *e, Evas_Object *obj, void *e
        __FUNC_EXIT__;
 }
 
-#ifdef WFD_DBUS_LAUNCH
-/**
- *     This function let the ug initialize wfd
- *     @return   void
- *     @param[in] data the pointer to the main data structure
- *     @param[in] evas the pointer to the evas canvas
- *     @param[in] obj the pointer to the evas object
- *     @param[in] event_info the pointer to the event information
- */
-static void _wfd_init_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
-{
-       __FUNC_ENTER__;
-       int res = -1;
-       struct ug_data *ugd = (struct ug_data *)data;
-       WFD_RET_IF(ugd == NULL || ugd->base == NULL, "Incorrect parameter(NULL)\n");
-
-       evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb);
-
-       res = launch_wifi_direct_manager(ugd);
-       if (res != 0)
-               DBG(LOG_ERROR, "Failed to launch wifi direct manager\n");
-
-       __FUNC_EXIT__;
-       return;
-}
-#endif
-
 static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, void *priv)
 {
        __FUNC_ENTER__;
@@ -469,9 +427,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control,
        } else {
                ugd->wfd_status = WIFI_DIRECT_STATE_DEACTIVATED;
 
-#ifdef WFD_DBUS_LAUNCH
-               evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb, ugd);
-#else
                ret = init_wfd_client(ugd);
                WFD_RETV_IF(ret != 0, NULL,  "Failed to initialize WFD client library\n");
 
@@ -481,7 +436,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control,
                        ret = wfd_client_switch_on(ugd);
                        WFD_RETV_IF(ret != 0, NULL, "Failed to activate WFD\n");
                }
-#endif
        }
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR,
                        __wfd_main_vconf_change_cb, ugd);
@@ -626,11 +580,6 @@ static void on_destroy(ui_gadget_h ug, app_control_h control, void *priv)
        WFD_IF_FREE_MEM(ugd->view_type);
 
        WFD_IF_DEL_OBJ(ugd->bg);
-
-#ifdef WFD_DBUS_LAUNCH
-       if (ugd->base)
-               evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb);
-#endif
        WFD_IF_DEL_OBJ(ugd->base);
        DBG(LOG_INFO, "WFD client deregistered");