summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-11-02 10:11:02 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-11-18 11:36:46 -0500
commit6ec652a4ffcf7571abb233bcd6b03454f7e458a1 (patch)
tree8a8d2e4be7149777426ea04f477af0cf9033c1db
parentc6a8a52c0da45ccb83bc443942f3e019945cfd2d (diff)
add bool return for e_exec_phony_del() to return deletion success
CID 1181927
-rw-r--r--src/bin/e_client.c9
-rw-r--r--src/bin/e_exec.c17
-rw-r--r--src/bin/e_exec.h2
3 files changed, 16 insertions, 12 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 477d3e31c..6098d29af 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -585,15 +585,18 @@ _e_client_del(E_Client *ec)
585 if (ec->exe_inst) 585 if (ec->exe_inst)
586 { 586 {
587 if (ec->exe_inst->phony && (eina_list_count(ec->exe_inst->clients) == 1)) 587 if (ec->exe_inst->phony && (eina_list_count(ec->exe_inst->clients) == 1))
588 e_exec_phony_del(ec->exe_inst); 588 {
589 if (e_exec_phony_del(ec->exe_inst))
590 ec->exe_inst = NULL;
591 }
589 else 592 else
590 { 593 {
591 if (!ec->exe_inst->deleted) 594 if (!ec->exe_inst->deleted)
592 ec->exe_inst->clients = eina_list_remove(ec->exe_inst->clients, ec); 595 ec->exe_inst->clients = eina_list_remove(ec->exe_inst->clients, ec);
593 } 596 }
594 if (!ec->exe_inst->deleted)
595 ec->exe_inst = NULL;
596 } 597 }
598 if (ec->exe_inst && (!ec->exe_inst->deleted))
599 ec->exe_inst = NULL;
597 600
598 _e_client_mouse_action_end(ec); 601 _e_client_mouse_action_end(ec);
599 if (action_client == ec) _e_client_action_finish(); 602 if (action_client == ec) _e_client_action_finish();
diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c
index d9f29fc8b..702ede456 100644
--- a/src/bin/e_exec.c
+++ b/src/bin/e_exec.c
@@ -65,7 +65,7 @@ static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
65static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); 65static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
66static Evas_Object *_dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *lines); 66static Evas_Object *_dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *lines);
67static void _dialog_save_cb(void *data, void *data2); 67static void _dialog_save_cb(void *data, void *data2);
68static void _e_exec_instance_free(E_Exec_Instance *inst); 68static Eina_Bool _e_exec_instance_free(E_Exec_Instance *inst);
69 69
70/* local subsystem globals */ 70/* local subsystem globals */
71static Eina_List *e_exec_start_pending = NULL; 71static Eina_List *e_exec_start_pending = NULL;
@@ -211,14 +211,14 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
211 return inst; 211 return inst;
212} 212}
213 213
214E_API void 214E_API Eina_Bool
215e_exec_phony_del(E_Exec_Instance *inst) 215e_exec_phony_del(E_Exec_Instance *inst)
216{ 216{
217 if (!inst) return; 217 if (!inst) return EINA_TRUE;
218 EINA_SAFETY_ON_TRUE_RETURN(!inst->phony); 218 EINA_SAFETY_ON_TRUE_RETURN_VAL(!inst->phony, EINA_FALSE);
219 inst->ref--; 219 inst->ref--;
220 _e_exe_instance_watchers_call(inst, E_EXEC_WATCH_STOPPED); 220 _e_exe_instance_watchers_call(inst, E_EXEC_WATCH_STOPPED);
221 _e_exec_instance_free(inst); 221 return _e_exec_instance_free(inst);
222} 222}
223 223
224E_API E_Exec_Instance * 224E_API E_Exec_Instance *
@@ -587,13 +587,13 @@ _e_exec_cb_expire_timer(void *data)
587 return ECORE_CALLBACK_CANCEL; 587 return ECORE_CALLBACK_CANCEL;
588} 588}
589 589
590static void 590static Eina_Bool
591_e_exec_instance_free(E_Exec_Instance *inst) 591_e_exec_instance_free(E_Exec_Instance *inst)
592{ 592{
593 Eina_List *instances; 593 Eina_List *instances;
594 E_Client *ec; 594 E_Client *ec;
595 595
596 if (inst->ref) return; 596 if (inst->ref) return EINA_FALSE;
597 E_FREE_LIST(inst->watchers, free); 597 E_FREE_LIST(inst->watchers, free);
598 if (inst->key) 598 if (inst->key)
599 { 599 {
@@ -613,7 +613,7 @@ _e_exec_instance_free(E_Exec_Instance *inst)
613 inst->deleted = 1; 613 inst->deleted = 1;
614 inst->ref++; 614 inst->ref++;
615 ecore_event_add(E_EVENT_EXEC_DEL, inst, _e_exec_cb_exec_del_free, inst); 615 ecore_event_add(E_EVENT_EXEC_DEL, inst, _e_exec_cb_exec_del_free, inst);
616 return; 616 return EINA_FALSE;
617 } 617 }
618 if (inst->desktop) 618 if (inst->desktop)
619 e_exec_start_pending = eina_list_remove(e_exec_start_pending, 619 e_exec_start_pending = eina_list_remove(e_exec_start_pending,
@@ -629,6 +629,7 @@ _e_exec_instance_free(E_Exec_Instance *inst)
629 if (inst->exe) ecore_exe_data_set(inst->exe, NULL); 629 if (inst->exe) ecore_exe_data_set(inst->exe, NULL);
630 } 630 }
631 free(inst); 631 free(inst);
632 return EINA_TRUE;
632} 633}
633 634
634/* 635/*
diff --git a/src/bin/e_exec.h b/src/bin/e_exec.h
index df59b1d0c..2aa1f427d 100644
--- a/src/bin/e_exec.h
+++ b/src/bin/e_exec.h
@@ -36,7 +36,7 @@ EINTERN int e_exec_shutdown(void);
36E_API void e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data); 36E_API void e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data);
37E_API E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method); 37E_API E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
38E_API E_Exec_Instance *e_exec_phony(E_Client *ec); 38E_API E_Exec_Instance *e_exec_phony(E_Client *ec);
39E_API void e_exec_phony_del(E_Exec_Instance *inst); 39E_API Eina_Bool e_exec_phony_del(E_Exec_Instance *inst);
40E_API E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid); 40E_API E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid);
41E_API Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid); 41E_API Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);
42E_API E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop); 42E_API E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop);