Replace json_parser_new with g_XXX_type_get 73/15673/1
authorSung-jae Park <nicesj.park@samsung.com>
Sat, 25 Jan 2014 05:40:00 +0000 (14:40 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sat, 25 Jan 2014 05:40:00 +0000 (14:40 +0900)
to intialize the glib type system for each objects.

Change-Id: Icda6164f180844f0c24cbcad087dac16a379130d

src/main.c

index 0972992..a5c1a2f 100644 (file)
@@ -215,6 +215,196 @@ static void time_changed_cb(keynode_t *node, void *user_data)
        lb_system_event_all(LB_SYS_EVENT_TIME_CHANGED);
 }
 
+static void initialize_glib_type_system(void)
+{
+       GType type;
+
+       type = G_TYPE_DBUS_ACTION_GROUP;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_ANNOTATION_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_ARG_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_AUTH_OBSERVER;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_CALL_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_CAPABILITY_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_CONNECTION;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_CONNECTION_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_ERROR;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_INTERFACE;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_INTERFACE_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_INTERFACE_SKELETON;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_INTERFACE_SKELETON_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_MENU_MODEL;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_MESSAGE;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_MESSAGE_BYTE_ORDER;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_MESSAGE_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_MESSAGE_HEADER_FIELD;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_MESSAGE_TYPE;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_METHOD_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_METHOD_INVOCATION;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_NODE_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT_MANAGER;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT_MANAGER_CLIENT;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT_MANAGER_CLIENT_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT_MANAGER_SERVER;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT_PROXY;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_OBJECT_SKELETON;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_PROPERTY_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_PROPERTY_INFO_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_PROXY;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_PROXY_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_SEND_MESSAGE_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_SERVER;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_SERVER_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_SIGNAL_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_SIGNAL_INFO;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = G_TYPE_DBUS_SUBTREE_FLAGS;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_NODE;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_OBJECT;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_ARRAY;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_ARRAY;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_SERIALIZABLE;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_PARSER;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+       type = JSON_TYPE_GENERATOR;
+       if (type != G_TYPE_OBJECT) {
+               DbgPrint("initialized\n");
+       }
+}
+
 static bool app_create(void *data)
 {
        int ret;
@@ -222,11 +412,7 @@ static bool app_create(void *data)
        /*!
         * Touch the glib type system
         */
-       JsonParser *parser;
-       parser = json_parser_new();
-       if (parser) {
-               g_object_unref(parser);
-       }
+       initialize_glib_type_system();
 
        conf_update_size();