[epiphany] downloads: Remove unused EphyDownload:source property
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] downloads: Remove unused EphyDownload:source property
- Date: Wed, 8 Jan 2014 11:31:40 +0000 (UTC)
commit e28f8c6f268376899527bf00ccfb8380eeef0cce
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Wed Jan 8 12:03:54 2014 +0100
downloads: Remove unused EphyDownload:source property
embed/ephy-download.c | 39 ---------------------------------------
embed/ephy-download.h | 1 -
tests/ephy-download-test.c | 7 +++++--
3 files changed, 5 insertions(+), 42 deletions(-)
---
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index c34c588..d8e7902 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -61,7 +61,6 @@ enum
PROP_0,
PROP_DOWNLOAD,
PROP_DESTINATION,
- PROP_SOURCE,
PROP_ACTION,
PROP_START_TIME,
PROP_WINDOW,
@@ -93,9 +92,6 @@ ephy_download_get_property (GObject *object,
case PROP_DESTINATION:
g_value_set_string (value, ephy_download_get_destination_uri (download));
break;
- case PROP_SOURCE:
- g_value_set_string (value, ephy_download_get_source_uri (download));
- break;
case PROP_ACTION:
g_value_set_enum (value, ephy_download_get_action (download));
break;
@@ -131,7 +127,6 @@ ephy_download_set_property (GObject *object,
ephy_download_set_widget (download, g_value_get_object (value));
break;
case PROP_DOWNLOAD:
- case PROP_SOURCE:
case PROP_START_TIME:
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -476,22 +471,6 @@ ephy_download_get_destination_uri (EphyDownload *download)
}
/**
- * ephy_download_get_source_uri:
- * @download: an #EphyDownload
- *
- * Gets the source URI that this download is/will download.
- *
- * Returns: source URI.
- **/
-const char *
-ephy_download_get_source_uri (EphyDownload *download)
-{
- g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), NULL);
-
- return download->priv->source;
-}
-
-/**
* ephy_download_get_action:
* @download: an #EphyDownload
*
@@ -639,7 +618,6 @@ ephy_download_finalize (GObject *object)
priv = download->priv;
g_free (priv->destination);
- g_free (priv->source);
LOG ("EphyDownload finalised %p", object);
@@ -687,20 +665,6 @@ ephy_download_class_init (EphyDownloadClass *klass)
G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB));
- /**
- * EphyDownload::source:
- *
- * Download's origin URI
- */
- g_object_class_install_property (object_class, PROP_SOURCE,
- g_param_spec_string ("source",
- "Source",
- "Source URI",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
/**
* EphyDownload::action:
@@ -912,7 +876,6 @@ ephy_download_new_for_download (WebKitDownload *download,
GtkWindow *parent)
{
EphyDownload *ephy_download;
- WebKitURIRequest *request;
g_return_val_if_fail (WEBKIT_IS_DOWNLOAD (download), NULL);
@@ -933,8 +896,6 @@ ephy_download_new_for_download (WebKitDownload *download,
ephy_download->priv->download = g_object_ref (download);
g_object_set_data (G_OBJECT (download), "ephy-download-set", GINT_TO_POINTER (TRUE));
- request = webkit_download_get_request (download);
- ephy_download->priv->source = g_strdup (webkit_uri_request_get_uri (request));
/* In WebKit2 the download has already started */
ephy_embed_shell_add_download (ephy_embed_shell_get_default (), ephy_download);
diff --git a/embed/ephy-download.h b/embed/ephy-download.h
index 6e039d2..cc53e2d 100644
--- a/embed/ephy-download.h
+++ b/embed/ephy-download.h
@@ -90,7 +90,6 @@ void ephy_download_set_destination_uri (EphyDownload *download,
WebKitDownload *ephy_download_get_webkit_download (EphyDownload *download);
const char *ephy_download_get_destination_uri (EphyDownload *download);
-const char *ephy_download_get_source_uri (EphyDownload *download);
char *ephy_download_get_content_type (EphyDownload *download);
guint32 ephy_download_get_start_time (EphyDownload *download);
diff --git a/tests/ephy-download-test.c b/tests/ephy-download-test.c
index 196f9fd..738a53c 100644
--- a/tests/ephy-download-test.c
+++ b/tests/ephy-download-test.c
@@ -141,8 +141,11 @@ test_ephy_download_new (Fixture *fixture, gconstpointer data)
static void
test_ephy_download_new_for_uri (Fixture *fixture, gconstpointer data)
{
- g_assert_cmpstr (fixture->source, ==,
- ephy_download_get_source_uri (fixture->download));
+ WebKitDownload *download = ephy_download_get_webkit_download (fixture->download);
+ WebKitURIRequest *request = webkit_download_get_request (download);
+
+ g_assert(request);
+ g_assert_cmpstr (fixture->source, ==, webkit_uri_request_get_uri (request));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]