openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #04850
[Merge] lp:~googol-hush/openlp/fixes into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
#690774 "Add missing songs" floods the database with duplicates
https://bugs.launchpad.net/bugs/690774
Fixed bug #690774
--
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/43955
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/core/ui/filerenamedialog.py'
--- openlp/core/ui/filerenamedialog.py 2010-11-03 18:03:28 +0000
+++ openlp/core/ui/filerenamedialog.py 2010-12-16 19:18:52 +0000
@@ -30,24 +30,24 @@
class Ui_FileRenameDialog(object):
def setupUi(self, FileRenameDialog):
- FileRenameDialog.setObjectName("FileRenameDialog")
+ FileRenameDialog.setObjectName(u'FileRenameDialog')
FileRenameDialog.resize(400, 87)
self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog)
self.buttonBox.setGeometry(QtCore.QRect(210, 50, 171, 25))
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Ok)
- self.buttonBox.setObjectName("buttonBox")
+ self.buttonBox.setObjectName(u'buttonBox')
self.widget = QtGui.QWidget(FileRenameDialog)
self.widget.setGeometry(QtCore.QRect(10, 10, 381, 35))
- self.widget.setObjectName("widget")
+ self.widget.setObjectName(u'widget')
self.horizontalLayout = QtGui.QHBoxLayout(self.widget)
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.FileRenameLabel = QtGui.QLabel(self.widget)
- self.FileRenameLabel.setObjectName("FileRenameLabel")
- self.horizontalLayout.addWidget(self.FileRenameLabel)
- self.FileNameEdit = QtGui.QLineEdit(self.widget)
- self.FileNameEdit.setObjectName("FileNameEdit")
- self.horizontalLayout.addWidget(self.FileNameEdit)
+ self.horizontalLayout.setObjectName(u'horizontalLayout')
+ self.fileRenameLabel = QtGui.QLabel(self.widget)
+ self.fileRenameLabel.setObjectName(u'fileRenameLabel')
+ self.horizontalLayout.addWidget(self.fileRenameLabel)
+ self.fileNameEdit = QtGui.QLineEdit(self.widget)
+ self.fileNameEdit.setObjectName(u'fileNameEdit')
+ self.horizontalLayout.addWidget(self.fileNameEdit)
self.retranslateUi(FileRenameDialog)
QtCore.QMetaObject.connectSlotsByName(FileRenameDialog)
@@ -55,6 +55,5 @@
def retranslateUi(self, FileRenameDialog):
FileRenameDialog.setWindowTitle(translate('OpenLP.FileRenameForm',
'File Rename'))
- self.FileRenameLabel.setText(translate('OpenLP.FileRenameForm',
+ self.fileRenameLabel.setText(translate('OpenLP.FileRenameForm',
'New File Name:'))
-
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2010-12-11 20:49:50 +0000
+++ openlp/core/ui/thememanager.py 2010-12-16 19:18:52 +0000
@@ -225,10 +225,10 @@
"""
item = self.themeListWidget.currentItem()
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
- self.fileRenameForm.FileNameEdit.setText(oldThemeName)
+ self.fileRenameForm.fileNameEdit.setText(oldThemeName)
self.saveThemeName = u''
if self.fileRenameForm.exec_():
- newThemeName = unicode(self.fileRenameForm.FileNameEdit.text())
+ newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
oldThemeData = self.getThemeData(oldThemeName)
self.deleteTheme(oldThemeName)
self.cloneThemeData(oldThemeData, newThemeName)
@@ -239,10 +239,10 @@
"""
item = self.themeListWidget.currentItem()
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
- self.fileRenameForm.FileNameEdit.setText(oldThemeName)
+ self.fileRenameForm.fileNameEdit.setText(oldThemeName)
self.saveThemeName = u''
if self.fileRenameForm.exec_():
- newThemeName = unicode(self.fileRenameForm.FileNameEdit.text())
+ newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
themeData = self.getThemeData(oldThemeName)
self.cloneThemeData(themeData, newThemeName)
self.loadThemes()
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2010-12-09 15:08:04 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2010-12-16 19:18:52 +0000
@@ -44,6 +44,7 @@
self.PluginName = u'Songs'
BaseListWithDnD.__init__(self, parent)
+
class SongMediaItem(MediaManagerItem):
"""
This is the custom media manager item for Songs.
@@ -392,7 +393,7 @@
author_audit.append(unicode(author.display_name))
raw_footer.append(song.title)
raw_footer.append(author_list)
- raw_footer.append(song.copyright )
+ raw_footer.append(song.copyright)
raw_footer.append(unicode(
translate('SongsPlugin.MediaItem', 'CCLI License: ') +
QtCore.QSettings().value(u'general/ccli number',
@@ -417,24 +418,28 @@
item.data_string[u'title'].split(u'@')[0].lower() ,
Song.search_title.asc())
author_list = item.data_string[u'authors'].split(u', ')
+ # The service item always has an author (at least it has u'' as
+ # author). However, songs saved in the database do not have to have
+ # an author.
+ if u'' in author_list:
+ author_list.remove(u'')
editId = 0
uuid = item._uuid
+ add_song = True
if search_results:
for song in search_results:
- count = 0
+ same_authors = True
for author in song.authors:
- if author.display_name in author_list:
- count += 1
- # All Authors the same
- if count == len(author_list):
+ if author.display_name not in author_list:
+ same_authors = False
+ # All Authors the same, so we can stop here and the song
+ # does not have to be saved.
+ if same_authors:
editId = song.id
- else:
- # Authors different
- if self.addSongFromService:
- editId = self.openLyrics. \
- xml_to_song(item.xml_version)
- else:
- # Title does not match
+ add_song = False
+ break
+ if add_song:
+ # Authors different
if self.addSongFromService:
editId = self.openLyrics.xml_to_song(item.xml_version)
# Update service with correct song id
Follow ups