Fix init/shutdown process in wkb-ibus and wkb-ibus-test
[profile/ivi/weekeyboard.git] / src / wkb-ibus-test.c
index e9bcf03..ec7d7a3 100644 (file)
  */
 
 #include "wkb-ibus.h"
+#include "wkb-log.h"
 
 #define _GNU_SOURCE
 #include <signal.h>
 
 #include <Eina.h>
-#include <Eet.h>
 #include <Ecore.h>
 #include <Eldbus.h>
+#include <Efreet.h>
 
 static void
 _finish(int foo)
 {
-   printf("FINISH\n");
+   ERR("FINISH\n");
    wkb_ibus_shutdown();
 }
 
@@ -40,31 +41,20 @@ _connect_timer(void *data)
 int
 main (int argc, char *argv[])
 {
-   int ret = 0;
-   if (!eet_init())
-     {
-        printf("Error initializing eet");
-        return 1;
-     }
+   int ret = 1;
+
+   if (!wkb_log_init("ibus-test"))
+      return 1;
 
    if (!ecore_init())
      {
-        printf("Error initializing ecore");
-        ret = 1;
+        ERR("Error initializing ecore");
         goto ecore_err;
      }
 
-   if (!eldbus_init())
-     {
-        printf("Error initializing eldbus");
-        ret = 1;
-        goto eldbus_err;
-     }
-
    if (!wkb_ibus_init())
      {
-        printf("Error initializing ibus");
-        ret = 1;
+        ERR("Error initializing ibus");
         goto end;
      }
 
@@ -74,15 +64,13 @@ main (int argc, char *argv[])
    signal(SIGINT, _finish);
 
    ecore_main_loop_begin();
+   ret = 0;
 
 end:
-   eldbus_shutdown();
-
-eldbus_err:
    ecore_shutdown();
 
 ecore_err:
-   eet_shutdown();
+   wkb_log_shutdown();
 
    return ret;
 }