diff options
author | Darin Adler <darin@src.gnome.org> | 2000-05-16 23:22:55 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-05-16 23:22:55 +0000 |
commit | 6281f2eeac20acfe65182d3ec4855f0fdae0b941 (patch) | |
tree | 6631fbd9813343afb20a84780cdd3e2cb90d9a6d | |
parent | 911f8288b9a1c2d43fd652f7bc61a1d0da8f5a9c (diff) | |
download | nautilus-6281f2eeac20acfe65182d3ec4855f0fdae0b941.tar.gz |
Quick cleanup pass on FIXMEs.
* check-FIXME.pl: Added the count of FIXMEs with bug numbers
as well as the count of FIXMEs without.
* components/services/trilobite/lib/helixcode-utils.c:
(xml_get_value), (prune_xml), (check_for_root_user),
(check_for_redhat), (determine_redhat_version),
(determine_mandrake_version), (determine_turbolinux_version),
(determine_suse_version), (determine_debian_version),
(determine_distribution_type), (get_distribution_name):
A tiny bit of cleanup on these functions. There was some really
bad code in here, including code that compared strings with ==.
Also a lot of code that does open and then no close, for no
good reason, so I added the close.
* libnautilus-extensions/nautilus-file.c: (rename_callback),
(nautilus_file_get_mapped_uri):
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_update_icon):
* libnautilus-extensions/nautilus-icon-dnd.c:
(confirm_switch_to_manual_layout), (nautilus_icon_dnd_begin_drag):
* src/file-manager/fm-icon-view.c: (update_layout_menus),
(sort_callback), (manual_layout_callback):
* src/ntl-view.c: (nautilus_view_destroy_client):
Added bug numbers to some FIXMEs.
-rw-r--r-- | ChangeLog | 29 | ||||
-rwxr-xr-x | check-FIXME.pl | 4 | ||||
-rw-r--r-- | components/services/trilobite/lib/helixcode-utils.c | 144 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-file.c | 5 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-icon-container.c | 11 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-icon-dnd.c | 18 | ||||
-rw-r--r-- | libnautilus-private/nautilus-file.c | 5 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 11 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-dnd.c | 18 | ||||
-rw-r--r-- | src/file-manager/fm-icon-view.c | 8 | ||||
-rw-r--r-- | src/nautilus-view-frame.c | 4 | ||||
-rw-r--r-- | src/ntl-view.c | 4 |
12 files changed, 139 insertions, 122 deletions
@@ -1,3 +1,32 @@ +2000-05-16 Darin Adler <darin@eazel.com> + + Quick cleanup pass on FIXMEs. + + * check-FIXME.pl: Added the count of FIXMEs with bug numbers + as well as the count of FIXMEs without. + + * components/services/trilobite/lib/helixcode-utils.c: + (xml_get_value), (prune_xml), (check_for_root_user), + (check_for_redhat), (determine_redhat_version), + (determine_mandrake_version), (determine_turbolinux_version), + (determine_suse_version), (determine_debian_version), + (determine_distribution_type), (get_distribution_name): + A tiny bit of cleanup on these functions. There was some really + bad code in here, including code that compared strings with ==. + Also a lot of code that does open and then no close, for no + good reason, so I added the close. + + * libnautilus-extensions/nautilus-file.c: (rename_callback), + (nautilus_file_get_mapped_uri): + * libnautilus-extensions/nautilus-icon-container.c: + (nautilus_icon_container_update_icon): + * libnautilus-extensions/nautilus-icon-dnd.c: + (confirm_switch_to_manual_layout), (nautilus_icon_dnd_begin_drag): + * src/file-manager/fm-icon-view.c: (update_layout_menus), + (sort_callback), (manual_layout_callback): + * src/ntl-view.c: (nautilus_view_destroy_client): + Added bug numbers to some FIXMEs. + 2000-05-16 Eskil Heyn Olsen <eskil@eazel.om> * components/services/trilobite/sample/service/Makefile.am diff --git a/check-FIXME.pl b/check-FIXME.pl index e672a2caa..fbd2428f5 100755 --- a/check-FIXME.pl +++ b/check-FIXME.pl @@ -80,7 +80,7 @@ foreach my $file (@ARGV) if ($no_bug_lines ne "") { my @no_bug_list = sort split /\n/, $no_bug_lines; - print "\n", scalar(@no_bug_list), " FIXMEs don't have bug reports:\n\n"; + print "\n", scalar(@no_bug_list), " FIXMEs don't have bug numbers:\n\n"; foreach my $line (@no_bug_list) { print $line, "\n"; @@ -88,6 +88,7 @@ if ($no_bug_lines ne "") } # list the ones with bugs that are not open +print "\n", scalar(keys %bug_lines), " FIXMEs with bug numbers.\n"; sub numerically { $a <=> $b; } foreach my $bug (sort numerically keys %bug_lines) { @@ -106,3 +107,4 @@ foreach my $bug (sort numerically keys %bug_lines) print $line, "\n"; } } +print "\n"; diff --git a/components/services/trilobite/lib/helixcode-utils.c b/components/services/trilobite/lib/helixcode-utils.c index 7c2d38937..5103a6777 100644 --- a/components/services/trilobite/lib/helixcode-utils.c +++ b/components/services/trilobite/lib/helixcode-utils.c @@ -35,7 +35,8 @@ static float determine_suse_version (void); static float determine_debian_version (void); char* -xml_get_value (xmlNode* node, const char* name) { +xml_get_value (xmlNode* node, const char* name) +{ char* ret; xmlNode *child; @@ -57,7 +58,8 @@ xml_get_value (xmlNode* node, const char* name) { } /* end xml_get_value */ xmlDocPtr -prune_xml (char* xmlbuf) { +prune_xml (char* xmlbuf) +{ xmlDocPtr doc; char* newbuf; int length; @@ -85,7 +87,8 @@ prune_xml (char* xmlbuf) { } /* end prune_xml */ gboolean -check_for_root_user () { +check_for_root_user (void) +{ uid_t uid; uid = getuid (); @@ -98,7 +101,8 @@ check_for_root_user () { } /* end check_for_root_user */ gboolean -check_for_redhat () { +check_for_redhat (void) +{ if (g_file_exists ("/etc/redhat-release") != 0) { return TRUE; } @@ -107,14 +111,13 @@ check_for_redhat () { } } /* end check_for_redhat */ - -/* FIXME - the following functions are not closing fd correctly. This needs - to be fixed and the functions need to be cleaned up. They are ugly right - now. Bug #908 in Bugzilla. +/* FIXME bugzilla.eazel.com 908: - the following functions are not + * closing fd correctly. This needs to be fixed and the functions + * need to be cleaned up. They are ugly right now. */ - static float -determine_redhat_version () { +determine_redhat_version (void) +{ int fd; char buf[1024]; @@ -125,6 +128,7 @@ determine_redhat_version () { fd = open ("/etc/redhat-release", O_RDONLY); g_return_val_if_fail (fd != -1, 0); read (fd, buf, 1023); + close (fd); buf[1023] = '\0'; /* These check for LinuxPPC. For whatever reason, they use /etc/redhat-release */ @@ -155,8 +159,8 @@ determine_redhat_version () { } /* determine_redhat_version */ static float -determine_mandrake_version () { - +determine_mandrake_version (void) +{ int fd; char buf[1024]; char* text; @@ -166,6 +170,7 @@ determine_mandrake_version () { fd = open ("/etc/mandrake-release", O_RDONLY); g_return_val_if_fail (fd != -1, 0); read (fd, buf, 1023); + close (fd); buf[1023] = '\0'; text = strstr (buf, "6.0"); if (text) @@ -188,8 +193,8 @@ determine_mandrake_version () { } /* determine_mandrake_version */ static float -determine_turbolinux_version () { - +determine_turbolinux_version (void) +{ int fd; char buf[1024]; char* text; @@ -199,6 +204,7 @@ determine_turbolinux_version () { fd = open ("/etc/turbolinux-release", O_RDONLY); g_return_val_if_fail (fd != -1, 0); read (fd, buf, 1023); + close (fd); buf[1023] = '\0'; text = strstr (buf, "7."); if (text) @@ -221,8 +227,8 @@ determine_turbolinux_version () { } /* determine_turbolinux_version */ static float -determine_suse_version () { - +determine_suse_version (void) +{ int fd; char buf[1024]; char* text; @@ -232,6 +238,7 @@ determine_suse_version () { fd = open ("/etc/SuSE-release", O_RDONLY); g_return_val_if_fail (fd != -1, 0); read (fd, buf, 1023); + close (fd); buf[1023] = '\0'; text = strstr (buf, "6."); if (!text) @@ -248,7 +255,8 @@ determine_suse_version () { } /* determine_suse_version */ static float -determine_debian_version () { +determine_debian_version (void) +{ int fd; char buf[1024]; @@ -257,6 +265,7 @@ determine_debian_version () { fd = open ("/etc/debian_version", O_RDONLY); g_return_val_if_fail (fd != -1, 0); read (fd, buf, 1023); + close (fd); buf[1023] = '\0'; sscanf (buf, "%f", &version); if (version < 2.1) @@ -265,8 +274,8 @@ determine_debian_version () { } /* determine_debian_version */ DistributionType -determine_distribution_type (void) { - +determine_distribution_type (void) +{ float version; DistributionType rv; @@ -363,69 +372,42 @@ determine_distribution_type (void) { return rv; } /* determine_distribution_type */ -char* -get_distribution_name (const DistributionType* dtype) { - - char* rv; - rv = NULL; - - while (rv != NULL) { - switch ((int) dtype) { - case DISTRO_REDHAT_5: - rv = g_strdup ("RedHat Linux 5.x"); - break; - case DISTRO_REDHAT_6: - rv = g_strdup ("RedHat Linux 6.0"); - break; - case DISTRO_REDHAT_6_1: - rv = g_strdup ("RedHat Linux 6.1"); - break; - case DISTRO_REDHAT_6_2: - rv = g_strdup ("RedHat Linux 6.2"); - break; - case DISTRO_MANDRAKE_6_1: - rv = g_strdup ("Mandrake Linux 6.2"); - break; - case DISTRO_MANDRAKE_7: - rv = g_strdup ("Mandrake Linux 7.x"); - break; - case DISTRO_CALDERA: - rv = g_strdup ("Caldera OpenLinux"); - break; - case DISTRO_SUSE: - rv = g_strdup ("SuSe Linux"); - break; - case DISTRO_LINUXPPC: - rv = g_strdup ("LinuxPPC"); - break; - case DISTRO_TURBOLINUX_4: - rv = g_strdup ("TurboLinux 4.x"); - break; - case DISTRO_TURBOLINUX_6: - rv = g_strdup ("TurboLinux 6.x"); - break; - case DISTRO_COREL: - rv = g_strdup ("Corel Linux"); - break; - case DISTRO_DEBIAN_2_1: - rv = g_strdup ("Debian GNU/Linux 2.1"); - break; - case DISTRO_DEBIAN_2_2: - rv = g_strdup ("Debian GNU/Linux 2.2"); - break; - case DISTRO_UNKNOWN: - rv = g_strdup ("Unknown Linux Distribtion"); - break; - default: - rv = g_strdup ("INVALID_RETURN_VALUE"); - break; - } - } - if (rv == "INVALID_RETURN_VALUE") { +char * +get_distribution_name (const DistributionType* dtype) +{ + switch ((int) dtype) { + case DISTRO_REDHAT_5: + return g_strdup ("RedHat Linux 5.x"); + case DISTRO_REDHAT_6: + return g_strdup ("RedHat Linux 6.0"); + case DISTRO_REDHAT_6_1: + return g_strdup ("RedHat Linux 6.1"); + case DISTRO_REDHAT_6_2: + return g_strdup ("RedHat Linux 6.2"); + case DISTRO_MANDRAKE_6_1: + return g_strdup ("Mandrake Linux 6.2"); + case DISTRO_MANDRAKE_7: + return g_strdup ("Mandrake Linux 7.x"); + case DISTRO_CALDERA: + return g_strdup ("Caldera OpenLinux"); + case DISTRO_SUSE: + return g_strdup ("SuSe Linux"); + case DISTRO_LINUXPPC: + return g_strdup ("LinuxPPC"); + case DISTRO_TURBOLINUX_4: + return g_strdup ("TurboLinux 4.x"); + case DISTRO_TURBOLINUX_6: + return g_strdup ("TurboLinux 6.x"); + case DISTRO_COREL: + return g_strdup ("Corel Linux"); + case DISTRO_DEBIAN_2_1: + return g_strdup ("Debian GNU/Linux 2.1"); + case DISTRO_DEBIAN_2_2: + return g_strdup ("Debian GNU/Linux 2.2"); + case DISTRO_UNKNOWN: + return g_strdup ("unknown Linux distribution"); + default: fprintf (stderr, "Invalid DistributionType !\n"); exit (1); } - else { - return rv; - } } /* end get_distribution_name */ diff --git a/libnautilus-extensions/nautilus-file.c b/libnautilus-extensions/nautilus-file.c index 5d0bcba89..9f55faf79 100644 --- a/libnautilus-extensions/nautilus-file.c +++ b/libnautilus-extensions/nautilus-file.c @@ -557,7 +557,8 @@ rename_callback (GnomeVFSAsyncHandle *handle, /* We have to handle this case because if you pass * GNOME_VFS_ERROR_MODE_ABORT, you never get the * error code for a failed rename. - * FIXME: I believe this represents a bug in GNOME VFS. + * FIXME bugzilla.eazel.com 912: I believe this + * represents a bug in GNOME VFS. */ return GNOME_VFS_XFER_ERROR_ACTION_ABORT; default: @@ -1135,7 +1136,7 @@ nautilus_file_get_mapped_uri (NautilusFile *file) return NULL; } - /* FIXME: Need to use async. I/O. */ + /* FIXME bugzilla.eazel.com 911: Need to use async. I/O. */ /* see if it's a gmc style URI by reading the first part of the file */ result = gnome_vfs_open (&handle, actual_uri, GNOME_VFS_OPEN_READ); if (result == GNOME_VFS_OK) { diff --git a/libnautilus-extensions/nautilus-icon-container.c b/libnautilus-extensions/nautilus-icon-container.c index d60201b91..7e0c7386d 100644 --- a/libnautilus-extensions/nautilus-icon-container.c +++ b/libnautilus-extensions/nautilus-icon-container.c @@ -2719,11 +2719,12 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container, return; } - /* Close any open edit. - * FIXME: Why must we do this? This function is called if there's - * any change. Probably we only want to do this for certain kinds - * of changes and even then it seems rude to discard the user's - * text instead of prompting. + /* Close any open edit. */ + /* FIXME bugzilla.eazel.com 913: Why must we do this? This + * function is called if there's any change. Probably we only + * want to do this for certain kinds of changes and even then + * it seems rude to discard the user's text instead of + * prompting. */ end_renaming_mode (container, TRUE); diff --git a/libnautilus-extensions/nautilus-icon-dnd.c b/libnautilus-extensions/nautilus-icon-dnd.c index 7dfdf47bb..79e57f692 100644 --- a/libnautilus-extensions/nautilus-icon-dnd.c +++ b/libnautilus-extensions/nautilus-icon-dnd.c @@ -722,12 +722,10 @@ confirm_switch_to_manual_layout (NautilusIconContainer *container) { const char *message; - /* FIXME: Use of the word "directory" makes this FMIconView specific. - * Move this into FMIconView so NautilusIconContainer can - * be used for things that are not directories? - */ - /* FIXME bugzilla.eazel.com 544: The hard-coded newlines in these - * messages are terrible! + /* FIXME bugzilla.eazel.com 915: Use of the word "directory" + * makes this FMIconView specific. Move these messages into + * FMIconView so NautilusIconContainer can be used for things + * that are not directories? */ if (nautilus_icon_container_has_stored_icon_positions (container)) { if (nautilus_g_list_exactly_one_item (container->details->dnd_info->selection_list)) { @@ -1145,9 +1143,11 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container, /* create a pixmap and mask to drag with */ pixbuf = nautilus_icon_canvas_item_get_image (container->details->drag_icon->item); - /* unfortunately, X is very slow when using a stippled mask, so only use the stipple - for relatively small pixbufs. FIXME: Eventually, we may have to remove this entirely - for UI consistency reasons */ + /* unfortunately, X is very slow when using a stippled mask, + so only use the stipple for relatively small pixbufs. */ + /* FIXME bugzilla.eazel.com 914: Eventually, we may have to + * remove this entirely for UI consistency reasons. + */ if (gdk_pixbuf_get_width(pixbuf) * gdk_pixbuf_get_height(pixbuf) < 4096) { transparent_pixbuf = nautilus_make_semi_transparent (pixbuf); diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index 5d0bcba89..9f55faf79 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -557,7 +557,8 @@ rename_callback (GnomeVFSAsyncHandle *handle, /* We have to handle this case because if you pass * GNOME_VFS_ERROR_MODE_ABORT, you never get the * error code for a failed rename. - * FIXME: I believe this represents a bug in GNOME VFS. + * FIXME bugzilla.eazel.com 912: I believe this + * represents a bug in GNOME VFS. */ return GNOME_VFS_XFER_ERROR_ACTION_ABORT; default: @@ -1135,7 +1136,7 @@ nautilus_file_get_mapped_uri (NautilusFile *file) return NULL; } - /* FIXME: Need to use async. I/O. */ + /* FIXME bugzilla.eazel.com 911: Need to use async. I/O. */ /* see if it's a gmc style URI by reading the first part of the file */ result = gnome_vfs_open (&handle, actual_uri, GNOME_VFS_OPEN_READ); if (result == GNOME_VFS_OK) { diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index d60201b91..7e0c7386d 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -2719,11 +2719,12 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container, return; } - /* Close any open edit. - * FIXME: Why must we do this? This function is called if there's - * any change. Probably we only want to do this for certain kinds - * of changes and even then it seems rude to discard the user's - * text instead of prompting. + /* Close any open edit. */ + /* FIXME bugzilla.eazel.com 913: Why must we do this? This + * function is called if there's any change. Probably we only + * want to do this for certain kinds of changes and even then + * it seems rude to discard the user's text instead of + * prompting. */ end_renaming_mode (container, TRUE); diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c index 7dfdf47bb..79e57f692 100644 --- a/libnautilus-private/nautilus-icon-dnd.c +++ b/libnautilus-private/nautilus-icon-dnd.c @@ -722,12 +722,10 @@ confirm_switch_to_manual_layout (NautilusIconContainer *container) { const char *message; - /* FIXME: Use of the word "directory" makes this FMIconView specific. - * Move this into FMIconView so NautilusIconContainer can - * be used for things that are not directories? - */ - /* FIXME bugzilla.eazel.com 544: The hard-coded newlines in these - * messages are terrible! + /* FIXME bugzilla.eazel.com 915: Use of the word "directory" + * makes this FMIconView specific. Move these messages into + * FMIconView so NautilusIconContainer can be used for things + * that are not directories? */ if (nautilus_icon_container_has_stored_icon_positions (container)) { if (nautilus_g_list_exactly_one_item (container->details->dnd_info->selection_list)) { @@ -1145,9 +1143,11 @@ nautilus_icon_dnd_begin_drag (NautilusIconContainer *container, /* create a pixmap and mask to drag with */ pixbuf = nautilus_icon_canvas_item_get_image (container->details->drag_icon->item); - /* unfortunately, X is very slow when using a stippled mask, so only use the stipple - for relatively small pixbufs. FIXME: Eventually, we may have to remove this entirely - for UI consistency reasons */ + /* unfortunately, X is very slow when using a stippled mask, + so only use the stipple for relatively small pixbufs. */ + /* FIXME bugzilla.eazel.com 914: Eventually, we may have to + * remove this entirely for UI consistency reasons. + */ if (gdk_pixbuf_get_width(pixbuf) * gdk_pixbuf_get_height(pixbuf) < 4096) { transparent_pixbuf = nautilus_make_semi_transparent (pixbuf); diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index 8d715e45f..ee18d26ec 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -134,7 +134,7 @@ struct FMIconViewDetails const SortCriterion *sort; - /* FIXME: Workaround for Bonobo bug. */ + /* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */ gboolean updating_bonobo_radio_menu_item; }; @@ -480,7 +480,7 @@ update_layout_menus (FMIconView *view) return; } - /* FIXME: Workaround for Bonobo bug. */ + /* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */ view->details->updating_bonobo_radio_menu_item = TRUE; path = MENU_PATH_MANUAL_LAYOUT; if (nautilus_icon_container_is_auto_layout (get_icon_container (view))) { @@ -755,7 +755,7 @@ sort_callback (BonoboUIHandler *handler, gpointer user_data, const char *path) icon_view = FM_ICON_VIEW (user_data); - /* FIXME: Workaround for Bonobo bug. */ + /* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */ if (icon_view->details->updating_bonobo_radio_menu_item) { return; } @@ -774,7 +774,7 @@ manual_layout_callback (BonoboUIHandler *handler, icon_view = FM_ICON_VIEW (user_data); - /* FIXME: Workaround for Bonobo bug. */ + /* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */ if (icon_view->details->updating_bonobo_radio_menu_item) { return; } diff --git a/src/nautilus-view-frame.c b/src/nautilus-view-frame.c index da2f3bd6a..4fc8d8174 100644 --- a/src/nautilus-view-frame.c +++ b/src/nautilus-view-frame.c @@ -250,8 +250,8 @@ nautilus_view_destroy_client(NautilusView *view) view->component_class->destroy(view, &ev); } - /* FIXME: This should be bonobo_object_unref, but there is a circular - * reference that prevents it from working. + /* FIXME bugzilla.eazel.com 917: This should be bonobo_object_unref, + * but there is a circular reference that prevents it from working. */ bonobo_object_destroy (view->view_frame); view->view_frame = NULL; diff --git a/src/ntl-view.c b/src/ntl-view.c index da2f3bd6a..4fc8d8174 100644 --- a/src/ntl-view.c +++ b/src/ntl-view.c @@ -250,8 +250,8 @@ nautilus_view_destroy_client(NautilusView *view) view->component_class->destroy(view, &ev); } - /* FIXME: This should be bonobo_object_unref, but there is a circular - * reference that prevents it from working. + /* FIXME bugzilla.eazel.com 917: This should be bonobo_object_unref, + * but there is a circular reference that prevents it from working. */ bonobo_object_destroy (view->view_frame); view->view_frame = NULL; |