aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-07-04 07:02:41 +0800
committerChristian Persch <chpe@src.gnome.org>2004-07-04 07:02:41 +0800
commit9ca863b51695d5f237e5083948b88cb140b1358e (patch)
tree3df20d0d5721770ec8ecccd95a4dba4e2f9260ed /embed
parent6a0c3f0befbc71168923838d9f2b2dca7ab9d5df (diff)
downloadgsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.tar
gsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.tar.gz
gsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.tar.bz2
gsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.tar.lz
gsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.tar.xz
gsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.tar.zst
gsoc2013-epiphany-9ca863b51695d5f237e5083948b88cb140b1358e.zip
Fix compilation with mozilla 1.7.
2004-07-04 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-download.cpp: (impl_get_mime_type): Fix compilation with mozilla 1.7.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-download.cpp17
1 files changed, 15 insertions, 2 deletions
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());
}