Prevent Places gadget from segfaulting Enlightenment on FreeBSD, add UFS/ZFS detection and tag them with FreeBSD icon. Free spaces on disks aren't still shown pretty much right (172,1GB remaining from 39,1GB, -340%) and opening a mounted disk opens root filesystem in EFM and not the right dir, but at least it allows simple mount / umount and shows all disks properly.

SVN revision: 57250
This commit is contained in:
Daniel Kolesa 2011-02-22 23:08:27 +00:00
parent 819224b6e2
commit 72324ca29d
3 changed files with 21 additions and 2 deletions

View File

@ -7,6 +7,7 @@ images
image: "tag_ext3.png" COMP; image: "tag_ext3.png" COMP;
image: "tag_fat.png" COMP; image: "tag_fat.png" COMP;
image: "tag_hfs.png" COMP; image: "tag_hfs.png" COMP;
image: "tag_ufs.png" COMP;
image: "tag_dvd.png" COMP; image: "tag_dvd.png" COMP;
} }
@ -160,6 +161,11 @@ collections
inherit: "default" 0.0; inherit: "default" 0.0;
color: 255 255 255 240; color: 255 255 255 240;
} }
description { state: "ufs" 0.0;
image.normal: "tag_ufs.png";
inherit: "default" 0.0;
color: 255 255 255 240;
}
description { state: "dvd" 0.0; description { state: "dvd" 0.0;
image.normal: "tag_dvd.png"; image.normal: "tag_dvd.png";
inherit: "default" 0.0; inherit: "default" 0.0;
@ -453,6 +459,12 @@ collections
action: STATE_SET "hfs" 0.0; action: STATE_SET "hfs" 0.0;
target: "icon_tag"; target: "icon_tag";
} }
program { name: "set_tag_ufs";
signal: "icon,tag,ufs";
source: "places";
action: STATE_SET "ufs" 0.0;
target: "icon_tag";
}
program { name: "set_tag_dvd"; program { name: "set_tag_dvd";
signal: "icon,tag,dvd"; signal: "icon,tag,dvd";
source: "places"; source: "places";

BIN
images/tag_ufs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -268,11 +268,12 @@ places_fill_box(Evas_Object *box)
} }
else evas_object_del(icon); else evas_object_del(icon);
//set partition type tag //set partition type tag
if (!strcmp(vol->fstype, "ext2") || !strcmp(vol->fstype, "ext3") || if (!strcmp(vol->fstype, "ext2") || !strcmp(vol->fstype, "ext3") ||
!strcmp(vol->fstype, "ext4") || !strcmp(vol->fstype, "reiserfs")) !strcmp(vol->fstype, "ext4") || !strcmp(vol->fstype, "reiserfs"))
edje_object_signal_emit(o, "icon,tag,ext3", "places"); edje_object_signal_emit(o, "icon,tag,ext3", "places");
else if (!strcmp(vol->fstype, "ufs") || !strcmp(vol->fstype, "zfs"))
edje_object_signal_emit(o, "icon,tag,ufs", "places");
else if (!strcmp(vol->fstype, "vfat") || !strcmp(vol->fstype, "ntfs") || else if (!strcmp(vol->fstype, "vfat") || !strcmp(vol->fstype, "ntfs") ||
!strcmp(vol->fstype, "ntfs-3g")) !strcmp(vol->fstype, "ntfs-3g"))
edje_object_signal_emit(o, "icon,tag,fat", "places"); edje_object_signal_emit(o, "icon,tag,fat", "places");
@ -282,7 +283,7 @@ places_fill_box(Evas_Object *box)
edje_object_signal_emit(o, "icon,tag,dvd", "places"); edje_object_signal_emit(o, "icon,tag,dvd", "places");
//set mount/eject icon //set mount/eject icon
if (vol->requires_eject || (vol->mounted && strcmp(vol->mount_point, "/")) || if (vol->requires_eject || (vol->mounted && vol->mount_point ? vol->mount_point[0] != '/' : 1) ||
!strcmp(vol->bus, "usb")) //Some usb key don't have requires_eject set (probably an hal error) !strcmp(vol->bus, "usb")) //Some usb key don't have requires_eject set (probably an hal error)
edje_object_signal_emit(o, "icon,eject,show", "places"); edje_object_signal_emit(o, "icon,eject,show", "places");
else else
@ -548,12 +549,16 @@ _places_volume_add(const char *udi)
v = E_NEW(Volume, 1); v = E_NEW(Volume, 1);
if (!v) return; if (!v) return;
// safe defaults
v->udi = eina_stringshare_add(udi); v->udi = eina_stringshare_add(udi);
v->valid = 0; v->valid = 0;
v->obj = NULL; v->obj = NULL;
v->icon = NULL; v->icon = NULL;
v->to_mount = 0; v->to_mount = 0;
v->force_open = 0; v->force_open = 0;
v->drive_type = "";
v->model = "";
v->bus = "";
if (places_conf->auto_mount) if (places_conf->auto_mount)
v->to_mount = 1; v->to_mount = 1;
@ -976,6 +981,8 @@ _places_volume_properties_cb(void *data, void *reply_data, DBusError *error)
_places_storage_properties_cb, v); _places_storage_properties_cb, v);
} }
//_places_print_volume(v);
return; return;
} }