aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2004-07-04 06:52:28 +0800
committerXan Lopez <xan@src.gnome.org>2004-07-04 06:52:28 +0800
commit6a0c3f0befbc71168923838d9f2b2dca7ab9d5df (patch)
treef67a33cf1d657024c861d2bc495eb9e9c6bf403a /embed/mozilla
parent5a4f5d1450a62608504d8e157e63257f214e1ea2 (diff)
downloadgsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.tar
gsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.tar.gz
gsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.tar.bz2
gsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.tar.lz
gsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.tar.xz
gsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.tar.zst
gsoc2013-epiphany-6a0c3f0befbc71168923838d9f2b2dca7ab9d5df.zip
Add a MIME icon in the File column. Some indent fixes.
* embed/downloader-view.c: (downloader_view_get_type), (downloader_view_class_init), (downloader_view_init), (downloader_view_finalize), (format_interval), (downloader_view_add_download), (downloader_view_build_ui), (downloader_view_remove_download): Add a MIME icon in the File column. Some indent fixes. * embed/ephy-download.c: (ephy_download_get_mime): * embed/ephy-download.h: * embed/mozilla/MozDownload.cpp: * embed/mozilla/mozilla-download.cpp: Implement the method to get the MIME of a download and port to nsEmbedString. * embed/mozilla/PrintingPromptService.cpp: Remove bogus nsString.h header.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/MozDownload.cpp5
-rw-r--r--embed/mozilla/PrintingPromptService.cpp1
-rw-r--r--embed/mozilla/mozilla-download.cpp23
3 files changed, 24 insertions, 5 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 8fef252a2..1de028493 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -253,7 +253,10 @@ MozDownload::GetElapsedTime(PRInt64 *aElapsedTime)
NS_IMETHODIMP
MozDownload::GetMIMEInfo(nsIMIMEInfo **aMIMEInfo)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ NS_ENSURE_ARG_POINTER(aMIMEInfo);
+ *aMIMEInfo = mMIMEInfo;
+
+ return NS_OK;
}
NS_IMETHODIMP
diff --git a/embed/mozilla/PrintingPromptService.cpp b/embed/mozilla/PrintingPromptService.cpp
index 03b831f50..37ce2222b 100644
--- a/embed/mozilla/PrintingPromptService.cpp
+++ b/embed/mozilla/PrintingPromptService.cpp
@@ -36,7 +36,6 @@
#include <nsIPrintSettings.h>
#include <nsCOMPtr.h>
-#include <nsString.h>
#include <nsIServiceManager.h>
/* Implementation file */
diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp
index 0ad8dc2c6..9f2aca9dd 100644
--- a/embed/mozilla/mozilla-download.cpp
+++ b/embed/mozilla/mozilla-download.cpp
@@ -26,7 +26,7 @@
#include "ephy-debug.h"
-#include "nsString.h"
+#include <nsEmbedString.h>
static void
mozilla_download_class_init (MozillaDownloadClass *klass);
@@ -89,7 +89,7 @@ impl_get_target (EphyDownload *download)
mozDownload->GetTargetFile (getter_AddRefs (targetFile));
- nsCAutoString tempPathStr;
+ nsEmbedCString tempPathStr;
targetFile->GetNativePath (tempPathStr);
return g_strdup (tempPathStr.get ());
@@ -100,7 +100,7 @@ impl_get_source (EphyDownload *download)
{
nsCOMPtr<nsIURI> uri;
MozDownload *mozDownload;
- nsCString spec;
+ nsEmbedCString spec;
mozDownload = MOZILLA_DOWNLOAD (download)->priv->moz_download;
@@ -175,6 +175,22 @@ impl_get_elapsed_time (EphyDownload *download)
return elapsed / 1000000;
}
+static char*
+impl_get_mime (EphyDownload *download)
+{
+ MozDownload *mozDownload;
+ nsCOMPtr<nsIMIMEInfo> mime;
+ nsEmbedCString mimeType;
+
+ mozDownload = MOZILLA_DOWNLOAD (download)->priv->moz_download;
+
+ mozDownload->GetMIMEInfo (getter_AddRefs(mime));
+ if (mime == nsnull) return NULL;
+ mime->GetMIMEType(mimeType);
+
+ return g_strdup (mimeType.get());
+}
+
static void
impl_cancel (EphyDownload *download)
{
@@ -260,6 +276,7 @@ mozilla_download_class_init (MozillaDownloadClass *klass)
download_class->get_target = impl_get_target;
download_class->get_source = impl_get_source;
download_class->get_state = impl_get_state;
+ download_class->get_mime = impl_get_mime;
download_class->cancel = impl_cancel;
download_class->pause = impl_pause;
download_class->resume = impl_resume;