clean up + fix

This commit is contained in:
Andreas Preikschat 2012-05-17 22:06:23 +02:00
parent c36475f27e
commit cb13f805e4
2 changed files with 9 additions and 11 deletions

View File

@ -352,8 +352,7 @@ class MediaController(object):
if overriddenPlayer and overriddenPlayer != u'auto': if overriddenPlayer and overriddenPlayer != u'auto':
usedPlayers = [overriddenPlayer] usedPlayers = [overriddenPlayer]
if controller.media_info.file_info.isFile(): if controller.media_info.file_info.isFile():
suffix = u'*.%s' % \ suffix = u'*.%s' % controller.media_info.file_info.suffix().lower()
controller.media_info.file_info.suffix().toLower()
for title in usedPlayers: for title in usedPlayers:
player = self.mediaPlayers[title] player = self.mediaPlayers[title]
if suffix in player.video_extensions_list: if suffix in player.video_extensions_list:

View File

@ -738,10 +738,10 @@ class ServiceManager(QtGui.QWidget):
item = self.serviceManagerList.itemAt(point) item = self.serviceManagerList.itemAt(point)
if item is None: if item is None:
return return
if item.parent() is None: if item.parent():
pos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
else:
pos = item.parent().data(0, QtCore.Qt.UserRole).toInt()[0] pos = item.parent().data(0, QtCore.Qt.UserRole).toInt()[0]
else:
pos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
serviceItem = self.serviceItems[pos - 1] serviceItem = self.serviceItems[pos - 1]
self.editAction.setVisible(False) self.editAction.setVisible(False)
self.maintainAction.setVisible(False) self.maintainAction.setVisible(False)
@ -750,13 +750,12 @@ class ServiceManager(QtGui.QWidget):
if serviceItem[u'service_item'].is_capable(ItemCapabilities.CanEdit)\ if serviceItem[u'service_item'].is_capable(ItemCapabilities.CanEdit)\
and serviceItem[u'service_item'].edit_id: and serviceItem[u'service_item'].edit_id:
self.editAction.setVisible(True) self.editAction.setVisible(True)
if serviceItem[u'service_item']\ if serviceItem[u'service_item'].is_capable(
.is_capable(ItemCapabilities.CanMaintain): ItemCapabilities.CanMaintain):
self.maintainAction.setVisible(True) self.maintainAction.setVisible(True)
if item.parent() is None: self.notesAction.setVisible(item.parent() is None)
self.notesAction.setVisible(True) if serviceItem[u'service_item'].is_capable(
if serviceItem[u'service_item']\ ItemCapabilities.HasVariableStartTime):
.is_capable(ItemCapabilities.HasVariableStartTime):
self.timeAction.setVisible(True) self.timeAction.setVisible(True)
self.themeMenu.menuAction().setVisible(False) self.themeMenu.menuAction().setVisible(False)
# Set up the theme menu. # Set up the theme menu.