[epiphany/downloads: 6/8] embed-persist: downloader-view: removed



commit 6f613de74061f161c35ec40a4b5cd3c9dd909613
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Mon Jan 17 14:37:06 2011 -0500

    embed-persist: downloader-view: removed
    
    Remove all our legacy downloads code.

 data/glade/epiphany.ui     |   80 ----
 embed/Makefile.am          |    4 -
 embed/downloader-view.c    | 1022 --------------------------------------------
 embed/downloader-view.h    |   84 ----
 embed/ephy-embed-persist.c |  911 ---------------------------------------
 embed/ephy-embed-persist.h |  132 ------
 embed/ephy-embed-shell.c   |   51 ---
 embed/ephy-embed-shell.h   |    4 -
 embed/ephy-embed.c         |    1 -
 src/Makefile.am            |    2 -
 src/ephy-session.c         |   20 +-
 src/ephy-shell.c           |    1 -
 src/ephy-window.c          |    1 -
 src/window-commands.c      |    1 -
 tests/Makefile.am          |    4 -
 tests/ephy-embed-persist.c |  315 --------------
 16 files changed, 4 insertions(+), 2629 deletions(-)
---
diff --git a/data/glade/epiphany.ui b/data/glade/epiphany.ui
index f8023a2..08c67b4 100644
--- a/data/glade/epiphany.ui
+++ b/data/glade/epiphany.ui
@@ -454,84 +454,4 @@
       <action-widget response="-11">encoding_help_button</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkDialog" id="download_manager_dialog">
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Downloads</property>
-    <property name="role">epiphany-download-manager</property>
-    <property name="default_width">440</property>
-    <property name="default_height">260</property>
-    <property name="type_hint">normal</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox31">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow1134">
-            <property name="height_request">100</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="border_width">5</property>
-            <property name="hscrollbar_policy">automatic</property>
-            <property name="vscrollbar_policy">automatic</property>
-            <property name="shadow_type">in</property>
-            <child>
-              <object class="GtkTreeView" id="clist">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area31">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="pause_button">
-                <property name="label">DYNAMIC</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="abort_button">
-                <property name="label">gtk-stop</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="1">pause_button</action-widget>
-      <action-widget response="2">abort_button</action-widget>
-    </action-widgets>
-  </object>
 </interface>
diff --git a/embed/Makefile.am b/embed/Makefile.am
index fdd5f11..d517fb4 100644
--- a/embed/Makefile.am
+++ b/embed/Makefile.am
@@ -8,7 +8,6 @@ header_DATA = \
 	$(INST_H_FILES)
 
 NOINST_H_FILES = \
-	downloader-view.h		\
 	ephy-embed-dialog.h		\
 	ephy-encodings.h		\
 	ephy-favicon-cache.h
@@ -20,7 +19,6 @@ INST_H_FILES = \
 	ephy-embed.h			\
 	ephy-embed-container.h          \
 	ephy-embed-event.h		\
-	ephy-embed-persist.h		\
 	ephy-embed-prefs.h		\
 	ephy-embed-single.h		\
 	ephy-embed-shell.h		\
@@ -37,13 +35,11 @@ BUILT_SOURCES = \
 libephyembed_la_SOURCES = \
 	ephy-adblock.c			\
 	ephy-adblock-manager.c		\
-	downloader-view.c		\
 	ephy-download.c			\
 	ephy-embed.c			\
 	ephy-embed-container.c          \
 	ephy-embed-dialog.c		\
 	ephy-embed-event.c		\
-	ephy-embed-persist.c		\
 	ephy-embed-single.c		\
 	ephy-embed-shell.c		\
 	ephy-embed-utils.c              \
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 40cf520..a1ce65e 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -25,7 +25,6 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
-#include "downloader-view.h"
 #include "ephy-adblock-manager.h"
 #include "ephy-debug.h"
 #include "ephy-download.h"
@@ -51,7 +50,6 @@
 struct _EphyEmbedShellPrivate
 {
 	EphyHistory *global_history;
-	DownloaderView *downloader_view;
 	GtkListStore *downloads;
 	EphyFaviconCache *favicon_cache;
 	EphyEmbedSingle *embed_single;
@@ -85,17 +83,6 @@ ephy_embed_shell_dispose (GObject *object)
 	EphyEmbedShell *shell = EPHY_EMBED_SHELL (object);
 	EphyEmbedShellPrivate *priv = shell->priv;
 
-	if (priv->downloader_view != NULL)
-	{
-		DownloaderView **downloader_view = &priv->downloader_view;
-		LOG ("Unref downloader");
-		g_object_remove_weak_pointer
-			(G_OBJECT (priv->downloader_view),
-			 (gpointer *) downloader_view);
-		g_object_unref (priv->downloader_view);
-		priv->downloader_view = NULL;
-	}
-
 	if (priv->downloads != NULL)
 	{
 		LOG ("Destroying downloads hash table");
@@ -200,44 +187,6 @@ ephy_embed_shell_get_global_history (EphyEmbedShell *shell)
 	return G_OBJECT (shell->priv->global_history);
 }
 
-/**
- * ephy_embed_shell_get_downloader_view:
- * @shell: the #EphyEmbedShell
- *
- * Return value: (transfer none):
- **/
-GObject *
-ephy_embed_shell_get_downloader_view (EphyEmbedShell *shell)
-{
-	g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
-
-	if (shell->priv->downloader_view == NULL)
-	{
-		DownloaderView **downloader_view;
-		shell->priv->downloader_view = downloader_view_new ();
-		downloader_view = &shell->priv->downloader_view;
-		g_object_add_weak_pointer
-			(G_OBJECT(shell->priv->downloader_view),
-			 (gpointer *) downloader_view);
-	}
-
-	return G_OBJECT (shell->priv->downloader_view);
-}
-
-/**
- * ephy_embed_shell_get_downloader_view_nocreate:
- * @shell: the #EphyEmbedShell
- *
- * Return value: (transfer none):
- **/
-GObject *
-ephy_embed_shell_get_downloader_view_nocreate (EphyEmbedShell *shell)
-{
-	g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
-
-	return (GObject *) shell->priv->downloader_view;
-}
-
 static GObject *
 impl_get_embed_single (EphyEmbedShell *shell)
 {
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 45c9d3d..d4522e0 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -69,10 +69,6 @@ GObject		  *ephy_embed_shell_get_favicon_cache	(EphyEmbedShell *shell);
 
 GObject		  *ephy_embed_shell_get_global_history	(EphyEmbedShell *shell);
 
-GObject		  *ephy_embed_shell_get_downloader_view	(EphyEmbedShell *shell);
-
-GObject		  *ephy_embed_shell_get_downloader_view_nocreate	(EphyEmbedShell *shell);
-
 GObject		  *ephy_embed_shell_get_encodings	(EphyEmbedShell *shell);
 
 GObject		  *ephy_embed_shell_get_embed_single	(EphyEmbedShell *shell);
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 7506b38..17b167e 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -25,7 +25,6 @@
 
 #include "config.h"
 
-#include "downloader-view.h"
 #include "ephy-adblock-manager.h"
 #include "ephy-debug.h"
 #include "ephy-download.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index ad6bf9e..c437cd7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -267,7 +267,6 @@ EPHY_GIR_H_FILES = \
 	$(top_srcdir)/embed/ephy-embed.h \
 	$(top_srcdir)/embed/ephy-embed-container.h \
 	$(top_srcdir)/embed/ephy-embed-event.h \
-	$(top_srcdir)/embed/ephy-embed-persist.h \
 	$(top_srcdir)/embed/ephy-embed-shell.h \
 	$(top_srcdir)/embed/ephy-embed-single.h \
 	$(top_srcdir)/embed/ephy-favicon-cache.h \
@@ -297,7 +296,6 @@ EPHY_GIR_C_FILES = \
 	$(top_srcdir)/embed/ephy-embed.c \
 	$(top_srcdir)/embed/ephy-embed-container.c \
 	$(top_srcdir)/embed/ephy-embed-event.c \
-	$(top_srcdir)/embed/ephy-embed-persist.c \
 	$(top_srcdir)/embed/ephy-embed-shell.c \
 	$(top_srcdir)/embed/ephy-embed-single.c \
 	$(top_srcdir)/embed/ephy-favicon-cache.c \
diff --git a/src/ephy-session.c b/src/ephy-session.c
index cee9e49..72acea0 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -167,7 +167,6 @@ confirm_shutdown_dialog_weak_ref_cb (InteractData *data,
 	EphySessionPrivate *priv = data->session->priv;
 	EggSMClient *sm_client = data->sm_client;
 	EphyShell *shell;
-	GObject *dv;
 	gboolean will_quit;
 
 	LOG ("confirm_shutdown_dialog_weak_ref_cb response %d", data->response);
@@ -180,14 +179,6 @@ confirm_shutdown_dialog_weak_ref_cb (InteractData *data,
 		g_object_weak_unref (G_OBJECT (shell),
 				     (GWeakNotify) confirm_shutdown_dialog_accept_cb,
 				     data);
-
-		dv = ephy_embed_shell_get_downloader_view_nocreate (ephy_embed_shell_get_default ());
-		if (dv != NULL)
-		{
-			g_object_weak_unref (dv,
-					     (GWeakNotify) confirm_shutdown_dialog_accept_cb,
-					     data);
-		}
 	}
 
 	if (data->timeout_id != 0)
@@ -208,15 +199,17 @@ client_quit_requested_cb (EggSMClient *sm_client,
 			  EphySession *session)
 {
 	EphySessionPrivate *priv = session->priv;
-	GObject *dv;
 	GtkWidget *dialog, *box;
 	InteractData *data;
+	GtkTreeModel *downloads;
 
 	/* If we're shutting down, check if there are downloads
 	 * remaining, since they can't be restarted.
 	 */
+
+	downloads = GTK_TREE_MODEL (ephy_embed_shell_get_downloads (embed_shell));
 	if (ephy_shell_get_default () == NULL ||
-	    (dv = ephy_embed_shell_get_downloader_view_nocreate (ephy_embed_shell_get_default ())) == NULL)
+	    gtk_tree_model_iter_n_children (downloads, NULL) == 0)
 	{
 		egg_sm_client_will_quit (sm_client, TRUE);
 		return;
@@ -271,11 +264,6 @@ client_quit_requested_cb (EggSMClient *sm_client,
 			   (GWeakNotify) confirm_shutdown_dialog_accept_cb,
 			   data);
 
-	/* When the download finishes, un-veto the shutdown */
-	g_object_weak_ref (dv,
-			   (GWeakNotify) confirm_shutdown_dialog_accept_cb,
-			   data);
-
 	g_signal_connect (dialog, "response",
 			  G_CALLBACK (confirm_shutdown_dialog_response_cb), data);
 	g_object_weak_ref (G_OBJECT (dialog),
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index f15ceda..6fddf9d 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -48,7 +48,6 @@
 #include "ephy-extensions-manager.h"
 #include "ephy-session.h"
 #include "ephy-lockdown.h"
-#include "downloader-view.h"
 #include "egg-toolbars-model.h"
 #include "ephy-toolbars-model.h"
 #include "ephy-toolbar.h"
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 806eda0..09a3c66 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -52,7 +52,6 @@
 #include "ephy-fullscreen-popup.h"
 #include "ephy-action-helper.h"
 #include "ephy-find-toolbar.h"
-#include "ephy-embed-persist.h"
 #include "ephy-location-entry.h"
 #include "ephy-web-view.h"
 
diff --git a/src/window-commands.c b/src/window-commands.c
index ff3647c..6b70b09 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -27,7 +27,6 @@
 #include "ephy-embed-single.h"
 #include "ephy-embed-utils.h"
 #include "ephy-shell.h"
-#include "ephy-embed-persist.h"
 #include "ephy-debug.h"
 #include "window-commands.h"
 #include "ephy-prefs.h"
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1b5aa15..bb538d8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,5 @@
 noinst_PROGRAMS = \
 	test-ephy-download \
-	test-ephy-embed-persist \
 	test-ephy-embed-single \
 	test-ephy-location-entry \
 	test-ephy-search-entry \
@@ -37,9 +36,6 @@ endif
 test_ephy_download_SOURCES = \
 	ephy-download.c
 
-test_ephy_embed_persist_SOURCES = \
-	ephy-embed-persist.c
-
 test_ephy_embed_single_SOURCES = \
 	ephy-embed-single.c
 



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