Commit 81054a09 authored by Darin Adler's avatar Darin Adler

Fixed to use g_iconv instead of iconv, starting with a patch from Jean

	* libnautilus-private/nautilus-desktop-file-loader.c:
	(validated_strdup): Fixed to use g_iconv instead of iconv,
	starting with a patch from Jean Schurger <jschurger@schurger.org>.

	* libnautilus-private/nautilus-font-factory.c: Remove.
	* libnautilus-private/nautilus-font-factory.h: Remove.
	* libnautilus-private/Makefile.am:
	Remove nautilus-font-factory.[ch].

	* libnautilus-private/nautilus-icon-canvas-item.c:
	(nautilus_icon_canvas_item_finalize),
	(nautilus_icon_canvas_item_set_arg),
	(nautilus_icon_canvas_item_get_arg), (draw_or_measure_label_text),
	(nautilus_icon_canvas_item_class_init):
	Get rid of the "font" arg. We'll have to replace this with something
	that works with Pango -- maybe just a font name.

	* src/file-manager/fm-list-view.c: (truncate_middle_callback),
	(get_cell_text): Turn off the GdkFont ellipsizing code. I hope this
	just goes away when Anders finishes his port to GtkTextView.

	* src/file-manager/fm-properties-window.c:
	(fm_properties_window_class_init), (real_destroy), (real_finalize):
	Fix a bug where it would try to disconnect a signal on an object
	that is already NULL by that time.

	* src/nautilus-profiler.c:
	(nautilus_profiler_bonobo_ui_report_callback): Disable the dump
	window, pending a port to GtkTextView instead of GtkText.

	* components/music/nautilus-music-view.c:
	* components/news/nautilus-news.c:
	* components/notes/nautilus-notes.c:
	* components/text/nautilus-text-view.c:
	* libnautilus-private/nautilus-file-operations-progress.c:
	* libnautilus-private/nautilus-file-operations.c:
	* libnautilus-private/nautilus-icon-container.c:
	* src/file-manager/fm-icon-view.c:
	* src/nautilus-sidebar-title.c:
	Get rid of some includes of unused headers.
parent 1f700df0
2002-01-07 Darin Adler <darin@bentspoon.com>
* libnautilus-private/nautilus-desktop-file-loader.c:
(validated_strdup): Fixed to use g_iconv instead of iconv,
starting with a patch from Jean Schurger <jschurger@schurger.org>.
* libnautilus-private/nautilus-font-factory.c: Remove.
* libnautilus-private/nautilus-font-factory.h: Remove.
* libnautilus-private/Makefile.am:
Remove nautilus-font-factory.[ch].
* libnautilus-private/nautilus-icon-canvas-item.c:
(nautilus_icon_canvas_item_finalize),
(nautilus_icon_canvas_item_set_arg),
(nautilus_icon_canvas_item_get_arg), (draw_or_measure_label_text),
(nautilus_icon_canvas_item_class_init):
Get rid of the "font" arg. We'll have to replace this with something
that works with Pango -- maybe just a font name.
* src/file-manager/fm-list-view.c: (truncate_middle_callback),
(get_cell_text): Turn off the GdkFont ellipsizing code. I hope this
just goes away when Anders finishes his port to GtkTextView.
* src/file-manager/fm-properties-window.c:
(fm_properties_window_class_init), (real_destroy), (real_finalize):
Fix a bug where it would try to disconnect a signal on an object
that is already NULL by that time.
* src/nautilus-profiler.c:
(nautilus_profiler_bonobo_ui_report_callback): Disable the dump
window, pending a port to GtkTextView instead of GtkText.
* components/music/nautilus-music-view.c:
* components/news/nautilus-news.c:
* components/notes/nautilus-notes.c:
* components/text/nautilus-text-view.c:
* libnautilus-private/nautilus-file-operations-progress.c:
* libnautilus-private/nautilus-file-operations.c:
* libnautilus-private/nautilus-icon-container.c:
* src/file-manager/fm-icon-view.c:
* src/nautilus-sidebar-title.c:
Get rid of some includes of unused headers.
2002-01-07 Darin Adler <darin@bentspoon.com>
Integrate patches from Frank Worsley <fworlsey@shaw.ca>.
......
......@@ -34,7 +34,6 @@
#include "pixmaps.h"
#include <eel/eel-background.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
......@@ -62,7 +61,6 @@
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus-private/nautilus-sound.h>
......
......@@ -64,7 +64,6 @@
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus-private/nautilus-theme.h>
......
......@@ -38,7 +38,6 @@
#include <bonobo/bonobo-property-bag.h>
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <libnautilus/nautilus-clipboard.h>
......
......@@ -51,7 +51,6 @@
#include <libnautilus-private/nautilus-bonobo-extensions.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus/libnautilus.h>
#include <libnautilus/nautilus-clipboard.h>
......
......@@ -83,8 +83,6 @@ libnautilus_private_la_SOURCES = \
nautilus-file.h \
nautilus-find-icon-image.c \
nautilus-find-icon-image.h \
nautilus-font-factory.c \
nautilus-font-factory.h \
nautilus-global-preferences.c \
nautilus-global-preferences.h \
nautilus-horizontal-splitter.c \
......
......@@ -25,20 +25,18 @@
#include <config.h>
#include "nautilus-desktop-file-loader.h"
#include "nautilus-program-choosing.h"
#include <libgnome/libgnome.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include "nautilus-program-choosing.h"
#include <eel/eel-gnome-extensions.h>
#include <eel/eel-vfs-extensions.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <locale.h>
#include <iconv.h>
#include <langinfo.h>
#include <libgnome/gnome-url.h>
#include <libgnomevfs/gnome-vfs-ops.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct NautilusDesktopFileSection NautilusDesktopFileSection;
typedef struct NautilusDesktopFileAddition NautilusDesktopFileAddition;
......@@ -993,7 +991,7 @@ validated_strdup (const char *str)
static gboolean initialized = FALSE;
gchar *pout, *pin, *buf;
gint len, ulen = 0, ib, ob;
iconv_t fd;
GIConv fd;
G_LOCK (init_validate);
if (!initialized) {
......@@ -1008,7 +1006,7 @@ validated_strdup (const char *str)
len = strlen (str);
if (looks_utf8 (str, len, NULL, &ulen)) {
if ((fd = iconv_open (locale, "UTF-8")) != (iconv_t)-1) {
if ((fd = g_iconv_open (locale, "UTF-8")) != (GIConv)-1) {
ib = len;
ob = ib * 3;
pout = buf = g_new0 (gchar, ob);
......@@ -1016,12 +1014,12 @@ validated_strdup (const char *str)
/* not portable either */
if (iconv (fd, &pin, &ib, &pout, &ob) == (size_t)-1) {
if (g_iconv (fd, &pin, &ib, &pout, &ob) == (size_t)-1) {
g_free (buf);
buf = NULL;
}
iconv_close (fd);
g_iconv_close (fd);
}
} else {
buf = g_strdup (str);
......
......@@ -30,7 +30,6 @@
#include "nautilus-file-operations-progress.h"
#include <eel/eel-ellipsizing-label.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
......
......@@ -30,7 +30,6 @@
#include "nautilus-file-operations-progress.h"
#include "nautilus-lib-self-check-functions.h"
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-stock-dialogs.h>
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-font-factory.c: Class for obtaining fonts.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#include <config.h>
#include "nautilus-font-factory.h"
#include "nautilus-global-preferences.h"
#include <eel/eel-gtk-macros.h>
#include <eel/eel-string.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <pthread.h>
#include <unistd.h>
#include <libgnome/gnome-i18n.h>
#define NAUTILUS_TYPE_FONT_FACTORY \
(nautilus_font_factory_get_type ())
#define NAUTILUS_FONT_FACTORY(obj) \
(GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_FONT_FACTORY, NautilusFontFactory))
#define NAUTILUS_FONT_FACTORY_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_FONT_FACTORY, NautilusFontFactoryClass))
#define NAUTILUS_IS_FONT_FACTORY(obj) \
(GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_FONT_FACTORY))
#define NAUTILUS_IS_FONT_FACTORY_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_FONT_FACTORY))
/* The font factory */
typedef struct {
GtkObject object;
GHashTable *fonts;
} NautilusFontFactory;
typedef struct {
GtkObjectClass parent_class;
} NautilusFontFactoryClass;
/* FontHashNode */
typedef struct {
char *name;
GdkFont *font;
} FontHashNode;
static NautilusFontFactory *global_font_factory = NULL;
static GtkType nautilus_font_factory_get_type (void);
static void nautilus_font_factory_class_init (NautilusFontFactoryClass *class);
static void nautilus_font_factory_init (NautilusFontFactory *factory);
static void destroy (GtkObject *object);
EEL_CLASS_BOILERPLATE (NautilusFontFactory,
nautilus_font_factory,
GTK_TYPE_OBJECT)
static void
unref_global_font_factory (void)
{
g_object_unref (global_font_factory);
}
/* Return a pointer to the single global font factory. */
static NautilusFontFactory *
nautilus_get_current_font_factory (void)
{
if (global_font_factory == NULL) {
global_font_factory = NAUTILUS_FONT_FACTORY (g_object_new (nautilus_font_factory_get_type (), NULL));
g_object_ref (global_font_factory);
gtk_object_sink (GTK_OBJECT (global_font_factory));
g_atexit (unref_global_font_factory);
}
return global_font_factory;
}
GtkObject *
nautilus_font_factory_get (void)
{
return GTK_OBJECT (nautilus_get_current_font_factory ());
}
static void
nautilus_font_factory_init (NautilusFontFactory *factory)
{
factory->fonts = g_hash_table_new (g_str_hash, g_str_equal);
}
static void
nautilus_font_factory_class_init (NautilusFontFactoryClass *class)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (class);
object_class->destroy = destroy;
}
#if GNOME2_CONVERSION_COMPLETE
static FontHashNode *
font_hash_node_alloc (const char *name)
{
FontHashNode *node;
g_assert (name != NULL);
node = g_new0 (FontHashNode, 1);
node->name = g_strdup (name);
return node;
}
#endif
static void
font_hash_node_free (FontHashNode *node)
{
g_assert (node != NULL);
g_free (node->name);
gdk_font_unref (node->font);
g_free (node);
}
static void
free_one_hash_node (gpointer key, gpointer value, gpointer callback_data)
{
FontHashNode *node;
g_assert (key != NULL);
g_assert (value != NULL);
g_assert (callback_data == NULL);
node = value;
g_assert (node->name == key);
font_hash_node_free (node);
}
static void
destroy (GtkObject *object)
{
NautilusFontFactory *factory;
factory = NAUTILUS_FONT_FACTORY (object);
g_hash_table_foreach (factory->fonts, free_one_hash_node, NULL);
g_hash_table_destroy (factory->fonts);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
#if GNOME2_CONVERSION_COMPLETE
static FontHashNode *
font_hash_node_lookup (const char *name)
{
NautilusFontFactory *factory;
g_assert (name != NULL);
factory = nautilus_get_current_font_factory ();
return (FontHashNode *) g_hash_table_lookup (factory->fonts, name);
}
static FontHashNode *
font_hash_node_lookup_with_insertion (const char *name)
{
NautilusFontFactory *factory;
FontHashNode *node;
GdkFont *font;
g_assert (name != NULL);
factory = nautilus_get_current_font_factory ();
node = font_hash_node_lookup (name);
if (node == NULL) {
font = gdk_fontset_load (name);
if (font != NULL) {
node = font_hash_node_alloc (name);
node->font = font;
g_hash_table_insert (factory->fonts, node->name, node);
}
}
return node;
}
/* Public functions */
GdkFont *
nautilus_font_factory_get_font_by_family (const char *family,
guint size_in_pixels)
{
NautilusFontFactory *factory;
GdkFont *font;
FontHashNode *node;
char *font_name;
char **fontset;
char **iter;
g_return_val_if_fail (family != NULL, NULL);
g_return_val_if_fail (size_in_pixels > 0, NULL);
/* FIXME bugzilla.gnome.org 47907:
* The "GTK System Font" string is hard coded in many places.
*/
if (eel_str_is_equal (family, "GTK System Font")) {
return eel_gtk_get_system_font ();
}
fontset = g_strsplit (family, ",", 5);
iter = fontset;
factory = nautilus_get_current_font_factory ();
while (*iter) {
/* FIXME bugzilla.gnome.org 47347:
* Its a hack that we check for "-" prefixes in font names.
* We do this in order not to break transalted font families.
*/
if (!eel_str_has_prefix (*iter, "-")) {
font_name = eel_gdk_font_xlfd_string_new ("*",
*iter,
"medium",
"r",
"normal",
"*",
size_in_pixels);
} else {
font_name = g_strdup (*iter);
}
g_free (*iter);
*iter = font_name;
iter++;
}
font_name = g_strjoinv (",", fontset);
g_strfreev (fontset);
node = font_hash_node_lookup_with_insertion (font_name);
if (node != NULL) {
g_assert (node->font != NULL);
font = node->font;
gdk_font_ref (font);
} else {
font = eel_gdk_font_get_fixed ();
}
g_free (font_name);
return font;
}
GdkFont *
nautilus_font_factory_get_font_from_preferences (guint size_in_pixels)
{
static gboolean icon_view_font_auto_value_registered;
static const char *icon_view_font_auto_value;
/* Can't initialize this in class_init, because no font factory
* instance may yet exist when this is called.
*/
if (!icon_view_font_auto_value_registered) {
eel_preferences_add_auto_string (NAUTILUS_PREFERENCES_ICON_VIEW_FONT,
&icon_view_font_auto_value);
icon_view_font_auto_value_registered = TRUE;
}
/* FIXME: We hardwire icon view font here, but some callers probably
* expect default font instead.
*/
return nautilus_font_factory_get_font_by_family (icon_view_font_auto_value, size_in_pixels);
}
#endif
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-font-factory.h: Class for obtaining fonts.
Copyright (C) 2000 Eazel, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_FONT_FACTORY_H
#define NAUTILUS_FONT_FACTORY_H
#include <gdk/gdk.h>
#include <gtk/gtkobject.h>
/* A There's a single NautilusFontFactory object. */
GtkObject *nautilus_font_factory_get (void);
/* Get a font by familiy. */
GdkFont * nautilus_font_factory_get_font_by_family (const char *family,
guint size_in_pixels);
/* Get a font according to the family set in preferences. */
GdkFont * nautilus_font_factory_get_font_from_preferences (guint size_in_pixels);
#endif /* NAUTILUS_FONT_FACTORY_H */
......@@ -32,7 +32,6 @@
#include "nautilus-theme.h"
#include <eel/eel-art-extensions.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gnome-extensions.h>
......@@ -73,7 +72,6 @@ struct NautilusIconCanvasItemDetails {
GList *emblem_pixbufs;
char *editable_text; /* Text that can be modified by a renaming function */
char *additional_text; /* Text that cannot be modifed, such as file size, etc. */
GdkFont *font;
NautilusEmblemAttachPoints *attach_points;
/* Size of the text at current font. */
......@@ -111,7 +109,6 @@ enum {
ARG_0,
ARG_EDITABLE_TEXT,
ARG_ADDITIONAL_TEXT,
ARG_FONT,
ARG_HIGHLIGHTED_FOR_SELECTION,
ARG_HIGHLIGHTED_AS_KEYBOARD_FOCUS,
ARG_HIGHLIGHTED_FOR_DROP,
......@@ -215,10 +212,6 @@ nautilus_icon_canvas_item_finalize (GObject *object)
g_free (details->additional_text);
g_free (details->attach_points);
if (details->font != NULL) {
gdk_font_unref (details->font);
}
if (details->rendered_pixbuf != NULL) {
g_object_unref (details->rendered_pixbuf);
}
......@@ -265,7 +258,6 @@ nautilus_icon_canvas_item_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
NautilusIconCanvasItem *item;
NautilusIconCanvasItemDetails *details;
GdkFont *font;
item = NAUTILUS_ICON_CANVAS_ITEM (object);
details = item->details;
......@@ -294,23 +286,6 @@ nautilus_icon_canvas_item_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
nautilus_icon_canvas_item_invalidate_label_size (item);
break;
case ARG_FONT:
font = GTK_VALUE_POINTER (*arg);
if (eel_gdk_font_equal (font, details->font)) {
return;
}
if (font != NULL) {
gdk_font_ref (font);
}
if (details->font != NULL) {
gdk_font_unref (details->font);
}
details->font = font;
nautilus_icon_canvas_item_invalidate_label_size (item);
break;
case ARG_HIGHLIGHTED_FOR_SELECTION:
if (!details->is_highlighted_for_selection == !GTK_VALUE_BOOL (*arg)) {
return;
......@@ -358,10 +333,6 @@ nautilus_icon_canvas_item_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
GTK_VALUE_STRING (*arg) = g_strdup (details->additional_text);
break;
case ARG_FONT:
GTK_VALUE_POINTER (*arg) = details->font;
break;
case ARG_HIGHLIGHTED_FOR_SELECTION:
GTK_VALUE_BOOL (*arg) = details->is_highlighted_for_selection;
break;
......@@ -652,7 +623,7 @@ draw_or_measure_label_text (NautilusIconCanvasItem *item,
/* No font or no text, then do no work. */
if (details->font == NULL || (!have_editable && !have_additional)) {
if (!have_editable && !have_additional) {
details->text_height = 0;
details->text_width = 0;
return;
......@@ -2051,8 +2022,6 @@ nautilus_icon_canvas_item_class_init (NautilusIconCanvasItemClass *class)
G_TYPE_STRING, GTK_ARG_READWRITE, ARG_EDITABLE_TEXT);
gtk_object_add_arg_type ("NautilusIconCanvasItem::additional_text",
G_TYPE_STRING, GTK_ARG_READWRITE, ARG_ADDITIONAL_TEXT);
gtk_object_add_arg_type ("NautilusIconCanvasItem::font",
GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_FONT);
gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_for_selection",
G_TYPE_BOOLEAN, GTK_ARG_READWRITE, ARG_HIGHLIGHTED_FOR_SELECTION);
gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_as_keyboard_focus",
......
......@@ -27,7 +27,6 @@
#include <config.h>
#include "nautilus-icon-container.h"
#include "nautilus-font-factory.h"
#include "nautilus-global-preferences.h"
#include "nautilus-icon-private.h"
#include "nautilus-icon-text-item.h"
......
......@@ -56,7 +56,6 @@
#include <libnautilus-private/nautilus-directory-background.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-icon-container.h>
#include <libnautilus-private/nautilus-icon-factory.h>
......
......@@ -30,7 +30,6 @@
#include <eel/eel-art-extensions.h>
#include <eel/eel-art-gtk-extensions.h>
#include <eel/eel-dnd.h>
#include <eel/eel-gdk-font-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
......@@ -44,7 +43,6 @@
#include <libgnomeui/gnome-uidefs.h>
#include <libnautilus-private/nautilus-directory-background.h>
#include <libnautilus-private/nautilus-file-dnd.h>
#include <libnautilus-private/nautilus-font-factory.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-icon-factory.h>
#include <libnautilus-private/nautilus-metadata.h>
......@@ -1089,7 +1087,11 @@ measure_width_callback (const char *string, void *context)
static char *
truncate_middle_callback (const char *string, int width, void *context)
{
#if GNOME2_CONVERSION_COMPLETE
return eel_string_ellipsize (string, (GdkFont *)context, width, EEL_ELLIPSIZE_MIDDLE);
#else
return g_strdup (string);
#endif
}
static char *
......@@ -1126,8 +1128,12 @@ get_cell_text (GtkWidget *widget, int column_index, int cell_width,
cell_text = NULL;
break;
}
#if GNOME2_CONVERSION_COMPLETE
return eel_string_ellipsize (cell_text, font, cell_width, EEL_ELLIPSIZE_MIDDLE);
#else
return g_strdup (cell_text);
#endif
}
......
......@@ -148,7 +148,6 @@ static GtkTargetEntry target_table[] = {
static void real_destroy (GtkObject *object);
static void real_finalize (GObject *object);
static void real_dispose (GObject *object);
static void fm_properties_window_class_init (FMPropertiesWindowClass *class);
static void fm_properties_window_init (FMPropertiesWindow *window);
static void create_properties_window_callback (NautilusFile *file,
......@@ -173,7 +172,6 @@ EEL_CLASS_BOILERPLATE (FMPropertiesWindow, fm_properties_window, GTK_TYPE_WINDOW
static void
fm_properties_window_class_init (FMPropertiesWindowClass *class)
{
G_OBJECT_CLASS (class)->dispose = real_dispose;
G_OBJECT_CLASS (class)->finalize = real_finalize;
GTK_OBJECT_CLASS (class)->destroy = real_destroy;
......@@ -2436,22 +2434,6 @@ fm_properties_window_present (NautilusFile *original_file, FMDirectoryView *dire
create_properties_window_callback, startup_data);
}
static void
real_dispose (GObject *object)
{
FMPropertiesWindow *window;
window = FM_PROPERTIES_WINDOW (object);
/* Disconnect file-changed handler here to avoid infinite loop
* of change notifications when file is removed; see bug 4911.
*/
gtk_signal_disconnect (GTK_OBJECT (window->details->target_file),
window->details->file_changed_handler_id);
EEL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
static void
real_destroy (GtkObject *object)
{
......@@ -2468,6 +2450,8 @@ real_destroy (GtkObject *object)
}
if (window->details->target_file != NULL) {
gtk_signal_disconnect (GTK_OBJECT (window->details->target_file),
window->details->file_changed_handler_id);
nautilus_file_monitor_remove (window->details->target_file, window);
nautilus_file_unref (window->details->target_file);
window->details->target_file = NULL;
......@@ -2486,9 +2470,6 @@ real_destroy (GtkObject *object)
window->details->update_directory_contents_timeout_id = 0;
}
/* Note that file_changed_handler_id is disconnected in dispose,
* and details are freed in finalize
*/
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
......@@ -2499,7 +2480,6 @@ real_finalize (GObject *object)
window = FM_PROPERTIES_WINDOW (object);
/* Note that file_changed_handler_id is disconnected in dispose */
g_free (window->details->pending_name);
g_free (window->details);
......