Diff
04 Jul 2010
 
 
 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/src/apps.c b/src/apps.c
index ee2de9c..7772dfc 100644
--- a/src/apps.c
+++ b/src/apps.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <libintl.h>
-#include <Ecore_Data.h>
+#include <Eina.h>
#include <Evas.h>
#include <Ecore_File.h>
#include <Efreet.h>
@@ -10,7 +10,7 @@
#include "choices.h"
#include "apps.h"
-Ecore_List *
+Eina_List *
_load_desktops(const char *path, const char *category) {
char fullname[1024];
char *filename;
@@ -19,14 +19,7 @@ _load_desktops(const char *path, const char *category) {
Eina_List *ls_orig;
Eina_List *l;
char *data;
- Ecore_List *desktops = ecore_list_new();
-
- if(!desktops)
- {
- printf("out of memory\n");
- return desktops;
- }
- ecore_list_free_cb_set(desktops, ECORE_FREE_CB(efreet_desktop_free));
+ Eina_List *desktops = NULL;
ls_orig = ls = ecore_file_ls(path);
if(!ls) {
@@ -52,7 +45,7 @@ _load_desktops(const char *path, const char *category) {
if(eina_list_search_unsorted(current->categories,
EINA_COMPARE_CB(strcmp), category))
{
- ecore_list_append(desktops, current);
+ desktops = eina_list_append(desktops, current);
continue;
}
}
@@ -72,7 +65,7 @@ static void apps_draw_handler(Evas_Object *choicebox __attribute__((unused)),
void *param)
{
Efreet_Desktop *desktop;
- desktop = ecore_list_index_goto((Ecore_List *) param, item_num);
+ desktop = eina_list_nth_list((Eina_List *) param, item_num);
if (!desktop)
return;
edje_object_part_text_set(item, "center-caption", desktop->name);
@@ -89,7 +82,7 @@ static void apps_handler(Evas_Object *choicebox __attribute__((unused)),
void *param)
{
Efreet_Desktop *desktop;
- desktop = ecore_list_index_goto((Ecore_List *) param, item_num);
+ desktop = eina_list_nth_list((Eina_List *) param, item_num);
if (!desktop)
return;
efreet_desktop_exec(desktop, NULL, NULL);
@@ -98,14 +91,14 @@ static void apps_handler(Evas_Object *choicebox __attribute__((unused)),
void run_desktop_files(Evas *canvas, const char *path, const char *category)
{
Evas_Object *choicebox;
- Ecore_List *desktops = _load_desktops(path, category);
+ Eina_List *desktops = _load_desktops(path, category);
int count;
if(!desktops) {
printf("Can't read desktops\n");
return;
}
Evas_Object *main_choicebox = evas_object_name_find(canvas, "choicebox");
- count = ecore_list_count(desktops);
+ count = eina_list_count(desktops);
printf("%d desktops loaded\n", count);
choicebox = choicebox_push(main_choicebox, canvas,
apps_handler,