Remove global variable to check the exist of smartreply 31/250731/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 4 Jan 2021 06:41:14 +0000 (15:41 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 4 Jan 2021 06:58:46 +0000 (15:58 +0900)
Change-Id: Ib62e86c920797548ff6995c4291475a20579cc41
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/ise.cpp

index 30a5ccd..b8f50de 100644 (file)
@@ -87,7 +87,6 @@ static string g_current_punctuation[MAX_DEFAULT_PUNCTUATION-1] = {"RCENT1", "RCE
 static vector<string> g_softcandidate_string;
 static bool g_softcandidate_show = false;
 static bool g_input_panel_show = false;
-static bool g_smartreply_reply_exist = false;
 static unsigned int g_smartreply_size = 0;
 static bool g_caps_mode_pending = false;
 static bool g_floating_mode = false;
@@ -310,7 +309,6 @@ static void _input_smartreply_notify_cb(void *user_data)
                 }
             }
             g_ic_smartreply = g_ic;
-            g_smartreply_reply_exist = true;
 
             ise_app_candidate_show();
             g_softcandidate_string = g_smartreply_strings;
@@ -2856,7 +2854,7 @@ static void ime_app_focus_in_cb(int context_id, void *user_data)
     LOGD("Enter\n");
     ise_focus_in(context_id);
     Candidate *candidate = get_candidate();
-    if (!g_smartreply_reply_exist && g_softcandidate_show) {
+    if (input_smartreply_get_reply_num() == 0 && g_softcandidate_show) {
         if (candidate) {
             ise_app_candidate_hide();
             candidate->hide();
@@ -2874,7 +2872,6 @@ static void ime_app_focus_out_cb(int context_id, void *user_data)
 #ifdef HAVE_CBHM
     g_set_mime_type = FALSE;
 #endif
-    g_smartreply_reply_exist = false;
     g_smartreply_size = 0;
     input_smartreply_deinit();
     g_ic_smartreply = -1;
@@ -3056,7 +3053,7 @@ static void ime_app_lookup_table_changed_cb(Eina_List *list, void *user_data)
         }
     }
 
-    if (g_smartreply_reply_exist) {
+    if (input_smartreply_get_reply_num() > 0) {
         if (candidate_strings[0] == "#" && candidate_strings[1] == "$") {
             char *text = NULL;
             int cursor;
@@ -3215,8 +3212,6 @@ static void ime_app_prediction_hint_set_cb(const char *prediction_hint, void *us
 
         if (input_smartreply_is_enabled()) {
             g_smartreply_size = 0;
-            g_smartreply_reply_exist = false;
-
             input_smartreply_get_reply_async();
         }
     }