Commit 075cd9bf authored by Darin Adler's avatar Darin Adler

reviewed by: Gene Ragan <gzr@eazel.com>

	* libnautilus-extensions/nautilus-file-operations.c:
	(get_label_font): It's illegal to unref a new widget since you
	don't own a ref to it. Sink it instead.
	(ellipsize_string_for_dialog): New function.
	(format_and_ellipsize_uri_for_dialog): Rename this function and
	change it to use nautilus_format_uri_for_display. Also add FIXME
	about where the ellipsis goes.
	(extract_and_ellipsize_file_name_for_dialog): Added a seprate
	function for the case where we want to extract the file name
	part only. The old code mixed the URI and file name cases in a
	way that would lead to anomalies with unusual names.
	(handle_transfer_vfs_error): Fixed storage leak.
	(is_special_link): Rewrote this function and also made it take
	a URI in text form, not a GnomeVFSURI.
	(handle_transfer_overwrite): Use is_special_link instead of
	duplicate its test. Removed incorrect use of NautilusFile (without
	waiting for results). Added quotes around file name in
	message. Use extract_and_ellipsize_file_name_for_dialog instead of
	our own ad-hoc functions.
	(make_next_duplicate_name): Get rid of bizarre buffer/sprintf that
	was used by someone who didn't know you can use printf formatting
	with g_warning.
	(vfs_uri_is_special_link): Created cover for one remaining caller
	of is_special_link that needs to pass a GnomeVFSURI.
	(nautilus_file_operations_copy_move): Use the new is_special_link
	(nautilus_file_operations_move_to_trash): Use
	extract_and_ellipsize_file_name_for_dialog instead of an old
	strange combination of calls.

	* libnautilus-extensions/nautilus-icon-factory.c:
	(nautilus_icon_factory_get_icon_name_for_regular_file): Fix
	obsolete comment and rearrange code now that plain text special
	case is gone.
parent 4824ee4d
2001-01-16 Darin Adler <darin@eazel.com>
reviewed by: Gene Ragan <gzr@eazel.com>
* libnautilus-extensions/nautilus-file-operations.c:
(get_label_font): It's illegal to unref a new widget since you
don't own a ref to it. Sink it instead.
(ellipsize_string_for_dialog): New function.
(format_and_ellipsize_uri_for_dialog): Rename this function and
change it to use nautilus_format_uri_for_display. Also add FIXME
about where the ellipsis goes.
(extract_and_ellipsize_file_name_for_dialog): Added a seprate
function for the case where we want to extract the file name
part only. The old code mixed the URI and file name cases in a
way that would lead to anomalies with unusual names.
(handle_transfer_vfs_error): Fixed storage leak.
(is_special_link): Rewrote this function and also made it take
a URI in text form, not a GnomeVFSURI.
(handle_transfer_overwrite): Use is_special_link instead of
duplicate its test. Removed incorrect use of NautilusFile (without
waiting for results). Added quotes around file name in
message. Use extract_and_ellipsize_file_name_for_dialog instead of
our own ad-hoc functions.
(make_next_duplicate_name): Get rid of bizarre buffer/sprintf that
was used by someone who didn't know you can use printf formatting
with g_warning.
(vfs_uri_is_special_link): Created cover for one remaining caller
of is_special_link that needs to pass a GnomeVFSURI.
(nautilus_file_operations_copy_move): Use the new is_special_link
(nautilus_file_operations_move_to_trash): Use
extract_and_ellipsize_file_name_for_dialog instead of an old
strange combination of calls.
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_icon_name_for_regular_file): Fix
obsolete comment and rearrange code now that plain text special
case is gone.
2001-01-16 Josh Barrow <josh@eazel.com>
* src/nautilus-first-time-druid.c: (druid_finished):
......@@ -152,7 +190,6 @@
* src/nautilus-window-private.h:
added a field to hold the event source listener ID.
>>>>>>> 1.3367
2001-01-15 Andy Hertzfeld <andy@eazel.com>
* components/throbber/main.c: (main):
......
......@@ -747,16 +747,8 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
{
const char *icon_name;
char *mime_type, *uri;
gboolean is_text_file;
/* force plain text files to use the generic document icon so
* we can have the text-in-icons feature; eventually, we
* want to force other types of text files as well
*/
mime_type = nautilus_file_get_mime_type (file);
is_text_file = nautilus_strcasecmp (mime_type, "text/plain") == 0;
if (mime_type != NULL) {
icon_name = gnome_vfs_mime_get_icon (mime_type);
if (icon_name != NULL) {
......@@ -765,11 +757,12 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
}
}
/* gnome_vfs_mime didn't give us an icon name, so we have to fall back on default icons. */
uri = nautilus_file_get_uri (file);
/* special-case icons based on the uri scheme. eventually we should generalize this. */
/* Special-case icons based on the uri scheme. Eventually we
* should generalize this or at least have a way for others to
* extend it.
*/
if (nautilus_istr_has_prefix (uri, "http:")
&& nautilus_strcmp (mime_type, "text/html") == 0) {
icon_name = ICON_NAME_WEB;
......@@ -779,13 +772,14 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
icon_name = nautilus_trash_monitor_is_empty ()
? ICON_NAME_TRASH_EMPTY : ICON_NAME_TRASH_NOT_EMPTY;
} else {
if (nautilus_file_is_executable (file) & !is_text_file) {
if (nautilus_file_is_executable (file)
&& nautilus_strcasecmp (mime_type, "text/plain") != 0) {
icon_name = ICON_NAME_EXECUTABLE;
} else {
icon_name = ICON_NAME_REGULAR;
}
}
g_free (uri);
g_free (mime_type);
......
......@@ -747,16 +747,8 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
{
const char *icon_name;
char *mime_type, *uri;
gboolean is_text_file;
/* force plain text files to use the generic document icon so
* we can have the text-in-icons feature; eventually, we
* want to force other types of text files as well
*/
mime_type = nautilus_file_get_mime_type (file);
is_text_file = nautilus_strcasecmp (mime_type, "text/plain") == 0;
if (mime_type != NULL) {
icon_name = gnome_vfs_mime_get_icon (mime_type);
if (icon_name != NULL) {
......@@ -765,11 +757,12 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
}
}
/* gnome_vfs_mime didn't give us an icon name, so we have to fall back on default icons. */
uri = nautilus_file_get_uri (file);
/* special-case icons based on the uri scheme. eventually we should generalize this. */
/* Special-case icons based on the uri scheme. Eventually we
* should generalize this or at least have a way for others to
* extend it.
*/
if (nautilus_istr_has_prefix (uri, "http:")
&& nautilus_strcmp (mime_type, "text/html") == 0) {
icon_name = ICON_NAME_WEB;
......@@ -779,13 +772,14 @@ nautilus_icon_factory_get_icon_name_for_regular_file (NautilusFile *file)
icon_name = nautilus_trash_monitor_is_empty ()
? ICON_NAME_TRASH_EMPTY : ICON_NAME_TRASH_NOT_EMPTY;
} else {
if (nautilus_file_is_executable (file) & !is_text_file) {
if (nautilus_file_is_executable (file)
&& nautilus_strcasecmp (mime_type, "text/plain") != 0) {
icon_name = ICON_NAME_EXECUTABLE;
} else {
icon_name = ICON_NAME_REGULAR;
}
}
g_free (uri);
g_free (mime_type);
......
......@@ -28,3 +28,4 @@ test-nautilus-pixbuf-tile
test-nautilus-preferences
test-nautilus-smooth-graphics
test-nautilus-widgets
test-nautilus-wrapped-label
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