summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-03-29 12:00:14 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-03-29 12:00:14 +0000
commitc3691314e7e0a9ec7abbb2aa1937619d98a15008 (patch)
treea73eab99b1dd460d4cfae6d2d6cbb0563816c635 /legacy/elementary
parent8c17d99712d530f2532dcd0546b2a5b47cf02bc8 (diff)
make elm robust and handle if u DONT set compile time dirs.. and work
anyway. SVN revision: 69750
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/examples/image_example_01.c3
-rw-r--r--legacy/elementary/src/lib/elm_main.c13
2 files changed, 11 insertions, 5 deletions
diff --git a/legacy/elementary/src/examples/image_example_01.c b/legacy/elementary/src/examples/image_example_01.c
index 0b358d8d2c..c6b1665e38 100644
--- a/legacy/elementary/src/examples/image_example_01.c
+++ b/legacy/elementary/src/examples/image_example_01.c
@@ -10,6 +10,7 @@ elm_main(int argc, char **argv)
10 Evas_Object *win, *bg, *image; 10 Evas_Object *win, *bg, *image;
11 char buf[PATH_MAX]; 11 char buf[PATH_MAX];
12 12
13 elm_app_info_set(elm_main, "elementary", "images/plant_01.jpg");
13 win = elm_win_add(NULL, "image", ELM_WIN_BASIC); 14 win = elm_win_add(NULL, "image", ELM_WIN_BASIC);
14 elm_win_title_set(win, "Image"); 15 elm_win_title_set(win, "Image");
15 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 16 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@@ -21,7 +22,7 @@ elm_main(int argc, char **argv)
21 elm_win_resize_object_add(win, bg); 22 elm_win_resize_object_add(win, bg);
22 evas_object_show(bg); 23 evas_object_show(bg);
23 24
24 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", DATA_DIR); 25 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
25 26
26 image = elm_image_add(win); 27 image = elm_image_add(win);
27 if (!elm_image_file_set(image, buf, NULL)) 28 if (!elm_image_file_set(image, buf, NULL))
diff --git a/legacy/elementary/src/lib/elm_main.c b/legacy/elementary/src/lib/elm_main.c
index 15365121b6..a1ab345b75 100644
--- a/legacy/elementary/src/lib/elm_main.c
+++ b/legacy/elementary/src/lib/elm_main.c
@@ -107,6 +107,7 @@ _prefix_check(void)
107 char **argv = NULL; 107 char **argv = NULL;
108 const char *dirs[4] = { NULL, NULL, NULL, NULL }; 108 const char *dirs[4] = { NULL, NULL, NULL, NULL };
109 char *caps = NULL, *p1, *p2; 109 char *caps = NULL, *p1, *p2;
110 char buf[PATH_MAX];
110 111
111 if (app_pfx) return; 112 if (app_pfx) return;
112 if (!app_domain) return; 113 if (!app_domain) return;
@@ -118,11 +119,15 @@ _prefix_check(void)
118 dirs[1] = app_compile_lib_dir; 119 dirs[1] = app_compile_lib_dir;
119 dirs[2] = app_compile_data_dir; 120 dirs[2] = app_compile_data_dir;
120 dirs[3] = app_compile_locale_dir; 121 dirs[3] = app_compile_locale_dir;
121 122
122 if (!dirs[1]) dirs[1] = dirs[0]; 123 if (!dirs[0]) dirs[0] = "/usr/local/bin";
123 if (!dirs[0]) dirs[0] = dirs[1]; 124 if (!dirs[1]) dirs[1] = "/usr/local/lib";
125 if (!dirs[2])
126 {
127 snprintf(buf, sizeof(buf), "/usr/local/share/%s", app_domain);
128 dirs[2] = buf;
129 }
124 if (!dirs[3]) dirs[3] = dirs[2]; 130 if (!dirs[3]) dirs[3] = dirs[2];
125 if (!dirs[2]) dirs[2] = dirs[3];
126 131
127 if (app_domain) 132 if (app_domain)
128 { 133 {