Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm_hal.c 


Log Message:


somewhere along the way the ability to handle empty mount point defines was
kiled. bring it back so it works!

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm_hal.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_fm_hal.c  31 Oct 2007 19:51:14 -0000      1.3
+++ e_fm_hal.c  6 Mar 2008 16:58:38 -0000       1.4
@@ -127,8 +127,29 @@
          v->mount_point, 
          v->parent);
 
-   if (!v->mount_point)
-     v->mount_point = e_fm2_hal_volume_mountpoint_get(v);
+   if ((!v->mount_point) || (v->mount_point[0] == 0))
+     {
+       if (v->mount_point) free(v->mount_point);
+       v->mount_point = e_fm2_hal_volume_mountpoint_get(v);
+       if ((!v->mount_point) || (v->mount_point[0] == 0))
+         {
+            char buf[PATH_MAX];
+            char *id;
+            
+            if (v->mount_point) free(v->mount_point);
+            id = "disk";
+            if ((v->uuid) && (v->uuid[0])) id = v->uuid;
+            if (ecore_file_is_dir("/media"))
+              snprintf(buf, sizeof(buf), "/media/%s", id);
+            else if (ecore_file_is_dir("/mnt"))
+              snprintf(buf, sizeof(buf), "/mnt/%s", id);
+            else if (ecore_file_is_dir("/tmp"))
+              snprintf(buf, sizeof(buf), "/tmp/%s", id);
+            else
+              snprintf(buf, sizeof(buf), "");
+            v->mount_point = strdup(buf);
+         }
+     }
 
    if ((s = e_fm2_hal_storage_find(v->parent)))
      {
@@ -198,25 +219,26 @@
          }
 
        /* Choose the label */
-       if (v->label)
+       if ((v->label) && (v->label[0]))
          snprintf(label, sizeof(label), "%s", v->label);
-       else if (v->partition_label)
+       else if ((v->partition_label) && (v->partition_label[0]))
          snprintf(label, sizeof(label) - 1, "%s", v->partition_label);
-       else if (v->storage->vendor && v->storage->model)
+       else if (((v->storage->vendor) && (v->storage->vendor[0])) && 
+                ((v->storage->model) && (v->storage->model[0])))
          {
             if (size[0] != '\0')
               snprintf(label, sizeof(label) - 1, "%s %s - %s", 
v->storage->vendor, v->storage->model, size);
             else
               snprintf(label, sizeof(label) - 1, "%s %s", v->storage->vendor, 
v->storage->model);
          }
-       else if (v->storage->model)
+       else if ((v->storage->model) && (v->storage->model[0]))
          {
             if (size[0] != '\0')
               snprintf(label, sizeof(label) - 1, "%s - %s", v->storage->model, 
size);
             else
               snprintf(label, sizeof(label) - 1, "%s", v->storage->model);
          }
-       else if (v->storage->vendor)
+       else if ((v->storage->vendor) && (v->storage->vendor[0]))
          {
             if (size[0] != '\0')
               snprintf(label, sizeof(label) - 1, "%s - %s", 
v->storage->vendor, size);
@@ -416,7 +438,7 @@
 
    v->mounts = evas_list_prepend(v->mounts, m);
 
-   printf("BEGIN MOUNT %p %s\n", m, v->mount_point);
+   printf("BEGIN MOUNT %p '%s'\n", m, v->mount_point);
    
    if (!v->mounted)
      {
@@ -453,7 +475,7 @@
        m->timeout = NULL;
      }
    if (m->mount_ok) m->mount_ok(m->data);
-   printf("MOUNT OK %s\n", m->mount_point);
+   printf("MOUNT OK '%s'\n", m->mount_point);
 }
 
 static int



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to