[gnome-music] window: properly trap tracker's GError
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] window: properly trap tracker's GError
- Date: Mon, 19 Jan 2015 11:21:17 +0000 (UTC)
commit 0f2b8549eb1721f8267b8f87765eb596062ebb6c
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 66bb56c..44146bd 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -197,18 +197,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]