Commit b3be7b7c authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Remove type checks, was showing up in profiles.

2002-10-18  Alexander Larsson  <alexl@redhat.com>

	* libnautilus-private/nautilus-file.c (nautilus_file_compare_for_sort_internal):
	* src/file-manager/fm-icon-view.c (fm_icon_view_compare_files):
	* src/file-manager/fm-icon-container.c (get_icon_view):
	Remove type checks, was showing up in profiles.

	* libnautilus-private/nautilus-directory.c (nautilus_directory_notify_files_added):
	Don't leak directory_uri
parent 6efb3bdc
2002-10-18 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.c (nautilus_file_compare_for_sort_internal):
* src/file-manager/fm-icon-view.c (fm_icon_view_compare_files):
* src/file-manager/fm-icon-container.c (get_icon_view):
Remove type checks, was showing up in profiles.
* libnautilus-private/nautilus-directory.c (nautilus_directory_notify_files_added):
Don't leak directory_uri
2002-10-18 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
......
......@@ -918,7 +918,7 @@ nautilus_directory_notify_files_added (GList *uris)
NautilusDirectory *directory;
GHashTable *parent_directories;
const char *uri;
const char *directory_uri;
char *directory_uri;
GnomeVFSURI *vfs_uri;
NautilusFile *file;
......@@ -941,6 +941,7 @@ nautilus_directory_notify_files_added (GList *uris)
directory_uri = uri_get_directory_part (uri);
file = nautilus_file_get_existing (directory_uri);
g_free (directory_uri);
if (file != NULL) {
nautilus_file_invalidate_count_and_mime_list (file);
......
......@@ -1860,9 +1860,6 @@ nautilus_file_compare_for_sort_internal (NautilusFile *file_1,
{
int compare;
g_return_val_if_fail (NAUTILUS_IS_FILE (file_1), 0);
g_return_val_if_fail (NAUTILUS_IS_FILE (file_2), 0);
switch (sort_type) {
case NAUTILUS_FILE_SORT_BY_DISPLAY_NAME:
compare = compare_by_display_name (file_1, file_2);
......
......@@ -42,9 +42,8 @@ GNOME_CLASS_BOILERPLATE (FMIconContainer, fm_icon_container,
static FMIconView *
get_icon_view (NautilusIconContainer *container)
{
g_assert (FM_IS_ICON_CONTAINER (container));
return FM_ICON_CONTAINER (container)->view;
/* Type unsafe comparison for performance */
return ((FMIconContainer *)container)->view;
}
static char *
......@@ -349,9 +348,10 @@ fm_icon_container_compare_icons (NautilusIconContainer *container,
(container, icon_a, icon_b);
}
/* Type unsafe comparisons for performance */
return fm_icon_view_compare_files (icon_view,
NAUTILUS_FILE (icon_a),
NAUTILUS_FILE (icon_b));
(NautilusFile *)icon_a,
(NautilusFile *)icon_b);
}
static int
......
......@@ -1749,11 +1749,10 @@ fm_icon_view_compare_files (FMIconView *icon_view,
NautilusFile *a,
NautilusFile *b)
{
g_assert (FM_IS_ICON_VIEW (icon_view));
return nautilus_file_compare_for_sort
(a, b, icon_view->details->sort->sort_type,
fm_directory_view_should_sort_directories_first (FM_DIRECTORY_VIEW (icon_view)),
/* Use type-unsafe cast for performance */
fm_directory_view_should_sort_directories_first ((FMDirectoryView *)icon_view),
icon_view->details->sort_reversed);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment