From 5af7d4610a3a6f69ebcc6596dc45d9630f89ffe4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 25 Aug 2009 09:30:38 +0200 Subject: [PATCH] song: handle QString keys. --- nephilim/song.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nephilim/song.py b/nephilim/song.py index c9c1145..d1ea869 100644 --- a/nephilim/song.py +++ b/nephilim/song.py @@ -46,6 +46,8 @@ class Song(dict): try: return dict.__getitem__(self, key) except KeyError: + if isinstance(key, QtCore.QString): + return self[str(key)] if key == 'tracknum': try: return int(self['track']) @@ -74,7 +76,6 @@ class Song(dict): ret = ret.replace('$songdir', os.path.dirname(self['file'])) return ret - class SongRef: """SongRef stores only a reference to the song (uri) instead of full metadata to conserve memory. Song's tags can be accessed -- 2.11.4.GIT