simplify a couple stringshare instances

SVN revision: 55804
This commit is contained in:
Mike Blumenkrantz 2011-01-03 01:54:01 +00:00
parent e4759bdb05
commit 6e9e8a38d5
1 changed files with 4 additions and 11 deletions

View File

@ -187,7 +187,8 @@ e_fm2_device_volume_add(E_Volume *v)
/* Choose the label */ /* Choose the label */
if ((v->label) && (v->label[0])) if ((v->label) && (v->label[0]))
{}else if ((v->partition_label) && (v->partition_label[0])) {}
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->vendor[0])) && else if (((v->storage->vendor) && (v->storage->vendor[0])) &&
((v->storage->model) && (v->storage->model[0]))) ((v->storage->model) && (v->storage->model[0])))
@ -214,11 +215,7 @@ e_fm2_device_volume_add(E_Volume *v)
else else
snprintf(label, sizeof(label), _("Unknown Volume")); snprintf(label, sizeof(label), _("Unknown Volume"));
if (label[0]) if (label[0]) eina_stringshare_replace(&v->label, label);
{
if (v->label) eina_stringshare_del(v->label);
v->label = eina_stringshare_add(label);
}
/* Choose the icon */ /* Choose the icon */
/* http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html */ /* http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html */
@ -245,11 +242,7 @@ e_fm2_device_volume_add(E_Volume *v)
|| !strcmp(v->storage->drive_type, "sd_mmc")) || !strcmp(v->storage->drive_type, "sd_mmc"))
icon = "media-flash"; icon = "media-flash";
} }
if (icon) if (icon) eina_stringshare_replace(&v->icon, icon);
{
if (v->icon) eina_stringshare_del(v->icon);
v->icon = eina_stringshare_add(icon);
}
if ((!v->mount_point) || if ((!v->mount_point) ||
(strcmp(v->mount_point, "/") && (strcmp(v->mount_point, "/") &&