From 42f1406dbf667e8ea95a6881e4f29676ee37d885 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 23 Jan 2004 08:38:47 +0000 Subject: [PATCH] Check if the completion is the same one as the old one. 2004-01-23 Anders Carlsson * gtk/gtkentry.c: (gtk_entry_set_completion): Check if the completion is the same one as the old one. * gtk/gtkentrycompletion.c: * gtk/gtkentrycompletion.h: Move GET_PRIVATE macro into .c file, fix a trivial spelling error. --- gtk/gtkentry.c | 3 +++ gtk/gtkentrycompletion.c | 3 ++- gtk/gtkentrycompletion.h | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 931606d047..394ca2a6a3 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -4716,6 +4716,9 @@ gtk_entry_set_completion (GtkEntry *entry, old = gtk_entry_get_completion (entry); + if (old == completion) + return; + if (old) { if (old->priv->completion_timeout) diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index cc615ccaa3..13884a8c7b 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -52,6 +52,7 @@ enum PROP_MINIMUM_KEY_LENGTH }; +#define GTK_ENTRY_COMPLETION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionPrivate)) static void gtk_entry_completion_class_init (GtkEntryCompletionClass *klass); static void gtk_entry_completion_cell_layout_init (GtkCellLayoutIface *iface); @@ -989,7 +990,7 @@ gtk_entry_completion_delete_action (GtkEntryCompletion *completion, * @completion: A #GtkEntryCompletion. * @column: The column in the model of @completion to get strings from. * - * Conviencefunction for setting up the most used case of this code: a + * Convience function for setting up the most used case of this code: a * completion list with just strings. This function will set up @completion * to have a list displaying all (and just) strings in the completion list, * and to get those strings from @column in the model of @completion. diff --git a/gtk/gtkentrycompletion.h b/gtk/gtkentrycompletion.h index beb59b0742..aed8165070 100644 --- a/gtk/gtkentrycompletion.h +++ b/gtk/gtkentrycompletion.h @@ -35,7 +35,6 @@ G_BEGIN_DECLS #define GTK_IS_ENTRY_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_COMPLETION)) #define GTK_IS_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_COMPLETION)) #define GTK_ENTRY_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass)) -#define GTK_ENTRY_COMPLETION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionPrivate)) typedef struct _GtkEntryCompletion GtkEntryCompletion; typedef struct _GtkEntryCompletionClass GtkEntryCompletionClass;