Unify search GtkComboBox so it work in gtk+-2 and gtk+-3

This commit is contained in:
infirit
2014-05-19 16:10:32 +02:00
parent cc28312a3f
commit 1bfcadb0c0
3 changed files with 1 additions and 33 deletions

View File

@@ -64,11 +64,7 @@ struct _PlumaHistoryEntryPrivate
GSettings *settings;
};
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE(PlumaHistoryEntry, pluma_history_entry, GTK_TYPE_COMBO_BOX_TEXT)
#else
G_DEFINE_TYPE(PlumaHistoryEntry, pluma_history_entry, GTK_TYPE_COMBO_BOX_ENTRY)
#endif
static void
pluma_history_entry_set_property (GObject *object,
@@ -514,12 +510,8 @@ pluma_history_entry_new (const gchar *history_id,
ret = g_object_new (PLUMA_TYPE_HISTORY_ENTRY,
"history-id", history_id,
"model", store,
#if GTK_CHECK_VERSION (3, 0, 0)
"has-entry", TRUE,
"id-column", 0,
#else
"text-column", 0,
#endif
"entry-text-column", 0,
NULL);
g_object_unref (store);

View File

@@ -48,20 +48,12 @@ typedef struct _PlumaHistoryEntryPrivate PlumaHistoryEntryPrivate;
struct _PlumaHistoryEntryClass
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkComboBoxTextClass parent_class;
#else
GtkComboBoxEntryClass parent_class;
#endif
};
struct _PlumaHistoryEntry
{
#if GTK_CHECK_VERSION (3, 0, 0)
GtkComboBoxText parent_instance;
#else
GtkComboBoxEntry parent_instance;
#endif
PlumaHistoryEntryPrivate *priv;
};