[rhythmbox] remove the return value for rb_source_add_uri as we never used it
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] remove the return value for rb_source_add_uri as we never used it
- Date: Sat, 25 Sep 2010 01:32:27 +0000 (UTC)
commit aebb0f3a5ffdfdc3eb6aaf8878c478fa8bd69943
Author: Jonathan Matthew <jonathan d14n org>
Date: Sat Sep 25 11:32:01 2010 +1000
remove the return value for rb_source_add_uri as we never used it
bindings/python/rb.defs | 2 +-
bindings/python/rb.override | 35 +++++------------------------------
plugins/iradio/rb-iradio-source.c | 17 ++++++++---------
sources/rb-library-source.c | 17 ++++++++---------
sources/rb-podcast-source.c | 13 ++++++++-----
sources/rb-source.c | 7 ++-----
sources/rb-source.h | 4 ++--
7 files changed, 34 insertions(+), 61 deletions(-)
---
diff --git a/bindings/python/rb.defs b/bindings/python/rb.defs
index d7a9913..d3fb4dc 100644
--- a/bindings/python/rb.defs
+++ b/bindings/python/rb.defs
@@ -1426,7 +1426,7 @@
(define-virtual impl_add_uri
(of-object "RBSource")
- (return-type "gboolean")
+ (return-type "none")
(parameters
'("const-char*" "uri")
'("const-char*" "title" (null-ok))
diff --git a/bindings/python/rb.override b/bindings/python/rb.override
index 699de3c..9637e62 100644
--- a/bindings/python/rb.override
+++ b/bindings/python/rb.override
@@ -1724,8 +1724,6 @@ _wrap_RBSource__proxy_do_impl_add_uri(RBSource *self, const char*uri, const char
PyObject *py_uri = NULL;
PyObject *py_title;
PyObject *py_genre;
- gboolean retval;
- PyObject *py_main_retval;
PyObject *py_retval;
PyObject *py_args;
PyObject *py_method;
@@ -1736,7 +1734,7 @@ _wrap_RBSource__proxy_do_impl_add_uri(RBSource *self, const char*uri, const char
if (PyErr_Occurred())
PyErr_Print();
pyg_gil_state_release(__py_state);
- return FALSE;
+ return;
}
if (uri)
py_uri = PyString_FromString(uri);
@@ -1745,7 +1743,7 @@ _wrap_RBSource__proxy_do_impl_add_uri(RBSource *self, const char*uri, const char
PyErr_Print();
Py_DECREF(py_self);
pyg_gil_state_release(__py_state);
- return FALSE;
+ return;
}
if (title)
py_title = PyString_FromString(title);
@@ -1772,30 +1770,9 @@ _wrap_RBSource__proxy_do_impl_add_uri(RBSource *self, const char*uri, const char
Py_DECREF(py_args);
Py_DECREF(py_self);
pyg_gil_state_release(__py_state);
- return FALSE;
+ return;
}
py_retval = PyObject_CallObject(py_method, py_args);
- if (!py_retval) {
- if (PyErr_Occurred())
- PyErr_Print();
- Py_XDECREF(py_retval);
- Py_DECREF(py_method);
- Py_DECREF(py_args);
- Py_DECREF(py_self);
- pyg_gil_state_release(__py_state);
- return FALSE;
- }
- py_retval = Py_BuildValue("(N)", py_retval);
- if (!PyArg_ParseTuple(py_retval, "O", &py_main_retval)) {
- if (PyErr_Occurred())
- PyErr_Print();
- Py_XDECREF(py_retval);
- Py_DECREF(py_method);
- Py_DECREF(py_args);
- Py_DECREF(py_self);
- pyg_gil_state_release(__py_state);
- return FALSE;
- }
if (callback) {
callback (self, uri, data);
if (destroy_data) {
@@ -1803,13 +1780,11 @@ _wrap_RBSource__proxy_do_impl_add_uri(RBSource *self, const char*uri, const char
}
}
- retval = PyObject_IsTrue(py_main_retval)? TRUE : FALSE;
-
+ if (PyErr_Occurred())
+ PyErr_Print();
Py_XDECREF(py_retval);
Py_DECREF(py_method);
Py_DECREF(py_args);
Py_DECREF(py_self);
pyg_gil_state_release(__py_state);
-
- return retval;
}
diff --git a/plugins/iradio/rb-iradio-source.c b/plugins/iradio/rb-iradio-source.c
index a5daa34..3a8281d 100644
--- a/plugins/iradio/rb-iradio-source.c
+++ b/plugins/iradio/rb-iradio-source.c
@@ -106,13 +106,13 @@ static void impl_song_properties (RBSource *source);
static gboolean impl_show_popup (RBSource *source);
static GList *impl_get_ui_actions (RBSource *source);
static guint impl_want_uri (RBSource *source, const char *uri);
-static gboolean impl_add_uri (RBSource *source,
- const char *uri,
- const char *title,
- const char *genre,
- RBSourceAddCallback callback,
- gpointer data,
- GDestroyNotify destroy_data);
+static void impl_add_uri (RBSource *source,
+ const char *uri,
+ const char *title,
+ const char *genre,
+ RBSourceAddCallback callback,
+ gpointer data,
+ GDestroyNotify destroy_data);
static void rb_iradio_source_do_query (RBIRadioSource *source);
@@ -656,7 +656,7 @@ impl_want_uri (RBSource *source, const char *uri)
return 0;
}
-static gboolean
+static void
impl_add_uri (RBSource *source,
const char *uri,
const char *title,
@@ -677,7 +677,6 @@ impl_add_uri (RBSource *source,
destroy_data (data);
}
}
- return TRUE;
}
static void
diff --git a/sources/rb-library-source.c b/sources/rb-library-source.c
index eb8bbd6..4c738fd 100644
--- a/sources/rb-library-source.c
+++ b/sources/rb-library-source.c
@@ -84,13 +84,13 @@ static gboolean impl_receive_drag (RBSource *source, GtkSelectionData *data);
static gboolean impl_can_paste (RBSource *asource);
static RBTrackTransferBatch *impl_paste (RBSource *source, GList *entries);
static guint impl_want_uri (RBSource *source, const char *uri);
-static gboolean impl_add_uri (RBSource *source,
- const char *uri,
- const char *title,
- const char *genre,
- RBSourceAddCallback callback,
- gpointer data,
- GDestroyNotify destroy_data);
+static void impl_add_uri (RBSource *source,
+ const char *uri,
+ const char *title,
+ const char *genre,
+ RBSourceAddCallback callback,
+ gpointer data,
+ GDestroyNotify destroy_data);
static void impl_get_status (RBSource *source, char **text, char **progress_text, float *progress);
static void rb_library_source_ui_prefs_sync (RBLibrarySource *source);
@@ -1455,7 +1455,7 @@ import_job_callback_cb (RhythmDBImportJob *job, int total, struct ImportJobCallb
data->callback (data->source, data->uri, data->data);
}
-static gboolean
+static void
impl_add_uri (RBSource *asource,
const char *uri,
const char *title,
@@ -1483,7 +1483,6 @@ impl_add_uri (RBSource *asource,
cbdata->destroy_data = destroy_data;
g_signal_connect_data (job, "complete", G_CALLBACK (import_job_callback_cb), cbdata, (GClosureNotify) import_job_callback_destroy, 0);
}
- return TRUE;
}
static void
diff --git a/sources/rb-podcast-source.c b/sources/rb-podcast-source.c
index 5bbda4e..4c5f241 100644
--- a/sources/rb-podcast-source.c
+++ b/sources/rb-podcast-source.c
@@ -255,7 +255,7 @@ static void impl_get_status (RBSource *source,
char **progress_text,
float *progress);
static guint impl_want_uri (RBSource *source, const char *uri);
-static gboolean impl_add_uri (RBSource *source,
+static void impl_add_uri (RBSource *source,
const char *uri,
const char *title,
const char *genre,
@@ -2071,7 +2071,7 @@ impl_want_uri (RBSource *source, const char *uri)
return 0;
}
-static gboolean
+static void
impl_add_uri (RBSource *asource,
const char *uri,
const char *title,
@@ -2082,9 +2082,12 @@ impl_add_uri (RBSource *asource,
{
RBPodcastSource *source = RB_PODCAST_SOURCE (asource);
rb_podcast_manager_subscribe_feed (source->priv->podcast_mgr, uri, FALSE);
- callback (asource, uri, data);
- destroy_data (data);
- return TRUE;
+ if (callback != NULL) {
+ callback (asource, uri, data);
+ if (destroy_data != NULL) {
+ destroy_data (data);
+ }
+ }
}
static void
diff --git a/sources/rb-source.c b/sources/rb-source.c
index 57d1ae0..c0360a3 100644
--- a/sources/rb-source.c
+++ b/sources/rb-source.c
@@ -1393,10 +1393,8 @@ rb_source_uri_is_source (RBSource *source, const char *uri)
*
* Adds an entry corresponding to the URI to the source. The
* @title and @genre parameters are not really used.
- *
- * Return value: TRUE if the URI was successfully added to the source
*/
-gboolean
+void
rb_source_add_uri (RBSource *source,
const char *uri,
const char *title,
@@ -1407,8 +1405,7 @@ rb_source_add_uri (RBSource *source,
{
RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
if (klass->impl_add_uri)
- return klass->impl_add_uri (source, uri, title, genre, callback, data, destroy_data);
- return FALSE;
+ klass->impl_add_uri (source, uri, title, genre, callback, data, destroy_data);
}
/**
diff --git a/sources/rb-source.h b/sources/rb-source.h
index 34b2a6f..6a035ee 100644
--- a/sources/rb-source.h
+++ b/sources/rb-source.h
@@ -127,7 +127,7 @@ struct _RBSourceClass
gboolean (*impl_try_playlist) (RBSource *source);
guint (*impl_want_uri) (RBSource *source, const char *uri);
- gboolean (*impl_add_uri) (RBSource *source,
+ void (*impl_add_uri) (RBSource *source,
const char *uri,
const char *title,
const char *genre,
@@ -203,7 +203,7 @@ void rb_source_song_properties (RBSource *source);
gboolean rb_source_try_playlist (RBSource *source);
guint rb_source_want_uri (RBSource *source, const char *uri);
gboolean rb_source_uri_is_source (RBSource *source, const char *uri);
-gboolean rb_source_add_uri (RBSource *source,
+void rb_source_add_uri (RBSource *source,
const char *uri,
const char *title,
const char *genre,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]