From 17955b15190075a200dd9b6b2535014c36a556fb Mon Sep 17 00:00:00 2001 From: Pavel Cisler Date: Wed, 31 Jan 2001 19:13:06 +0000 Subject: reviewed by: Gene Z. Ragan 2001-01-31 Pavel Cisler reviewed by: Gene Z. Ragan Fix 5324 (Should get rid of stack-based GnomeVFSFileInfo) * components/adapter/bonobo-stream-vfs.c: (vfs_get_info): Nuked some unused code that contained gnome_vfs_file_info_init. * components/adapter/nautilus-adapter-progressive-load-strategy.c: (nautilus_adapter_progressive_load_strategy_load_location): * libnautilus-extensions/nautilus-icon-factory.c: (path_represents_svg_image), (get_cache_time): * libnautilus-extensions/nautilus-thumbnails.c: (first_file_more_recent): * src/nautilus-window-menus.c: (get_static_bookmarks_file_path): Get rid of gnome_vfs_file_info_init. Replace all instances of stack-based GnomeVFSFileInfo structures, replace all calls to gnome_vfs_file_info_init with gnome_vfs_file_info_new. Replace most calls to gnome_vfs_file_info_clear with gnome_vfs_file_info_unref. * libnautilus-extensions/nautilus-preferences-item.c: (has_image_file): Rework to use gnome_vfs_uri_exists instead of trying to get file info. * components/adapter/nautilus-adapter-progressive-load-strategy.c: (nautilus_adapter_progressive_load_strategy_load_location): Fixed a bug where file info fields were being used after a gnome_vfs_file_info_clear call Fix 6146 ("Duplicate File" reports "You cannot copy a file over itself") * libnautilus-extensions/nautilus-file-operations.c: (nautilus_file_operations_copy_move): Make copying iside the same directory while the GNOME_VFS_XFER_USE_UNIQUE_NAMES move_option is set legal. --- src/nautilus-window-menus.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/nautilus-window-menus.c') diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c index 403096b81..1c0d31c9c 100644 --- a/src/nautilus-window-menus.c +++ b/src/nautilus-window-menus.c @@ -819,7 +819,8 @@ get_static_bookmarks_file_path (void) char *update_uri, *built_in_uri; char *user_directory_path; gboolean update_exists, built_in_exists; - GnomeVFSFileInfo update_info, built_in_info; + GnomeVFSFileInfo *update_info, *built_in_info; + char *result; /* see if there is a static bookmarks file in the updates directory and get its mod-date */ user_directory_path = nautilus_get_user_directory (); @@ -851,23 +852,28 @@ get_static_bookmarks_file_path (void) /* both files exist, so use the one with the most recent mod-date */ update_uri = gnome_vfs_get_local_path_from_uri (update_xml_file_path); - gnome_vfs_file_info_init (&update_info); - gnome_vfs_get_file_info (update_uri, &update_info, GNOME_VFS_FILE_INFO_DEFAULT); + update_info = gnome_vfs_file_info_new (); + gnome_vfs_get_file_info (update_uri, update_info, GNOME_VFS_FILE_INFO_DEFAULT); g_free (update_uri); built_in_uri = gnome_vfs_get_local_path_from_uri (built_in_xml_file_path); - gnome_vfs_file_info_init (&built_in_info); - gnome_vfs_get_file_info (built_in_uri, &built_in_info, GNOME_VFS_FILE_INFO_DEFAULT); + built_in_info = gnome_vfs_file_info_new (); + gnome_vfs_get_file_info (built_in_uri, built_in_info, GNOME_VFS_FILE_INFO_DEFAULT); g_free (built_in_uri); /* see which is most recent */ - if (update_info.mtime > built_in_info.mtime) { + if (update_info->mtime <= built_in_info->mtime) { + result = built_in_xml_file_path; + g_free (update_xml_file_path); + } else { + result = update_xml_file_path; g_free (built_in_xml_file_path); - return update_xml_file_path; - } - - g_free (update_xml_file_path); - return built_in_xml_file_path; + } + + gnome_vfs_file_info_unref (update_info); + gnome_vfs_file_info_unref (built_in_info); + + return result; } static void -- cgit v1.2.1