Change the type of auto-launch attribute to TEXT.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 27 Dec 2012 03:48:04 +0000 (12:48 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 27 Dec 2012 03:48:04 +0000 (12:48 +0900)
To launch the app using explict package name.

Change-Id: I6eecec6986af258fbac07d7653cb449cf3050a15

include/livebox_internal.h
packaging/liblivebox-viewer.spec
src/client.c
src/livebox.c

index d7dc0ed..a5e88d3 100644 (file)
@@ -21,7 +21,7 @@ extern void lb_invoke_event_handler(struct livebox *handler, enum livebox_event_
 extern void lb_invoke_fault_handler(enum livebox_fault_type type, const char *pkgname, const char *filename, const char *function);
 extern int lb_set_content(struct livebox *handler, const char *content);
 extern int lb_set_title(struct livebox *handler, const char *title);
-extern void lb_set_auto_launch(struct livebox *handler, int auto_launch);
+extern void lb_set_auto_launch(struct livebox *handler, const char *auto_launch);
 extern struct livebox *lb_find_livebox(const char *pkgname, const char *filename);
 extern struct livebox *lb_new_livebox(const char *pkgname, const char *filename, double timestamp);
 extern struct livebox *lb_find_livebox_by_timestamp(double timestamp);
@@ -97,7 +97,7 @@ struct livebox {
                int height;
                double priority;
 
-               int auto_launch;
+               char *auto_launch;
                double period;
                int pinup_supported;
 
index 52bc65b..ffa8554 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for the development of a livebox viewer
-Version: 0.8.6
+Version: 0.8.8
 Release: 1
 Group: main/app
 License: Flora License
index e84c67b..93dceaf 100644 (file)
@@ -544,7 +544,7 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
        const char *title;
 
        double timestamp;
-       int auto_launch;
+       const char *auto_launch;
        double priority;
        int size_list;
        int user;
@@ -558,7 +558,7 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
 
        int ret;
 
-       ret = packet_get(packet, "dsssiiiissssidiiiiidsi",
+       ret = packet_get(packet, "dsssiiiisssssdiiiiidsi",
                        &timestamp,
                        &pkgname, &id, &content,
                        &lb_w, &lb_h, &pd_w, &pd_h,
@@ -574,7 +574,7 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
        ErrPrint("[%lf] pkgname: %s, id: %s, content: %s, "
                "pd_w: %d, pd_h: %d, lb_w: %d, lb_h: %d, "
                "cluster: %s, category: %s, lb_fname: \"%s\", pd_fname: \"%s\", "
-               "auto_launch: %d, priority: %lf, size_list: %d, user: %d, pinup: %d, "
+               "auto_launch: %s, priority: %lf, size_list: %d, user: %d, pinup: %d, "
                "lb_type: %d, pd_type: %d, period: %lf, title: [%s], is_pinned_up: %d\n",
                timestamp, pkgname, id, content,
                pd_w, pd_h, lb_w, lb_h,
index 0a8774d..9ec8c4a 100644 (file)
@@ -893,8 +893,8 @@ EAPI int livebox_click(struct livebox *handler, double x, double y)
        }
 
        if (handler->lb.auto_launch)
-               if (aul_launch_app(handler->pkgname, NULL) < 0)
-                       ErrPrint("Failed to launch app %s\n", handler->pkgname);
+               if (aul_launch_app(handler->lb.auto_launch, NULL) < 0)
+                       ErrPrint("Failed to launch app %s\n", handler->lb.auto_launch);
 
        timestamp = util_timestamp();
        packet = packet_create_noack("clicked", "sssddd", handler->pkgname, handler->id, "clicked", timestamp, x, y);
@@ -2281,9 +2281,14 @@ void lb_set_size_list(struct livebox *handler, int size_list)
        handler->lb.size_list = size_list;
 }
 
-void lb_set_auto_launch(struct livebox *handler, int auto_launch)
+void lb_set_auto_launch(struct livebox *handler, const char *auto_launch)
 {
-       handler->lb.auto_launch = auto_launch;
+       if (!strlen(auto_launch))
+               return;
+
+       handler->lb.auto_launch = strdup(auto_launch);
+       if (!handler->lb.auto_launch)
+               ErrPrint("Heap: %s\n", strerror(errno));
 }
 
 void lb_set_priority(struct livebox *handler, double priority)
@@ -2448,6 +2453,7 @@ struct livebox *lb_unref(struct livebox *handler)
        free(handler->id);
        free(handler->pkgname);
        free(handler->filename);
+       free(handler->lb.auto_launch);
 
        if (handler->lb.data.fb) {
                fb_destroy(handler->lb.data.fb);