3 --- src/sj-main.c.orig 2010-03-30 14:29:55.000000000 +0000
5 @@ -680,11 +680,11 @@ AlbumDetails* multiple_album_dialog(GLis
7 static void baseuri_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
9 - g_assert (strcmp (entry->key, GCONF_BASEURI) == 0);
10 + g_assert (!entry || strcmp (entry->key, GCONF_BASEURI) == 0);
12 g_object_unref (base_uri);
14 - if (entry->value == NULL) {
15 + if (!entry || entry->value == NULL) {
16 base_uri = sj_get_default_music_directory ();
18 base_uri = g_file_new_for_uri (gconf_value_get_string (entry->value));
19 @@ -697,8 +697,8 @@ static void baseuri_changed_cb (GConfCli
21 static void path_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
23 - g_assert (strcmp (entry->key, GCONF_PATH_PATTERN) == 0);
24 - if (entry->value == NULL) {
25 + g_assert (!entry || strcmp (entry->key, GCONF_PATH_PATTERN) == 0);
26 + if (!entry || entry->value == NULL) {
27 /* TODO: this value and the value in sj-prefs need to be in one place */
28 path_pattern = g_strdup ("%aa/%at");
30 @@ -712,8 +712,8 @@ static void path_pattern_changed_cb (GCo
32 static void file_pattern_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
34 - g_assert (strcmp (entry->key, GCONF_FILE_PATTERN) == 0);
35 - if (entry->value == NULL) {
36 + g_assert (!entry || strcmp (entry->key, GCONF_FILE_PATTERN) == 0);
37 + if (!entry || entry->value == NULL) {
38 /* TODO: this value and the value in sj-prefs need to be in one place */
39 file_pattern = g_strdup ("%tN-%tt");
41 @@ -727,8 +727,8 @@ static void file_pattern_changed_cb (GCo
43 static void paranoia_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
45 - g_assert (strcmp (entry->key, GCONF_PARANOIA) == 0);
46 - if (entry->value == NULL) {
47 + g_assert (!entry || strcmp (entry->key, GCONF_PARANOIA) == 0);
48 + if (!entry || entry->value == NULL) {
49 sj_extractor_set_paranoia (extractor, DEFAULT_PARANOIA);
51 int value = gconf_value_get_int (entry->value);
52 @@ -743,8 +743,8 @@ static void paranoia_changed_cb (GConfCl
54 static void strip_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
56 - g_assert (strcmp (entry->key, GCONF_STRIP) == 0);
57 - if (entry->value == NULL) {
58 + g_assert (!entry || strcmp (entry->key, GCONF_STRIP) == 0);
59 + if (!entry || entry->value == NULL) {
62 strip_chars = gconf_value_get_bool (entry->value);
63 @@ -756,8 +756,8 @@ static void strip_changed_cb (GConfClien
65 static void eject_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
67 - g_assert (strcmp (entry->key, GCONF_EJECT) == 0);
68 - if (entry->value == NULL) {
69 + g_assert (!entry || strcmp (entry->key, GCONF_EJECT) == 0);
70 + if (!entry || entry->value == NULL) {
71 eject_finished = FALSE;
73 eject_finished = gconf_value_get_bool (entry->value);
74 @@ -769,8 +769,8 @@ static void eject_changed_cb (GConfClien
76 static void open_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
78 - g_assert (strcmp (entry->key, GCONF_OPEN) == 0);
79 - if (entry->value == NULL) {
80 + g_assert (!entry || strcmp (entry->key, GCONF_OPEN) == 0);
81 + if (!entry || entry->value == NULL) {
82 open_finished = FALSE;
84 open_finished = gconf_value_get_bool (entry->value);
85 @@ -782,10 +782,10 @@ static void open_changed_cb (GConfClient
87 static void audio_volume_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
89 - g_assert (strcmp (entry->key, GCONF_AUDIO_VOLUME) == 0);
90 + g_assert (!entry || strcmp (entry->key, GCONF_AUDIO_VOLUME) == 0);
92 GtkWidget *volb = glade_xml_get_widget (glade, "volume_button");
93 - if (entry->value == NULL) {
94 + if (!entry || entry->value == NULL) {
95 gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), 1.0);
97 gtk_scale_button_set_value (GTK_SCALE_BUTTON (volb), gconf_value_get_float (entry->value));
98 @@ -1107,9 +1107,9 @@ static void device_changed_cb (GConfClie
101 gboolean ignore_no_media = GPOINTER_TO_INT (user_data);
102 - g_assert (strcmp (entry->key, GCONF_DEVICE) == 0);
103 + g_assert (!entry || strcmp (entry->key, GCONF_DEVICE) == 0);
105 - if (entry->value == NULL || !cd_drive_exists (gconf_value_get_string (entry->value))) {
106 + if (!entry || entry->value == NULL || !cd_drive_exists (gconf_value_get_string (entry->value))) {
107 device = prefs_get_default_device();
108 if (device == NULL) {
109 #ifndef IGNORE_MISSING_CD
110 @@ -1137,8 +1137,8 @@ static void profile_changed_cb (GConfCli
112 GMAudioProfile *profile;
114 - g_assert (strcmp (entry->key, GCONF_AUDIO_PROFILE) == 0);
115 - if (!entry->value) return;
116 + g_assert (!entry || strcmp (entry->key, GCONF_AUDIO_PROFILE) == 0);
117 + if (!entry || !entry->value) return;
118 profile = gm_audio_profile_lookup (gconf_value_get_string (entry->value));
120 g_object_set (extractor, "profile", profile, NULL);
121 @@ -1190,8 +1190,8 @@ http_proxy_setup (GConfClient *client)
123 static void http_proxy_enable_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
125 - g_assert (strcmp (entry->key, GCONF_HTTP_PROXY_ENABLE) == 0);
126 - if (entry->value == NULL) return;
127 + g_assert (!entry || strcmp (entry->key, GCONF_HTTP_PROXY_ENABLE) == 0);
128 + if (!entry || entry->value == NULL) return;
129 http_proxy_setup (client);
132 @@ -1200,8 +1200,8 @@ static void http_proxy_enable_changed_cb
134 static void http_proxy_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
136 - g_assert (strcmp (entry->key, GCONF_HTTP_PROXY) == 0);
137 - if (entry->value == NULL) return;
138 + g_assert (!entry || strcmp (entry->key, GCONF_HTTP_PROXY) == 0);
139 + if (!entry || entry->value == NULL) return;
140 http_proxy_setup (client);
143 @@ -1210,8 +1210,8 @@ static void http_proxy_changed_cb (GConf
145 static void http_proxy_port_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
147 - g_assert (strcmp (entry->key, GCONF_HTTP_PROXY_PORT) == 0);
148 - if (entry->value == NULL) return;
149 + g_assert (!entry || strcmp (entry->key, GCONF_HTTP_PROXY_PORT) == 0);
150 + if (!entry || entry->value == NULL) return;
151 http_proxy_setup (client);
154 @@ -1414,7 +1414,8 @@ void on_artist_edit_changed(GtkEditable
156 if (current_album->artist) {
157 former_album_artist = current_album->artist;
160 + former_album_artist = g_strdup("");
161 current_album->artist = gtk_editable_get_chars (widget, 0, -1); /* get all the characters */
163 if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (track_store), &iter)) {