[rhythmbox] rhythmdb: allow entry types to be changed
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] rhythmdb: allow entry types to be changed
- Date: Sat, 22 Sep 2012 12:12:20 +0000 (UTC)
commit 4fcb839bbec767cf38962832959d493db447b7fa
Author: Jonathan Matthew <jonathan d14n org>
Date: Sat Sep 22 22:06:14 2012 +1000
rhythmdb: allow entry types to be changed
rhythmdb/rhythmdb-tree.c | 17 +++++++++++++++++
rhythmdb/rhythmdb.c | 3 +++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/rhythmdb/rhythmdb-tree.c b/rhythmdb/rhythmdb-tree.c
index aef651b..4c26eba 100644
--- a/rhythmdb/rhythmdb-tree.c
+++ b/rhythmdb/rhythmdb-tree.c
@@ -1570,6 +1570,23 @@ rhythmdb_tree_entry_set (RhythmDB *adb,
/* Handle special properties */
switch (propid)
{
+ case RHYTHMDB_PROP_TYPE:
+ {
+ RhythmDBTreeProperty *artist;
+ RhythmDBTreeProperty *genre;
+
+ g_mutex_lock (&db->priv->genres_lock);
+ remove_entry_from_album (db, entry);
+
+ entry->type = g_value_get_object (value);
+
+ genre = get_or_create_genre (db, entry->type, entry->genre);
+ artist = get_or_create_artist (db, genre, entry->artist);
+ set_entry_album (db, entry, artist, entry->album);
+ g_mutex_unlock (&db->priv->genres_lock);
+
+ return TRUE;
+ }
case RHYTHMDB_PROP_LOCATION:
{
RBRefString *s;
diff --git a/rhythmdb/rhythmdb.c b/rhythmdb/rhythmdb.c
index eca2ea3..47708e1 100644
--- a/rhythmdb/rhythmdb.c
+++ b/rhythmdb/rhythmdb.c
@@ -3321,6 +3321,9 @@ rhythmdb_entry_set_internal (RhythmDB *db,
case G_TYPE_DOUBLE:
nop = (g_value_get_double (value) == g_value_get_double (&old_value));
break;
+ case G_TYPE_OBJECT:
+ nop = (g_value_get_object (value) == g_value_get_object (&old_value));
+ break;
default:
g_assert_not_reached ();
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]