From 6241e9eb954ea19d4c77b937118b745809e5d32f Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 23 Nov 2003 12:12:24 +0000 Subject: Make it compile with mozilla 1.4 and 1.4.1 again. 2003-11-23 Christian Persch * embed/mozilla/mozilla-embed-single.cpp: Make it compile with mozilla 1.4 and 1.4.1 again. --- ChangeLog | 6 ++++ embed/mozilla/mozilla-embed-single.cpp | 50 ++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f5651f42..5578f1f18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-11-23 Christian Persch + + * embed/mozilla/mozilla-embed-single.cpp: + + Make it compile with mozilla 1.4 and 1.4.1 again. + 2003-11-23 Marco Pesenti Gritti * embed/Makefile.am: diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 3df1860ad..8b41666e6 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -53,12 +53,15 @@ #include #include #include -#include #include #include #include #include +#if MOZILLA_SNAPSHOT > 9 +#include +#else #include +#endif #if MOZILLA_SNAPSHOT > 12 #include #else @@ -589,7 +592,7 @@ impl_get_font_list (EphyEmbedSingle *shell, } static EphyCookie * -mozilla_cookie_to_ephy_cookie (nsICookie2 *keks) +mozilla_cookie_to_ephy_cookie (nsICookie *keks) { EphyCookie *cookie; @@ -610,14 +613,6 @@ mozilla_cookie_to_ephy_cookie (nsICookie2 *keks) keks->GetIsSecure (&isSecure); cookie->is_secure = isSecure != PR_FALSE; - PRUint64 dateTime; - keks->GetExpires (&dateTime); - cookie->expires = dateTime; - - PRInt64 expiry; - keks->GetExpiry (&expiry); - cookie->real_expires = expiry; - nsCookieStatus status; keks->GetStatus (&status); cookie->p3p_state = status; @@ -626,9 +621,27 @@ mozilla_cookie_to_ephy_cookie (nsICookie2 *keks) keks->GetPolicy (&policy); cookie->p3p_policy = policy; - PRBool isSession; - keks->GetIsSession (&isSession); - cookie->is_session = isSession != PR_FALSE; + PRUint64 dateTime; + keks->GetExpires (&dateTime); + cookie->expires = dateTime; + +#if MOZILLA_SNAPSHOT > 9 + nsCOMPtr keks2 = do_QueryInterface (keks); + if (keks2) + { + + PRBool isSession; + keks2->GetIsSession (&isSession); + cookie->is_session = isSession != PR_FALSE; + + if (!isSession) + { + PRInt64 expiry; + keks2->GetExpiry (&expiry); + cookie->real_expires = expiry; + } + } +#endif return cookie; } @@ -654,14 +667,9 @@ impl_list_cookies (EphyCookieManager *manager) result = cookieEnumerator->GetNext (getter_AddRefs(keks)); if (NS_FAILED (result) || !keks) continue; - nsCOMPtr keks2 = do_QueryInterface (keks, &result); - if (NS_FAILED (result) || !keks2) continue; + EphyCookie *cookie = mozilla_cookie_to_ephy_cookie (keks); - EphyCookie *cookie = mozilla_cookie_to_ephy_cookie (keks2); - if (cookie != NULL) - { - cookies = g_list_prepend (cookies, cookie); - } + cookies = g_list_prepend (cookies, cookie); } return cookies; @@ -675,7 +683,7 @@ impl_remove_cookie (EphyCookieManager *manager, nsCOMPtr cookieManager = do_GetService (NS_COOKIEMANAGER_CONTRACTID, &rv); if (NS_FAILED (rv) || !cookieManager) return; -g_print ("here!\n"); + cookieManager->Remove (nsDependentCString(cookie->domain), nsDependentCString(cookie->name), nsDependentCString(cookie->path), -- cgit