diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2008-04-23 13:25:35 +0200 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-04-26 16:54:25 +0200 |
commit | d8a11018692ec20a8ec6a3dcb1f2d942dcb72a90 (patch) | |
tree | b1d1cabc9d56d591c427d7ff6c7abd11aa428201 /libnautilus-private/nautilus-file-conflict-dialog.c | |
parent | 7e44bab4b8910bb26a91fc09a8e3b0cd12455bf8 (diff) | |
download | nautilus-d8a11018692ec20a8ec6a3dcb1f2d942dcb72a90.tar.gz |
Use NautilusFile machinery instead of is_dir
Use the NautilusFile cached data to find out whether a file is
a directory instead of using GIO.
Diffstat (limited to 'libnautilus-private/nautilus-file-conflict-dialog.c')
-rw-r--r-- | libnautilus-private/nautilus-file-conflict-dialog.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/libnautilus-private/nautilus-file-conflict-dialog.c b/libnautilus-private/nautilus-file-conflict-dialog.c index c7f4b16b7..43fba5ec9 100644 --- a/libnautilus-private/nautilus-file-conflict-dialog.c +++ b/libnautilus-private/nautilus-file-conflict-dialog.c @@ -57,31 +57,11 @@ G_DEFINE_TYPE (NautilusFileConflictDialog, #define NAUTILUS_FILE_CONFLICT_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), NAUTILUS_TYPE_FILE_CONFLICT_DIALOG, NautilusFileConflictDialogDetails)) -static gboolean -is_dir (GFile *file) -{ - GFileInfo *info; - gboolean res; - - res = FALSE; - info = g_file_query_info (file, - G_FILE_ATTRIBUTE_STANDARD_TYPE, - G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, - NULL, NULL); - if (info) { - res = g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY; - g_object_unref (info); - } - - return res; -} - static void build_dialog_appearance (NautilusFileConflictDialog *fcd) { GtkDialog *dialog; - gboolean source_is_dir; - gboolean dest_is_dir; + gboolean source_is_dir, dest_is_dir; NautilusFileConflictDialogDetails *details; char *primary_text, *secondary_text, *primary_markup; char *src_name, *dest_name, *dest_dir_name; @@ -93,8 +73,6 @@ build_dialog_appearance (NautilusFileConflictDialog *fcd) dialog = GTK_DIALOG (fcd); details = fcd->details; - source_is_dir = is_dir (details->source); - dest_is_dir = is_dir (details->destination); src = nautilus_file_get (details->source); dest = nautilus_file_get (details->destination); @@ -103,6 +81,9 @@ build_dialog_appearance (NautilusFileConflictDialog *fcd) src_name = nautilus_file_get_display_name (src); dest_name = nautilus_file_get_display_name (dest); dest_dir_name = nautilus_file_get_display_name (dest_dir); + + source_is_dir = nautilus_file_is_directory (src); + dest_is_dir = nautilus_file_is_directory (dest); /* Set up the right labels */ if (dest_is_dir) { |