davemds pushed a commit to branch master.

http://git.enlightenment.org/enlightenment/modules/places.git/commit/?id=1208a5979051362dbc9012958b96dd0dd0bb6e88

commit 1208a5979051362dbc9012958b96dd0dd0bb6e88
Author: Dave Andreoli <[email protected]>
Date:   Sat Jan 10 21:10:38 2015 +0100

    Use fs size from statvfs if the backend did not provide it
---
 src/e_mod_places.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/e_mod_places.c b/src/e_mod_places.c
index f4fd980..50146c0 100644
--- a/src/e_mod_places.c
+++ b/src/e_mod_places.c
@@ -495,7 +495,7 @@ places_run_fm(const char *directory)
 
 /* Internals */
 static unsigned long long
-_places_free_space_get(const char *mount)
+_places_free_space_get(const char *mount, Volume *vol)
 {
    struct statvfs s;
 
@@ -503,6 +503,9 @@ _places_free_space_get(const char *mount)
    if (statvfs(mount, &s) != 0)
      return 0;
 
+   if ((vol->size == 0) && (s.f_blocks))
+     vol->size = (unsigned long long)s.f_blocks * (unsigned long 
long)s.f_frsize;
+
    return (unsigned long long)s.f_bavail * (unsigned long long)s.f_frsize;
 }
 
@@ -516,7 +519,7 @@ _places_poller(void *data)
    EINA_LIST_FOREACH(volumes, l, vol)
      if (vol->valid && vol->mounted)
      {
-        new = _places_free_space_get(vol->mount_point);
+        new = _places_free_space_get(vol->mount_point, vol);
         // redraw only if the size has changed more that 1Mb
         if (abs(new - vol->free_space) > 1024 * 1024)
           {

-- 


Reply via email to