somewhere along the way the ability to handle empty mount point defines was
kiled. bring it back so it works! SVN revision: 33945
This commit is contained in:
parent
7cc26d7eea
commit
b02b82e4b4
|
@ -127,8 +127,29 @@ e_fm2_hal_volume_add(E_Volume *v)
|
||||||
v->mount_point,
|
v->mount_point,
|
||||||
v->parent);
|
v->parent);
|
||||||
|
|
||||||
if (!v->mount_point)
|
if ((!v->mount_point) || (v->mount_point[0] == 0))
|
||||||
v->mount_point = e_fm2_hal_volume_mountpoint_get(v);
|
{
|
||||||
|
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)))
|
if ((s = e_fm2_hal_storage_find(v->parent)))
|
||||||
{
|
{
|
||||||
|
@ -198,25 +219,26 @@ _e_fm2_volume_write(E_Volume *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Choose the label */
|
/* Choose the label */
|
||||||
if (v->label)
|
if ((v->label) && (v->label[0]))
|
||||||
snprintf(label, sizeof(label), "%s", v->label);
|
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);
|
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')
|
if (size[0] != '\0')
|
||||||
snprintf(label, sizeof(label) - 1, "%s %s - %s", v->storage->vendor, v->storage->model, size);
|
snprintf(label, sizeof(label) - 1, "%s %s - %s", v->storage->vendor, v->storage->model, size);
|
||||||
else
|
else
|
||||||
snprintf(label, sizeof(label) - 1, "%s %s", v->storage->vendor, v->storage->model);
|
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')
|
if (size[0] != '\0')
|
||||||
snprintf(label, sizeof(label) - 1, "%s - %s", v->storage->model, size);
|
snprintf(label, sizeof(label) - 1, "%s - %s", v->storage->model, size);
|
||||||
else
|
else
|
||||||
snprintf(label, sizeof(label) - 1, "%s", v->storage->model);
|
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')
|
if (size[0] != '\0')
|
||||||
snprintf(label, sizeof(label) - 1, "%s - %s", v->storage->vendor, size);
|
snprintf(label, sizeof(label) - 1, "%s - %s", v->storage->vendor, size);
|
||||||
|
@ -416,7 +438,7 @@ e_fm2_hal_mount(E_Volume *v,
|
||||||
|
|
||||||
v->mounts = evas_list_prepend(v->mounts, m);
|
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)
|
if (!v->mounted)
|
||||||
{
|
{
|
||||||
|
@ -453,7 +475,7 @@ _e_fm2_hal_mount_ok(E_Fm2_Mount *m)
|
||||||
m->timeout = NULL;
|
m->timeout = NULL;
|
||||||
}
|
}
|
||||||
if (m->mount_ok) m->mount_ok(m->data);
|
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
|
static int
|
||||||
|
|
Loading…
Reference in New Issue