diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | embed/mozilla/mozilla-download.cpp | 17 |
2 files changed, 21 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2004-07-04 Christian Persch <chpe@cvs.gnome.org> + + * embed/mozilla/mozilla-download.cpp: (impl_get_mime_type): + + Fix compilation with mozilla 1.7. + 2004-07-04 Xan Lopez <xan@gnome.org> * 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 <nsEmbedString.h> +#include <nsMemory.h> static void mozilla_download_class_init (MozillaDownloadClass *klass); @@ -180,13 +182,24 @@ impl_get_mime (EphyDownload *download) { MozDownload *mozDownload; nsCOMPtr<nsIMIMEInfo> 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()); } |