[gnome-music/gnome-3-14] window: properly trap tracker's GError
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gnome-3-14] window: properly trap tracker's GError
- Date: Mon, 19 Jan 2015 11:21:06 +0000 (UTC)
commit 201a367580449cdfe945cf1d5b82e4e89dd71d47
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Mon Jan 19 12:18:42 2015 +0100
window: properly trap tracker's GError
https://bugzilla.gnome.org/show_bug.cgi?id=733686
gnomemusic/window.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index b691288..40d2db8 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -195,18 +195,18 @@ class Window(Gtk.ApplicationWindow):
self._box.pack_start(self.player.actionbar, False, False, 0)
self._box.pack_start(self.selection_toolbar.actionbar, False, False, 0)
self.add(self._box)
- count = 1
+ count = 0
cursor = None
if Query.music_folder and Query.download_folder:
try:
cursor = tracker.query(Query.all_songs_count(), None)
+ if cursor is not None and cursor.next(None):
+ count = cursor.get_integer(0)
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:
self._switch_to_player_view()
# To revert to the No Music View when no songs are found
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]