X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgwin32mount.c;h=58986a1ac8bb55fae98be854fa255a067471fb9f;hb=4482977238ae80f64c2fe318d1500f4662c73980;hp=cb1855c6438e826a1c4a24e5ff5aad2f2812a268;hpb=1b28408b8bfe282f671716a39bba3208d3fef39a;p=platform%2Fupstream%2Fglib.git
diff --git a/gio/gwin32mount.c b/gio/gwin32mount.c
index cb1855c..58986a1 100644
--- a/gio/gwin32mount.c
+++ b/gio/gwin32mount.c
@@ -14,9 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see .
*
* Author: Alexander Larsson
* David Zeuthen
@@ -52,6 +50,7 @@ struct _GWin32Mount {
/* why does all this stuff need to be duplicated? It is in volume already! */
char *name;
GIcon *icon;
+ GIcon *symbolic_icon;
char *mount_path;
gboolean can_eject;
@@ -82,6 +81,8 @@ g_win32_mount_finalize (GObject *object)
if (mount->icon != NULL)
g_object_unref (mount->icon);
+ if (mount->symbolic_icon != NULL)
+ g_object_unref (mount->symbolic_icon);
g_free (mount->name);
g_free (mount->mount_path);
@@ -103,7 +104,7 @@ g_win32_mount_init (GWin32Mount *win32_mount)
{
}
-gchar *
+static gchar *
_win32_get_displayname (const char *drive)
{
gunichar2 *wdrive = g_utf8_to_utf16 (drive, -1, NULL, NULL, NULL);
@@ -116,7 +117,7 @@ _win32_get_displayname (const char *drive)
return name ? name : g_strdup (drive);
}
-/*
+/**
* _g_win32_mount_new:
* @volume_monitor: a #GVolumeMonitor.
* @path: a win32 path.
@@ -191,16 +192,16 @@ g_win32_mount_get_root (GMount *mount)
return g_file_new_for_path (win32_mount->mount_path);
}
-const char *
-_win32_drive_type_to_icon (int type)
+static const char *
+_win32_drive_type_to_icon (int type, gboolean use_symbolic)
{
switch (type)
{
- case DRIVE_REMOVABLE : return "gtk-floppy";
- case DRIVE_FIXED : return "gtk-harddisk";
- case DRIVE_REMOTE : return "gtk-network";
- case DRIVE_CDROM : return "gtk-cdrom";
- default : return "gtk-directory";
+ case DRIVE_REMOVABLE : return use_symbolic ? "drive-removable-media-symbolic" : "drive-removable-media";
+ case DRIVE_FIXED : return use_symbolic ? "drive-harddisk-symbolic" : "drive-harddisk";
+ case DRIVE_REMOTE : return use_symbolic ? "folder-remote-symbolic" : "folder-remote";
+ case DRIVE_CDROM : return use_symbolic ? "drive-optical-symbolic" : "drive-optical";
+ default : return use_symbolic ? "folder-symbolic" : "folder";
}
}
@@ -227,14 +228,29 @@ g_win32_mount_get_icon (GMount *mount)
}
else
{
- win32_mount->icon = g_themed_icon_new_with_default_fallbacks (
- _win32_drive_type_to_icon (win32_mount->drive_type));
+ win32_mount->icon = g_themed_icon_new_with_default_fallbacks (_win32_drive_type_to_icon (win32_mount->drive_type, FALSE));
}
}
return g_object_ref (win32_mount->icon);
}
+static GIcon *
+g_win32_mount_get_symbolic_icon (GMount *mount)
+{
+ GWin32Mount *win32_mount = G_WIN32_MOUNT (mount);
+
+ g_return_val_if_fail (win32_mount->mount_path != NULL, NULL);
+
+ /* lazy creation */
+ if (!win32_mount->symbolic_icon)
+ {
+ win32_mount->symbolic_icon = g_themed_icon_new_with_default_fallbacks (_win32_drive_type_to_icon (win32_mount->drive_type, TRUE));
+ }
+
+ return g_object_ref (win32_mount->symbolic_icon);
+}
+
static char *
g_win32_mount_get_uuid (GMount *mount)
{
@@ -336,6 +352,7 @@ g_win32_mount_mount_iface_init (GMountIface *iface)
iface->get_root = g_win32_mount_get_root;
iface->get_name = g_win32_mount_get_name;
iface->get_icon = g_win32_mount_get_icon;
+ iface->get_symbolic_icon = g_win32_mount_get_symbolic_icon;
iface->get_uuid = g_win32_mount_get_uuid;
iface->get_drive = g_win32_mount_get_drive;
iface->get_volume = g_win32_mount_get_volume;