[maemo-commits] [maemo-commits] r13211 - in projects/haf/trunk/hildon-fm: . debian hildon-fm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Wed Aug 15 17:11:28 EEST 2007
- Previous message: [maemo-commits] r13210 - projects/haf/trunk/hildon-theme-plankton/template
- Next message: [maemo-commits] r13212 - in projects/haf/trunk/maemo-launcher: . debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: kihamala Date: 2007-08-15 17:11:26 +0300 (Wed, 15 Aug 2007) New Revision: 13211 Modified: projects/haf/trunk/hildon-fm/ChangeLog projects/haf/trunk/hildon-fm/debian/changelog projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.h Log: fix bug 62319 Modified: projects/haf/trunk/hildon-fm/ChangeLog =================================================================== --- projects/haf/trunk/hildon-fm/ChangeLog 2007-08-15 13:58:28 UTC (rev 13210) +++ projects/haf/trunk/hildon-fm/ChangeLog 2007-08-15 14:11:26 UTC (rev 13211) @@ -1,3 +1,17 @@ +2007-08-15 Kimmo Hämäläinen <kimmo.hamalainen at nokia.com> + + * hildon-fm/hildon-file-system-voldev.h: Make the type member to + have three different values. + + * hildon-fm/hildon-file-system-voldev.c (gconf_value_changed): Use + new vol_type member. + (hildon_file_system_voldev_is_visible): Fix logic to take USB mass + storages into account. + (init_card_type): Renamed as init_vol_type and fixed logic to take + USB mass storages into account. + (hildon_file_system_voldev_volumes_change): Use new vol_type member + correctly. Fixes: NB#62319 + 2007-08-14 Marius Vollmer <marius.vollmer at nokia.com> Be smarter about handling empty names in the file chooser Modified: projects/haf/trunk/hildon-fm/debian/changelog =================================================================== --- projects/haf/trunk/hildon-fm/debian/changelog 2007-08-15 13:58:28 UTC (rev 13210) +++ projects/haf/trunk/hildon-fm/debian/changelog 2007-08-15 14:11:26 UTC (rev 13211) @@ -1,6 +1,8 @@ libhildonfm (1:1.9.39~unreleased) unstable; urgency=low * Fixes: NB#52803. + * Do not show USB mass storage device when no volumes are mounted. + Fixes: NB#62319 -- Marius Vollmer <marius.vollmer at nokia.com> Tue, 14 Aug 2007 19:48:47 +0300 Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c =================================================================== --- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c 2007-08-15 13:58:28 UTC (rev 13210) +++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.c 2007-08-15 14:11:26 UTC (rev 13211) @@ -52,8 +52,8 @@ static char * hildon_file_system_voldev_get_extra_info (HildonFileSystemSpecialLocation *location); -static void init_card_type (const char *path, - HildonFileSystemVoldev *voldev); +static void init_vol_type (const char *path, + HildonFileSystemVoldev *voldev); G_DEFINE_TYPE (HildonFileSystemVoldev, hildon_file_system_voldev, @@ -74,13 +74,13 @@ voldev = HILDON_FILE_SYSTEM_VOLDEV (data); location = HILDON_FILE_SYSTEM_SPECIAL_LOCATION (voldev); - if (!voldev->card_type_valid) - init_card_type (location->basepath, voldev); + if (!voldev->vol_type_valid) + init_vol_type (location->basepath, voldev); - if (voldev->internal_card && + if (voldev->vol_type == INT_CARD && g_ascii_strcasecmp (entry->key, USED_OVER_USB_INTERNAL_KEY) == 0) change = TRUE; - else if (!voldev->internal_card && + else if (voldev->vol_type == EXT_CARD && g_ascii_strcasecmp (entry->key, USED_OVER_USB_KEY) == 0) change = TRUE; @@ -164,15 +164,17 @@ GError *error = NULL; gboolean value; - if (!voldev->card_type_valid) - init_card_type (location->basepath, voldev); + if (!voldev->vol_type_valid) + init_vol_type (location->basepath, voldev); - if (voldev->internal_card) + if (voldev->vol_type == INT_CARD) value = gconf_client_get_bool (klass->gconf, USED_OVER_USB_INTERNAL_KEY, &error); - else + else if (voldev->vol_type == EXT_CARD) value = gconf_client_get_bool (klass->gconf, USED_OVER_USB_KEY, &error); + else + value = FALSE; /* USB_STORAGE */ if (error) { @@ -182,9 +184,12 @@ else voldev->used_over_usb = value; - ULOG_DEBUG_F("voldev->used_over_usb == %d", voldev->used_over_usb); + ULOG_DEBUG_F("%s type: %d, used_over_usb: %d", location->basepath, + voldev->vol_type, voldev->used_over_usb); if (voldev->volume && !voldev->used_over_usb) visible = gnome_vfs_volume_is_mounted (voldev->volume); + else if (voldev->drive && voldev->vol_type == USB_STORAGE) + visible = FALSE; /* USB drives are never visible */ else if (voldev->drive && !voldev->used_over_usb) visible = (gnome_vfs_drive_is_connected (voldev->drive) && !gnome_vfs_drive_is_mounted (voldev->drive)); @@ -295,14 +300,14 @@ return name; } -static void init_card_type (const char *path, - HildonFileSystemVoldev *voldev) +static void init_vol_type (const char *path, + HildonFileSystemVoldev *voldev) { HildonFileSystemVoldevClass *klass; gchar *value; gboolean drive; - if (voldev->card_type_valid) + if (voldev->vol_type_valid) /* already initialised */ return; @@ -314,8 +319,15 @@ klass = HILDON_FILE_SYSTEM_VOLDEV_GET_CLASS (voldev); - if (g_str_has_prefix (path, "drive://")) + if (g_str_has_prefix (path, "drive:///dev/sd") || + g_str_has_prefix (path, "file:///media/usb/")) { + voldev->vol_type = USB_STORAGE; + voldev->vol_type_valid = TRUE; + return; + } + else if (g_str_has_prefix (path, "drive://")) + { drive = TRUE; value = gconf_client_get_string (klass->gconf, "/system/osso/af/mmc-device-name", NULL); @@ -335,20 +347,20 @@ { snprintf (buf, 100, "drive://%s", value); if (g_str_has_prefix (path, buf)) - voldev->internal_card = FALSE; + voldev->vol_type = EXT_CARD; else - voldev->internal_card = TRUE; + voldev->vol_type = INT_CARD; } else { snprintf (buf, 100, "file://%s", value); if (strncmp (buf, path, 100) == 0) - voldev->internal_card = FALSE; + voldev->vol_type = EXT_CARD; else - voldev->internal_card = TRUE; + voldev->vol_type = INT_CARD; } - voldev->card_type_valid = TRUE; + voldev->vol_type_valid = TRUE; g_free (value); } } @@ -375,8 +387,8 @@ else voldev->volume = find_volume (location->basepath); - if (!voldev->card_type_valid) - init_card_type (location->basepath, voldev); + if (!voldev->vol_type_valid) + init_vol_type (location->basepath, voldev); if (voldev->volume) { @@ -401,13 +413,13 @@ else if (strcmp (location->fixed_icon, "gnome-dev-removable") == 0 || strcmp (location->fixed_icon, "gnome-dev-media-sdmmc") == 0) { - if (voldev->internal_card) + if (voldev->vol_type == INT_CARD) location->fixed_icon = "qgn_list_gene_internal_memory_card"; else location->fixed_icon = "qgn_list_gene_removable_memory_card"; location->fixed_title = beautify_mmc_name (location->fixed_title, - voldev->internal_card); + voldev->vol_type == INT_CARD); } } Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.h =================================================================== --- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.h 2007-08-15 13:58:28 UTC (rev 13210) +++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-system-voldev.h 2007-08-15 14:11:26 UTC (rev 13211) @@ -42,6 +42,12 @@ typedef struct _HildonFileSystemVoldev HildonFileSystemVoldev; typedef struct _HildonFileSystemVoldevClass HildonFileSystemVoldevClass; +typedef enum +{ + EXT_CARD, + INT_CARD, + USB_STORAGE +} voldev_t; struct _HildonFileSystemVoldev { @@ -49,8 +55,8 @@ GnomeVFSVolume *volume; GnomeVFSDrive *drive; gboolean used_over_usb; - gboolean internal_card; - gboolean card_type_valid; + voldev_t vol_type; + gboolean vol_type_valid; }; struct _HildonFileSystemVoldevClass
- Previous message: [maemo-commits] r13210 - projects/haf/trunk/hildon-theme-plankton/template
- Next message: [maemo-commits] r13212 - in projects/haf/trunk/maemo-launcher: . debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]