[gnome-music/gnome-3-12] Handle tracker query crash correctly
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gnome-3-12] Handle tracker query crash correctly
- Date: Fri, 3 Oct 2014 12:05:15 +0000 (UTC)
commit 6105b697a4da6da52aa8164937ca3925061168fd
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Fri Oct 3 14:00:47 2014 +0200
Handle tracker query crash correctly
User will be redirected to No Music page in this case
https://bugzilla.gnome.org/show_bug.cgi?id=733686
gnomemusic/window.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index fc59150..7eef6a0 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -200,7 +200,12 @@ class Window(Gtk.ApplicationWindow):
self._box.pack_start(self.selection_toolbar.eventbox, False, False, 0)
self.add(self._box)
count = 1
- cursor = tracker.query(Query.get_songs_count(), None)
+ cursor = None
+ try:
+ cursor = tracker.query(Query.all_songs_count(), None)
+ except Exception as e:
+ logger.error("Tracker query crashed: %s" % e)
+ count = 0
if cursor is not None and cursor.next(None):
count = cursor.get_integer(0)
if count > 0:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]