From 9ca863b51695d5f237e5083948b88cb140b1358e Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 3 Jul 2004 23:02:41 +0000 Subject: Fix compilation with mozilla 1.7. 2004-07-04 Christian Persch * embed/mozilla/mozilla-download.cpp: (impl_get_mime_type): Fix compilation with mozilla 1.7. --- ChangeLog | 6 ++++++ embed/mozilla/mozilla-download.cpp | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21347594d..9aa39eb26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-07-04 Christian Persch + + * embed/mozilla/mozilla-download.cpp: (impl_get_mime_type): + + Fix compilation with mozilla 1.7. + 2004-07-04 Xan Lopez * embed/downloader-view.c: (downloader_view_get_type), diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp index 9f2aca9dd..2997faa16 100644 --- a/embed/mozilla/mozilla-download.cpp +++ b/embed/mozilla/mozilla-download.cpp @@ -23,10 +23,12 @@ #endif #include "mozilla-download.h" +#include "mozilla-version.h" #include "ephy-debug.h" #include +#include static void mozilla_download_class_init (MozillaDownloadClass *klass); @@ -180,13 +182,24 @@ impl_get_mime (EphyDownload *download) { MozDownload *mozDownload; nsCOMPtr mime; - nsEmbedCString mimeType; + nsEmbedCString mimeType; mozDownload = MOZILLA_DOWNLOAD (download)->priv->moz_download; mozDownload->GetMIMEInfo (getter_AddRefs(mime)); - if (mime == nsnull) return NULL; + if (!mime) return NULL; + +#if MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 1) mime->GetMIMEType(mimeType); +#else + char *tmp = nsnull; + mime->GetMIMEType(&tmp); + mimeType.Assign(tmp); + if (tmp) + { + nsMemory::Free (tmp); + } +#endif return g_strdup (mimeType.get()); } -- cgit v1.2.3