2007-08-16 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Thu, 16 Aug 2007 11:45:58 +0000 (11:45 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Thu, 16 Aug 2007 11:45:58 +0000 (11:45 +0000)
* src/modest-tny-account-store.c: (volume_path_is_mounted):
Check the GnomeVFSVolume activation path instead of the device path,
so that the memory card is really really shown in the UI.

pmo-trunk-r3001

ChangeLog2
src/modest-tny-account-store.c

index 1fdd0b6..9f822b4 100644 (file)
@@ -1,5 +1,11 @@
 2007-08-16  Murray Cumming  <murrayc@murrayc.com>
 
 2007-08-16  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/modest-tny-account-store.c: (volume_path_is_mounted):
+       Check the GnomeVFSVolume activation path instead of the device path, 
+       so that the memory card is really really shown in the UI.
+
+2007-08-16  Murray Cumming  <murrayc@murrayc.com>
+
        * src/maemo/easysetup/modest-easysetup-wizard.c:
        (get_entered_account_title), (on_before_next), (entry_is_empty),
        (create_account):
        * src/maemo/easysetup/modest-easysetup-wizard.c:
        (get_entered_account_title), (on_before_next), (entry_is_empty),
        (create_account):
index d814bda..9faf6a2 100644 (file)
@@ -852,7 +852,11 @@ modest_tny_account_store_finalize (GObject *obj)
 
 gboolean volume_path_is_mounted (const gchar* path)
 {
 
 gboolean volume_path_is_mounted (const gchar* path)
 {
+       g_return_val_if_fail (path, FALSE);
+
        gboolean result = FALSE;
        gboolean result = FALSE;
+       gchar * path_as_uri = g_filename_to_uri (path, NULL, NULL);
+       g_return_val_if_fail (path_as_uri, FALSE);
 
        /* Get the monitor singleton: */
        GnomeVFSVolumeMonitor *monitor = gnome_vfs_get_volume_monitor();
 
        /* Get the monitor singleton: */
        GnomeVFSVolumeMonitor *monitor = gnome_vfs_get_volume_monitor();
@@ -877,16 +881,16 @@ gboolean volume_path_is_mounted (const gchar* path)
                        char *display_name = 
                                gnome_vfs_volume_get_display_name (volume);
                        printf ("volume display name=%s\n", display_name);
                        char *display_name = 
                                gnome_vfs_volume_get_display_name (volume);
                        printf ("volume display name=%s\n", display_name);
+                       g_free (display_name);
                        */
                        */
-
-                       char *device_path = 
-                               gnome_vfs_volume_get_device_path (volume);
-                       /* printf ("  device path=%s\n", device_path); */
-                       if (device_path && (strcmp (device_path, path) == 0))
+                       
+                       char *uri = 
+                               gnome_vfs_volume_get_activation_uri (volume);
+                       /* printf ("  uri=%s\n", uri); */
+                       if (uri && (strcmp (uri, path_as_uri) == 0))
                                result = TRUE;
 
                                result = TRUE;
 
-                       /* g_free (display_name); */
-                       g_free (device_path);
+                       g_free (uri);
 
                        gnome_vfs_volume_unref (volume);
                }
 
                        gnome_vfs_volume_unref (volume);
                }
@@ -894,6 +898,8 @@ gboolean volume_path_is_mounted (const gchar* path)
 
        g_list_free (list);
 
 
        g_list_free (list);
 
+       g_free (path_as_uri);
+
        return result;
 }
 
        return result;
 }