Fixed bug1222534 ny using userData rather than relying on a translated string

This commit is contained in:
Philip Ridout 2013-11-19 22:04:51 +00:00
parent c14cb6674c
commit b6b9f248af
1 changed files with 4 additions and 4 deletions

View File

@ -153,7 +153,7 @@ class PresentationMediaItem(MediaManagerItem):
if self.controllers[item].enabled():
self.displayTypeComboBox.addItem(item)
if self.displayTypeComboBox.count() > 1:
self.displayTypeComboBox.insertItem(0, self.Automatic)
self.displayTypeComboBox.insertItem(0, self.Automatic, userData=u'automatic')
self.displayTypeComboBox.setCurrentIndex(0)
if Settings().value(self.settingsSection + u'/override app',
QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked:
@ -277,13 +277,13 @@ class PresentationMediaItem(MediaManagerItem):
service_item.shortname = unicode(self.displayTypeComboBox.currentText())
service_item.add_capability(ItemCapabilities.ProvidesOwnDisplay)
service_item.add_capability(ItemCapabilities.HasDetailedTitleDisplay)
shortname = service_item.shortname
if not shortname:
if not service_item.shortname:
return False
for bitem in items:
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
if os.path.exists(filename):
if shortname == self.Automatic:
if self.displayTypeComboBox.itemData(
self.displayTypeComboBox.currentIndex()) == u'automatic':
service_item.shortname = self.findControllerByType(filename)
if not service_item.shortname:
return False