Add to remove the shortcut when container is removed 39/93039/5 accepted/tizen/3.0/common/20161116.143245 accepted/tizen/3.0/ivi/20161116.021101 accepted/tizen/3.0/mobile/20161116.021005 accepted/tizen/3.0/tv/20161116.021019 accepted/tizen/3.0/wearable/20161116.021040 accepted/tizen/common/20161114.171527 accepted/tizen/ivi/20161114.074214 accepted/tizen/mobile/20161114.074120 accepted/tizen/tv/20161114.074127 accepted/tizen/wearable/20161114.074155 submit/tizen/20161114.035936 submit/tizen_3.0/20161114.035945 submit/tizen_3.0/20161114.045617 submit/tizen_3.0/20161115.020653
authorSungbae Yoo <sungbae.yoo@samsung.com>
Thu, 20 Oct 2016 02:45:31 +0000 (11:45 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Thu, 10 Nov 2016 08:23:40 +0000 (17:23 +0900)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: I04fc0f358ec32a9873839ba1af16084144f01a7d

tools/apps/keyguard/src/main.c

index f04bc21..8ddae52 100644 (file)
@@ -51,7 +51,7 @@ unsigned int _get_left_attempts()
 {
        unsigned int attempt = 0, max_attempt = 0, expire_sec;
 
-        auth_passwd_check_passwd_state(AUTH_PWD_NORMAL, &attempt, &max_attempt, &expire_sec);
+               auth_passwd_check_passwd_state(AUTH_PWD_NORMAL, &attempt, &max_attempt, &expire_sec);
 
        if (max_attempt == 0) {
                return 0xffffffff;
@@ -80,6 +80,11 @@ static void __add_shortcut(const char* krate_name)
        shortcut_add_to_home(krate_name, LAUNCH_BY_URI, uri, ICON_PATH "/shortcut_icon.png", 0, NULL, NULL);
 }
 
+static void __remove_shortcut(const char* krate_name)
+{
+       shortcut_remove_from_home(krate_name, NULL, NULL);
+}
+
 static bool __app_create(void *data)
 {
        return true;
@@ -128,6 +133,13 @@ static void __app_control(app_control_h app_control, void *data)
                __add_shortcut(krate_name);
                ui_app_exit();
                return;
+       } else if (strncmp(tmp, "cleanup/", sizeof("cleanup/") - 1) == 0) {
+               char *krate_name;
+
+               krate_name = tmp + sizeof("cleanup/") - 1;
+               __remove_shortcut(krate_name);
+               ui_app_exit();
+               return;
        } else if (strncmp(tmp, "enter/", sizeof("enter/") - 1) == 0) {
                char* krate_name, *launch_parameter;
                char new_uri[PATH_MAX];
@@ -137,7 +149,7 @@ static void __app_control(app_control_h app_control, void *data)
                if (launch_parameter != NULL) {
                        *(launch_parameter++) = '\0';
                        if (launch_parameter[0] == '\0') {
-                               launch_parameter = KASKIT_PACKAGE;      
+                               launch_parameter = KASKIT_PACKAGE;
                        }
                } else {
                        launch_parameter = KASKIT_PACKAGE;
@@ -153,7 +165,7 @@ static void __app_control(app_control_h app_control, void *data)
                __launch_krate_app(krate_name, app_control);
                ui_app_exit();
                return;
-       }else if (strncmp(tmp, "launch/", sizeof("launch/") - 1) == 0) {
+       } else if (strncmp(tmp, "launch/", sizeof("launch/") - 1) == 0) {
                char* app_id;
 
                app_id = tmp + sizeof("launch/") - 1;