changeset 3364:38d5745b3b93 trunk

Automated merge with ssh://hg.atheme.org//hg/audacious
author William Pitcock <nenolod@atheme-project.org>
date Sat, 18 Aug 2007 14:18:26 -0500
parents 0b9ff4c95e81 (current diff) 9da616784f11 (diff)
children b4ff4ef0211f f7d56abcef56
files contrib/lap.py
diffstat 3 files changed, 30 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/lap.py	Sat Aug 18 14:17:39 2007 -0500
+++ b/contrib/lap.py	Sat Aug 18 14:18:26 2007 -0500
@@ -81,7 +81,7 @@
 		try:
 			if subprocess.call(['audtool','playlist-addurl',file_url]):
 				print "ERROR: audtool fallback returned an error for: %s" % file_url
-			else:
+			elif play:
 				os.system('audtool playlist-jump `audtool playlist-length`; audtool playback-play')
 		except OSError:
 			print "ERROR: Unable to call audtool as a fallback for: %s" % file_url
--- a/src/audacious/playlist.c	Sat Aug 18 14:17:39 2007 -0500
+++ b/src/audacious/playlist.c	Sat Aug 18 14:18:26 2007 -0500
@@ -2504,6 +2504,14 @@
     return result;
 }
 
+static gboolean
+playlist_request_win_update(gpointer unused)
+{
+    Playlist *playlist = playlist_get_active();
+    playlistwin_update_list(playlist);
+    return FALSE; /* to be called only once */
+}
+
 static gpointer
 playlist_get_info_func(gpointer arg)
 {
@@ -2600,7 +2608,9 @@
         }
 
         if (update_playlistwin) {
-            playlistwin_update_list(playlist);
+            /* we are in a different thread, so we can't do UI updates directly;
+               instead, schedule a playlist update in the main loop --giacomo */
+            g_idle_add_full(G_PRIORITY_HIGH_IDLE, playlist_request_win_update, NULL, NULL);
             update_playlistwin = FALSE;
         }
 
--- a/src/audacious/tuple_formatter.c	Sat Aug 18 14:17:39 2007 -0500
+++ b/src/audacious/tuple_formatter.c	Sat Aug 18 14:18:26 2007 -0500
@@ -124,16 +124,19 @@
                         level++;
                     }
                 }
-                else if (*iter == '}' && (sel == argument))
+                else if (*iter == '}')
                 {
                     level--;
-                    if (level == 0)
-                      break;
+                    if (sel == argument)
+                    {
+                        if (level == 0)
+                            break;
+                        else
+                            g_string_append_c(sel, *iter);
+                    }
                     else
-                      g_string_append_c(sel, *iter);
+                        break;
                 }
-                else if (*iter == '}' && ((sel != argument)))
-                    break;
                 else
                     g_string_append_c(sel, *iter);
             }
@@ -188,16 +191,19 @@
                         level++;
                     }
                 }
-                else if (*iter == '}' && (sel == argument))
+                else if (*iter == '}')
                 {
                     level--;
-                    if (level == 0)
-                      break;
+                    if (sel == argument)
+                    {
+                        if (level == 0)
+                            break;
+                        else
+                            g_string_append_c(sel, *iter);
+                    }
                     else
-                    g_string_append_c(sel, *iter);
+                        break;
                 }
-                else if (*iter == '}' && ((sel != argument)))
-                    break;
                 else
                     g_string_append_c(sel, *iter);
             }