Correctly handle urls wrt to url encoding

If the file is a real url (with urlencoded chars) then use
efreet_uri_decode to decode the uri and use the decoded
string in place of the raw file in window title and playlist items
v-0.4.0
Davide Andreoli 8 years ago
parent 6265d0dd71
commit bfa96f2e08
  1. 1
      src/bin/main.c
  2. 4
      src/bin/win.c
  3. 2
      src/bin/winlist.c
  4. 3
      src/bin/winvid.c
  5. 1
      src/bin/winvid.h

@ -121,6 +121,7 @@ elm_main(int argc, char **argv)
{
if (vid->file) eina_stringshare_del(vid->file);
if (vid->sub) eina_stringshare_del(vid->sub);
if (vid->uri) efreet_uri_free(vid->uri);
free(vid);
}

@ -42,6 +42,7 @@ _cb_win_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
{
if (vid->file) eina_stringshare_del(vid->file);
if (vid->sub) eina_stringshare_del(vid->sub);
if (vid->uri) efreet_uri_free(vid->uri);
free(vid);
}
evas_object_data_del(obj, "inf");
@ -280,6 +281,7 @@ win_video_delete(Evas_Object *win)
{
if (vid->file) eina_stringshare_del(vid->file);
if (vid->sub) eina_stringshare_del(vid->sub);
if (vid->uri) efreet_uri_free(vid->uri);
free(vid);
inf->file_list = eina_list_remove_list(inf->file_list, l);
direction = (l_next == NULL ? -1 : 1);
@ -425,7 +427,7 @@ win_title_update(Evas_Object *win)
}
else
{
s = ecore_file_file_get(file);
s = ecore_file_file_get(vid->uri ? vid->uri->path : file);
if ((s) && (s[0] != 0))
snprintf(buf, sizeof(buf), "Rage: %s", s);
else

@ -174,7 +174,7 @@ _fill_box(Evas_Object *win)
elm_layout_signal_callback_add(o, "rage,selected", "rage", _cb_selected, win);
evas_object_data_set(o, "list", l);
s = ecore_file_file_get(vid->file);
s = ecore_file_file_get(vid->uri ? vid->uri->path : vid->file);
if ((s) && (s[0] != 0)) elm_object_part_text_set(o, "rage.title", s);
else elm_object_part_text_set(o, "rage.title", vid->file);

@ -219,6 +219,7 @@ win_video_file_list_set(Evas_Object *win, Eina_List *list)
{
if (vid->file) vid2->file = eina_stringshare_add(vid->file);
if (vid->sub) vid2->sub = eina_stringshare_add(vid->sub);
vid2->uri = efreet_uri_decode(vid->file);
list2 = eina_list_append(list2, vid2);
}
}
@ -234,6 +235,7 @@ win_video_insert(Evas_Object *win, const char *file)
vid = calloc(1, sizeof(Winvid_Entry));
vid->file = eina_stringshare_add(file);
vid->uri = efreet_uri_decode(vid->file);
inf->file_list = eina_list_append_relative_list(inf->file_list, vid,
inf->file_cur);
evas_object_data_set(win, "file_list", inf->file_list);
@ -255,6 +257,7 @@ win_video_free(Evas_Object *win)
printf("[%p] Free %s\n", vid, vid->file);
if (vid->file) eina_stringshare_del(vid->file);
if (vid->sub) eina_stringshare_del(vid->sub);
if (vid->uri) efreet_uri_free(vid->uri);
free(vid);
}

@ -4,6 +4,7 @@
typedef struct _Winvid_Entry
{
const char *file;
Efreet_Uri *uri;
const char *sub;
} Winvid_Entry;

Loading…
Cancel
Save