[epiphany/wip/downloads: 1/10] downloads: Fix ephy_download_get_content_type() to actually return the content type



commit 663b0eb02ae80f6f79fc7908d946561663d91dca
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed Oct 7 10:18:33 2015 +0200

    downloads: Fix ephy_download_get_content_type() to actually return the content type
    
    It was returning the MIME type.

 embed/ephy-download.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index b3364e9..868a4fb 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -157,12 +157,15 @@ ephy_download_get_content_type (EphyDownload *download)
 
   response = webkit_download_get_response (download->priv->download);
   if (response) {
-    content_type = g_strdup (webkit_uri_response_get_mime_type (response));
+    const char *mime_type = webkit_uri_response_get_mime_type (response);
 
-    LOG ("ephy_download_get_content_type: WebKit: %s", content_type);
+    LOG ("ephy_download_get_content_type: WebKit mime type: %s", mime_type);
 
-    if (content_type)
-      return content_type;
+    if (mime_type) {
+      content_type = g_content_type_from_mime_type (mime_type);
+      if (content_type)
+        return content_type;
+    }
   }
 
   destination_uri = webkit_download_get_destination (download->priv->download);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]