Use app_laucher to launch applications registered by application framework. 64/38964/1 accepted/tizen_common tizen tizen_3.0.2015.q2_common accepted/tizen/common/20150511.125909 submit/tizen_common/20150511.102306
authorBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Wed, 29 Oct 2014 13:23:41 +0000 (14:23 +0100)
committerRafal Krypa <r.krypa@samsung.com>
Mon, 4 May 2015 09:45:24 +0000 (11:45 +0200)
In Tizen, applications installed have specific destop file field.

When it appears in destop file use "app_launcher -s <appid>" to launch them

changes in review : https://review.tizen.org/gerrit/29552 are needed first
BUG-Tizen=TC-1968

Change-Id: I213976616f7f8bca9b550bc738d2c7e6b6638c5d
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
src/tz-launcher.c

index 8f8d9fc..c116c91 100644 (file)
@@ -51,7 +51,7 @@ gboolean
 file_is_desktop_file_for_application (GFile *file, gboolean store_values, gchar ***table)
 {
        gboolean result;
-
+       gchar *appid;
        GKeyFile *keyfile = g_key_file_new ();
        g_key_file_load_from_file (keyfile, g_file_get_path(file), G_KEY_FILE_NONE, NULL);
 
@@ -59,7 +59,13 @@ file_is_desktop_file_for_application (GFile *file, gboolean store_values, gchar
        gchar **values = g_new (gchar*, 7);
        values[0] = g_key_file_get_value (keyfile, "Desktop Entry", "Name", &error);
        values[1] = g_key_file_get_value (keyfile, "Desktop Entry", "Comment", NULL);
-       values[2] = g_key_file_get_value (keyfile, "Desktop Entry", "Exec", &error);
+       appid = g_key_file_get_value (keyfile, "Desktop Entry", "X-TIZEN-AppID", NULL);
+       if (!appid)
+               values[2] = g_key_file_get_value (keyfile, "Desktop Entry", "Exec", &error);
+       else {
+               values[2] = g_strdup_printf ("app_launcher -s %s",appid);
+               g_free(appid);
+       }
        values[3] = g_key_file_get_value (keyfile, "Desktop Entry", "Icon", NULL);
        values[4] = g_key_file_get_value (keyfile, "Desktop Entry", "Terminal", NULL);
        values[5] = g_key_file_get_value (keyfile, "Desktop Entry", "Type", &error);