From 8fdb4086efaad93d0c9349520081a9608853fca0 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sat, 29 Dec 2007 16:59:25 +0000 Subject: Use the new interfaces for backward/forward menus. Store nth data in the HistoryItem itself. Try to use HISTORY_ITEM_DATA_KEY data from object in navigation action before falling back to URL_DATA_KEY. Bug #506005 svn path=/trunk/; revision=7834 --- embed/mozilla/mozilla-embed.cpp | 5 ++--- embed/mozilla/mozilla-history-item.cpp | 3 +-- embed/mozilla/mozilla-history-item.h | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index ba1b589d8..ad52392fb 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -971,10 +971,9 @@ impl_get_previous_history_item (EphyEmbed *embed) static void impl_go_to_history_item (EphyEmbed *embed, EphyHistoryItem *item) { - int index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), - HISTORY_ITEM_INDEX_KEY)); + MozillaHistoryItem *mitem = MOZILLA_HISTORY_ITEM (item); - MOZILLA_EMBED (embed)->priv->browser->GoToHistoryIndex (index); + MOZILLA_EMBED (embed)->priv->browser->GoToHistoryIndex (mitem->nth); } static void diff --git a/embed/mozilla/mozilla-history-item.cpp b/embed/mozilla/mozilla-history-item.cpp index b3c364e25..570b2fbe0 100644 --- a/embed/mozilla/mozilla-history-item.cpp +++ b/embed/mozilla/mozilla-history-item.cpp @@ -62,8 +62,7 @@ mozilla_history_item_new (const char *url, const char *title, int index) item->url = g_strdup (url); item->title = g_strdup (title); - - g_object_set_data (G_OBJECT (item), HISTORY_ITEM_INDEX_KEY, GINT_TO_POINTER (index)); + item->nth = index; return item; } diff --git a/embed/mozilla/mozilla-history-item.h b/embed/mozilla/mozilla-history-item.h index 270fb6f53..de764a665 100644 --- a/embed/mozilla/mozilla-history-item.h +++ b/embed/mozilla/mozilla-history-item.h @@ -13,8 +13,6 @@ G_BEGIN_DECLS #define MOZILLA_IS_HISTORY_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOZILLA_TYPE_HISTORY_ITEM)) #define MOZILLA_HISTORY_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOZILLA_TYPE_HISTORY_ITEM, MozillaHistoryItemClass)) -#define HISTORY_ITEM_INDEX_KEY "NTh" - typedef struct _MozillaHistoryItem MozillaHistoryItem; typedef struct _MozillaHistoryItemClass MozillaHistoryItemClass; @@ -29,6 +27,7 @@ struct _MozillaHistoryItem char *url; char *title; + int nth; }; GType mozilla_history_item_get_type (void) G_GNUC_CONST; -- cgit v1.2.3