[EGIT] [apps/rage] master 02/02: rage - quieten coverity even though its not an isue

2015-10-10 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=40483f4de33d857457db630c5f3ef65fd257f65f

commit 40483f4de33d857457db630c5f3ef65fd257f65f
Author: Carsten Haitzler (Rasterman) 
Date:   Sun Oct 11 14:46:06 2015 +0900

rage - quieten coverity even though its not an isue

locks in entry frees are not needed as by the time something is freed
a thread is no longer using it, but this should make coverity happy.
---
 src/bin/browser.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/browser.c b/src/bin/browser.c
index 975e2a2..f53f5f6 100644
--- a/src/bin/browser.c
+++ b/src/bin/browser.c
@@ -500,11 +500,13 @@ _entry_free(Entry *entry)
Entry *subentry;
Eina_Stringshare *str;
if (!entry) return;
+   eina_lock_take(&(entry->lock));
entry->sels = eina_list_free(entry->sels);
EINA_LIST_FREE(entry->files, str) eina_stringshare_del(str);
EINA_LIST_FREE(entry->dirs, subentry) _entry_free(subentry);
if (entry->base) evas_object_del(entry->base);
eina_stringshare_del(entry->path);
+   eina_lock_release(&(entry->lock));
eina_lock_free(&(entry->lock));
if (entry == selentry) selentry = NULL;
free(entry);

-- 




[EGIT] [apps/rage] master 01/02: rage - fix coverity issues.

2015-10-10 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=25a21888bca3eb6c078097516084bca99ea125a0

commit 25a21888bca3eb6c078097516084bca99ea125a0
Author: Carsten Haitzler (Rasterman) 
Date:   Sun Oct 11 14:44:26 2015 +0900

rage - fix coverity issues.
---
 src/bin/albumart.c | 3 +--
 src/bin/browser.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/bin/albumart.c b/src/bin/albumart.c
index d32a532..9faf4fa 100644
--- a/src/bin/albumart.c
+++ b/src/bin/albumart.c
@@ -260,11 +260,10 @@ albumart_find(const char *file,
  handle_complete = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE,
_cb_http_complete, NULL);
 
-   if (!file) return;
fetchfile = _inpath(file);
 
_fetch_done = fetch_done;
-   _fetch_data = _fetch_data;
+   _fetch_data = fetch_data;
 
path = _thumbpath(fetchfile);
if (path)
diff --git a/src/bin/browser.c b/src/bin/browser.c
index 3a1cd9b..975e2a2 100644
--- a/src/bin/browser.c
+++ b/src/bin/browser.c
@@ -335,8 +335,7 @@ _entry_files_redo(Evas_Object *win, Entry *entry)
_item_size_get(win, , );
cols = w / iw;
if (cols < 1) cols = 1;
-   if (cols > 0) rows = (num + (cols - 1)) / cols;
-   else rows = 0;
+   rows = (num + (cols - 1)) / cols;
 
entry->iw = iw;
entry->ih = ih;

-- 




[EGIT] [apps/rage] master 04/04: rage - borwser - remember prev selected entry and re-sel on re-show

2015-10-10 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=4b516ab8bb701702a95633d3349c55b90e70c92c

commit 4b516ab8bb701702a95633d3349c55b90e70c92c
Author: Carsten Haitzler (Rasterman) 
Date:   Sun Oct 11 11:33:00 2015 +0900

rage - borwser - remember prev selected entry and re-sel on re-show
---
 src/bin/browser.c | 54 ++
 1 file changed, 54 insertions(+)

diff --git a/src/bin/browser.c b/src/bin/browser.c
index 75a8842..3a1cd9b 100644
--- a/src/bin/browser.c
+++ b/src/bin/browser.c
@@ -40,11 +40,17 @@ struct _Entry
Eina_Bool sel : 1;
 };
 
+static char *selfile = NULL;
+static Entry *selentry = NULL;
+static int seli = 0;
+
 static Evas_Object *bx = NULL;
 static Evas_Object *sc, *bt;
 static Ecore_Thread *fill_thread = NULL;
 static Entry *dir_entry = NULL;
 
+static void _sel_go(Evas_Object *win EINA_UNUSED, Entry *base_entry, int x, 
int y);
+
 static void
 _item_size_get(Evas_Object *win, Evas_Coord *w, Evas_Coord *h)
 {
@@ -122,6 +128,7 @@ _fill_scan(Ecore_Thread *th, Entry *parent, const char *dir)
files = ecore_file_ls(dir);
if (!files)
  {
+if (entry == selentry) selentry = NULL;
 free(entry);
 return NULL;
  }
@@ -298,6 +305,18 @@ _entry_files_unpop(Evas_Object *win EINA_UNUSED, Entry 
*entry)
 }
 
 static void
+_cb_sel_job(void *data)
+{
+   Evas_Object *win = data;
+   Entry *entry = selentry;
+   if ((!dir_entry) || (!entry)) return;
+   entry->sel = EINA_TRUE;
+   if (entry->cols > 0) entry->sel_y = seli / entry->cols;
+   entry->sel_x = seli - (entry->sel_y * entry->cols);
+   _sel_go(win, dir_entry, 0, 0);
+}
+
+static void
 _entry_files_redo(Evas_Object *win, Entry *entry)
 {
Evas_Coord x, y,w, h, iw = 1, ih = 1, ww, wh;
@@ -330,6 +349,27 @@ _entry_files_redo(Evas_Object *win, Entry *entry)
_entry_files_unpop(win, entry);
if (eina_rectangles_intersect(, )) _entry_files_pop(win, entry);
 
+   if (selfile)
+ {
+Eina_List *l;
+const char *file;
+char buf[PATH_MAX];
+int i;
+
+i = 0;
+EINA_LIST_FOREACH(entry->files, l, file)
+  {
+ snprintf(buf, sizeof(buf), "%s/%s", entry->path, file);
+ if (!strcmp(buf, selfile))
+   {
+  selentry = entry;
+  seli = i;
+  ecore_job_add(_cb_sel_job, win);
+  break;
+   }
+ i++;
+  }
+ }
 done:
eina_lock_release(&(entry->lock));
 }
@@ -467,6 +507,7 @@ _entry_free(Entry *entry)
if (entry->base) evas_object_del(entry->base);
eina_stringshare_del(entry->path);
eina_lock_free(&(entry->lock));
+   if (entry == selentry) selentry = NULL;
free(entry);
 }
 
@@ -547,6 +588,7 @@ _sel_go(Evas_Object *win EINA_UNUSED, Entry *base_entry, 
int x, int y)
 {
Evas_Object *o;
Evas_Coord bxx, bxy, tbx, tby;
+   const char *file;
 
if (!base_entry) return;
evas_object_geometry_get(bx, , , NULL, NULL);
@@ -677,6 +719,18 @@ _sel_go(Evas_Object *win EINA_UNUSED, Entry *base_entry, 
int x, int y)
 eina_lock_release(&(entry->lock));
 eina_list_free(flatlist);
  }
+   entry = _sel_find(base_entry);
+   if (entry)
+ {
+file = _sel_file_find(entry);
+if (file)
+  {
+ char buf[PATH_MAX];
+ snprintf(buf, sizeof(buf), "%s/%s", entry->path, file);
+ if (selfile) free(selfile);
+ selfile = strdup(buf);
+  }
+ }
 }
 
 static void

-- 




[EGIT] [apps/rage] master 02/04: rage - expand stop action to also use backspace and del keys

2015-10-10 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=c72e038237152dd068656841da56c6b489e0770d

commit c72e038237152dd068656841da56c6b489e0770d
Author: Carsten Haitzler (Rasterman) 
Date:   Sun Oct 11 10:46:50 2015 +0900

rage - expand stop action to also use backspace and del keys
---
 src/bin/key.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/bin/key.c b/src/bin/key.c
index 69de77d..cb835cd 100644
--- a/src/bin/key.c
+++ b/src/bin/key.c
@@ -107,7 +107,9 @@ key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
 win_do_play_pause(win);
  }
else if ((!strcmp(ev->keyname, "s")) ||
-(!strcmp(ev->key, "XF86AudioStop")))
+(!strcmp(ev->key, "XF86AudioStop")) ||
+(!strcmp(ev->key, "BackSpace")) ||
+(!strcmp(ev->key, "Delete")))
  {
 video_stop(inf->vid);
 elm_layout_signal_emit(inf->lay, "action,stop", "rage");
@@ -115,7 +117,6 @@ key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
  }
else if (!strcmp(ev->keyname, "c"))
  {
-printf("(c)lear!\n");
 video_stop(inf->vid);
 elm_layout_signal_emit(inf->lay, "action,stop", "rage");
 win_video_free(win);

-- 




[EGIT] [apps/rage] master 03/04: rage browser - delete dir entries when deleting browser on hide

2015-10-10 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=04630ed478fedfbd3ebeec184ebe20dabaaedb59

commit 04630ed478fedfbd3ebeec184ebe20dabaaedb59
Author: Carsten Haitzler (Rasterman) 
Date:   Sun Oct 11 11:06:50 2015 +0900

rage browser - delete dir entries when deleting browser on hide
---
 src/bin/browser.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/bin/browser.c b/src/bin/browser.c
index de771fe..75a8842 100644
--- a/src/bin/browser.c
+++ b/src/bin/browser.c
@@ -462,9 +462,9 @@ _entry_free(Entry *entry)
Eina_Stringshare *str;
if (!entry) return;
entry->sels = eina_list_free(entry->sels);
-   if (entry->base) evas_object_del(entry->base);
EINA_LIST_FREE(entry->files, str) eina_stringshare_del(str);
EINA_LIST_FREE(entry->dirs, subentry) _entry_free(subentry);
+   if (entry->base) evas_object_del(entry->base);
eina_stringshare_del(entry->path);
eina_lock_free(&(entry->lock));
free(entry);
@@ -793,6 +793,8 @@ _cb_hidden(void *data, Evas_Object *obj, const char *sig 
EINA_UNUSED, const char
elm_layout_signal_callback_del(obj, "browser,state,hidden,finished", "rage",
   _cb_hidden);
if (fill_thread) ecore_thread_cancel(fill_thread);
+   if (dir_entry) _entry_free(dir_entry);
+   dir_entry = NULL;
evas_object_del(bx);
bx = NULL;
evas_object_del(bt);

-- 




[EGIT] [apps/rage] master 01/04: rage - dont resize window first audio play after browser mode

2015-10-10 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=e76c1c3cf14777299f9d0c222f85134f29b09d2f

commit e76c1c3cf14777299f9d0c222f85134f29b09d2f
Author: Carsten Haitzler (Rasterman) 
Date:   Sun Oct 11 10:45:24 2015 +0900

rage - dont resize window first audio play after browser mode
---
 src/bin/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/main.c b/src/bin/main.c
index 3746431..45638f1 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -142,6 +142,7 @@ elm_main(int argc, char **argv)
if (file_num <= 0)
  {
 inf->browse_mode = EINA_TRUE;
+inf->sized = EINA_TRUE;
 browser_show(win);
 //elm_layout_signal_emit(inf->lay, "about,show", "rage");
 evas_object_show(win);

-- 




[EGIT] [apps/rage] master 01/01: Disable adding files that cannot be played

2015-10-10 Thread Markus Törnqvist
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=e5edb6748b0d5e2afe8ca98c09c02aa1a82182b2

commit e5edb6748b0d5e2afe8ca98c09c02aa1a82182b2
Author: Markus Törnqvist 
Date:   Sat Oct 10 17:01:01 2015 +0900

Disable adding files that cannot be played

Summary: Dropping a directory into Rage added everything before this patch, 
complaining about some files and definitely not playing them. This adds 
`emotion_object_extension_may_play_get()` checks.

Test Plan:
Drop a non-playable file and a directory containing non-playable files.

The file(s) get(s) added (but cannot be played, obviously) before this 
patch and after this they're ignored.

Reviewers: raster

Projects: #rage

Differential Revision: https://phab.enlightenment.org/D3162
---
 src/bin/dnd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bin/dnd.c b/src/bin/dnd.c
index cafcc09..c14643a 100644
--- a/src/bin/dnd.c
+++ b/src/bin/dnd.c
@@ -154,6 +154,8 @@ _cb_recurse(void *data, Eio_File *f EINA_UNUSED, const 
Eina_File_Direct_Info *in
struct _recurse_data *d = data;
if (info->type == EINA_FILE_DIR)
   return;
+   else if (!emotion_object_extension_may_play_get(info->path))
+  return;
 
d->list = eina_list_sorted_insert(d->list, EINA_COMPARE_CB(_pathcmp), 
_escape_parse(info->path));
 }
@@ -190,6 +192,7 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED, 
Elm_Selection_Data *ev)
  free(esc);
  continue;
   }
+else if (!emotion_object_extension_may_play_get(esc)) continue;
 
 playlist = eina_list_sorted_insert(playlist, 
EINA_COMPARE_CB(_pathcmp), esc);
  }

--