[rhythmbox] ipod: Move all playlist handlers to private playlist code
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] ipod: Move all playlist handlers to private playlist code
- Date: Wed, 14 Mar 2012 13:29:15 +0000 (UTC)
commit d99a239c500516c792d50712834a2be76c10feb2
Author: Jonathan Matthew <jonathan d14n org>
Date: Wed Mar 14 23:16:50 2012 +1000
ipod: Move all playlist handlers to private playlist code
Various other cleanups, removal of the notify::base-query-model
signal handler that would never have worked, and stuff moved
from impl_delete_thyself to the dispose method where it belongs.
based on a patch by Cole Robinson <crobinso redhat com>
plugins/ipod/rb-ipod-plugin.c | 5 +-
plugins/ipod/rb-ipod-source.c | 190 +-----------------
plugins/ipod/rb-ipod-static-playlist-source.c | 266 +++++++++++++++++--------
plugins/ipod/rb-ipod-static-playlist-source.h | 6 -
4 files changed, 184 insertions(+), 283 deletions(-)
---
diff --git a/plugins/ipod/rb-ipod-plugin.c b/plugins/ipod/rb-ipod-plugin.c
index 089c1b4..e0907bc 100644
--- a/plugins/ipod/rb-ipod-plugin.c
+++ b/plugins/ipod/rb-ipod-plugin.c
@@ -277,14 +277,13 @@ rb_ipod_plugin_cmd_playlist_rename (GtkAction *action, RBSource *source)
static void
rb_ipod_plugin_cmd_playlist_delete (GtkAction *action, RBSource *source)
{
- RBIpodStaticPlaylistSource *psource;
RBiPodSource *ipod_source;
g_return_if_fail (RB_IS_IPOD_STATIC_PLAYLIST_SOURCE (source));
- psource = RB_IPOD_STATIC_PLAYLIST_SOURCE (source);
- ipod_source = rb_ipod_static_playlist_source_get_ipod_source (psource);
+ g_object_get (source, "ipod-source", &ipod_source, NULL);
rb_ipod_source_remove_playlist (ipod_source, source);
+ g_object_unref (ipod_source);
}
static void
diff --git a/plugins/ipod/rb-ipod-source.c b/plugins/ipod/rb-ipod-source.c
index 7a23d0c..194807c 100644
--- a/plugins/ipod/rb-ipod-source.c
+++ b/plugins/ipod/rb-ipod-source.c
@@ -587,170 +587,6 @@ ipod_path_to_uri (const char *mount_point, const char *ipod_path)
}
static void
-playlist_track_removed (RhythmDBQueryModel *m,
- RhythmDBEntry *entry,
- gpointer data)
-{
- RBIpodStaticPlaylistSource *playlist = RB_IPOD_STATIC_PLAYLIST_SOURCE (data);
- Itdb_Playlist *ipod_pl = rb_ipod_static_playlist_source_get_itdb_playlist (playlist);
- RBiPodSource *ipod = rb_ipod_static_playlist_source_get_ipod_source (playlist);
- RbIpodDb *ipod_db = rb_ipod_static_playlist_source_get_ipod_db (playlist);
- Itdb_Track *track;
-
- g_return_if_fail (ipod != NULL);
- g_return_if_fail (ipod_pl != NULL);
-
- track = rb_ipod_source_lookup_track (ipod, entry);
- g_return_if_fail (track != NULL);
- rb_ipod_db_remove_from_playlist (ipod_db, ipod_pl, track);
-}
-
-static void
-playlist_track_added (GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer data)
-{
- RBIpodStaticPlaylistSource *playlist = RB_IPOD_STATIC_PLAYLIST_SOURCE (data);
- Itdb_Playlist *ipod_pl = rb_ipod_static_playlist_source_get_itdb_playlist (playlist);
- RBiPodSource *ipod = rb_ipod_static_playlist_source_get_ipod_source (playlist);
- RbIpodDb *ipod_db = rb_ipod_static_playlist_source_get_ipod_db (playlist);
- Itdb_Track *track;
- RhythmDBEntry *entry;
-
- g_return_if_fail (ipod != NULL);
- g_return_if_fail (ipod_pl != NULL);
-
- gtk_tree_model_get (model, iter, 0, &entry, -1);
- track = rb_ipod_source_lookup_track (ipod, entry);
- g_return_if_fail (track != NULL);
-
- rb_ipod_db_add_to_playlist (ipod_db, ipod_pl, track);
-}
-
-static void
-playlist_before_save (RbIpodDb *ipod_db, gpointer data)
-{
- RBIpodStaticPlaylistSource *playlist = RB_IPOD_STATIC_PLAYLIST_SOURCE (data);
- GtkTreeModel *model = GTK_TREE_MODEL (rb_playlist_source_get_query_model (RB_PLAYLIST_SOURCE (playlist)));
- Itdb_Playlist *ipod_pl = rb_ipod_static_playlist_source_get_itdb_playlist (playlist);
- RBiPodSource *ipod = rb_ipod_static_playlist_source_get_ipod_source (playlist);
- GtkTreeIter iter;
-
- if (!rb_ipod_static_playlist_source_get_was_reordered (playlist)) {
- return;
- }
-
- rb_ipod_static_playlist_source_set_was_reordered (playlist, FALSE);
-
- /* Sanity check that all tracks are in entry_map */
-
- if (gtk_tree_model_get_iter_first (model, &iter)) {
- do {
- RhythmDBEntry *entry;
- Itdb_Track *track;
-
- gtk_tree_model_get (model, &iter, 0, &entry, -1);
- track = rb_ipod_source_lookup_track (ipod, entry);
-
- g_return_if_fail (track != NULL);
- } while (gtk_tree_model_iter_next (model, &iter));
- }
-
- /* Remove all tracks then re-add in correct order */
-
- while (ipod_pl->members != NULL) {
- Itdb_Track *track;
-
- track = (Itdb_Track *)ipod_pl->members->data;
-
- rb_debug ("removing \"%s\" from \"%s\"", track->title, ipod_pl->name);
-
- /* Call directly to itdb to avoid scheduling another save */
- itdb_playlist_remove_track (ipod_pl, track);
- }
-
- if (gtk_tree_model_get_iter_first (model, &iter)) {
- do {
- RhythmDBEntry *entry;
- Itdb_Track *track;
-
- gtk_tree_model_get (model, &iter, 0, &entry, -1);
- track = rb_ipod_source_lookup_track (ipod, entry);
-
- rb_debug ("adding \"%s\" to \"%s\"", track->title, ipod_pl->name);
-
- /* Call directly to itdb to avoid scheduling another save */
- itdb_playlist_add_track (ipod_pl, track, -1);
- } while (gtk_tree_model_iter_next (model, &iter));
- }
-}
-
-static void
-playlist_rows_reordered (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gint *order, gpointer data)
-{
- RBIpodStaticPlaylistSource *playlist = RB_IPOD_STATIC_PLAYLIST_SOURCE (data);
- RbIpodDb *ipod_db = rb_ipod_static_playlist_source_get_ipod_db (playlist);
-
- /* Mark as reordered; will check before save */
- rb_ipod_static_playlist_source_set_was_reordered (playlist, TRUE);
-
- rb_ipod_db_save_async (ipod_db);
-}
-
-static void
-playlist_source_model_disconnect_signals (GObject *model, RBIpodStaticPlaylistSource *playlist_source)
-{
- g_return_if_fail (RB_IS_IPOD_STATIC_PLAYLIST_SOURCE (playlist_source));
-
- g_signal_handlers_disconnect_by_func (model,
- G_CALLBACK (playlist_track_added),
- playlist_source);
- g_signal_handlers_disconnect_by_func (model,
- G_CALLBACK (playlist_track_removed),
- playlist_source);
- g_signal_handlers_disconnect_by_func (model,
- G_CALLBACK (playlist_rows_reordered),
- playlist_source);
-}
-
-static void
-playlist_source_model_connect_signals (RBIpodStaticPlaylistSource *playlist_source)
-{
- RhythmDBQueryModel *model;
-
- g_return_if_fail (RB_IS_IPOD_STATIC_PLAYLIST_SOURCE (playlist_source));
-
- g_object_get (G_OBJECT (playlist_source),
- "base-query-model", &model, NULL);
- g_signal_connect (model, "row-inserted",
- G_CALLBACK (playlist_track_added),
- playlist_source);
- g_signal_connect (model, "entry-removed",
- G_CALLBACK (playlist_track_removed),
- playlist_source);
- g_signal_connect (model, "rows-reordered",
- G_CALLBACK (playlist_rows_reordered),
- playlist_source);
- g_object_unref (model);
-}
-
-static void
-playlist_source_model_changed (GObject *obj, GParamSpec *pspec, gpointer old_model)
-{
- RBIpodStaticPlaylistSource *playlist_source;
-
- rb_debug ("base model changed for iPod playlist");
-
- playlist_source = RB_IPOD_STATIC_PLAYLIST_SOURCE (obj);
-
- playlist_source_model_disconnect_signals (G_OBJECT (old_model), playlist_source);
-
- playlist_source_model_connect_signals (playlist_source);
-}
-
-static void
set_podcast_icon (RBIpodStaticPlaylistSource *source)
{
GdkPixbuf *pixbuf;
@@ -776,7 +612,6 @@ add_rb_playlist (RBiPodSource *source, Itdb_Playlist *playlist)
GList *it;
RBiPodSourcePrivate *priv = IPOD_SOURCE_GET_PRIVATE (source);
RhythmDBEntryType *entry_type;
- RhythmDBQueryModel *model;
g_object_get (source,
"shell", &shell,
@@ -812,17 +647,6 @@ add_rb_playlist (RBiPodSource *source, Itdb_Playlist *playlist)
playlist->userdata_destroy = g_object_unref;
playlist->userdata_duplicate = g_object_ref;
- g_object_get (G_OBJECT (playlist_source),
- "base-query-model", &model, NULL);
- g_signal_connect (playlist_source, "notify::base-query-model",
- G_CALLBACK (playlist_source_model_changed),
- playlist_source);
- g_signal_connect (priv->ipod_db, "before-save",
- G_CALLBACK (playlist_before_save),
- playlist_source);
- g_object_unref (model);
- playlist_source_model_connect_signals (playlist_source);
-
if (itdb_playlist_is_podcasts(playlist)) {
priv->podcast_pl = playlist_source;
set_podcast_icon (playlist_source);
@@ -2013,17 +1837,8 @@ impl_delete_thyself (RBDisplayPage *page)
Itdb_Playlist *playlist = (Itdb_Playlist *)p->data;
if (!itdb_playlist_is_mpl (playlist) && !playlist->is_spl) {
RBSource *rb_playlist;
- RhythmDBQueryModel *model;
rb_playlist = RB_SOURCE (playlist->userdata);
- g_object_get (G_OBJECT (rb_playlist),
- "base-query-model", &model, NULL);
-
- /* remove these to ensure they aren't called during source deletion */
- playlist_source_model_disconnect_signals (G_OBJECT (model),
- RB_IPOD_STATIC_PLAYLIST_SOURCE (rb_playlist));
-
- g_object_unref (model);
rb_display_page_delete_thyself (RB_DISPLAY_PAGE (rb_playlist));
}
}
@@ -2057,9 +1872,12 @@ rb_ipod_source_remove_playlist (RBiPodSource *ipod_source,
{
RBiPodSourcePrivate *priv = IPOD_SOURCE_GET_PRIVATE (ipod_source);
RBIpodStaticPlaylistSource *playlist_source = RB_IPOD_STATIC_PLAYLIST_SOURCE (source);
+ Itdb_Playlist *playlist;
rb_display_page_delete_thyself (RB_DISPLAY_PAGE (source));
- rb_ipod_db_remove_playlist (priv->ipod_db, rb_ipod_static_playlist_source_get_itdb_playlist (playlist_source));
+
+ g_object_get (playlist_source, "itdb-playlist", &playlist, NULL);
+ rb_ipod_db_remove_playlist (priv->ipod_db, playlist);
}
diff --git a/plugins/ipod/rb-ipod-static-playlist-source.c b/plugins/ipod/rb-ipod-static-playlist-source.c
index 0a95dc8..261c4c4 100644
--- a/plugins/ipod/rb-ipod-static-playlist-source.c
+++ b/plugins/ipod/rb-ipod-static-playlist-source.c
@@ -45,11 +45,6 @@ static void rb_ipod_static_playlist_source_get_property (GObject *object,
GParamSpec *pspec);
static gboolean impl_show_popup (RBDisplayPage *page);
-static void impl_delete_thyself (RBDisplayPage *page);
-
-static void source_name_changed_cb (RBIpodStaticPlaylistSource *source,
- GParamSpec *spec,
- gpointer data);
typedef struct
{
@@ -67,10 +62,168 @@ enum {
PROP_0,
PROP_IPOD_SOURCE,
PROP_IPOD_DB,
- PROP_ITDB_PLAYLIST,
- PROP_WAS_REORDERED
+ PROP_ITDB_PLAYLIST
};
+static void
+playlist_track_removed (RhythmDBQueryModel *m,
+ RhythmDBEntry *entry,
+ gpointer data)
+{
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (data);
+ Itdb_Track *track;
+
+ track = rb_ipod_source_lookup_track (priv->ipod_source, entry);
+ g_return_if_fail (track != NULL);
+ rb_ipod_db_remove_from_playlist (priv->ipod_db, priv->itdb_playlist, track);
+}
+
+static void
+playlist_track_added (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (data);
+ Itdb_Track *track;
+ RhythmDBEntry *entry;
+
+ gtk_tree_model_get (model, iter, 0, &entry, -1);
+ track = rb_ipod_source_lookup_track (priv->ipod_source, entry);
+ g_return_if_fail (track != NULL);
+
+ rb_ipod_db_add_to_playlist (priv->ipod_db, priv->itdb_playlist, track);
+}
+
+static void
+playlist_before_save (RbIpodDb *ipod_db, gpointer data)
+{
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (data);
+ RhythmDBQueryModel *model;
+ GtkTreeIter iter;
+
+ if (priv->was_reordered == FALSE)
+ return;
+ priv->was_reordered = FALSE;
+
+ /* Sanity check that all tracks are in entry_map */
+
+ g_object_get (G_OBJECT (data), "base-query-model", &model, NULL);
+ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) {
+ do {
+ RhythmDBEntry *entry;
+ Itdb_Track *track;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 0, &entry, -1);
+ track = rb_ipod_source_lookup_track (priv->ipod_source, entry);
+
+ g_return_if_fail (track != NULL);
+ } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter));
+ }
+
+ /* Remove all tracks then re-add in correct order */
+
+ while (priv->itdb_playlist->members != NULL) {
+ Itdb_Track *track;
+
+ track = (Itdb_Track *)priv->itdb_playlist->members->data;
+
+ rb_debug ("removing \"%s\" from \"%s\"", track->title, priv->itdb_playlist->name);
+
+ /* Call directly to itdb to avoid scheduling another save */
+ itdb_playlist_remove_track (priv->itdb_playlist, track);
+ }
+
+ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) {
+ do {
+ RhythmDBEntry *entry;
+ Itdb_Track *track;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 0, &entry, -1);
+ track = rb_ipod_source_lookup_track (priv->ipod_source, entry);
+
+ rb_debug ("adding \"%s\" to \"%s\"", track->title, priv->itdb_playlist->name);
+
+ /* Call directly to itdb to avoid scheduling another save */
+ itdb_playlist_add_track (priv->itdb_playlist, track, -1);
+ } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter));
+ }
+
+ g_object_unref (model);
+}
+
+static void
+playlist_rows_reordered (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gint *order,
+ gpointer data)
+{
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (data);
+ priv->was_reordered = TRUE;
+
+ rb_ipod_db_save_async (priv->ipod_db);
+}
+
+static void
+playlist_source_model_disconnect_signals (RBIpodStaticPlaylistSource *source)
+{
+ RhythmDBQueryModel *model;
+
+ g_return_if_fail (RB_IS_IPOD_STATIC_PLAYLIST_SOURCE (source));
+
+ g_object_get (source, "base-query-model", &model, NULL);
+
+ g_signal_handlers_disconnect_by_func (model,
+ G_CALLBACK (playlist_track_added),
+ source);
+ g_signal_handlers_disconnect_by_func (model,
+ G_CALLBACK (playlist_track_removed),
+ source);
+ g_signal_handlers_disconnect_by_func (model,
+ G_CALLBACK (playlist_rows_reordered),
+ source);
+
+ g_object_unref (model);
+}
+
+static void
+playlist_source_model_connect_signals (RBIpodStaticPlaylistSource *playlist_source)
+{
+ RhythmDBQueryModel *model;
+
+ g_return_if_fail (RB_IS_IPOD_STATIC_PLAYLIST_SOURCE (playlist_source));
+
+ g_object_get (playlist_source, "base-query-model", &model, NULL);
+ g_signal_connect (model, "row-inserted",
+ G_CALLBACK (playlist_track_added),
+ playlist_source);
+ g_signal_connect (model, "entry-removed",
+ G_CALLBACK (playlist_track_removed),
+ playlist_source);
+ g_signal_connect (model, "rows-reordered",
+ G_CALLBACK (playlist_rows_reordered),
+ playlist_source);
+ g_object_unref (model);
+}
+
+static void
+source_name_changed_cb (RBIpodStaticPlaylistSource *source,
+ GParamSpec *spec,
+ gpointer data)
+{
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (source);
+ char *name;
+
+ g_object_get (source, "name", &name, NULL);
+
+ if ((priv->itdb_playlist != NULL) && (strcmp (name, priv->itdb_playlist->name) != 0)) {
+ rb_debug ("changing playlist name to %s", name);
+ rb_ipod_db_rename_playlist (priv->ipod_db, priv->itdb_playlist, name);
+ }
+ g_free (name);
+}
+
static void
rb_ipod_static_playlist_source_class_init (RBIpodStaticPlaylistSourceClass *klass)
@@ -85,7 +238,6 @@ rb_ipod_static_playlist_source_class_init (RBIpodStaticPlaylistSourceClass *klas
object_class->set_property = rb_ipod_static_playlist_source_set_property;
page_class->show_popup = impl_show_popup;
- page_class->delete_thyself = impl_delete_thyself;
source_class->impl_can_move_to_trash = (RBSourceFeatureFunc) rb_false_function;
source_class->impl_can_delete = (RBSourceFeatureFunc) rb_true_function;
@@ -115,13 +267,6 @@ rb_ipod_static_playlist_source_class_init (RBIpodStaticPlaylistSourceClass *klas
"itdb-playlist",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class,
- PROP_WAS_REORDERED,
- g_param_spec_pointer ("was-reordered",
- "was-reordered",
- "was-reordered",
- G_PARAM_READWRITE));
-
g_type_class_add_private (klass, sizeof (RBIpodStaticPlaylistSourcePrivate));
}
@@ -139,20 +284,27 @@ rb_ipod_static_playlist_source_init (RBIpodStaticPlaylistSource *source)
static void
rb_ipod_static_playlist_source_constructed (GObject *object)
{
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (object);
+ RhythmDBQueryModel *model;
+
RB_CHAIN_GOBJECT_METHOD (rb_ipod_static_playlist_source_parent_class, constructed, object);
+
g_signal_connect (object, "notify::name", (GCallback)source_name_changed_cb, NULL);
-}
-static void
-rb_ipod_static_playlist_source_dispose (GObject *object)
-{
- G_OBJECT_CLASS (rb_ipod_static_playlist_source_parent_class)->dispose (object);
+ g_object_get (object, "base-query-model", &model, NULL);
+ g_signal_connect (priv->ipod_db, "before-save",
+ G_CALLBACK (playlist_before_save),
+ object);
+ g_object_unref (model);
+ playlist_source_model_connect_signals (RB_IPOD_STATIC_PLAYLIST_SOURCE (object));
+
}
static void
-impl_delete_thyself (RBDisplayPage *page)
+rb_ipod_static_playlist_source_dispose (GObject *object)
{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (page);
+ RBIpodStaticPlaylistSource *source = RB_IPOD_STATIC_PLAYLIST_SOURCE (object);
+ RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (object);
if (priv->ipod_source) {
g_object_unref (priv->ipod_source);
@@ -162,8 +314,10 @@ impl_delete_thyself (RBDisplayPage *page)
g_object_unref (priv->ipod_db);
priv->ipod_db = NULL;
}
-
- RB_DISPLAY_PAGE_CLASS (rb_ipod_static_playlist_source_parent_class)->delete_thyself (page);
+
+ playlist_source_model_disconnect_signals (source);
+
+ G_OBJECT_CLASS (rb_ipod_static_playlist_source_parent_class)->dispose (object);
}
RBIpodStaticPlaylistSource *
@@ -209,9 +363,6 @@ rb_ipod_static_playlist_source_set_property (GObject *object,
case PROP_ITDB_PLAYLIST:
priv->itdb_playlist = g_value_get_pointer (value);
break;
- case PROP_WAS_REORDERED:
- priv->was_reordered = g_value_get_boolean (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -236,56 +387,12 @@ rb_ipod_static_playlist_source_get_property (GObject *object,
case PROP_ITDB_PLAYLIST:
g_value_set_pointer (value, priv->itdb_playlist);
break;
- case PROP_WAS_REORDERED:
- g_value_set_boolean (value, priv->was_reordered);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
-
-Itdb_Playlist*
-rb_ipod_static_playlist_source_get_itdb_playlist (RBIpodStaticPlaylistSource *playlist)
-{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (playlist);
-
- return priv->itdb_playlist;
-}
-
-RBiPodSource*
-rb_ipod_static_playlist_source_get_ipod_source (RBIpodStaticPlaylistSource *playlist)
-{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (playlist);
-
- return priv->ipod_source;
-}
-
-RbIpodDb*
-rb_ipod_static_playlist_source_get_ipod_db (RBIpodStaticPlaylistSource *playlist)
-{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (playlist);
-
- return priv->ipod_db;
-}
-
-gboolean
-rb_ipod_static_playlist_source_get_was_reordered (RBIpodStaticPlaylistSource *playlist)
-{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (playlist);
-
- return priv->was_reordered;
-}
-
-void
-rb_ipod_static_playlist_source_set_was_reordered (RBIpodStaticPlaylistSource *playlist, gboolean was_reordered)
-{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (playlist);
-
- priv->was_reordered = was_reordered;
-}
-
static gboolean
impl_show_popup (RBDisplayPage *page)
{
@@ -293,23 +400,6 @@ impl_show_popup (RBDisplayPage *page)
return TRUE;
}
-static void
-source_name_changed_cb (RBIpodStaticPlaylistSource *source,
- GParamSpec *spec,
- gpointer data)
-{
- RBIpodStaticPlaylistSourcePrivate *priv = IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (source);
- char *name;
-
- g_object_get (source, "name", &name, NULL);
-
- if ((priv->itdb_playlist != NULL) && (strcmp (name, priv->itdb_playlist->name) != 0)) {
- rb_debug ("changing playlist name to %s", name);
- rb_ipod_db_rename_playlist (priv->ipod_db, priv->itdb_playlist, name);
- }
- g_free (name);
-}
-
void
_rb_ipod_static_playlist_source_register_type (GTypeModule *module)
{
diff --git a/plugins/ipod/rb-ipod-static-playlist-source.h b/plugins/ipod/rb-ipod-static-playlist-source.h
index 49c833f..383b447 100644
--- a/plugins/ipod/rb-ipod-static-playlist-source.h
+++ b/plugins/ipod/rb-ipod-static-playlist-source.h
@@ -54,12 +54,6 @@ RBIpodStaticPlaylistSource * rb_ipod_static_playlist_source_new (RBShell *shell,
Itdb_Playlist *playlist,
RhythmDBEntryType *entry_type);
-Itdb_Playlist* rb_ipod_static_playlist_source_get_itdb_playlist (RBIpodStaticPlaylistSource *playlist);
-RBiPodSource* rb_ipod_static_playlist_source_get_ipod_source (RBIpodStaticPlaylistSource *playlist);
-RbIpodDb* rb_ipod_static_playlist_source_get_ipod_db (RBIpodStaticPlaylistSource *playlist);
-gboolean rb_ipod_static_playlist_source_get_was_reordered (RBIpodStaticPlaylistSource *playlist);
-void rb_ipod_static_playlist_source_set_was_reordered (RBIpodStaticPlaylistSource *playlist, gboolean was_reordered);
-
G_END_DECLS
#endif /* __RB_IPOD_STATIC_PLAYLIST_SOURCE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]