diff options
author | Alastair Poole <netstar@gmail.com> | 2018-09-24 10:26:23 +0000 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-09-27 10:13:50 +0200 |
commit | c0b672db9c55488e0c47f8373c5e5a1a7b5c11b1 (patch) | |
tree | 2abec9801ddcd7e8bed8570dd22c11ff1384f7ce /src/lib/efreet | |
parent | 0e41b59f6dddd5ebeaf534196ed3d7a2813bee51 (diff) |
efreet_menu: remove unused and unreachable code.
Coverity doesn't like this unreachable code. This purges
efreet_menu of all unused code for the deprecated and
non-working menu_async methods. The warnings remain
at compile time and run time.
Differential Revision: https://phab.enlightenment.org/D7101
Diffstat (limited to 'src/lib/efreet')
-rw-r--r-- | src/lib/efreet/efreet_menu.c | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c index f48f13c07e..f3160b8b97 100644 --- a/src/lib/efreet/efreet_menu.c +++ b/src/lib/efreet/efreet_menu.c | |||
@@ -319,9 +319,6 @@ static void efreet_menu_path_set(Efreet_Menu_Internal *internal, const char *pat | |||
319 | static int efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent); | 319 | static int efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent); |
320 | static int efreet_menu_save_indent(FILE *f, int indent); | 320 | static int efreet_menu_save_indent(FILE *f, int indent); |
321 | 321 | ||
322 | static void _efreet_menu_async_parse_cb(void *data, Ecore_Thread *thread); | ||
323 | static void _efreet_menu_async_end_cb(void *data, Ecore_Thread *thread); | ||
324 | |||
325 | int | 322 | int |
326 | efreet_menu_init(void) | 323 | efreet_menu_init(void) |
327 | { | 324 | { |
@@ -530,43 +527,11 @@ efreet_menu_file_set(const char *file) | |||
530 | 527 | ||
531 | /* deprecated */ | 528 | /* deprecated */ |
532 | EFREET_DEPRECATED_API EAPI void | 529 | EFREET_DEPRECATED_API EAPI void |
533 | efreet_menu_async_get(Efreet_Menu_Cb func, const void *data) | 530 | efreet_menu_async_get(Efreet_Menu_Cb func EINA_UNUSED, const void *data EINA_UNUSED) |
534 | { | 531 | { |
535 | char menu[PATH_MAX]; | ||
536 | const char *dir; | ||
537 | Eina_List *config_dirs, *l; | ||
538 | |||
539 | ERR("%s is deprecated and shouldn't be called", __FUNCTION__); | 532 | ERR("%s is deprecated and shouldn't be called", __FUNCTION__); |
540 | 533 | ||
541 | return; | 534 | return; |
542 | |||
543 | |||
544 | if (!func) return; | ||
545 | |||
546 | #ifndef STRICT_SPEC | ||
547 | /* prefer user set menu */ | ||
548 | if (efreet_menu_file) | ||
549 | { | ||
550 | if (ecore_file_exists(efreet_menu_file)) | ||
551 | efreet_menu_async_parse(efreet_menu_file, func, data); | ||
552 | } | ||
553 | #endif | ||
554 | |||
555 | /* check the users config directory first */ | ||
556 | snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu", | ||
557 | efreet_config_home_get(), efreet_menu_prefix); | ||
558 | if (ecore_file_exists(menu)) | ||
559 | efreet_menu_async_parse(menu, func, data); | ||
560 | |||
561 | /* fallback to the XDG_CONFIG_DIRS */ | ||
562 | config_dirs = efreet_config_dirs_get(); | ||
563 | EINA_LIST_FOREACH(config_dirs, l, dir) | ||
564 | { | ||
565 | snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu", | ||
566 | dir, efreet_menu_prefix); | ||
567 | if (ecore_file_exists(menu)) | ||
568 | efreet_menu_async_parse(menu, func, data); | ||
569 | } | ||
570 | } | 535 | } |
571 | 536 | ||
572 | EAPI Efreet_Menu * | 537 | EAPI Efreet_Menu * |
@@ -606,18 +571,11 @@ efreet_menu_get(void) | |||
606 | 571 | ||
607 | /* deprecated */ | 572 | /* deprecated */ |
608 | EFREET_DEPRECATED_API EAPI void | 573 | EFREET_DEPRECATED_API EAPI void |
609 | efreet_menu_async_parse(const char *path, Efreet_Menu_Cb func, const void *data) | 574 | efreet_menu_async_parse(const char *path EINA_UNUSED, Efreet_Menu_Cb func EINA_UNUSED, const void *data EINA_UNUSED) |
610 | { | 575 | { |
611 | Efreet_Menu_Async *async; | ||
612 | |||
613 | ERR("%s is deprecated and shouldn't be called", __FUNCTION__); | 576 | ERR("%s is deprecated and shouldn't be called", __FUNCTION__); |
614 | 577 | ||
615 | return; | 578 | return; |
616 | async = NEW(Efreet_Menu_Async, 1); | ||
617 | async->func = func; | ||
618 | async->data = (void*)data; | ||
619 | async->path = eina_stringshare_add(path); | ||
620 | ecore_thread_run(_efreet_menu_async_parse_cb, _efreet_menu_async_end_cb, NULL, async); | ||
621 | } | 579 | } |
622 | 580 | ||
623 | EAPI Efreet_Menu * | 581 | EAPI Efreet_Menu * |
@@ -3925,20 +3883,3 @@ efreet_menu_save_indent(FILE *f, int indent) | |||
3925 | return 1; | 3883 | return 1; |
3926 | } | 3884 | } |
3927 | 3885 | ||
3928 | static void | ||
3929 | _efreet_menu_async_parse_cb(void *data, Ecore_Thread *thread EINA_UNUSED) | ||
3930 | { | ||
3931 | Efreet_Menu_Async *async = data; | ||
3932 | |||
3933 | async->menu = efreet_menu_parse(async->path); | ||
3934 | } | ||
3935 | |||
3936 | static void | ||
3937 | _efreet_menu_async_end_cb(void *data, Ecore_Thread *thread EINA_UNUSED) | ||
3938 | { | ||
3939 | Efreet_Menu_Async *async = data; | ||
3940 | |||
3941 | async->func(async->data, async->menu); | ||
3942 | eina_stringshare_del(async->path); | ||
3943 | free(async); | ||
3944 | } | ||