+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
+Tue Oct 23 11:53:00 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+ * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+ G_CONST_RETURN. (Murray Cumming)
+
+ * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+ Make G_CONST_RETURN.
+
+ * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+ results of g_get_home_dir().
+
+ * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
+ copy. Storing the return from gtk_entry_get_text() is evil.
+
+ * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
+ gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
+ gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+ gtk/gtksignal.c: Add const.
+
+ * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+ * gtk/gtktreeview.c: Namespace object data keys to be safe, even
+ if we are setting them on private widgets.
+
+ * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
+ Duplicate entry->text before setting it as object data.
+
2001-10-22 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
Mon Oct 22 11:47:47 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Add cursor-position, selection-bound
- properties. (#62148, Reported by Padraig O'briain)
+ properties. (#62148, reported by Padraig O'Briain)
* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
to cursor_position. (1.3.x addition, text_position is an awful
name.) Make cursor_position read-only to avoid sticky questions
- of interaction with selection_bound.
+ of interaction with selection_bound. (#62636, reported by
+ Padraig O'Briain)
Mon Oct 22 16:25:12 2001 Owen Taylor <otaylor@redhat.com>
get_direction (void)
{
XkbDescRec *xkb = get_xkb ();
- char *name;
+ const char *name;
XkbStateRec state_rec;
PangoDirection result;
-DGTK_VERSION=\"@GTK_VERSION@\" \
-DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\" \
-DTESTGTK_RCFILE=\"`pwd`/$(srcdir)/testgtkrc\" \
- -DG_DISABLE_CONST_RETURNS \
-I$(top_builddir)/gtk \
-I$(top_srcdir) -I../gdk \
-I$(top_srcdir)/gdk \
binding_match_activate (GSList *pspec_list,
GtkObject *object,
guint path_length,
- gchar *path,
- gchar *path_reversed)
+ const gchar *path,
+ const gchar *path_reversed)
{
GSList *slist;
while (class_type && !handled)
{
guint path_length;
- gchar *path, *path_reversed;
+ const gchar *path;
+ gchar *path_reversed;
path = gtk_type_name (class_type);
path_reversed = g_strdup (path);
gpointer data)
{
gchar *path;
- gchar *new_text;
+ const gchar *new_text;
path = g_object_get_data (G_OBJECT (entry), GTK_CELL_RENDERER_TEXT_PATH);
new_text = gtk_entry_get_text (GTK_ENTRY (entry));
static GtkListItem *
gtk_combo_find (GtkCombo * combo)
{
- gchar *text;
+ const gchar *text;
gchar *ltext;
GList *clist;
int (*string_compare) (const char *, const char *);
static CompletionState* cmpl_init_state (void);
static void cmpl_free_state (CompletionState *cmpl_state);
static gint cmpl_state_okay (CompletionState* cmpl_state);
-static gchar* cmpl_strerror (gint);
+static const gchar* cmpl_strerror (gint);
static PossibleCompletion* cmpl_completion_matches(gchar *text_to_complete,
gchar **remaining_text,
/* When the user selects a non-directory, call cmpl_completion_fullname
* to get the full name of the selected file.
*/
-static gchar* cmpl_completion_fullname (gchar*, CompletionState* cmpl_state);
+static gchar* cmpl_completion_fullname (const gchar*, CompletionState* cmpl_state);
/* Directory operations. */
static CompletionDir* open_dir (gchar* dir_name,
CompletionState* cmpl_state);
#ifdef HAVE_PWD_H
-static CompletionDir* open_user_dir (gchar* text_to_complete,
+static CompletionDir* open_user_dir (const gchar* text_to_complete,
CompletionState *cmpl_state);
#endif
static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir,
GValue *value,
GParamSpec *pspec);
static void gtk_file_selection_init (GtkFileSelection *filesel);
+static void gtk_file_selection_finalize (GObject *object);
static void gtk_file_selection_destroy (GtkObject *object);
static gint gtk_file_selection_key_press (GtkWidget *widget,
GdkEventKey *event,
parent_class = gtk_type_class (GTK_TYPE_DIALOG);
+ gobject_class->finalize = gtk_file_selection_finalize;
gobject_class->set_property = gtk_file_selection_set_property;
gobject_class->get_property = gtk_file_selection_get_property;
guint time,
GtkFileSelection *filesel)
{
- gchar *file;
+ const gchar *file;
gchar *uri_list;
char hostname[256];
int res;
static gchar nothing[2] = "";
static gchar something[MAXPATHLEN*2];
char *sys_filename;
- char *text;
+ const char *text;
g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
+static void
+gtk_file_selection_finalize (GObject *object)
+{
+ GtkFileSelection *filesel = GTK_FILE_SELECTION (object);
+
+ g_free (filesel->fileop_file);
+}
+
/* Begin file operations callbacks */
static void
gpointer data)
{
GtkFileSelection *fs = data;
- gchar *dirname;
+ const gchar *dirname;
gchar *path;
gchar *full_path;
gchar *sys_full_path;
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *dialog;
- gchar *filename;
+ const gchar *filename;
gchar *buf;
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
if (strlen (filename) < 1)
return;
- fs->fileop_file = filename;
+ g_free (fs->fileop_file);
+ fs->fileop_file = g_strdup (filename);
/* main dialog */
fs->fileop_dialog = dialog = gtk_dialog_new ();
{
GtkFileSelection *fs = data;
gchar *buf;
- gchar *file;
+ const gchar *file;
gchar *path;
gchar *new_filename;
gchar *old_filename;
if (fs->fileop_dialog)
return;
- fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
+ g_free (fs->fileop_file);
+ fs->fileop_file = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)));
if (strlen (fs->fileop_file) < 1)
return;
#ifdef G_WITH_CYGWIN
translate_win32_path (fs);
#endif
- text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
-
- text = g_strdup (text);
+ text = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)));
gtk_file_selection_populate (fs, text, TRUE);
}
static gchar*
-cmpl_completion_fullname (gchar *text,
+cmpl_completion_fullname (const gchar *text,
CompletionState *cmpl_state)
{
static char nothing[2] = "";
/* open a directory by user name */
static CompletionDir*
-open_user_dir (gchar *text_to_complete,
+open_user_dir (const gchar *text_to_complete,
CompletionState *cmpl_state)
{
CompletionDir *result;
if (!cmp_len)
{
/* ~/ */
- gchar *homedir = g_get_home_dir ();
+ const gchar *homedir = g_get_home_dir ();
gchar *utf8_homedir = g_filename_to_utf8 (homedir, -1, NULL, NULL, NULL);
- g_free (homedir);
-
if (utf8_homedir)
result = open_dir (utf8_homedir, cmpl_state);
else
return cmpl_state && cmpl_state->reference_dir;
}
-static gchar*
+static const gchar*
cmpl_strerror (gint err)
{
if (err == CMPL_ERRNO_TOO_LONG)
gpointer data)
{
GtkFontSelection *fontsel;
- gchar *family_name;
+ const gchar *family_name;
gint index;
fontsel = GTK_FONT_SELECTION (data);
{
GtkFontSelection *fontsel;
gint new_size;
- gchar *text;
+ const gchar *text;
fontsel = GTK_FONT_SELECTION (data);
gint new_height;
GtkRequisition old_requisition;
GtkWidget *preview_entry = fontsel->preview_entry;
- gchar *text;
+ const gchar *text;
gtk_widget_get_child_requisition (preview_entry, &old_requisition);
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
-gchar*
+G_CONST_RETURN gchar*
gtk_font_selection_get_preview_text (GtkFontSelection *fontsel)
{
return gtk_entry_get_text (GTK_ENTRY (fontsel->preview_entry));
return gtk_font_selection_set_font_name (GTK_FONT_SELECTION (fsd->fontsel), fontname);
}
-gchar*
+G_CONST_RETURN gchar*
gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd)
{
return gtk_font_selection_get_preview_text (GTK_FONT_SELECTION (fsd->fontsel));
GdkFont* gtk_font_selection_get_font (GtkFontSelection *fontsel);
#endif /* GTK_DISABLE_DEPRECATED */
-gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
- const gchar *fontname);
-gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
-void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
- const gchar *text);
-
-
+gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
+ const gchar *fontname);
+G_CONST_RETURN gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
+void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
+ const gchar *text);
/*****************************************************************************
* GtkFontSelectionDialog functions.
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
-gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
+G_CONST_RETURN gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
/* This sets the text in the preview entry. It will be copied by the entry,
so there's no need to g_strdup() it first. */
gint best_goodness = 0;
gint i;
gchar *tmp_locale, *tmp;
- gchar *envvar;
+ const gchar *envvar;
if (!contexts_hash)
gtk_im_module_init ();
static gchar **
get_module_path (void)
{
- gchar *module_path = g_getenv ("GTK_MODULE_PATH");
- gchar *exe_prefix = g_getenv("GTK_EXE_PREFIX");
+ const gchar *module_path_env = g_getenv ("GTK_MODULE_PATH");
+ const gchar *exe_prefix = g_getenv("GTK_EXE_PREFIX");
gchar **result;
+ gchar *module_path;
gchar *default_dir;
if (exe_prefix)
default_dir = g_build_filename (get_gtk_win32_directory (""), "modules", NULL);
#endif
}
- module_path = g_strconcat (module_path ? module_path : "",
- module_path ? G_SEARCHPATH_SEPARATOR_S : "",
+ module_path = g_strconcat (module_path_env ? module_path_env : "",
+ module_path_env ? G_SEARCHPATH_SEPARATOR_S : "",
default_dir, NULL);
result = pango_split_file_list (module_path);
case G_TYPE_STRING: if (copy_string)
GTK_VALUE_STRING (*arg) = g_value_dup_string (value);
else
- GTK_VALUE_STRING (*arg) = g_value_get_string (value);
+ GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value);
break;
default:
return FALSE;
gint end)
{
gchar *str = NULL;
- gchar *charset;
+ const gchar *charset;
gboolean need_conversion = !g_get_charset (&charset);
if (old_editable->visible)
gboolean is_clipboard)
{
const gchar *str = NULL;
- gchar *charset;
+ const gchar *charset;
gboolean need_conversion = FALSE;
if (text)
const gchar *type)
{
gchar *path = NULL;
- gchar *home_dir;
+ const gchar *home_dir;
gchar *subpath;
if (type)
gpointer dummy)
{
gboolean continue_emission;
- gchar *str;
+ const gchar *str;
str = g_value_get_string (handler_return);
g_value_set_string (return_accu, str);
g_signal_connect_closure_by_id (object,
g_signal_lookup (signal, G_OBJECT_TYPE (object)), 0,
- g_cclosure_new_object_swap (func, alive_object),
+ g_cclosure_new_object_swap (func, G_OBJECT (alive_object)),
FALSE);
}
case G_TYPE_STRING: if (copy_string)
GTK_VALUE_STRING (*arg) = g_value_dup_string (value);
else
- GTK_VALUE_STRING (*arg) = g_value_get_string (value);
+ GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value);
break;
default:
return FALSE;
case G_TYPE_STRING: if (copy_string)
*GTK_RETLOC_STRING (*arg) = g_value_dup_string (value);
else
- *GTK_RETLOC_STRING (*arg) = g_value_get_string (value);
+ *GTK_RETLOC_STRING (*arg) = (char *) g_value_get_string (value);
break;
default:
return FALSE;
GValue a_value = {0, };
GValue b_value = {0, };
gint retval;
- gchar *stra, *strb;
+ const gchar *stra, *strb;
gtk_tree_model_get_value (model, a, column, &a_value);
gtk_tree_model_get_value (model, b, column, &b_value);
/* position window */
- gtk_object_set_data (GTK_OBJECT (window), "text",
- gtk_entry_get_text (GTK_ENTRY (entry)));
+ gtk_object_set_data_full (GTK_OBJECT (window), "gtk-tree-view-text",
+ g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))),
+ (GDestroyNotify) g_free);
gtk_object_set_data (GTK_OBJECT (tree_view),
GTK_TREE_VIEW_SEARCH_DIALOG_KEY, window);
GtkTreeModel *model;
GtkTreeSelection *selection;
- text = gtk_object_get_data (GTK_OBJECT (window), "text");
- selected_iter = gtk_object_get_data (GTK_OBJECT (window), "selected-iter");
+ text = gtk_object_get_data (GTK_OBJECT (window), "gtk-tree-view-text");
+ selected_iter = gtk_object_get_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter");
g_return_if_fail (text != NULL);
/* search */
gtk_tree_selection_unselect_all (selection);
- selected_iter = gtk_object_get_data (GTK_OBJECT (window), "selected-iter");
+ selected_iter = gtk_object_get_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter");
if (selected_iter)
g_free (selected_iter);
- gtk_object_remove_data (GTK_OBJECT (window), "selected-iter");
+ gtk_object_remove_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter");
if (len < 1)
return;
{
selected_iter = g_malloc (sizeof (int));
*selected_iter = 1;
- gtk_object_set_data (GTK_OBJECT (window), "selected-iter",
+ gtk_object_set_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter",
selected_iter);
}
}