[epiphany] Add filename-suggested signal to EphyDownload



commit 4897f86d5192049e88c4964411eecd07dd5fe43b
Author: Daniel Wyatt <Daniel Wyatt gmail com>
Date:   Sat Nov 30 12:46:43 2013 -0500

    Add filename-suggested signal to EphyDownload
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674291

 embed/ephy-download.c |   17 +++++++++++++++++
 embed/ephy-download.h |    2 ++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index 3c162c3..9f7c158 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -804,6 +804,22 @@ ephy_download_class_init (EphyDownloadClass *klass)
   /**
    * EphyDownload::completed:
    *
+   * The ::filename-suggested signal is emitted when we have received the
+   * suggested filename from WebKit.
+   **/
+  g_signal_new ("filename-suggested",
+                G_OBJECT_CLASS_TYPE (object_class),
+                G_SIGNAL_RUN_LAST,
+                G_STRUCT_OFFSET (EphyDownloadClass, filename_suggested),
+                NULL, NULL,
+                g_cclosure_marshal_generic,
+                G_TYPE_NONE,
+                1,
+                G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+  /**
+   * EphyDownload::completed:
+   *
    * The ::completed signal is emitted when @download has finished downloading.
    **/
   g_signal_new ("completed",
@@ -854,6 +870,7 @@ download_decide_destination_cb (WebKitDownload *wk_download,
 {
   char *dest;
 
+  g_signal_emit_by_name (download, "filename-suggested", suggested_filename);
   if (download->priv->destination) {
     webkit_download_set_destination (wk_download, download->priv->destination);
     return TRUE;
diff --git a/embed/ephy-download.h b/embed/ephy-download.h
index 17b1a2c..1d7af30 100644
--- a/embed/ephy-download.h
+++ b/embed/ephy-download.h
@@ -56,6 +56,8 @@ struct _EphyDownloadClass
 {
   GObjectClass parent_class;
 
+  void (* filename_suggested) (EphyDownload *download,
+                               char *suggested_filename);
   void (* completed)  (EphyDownload *download);
   void (* error)      (EphyDownload *download,
                        gint error_code,


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