forked from openlp/openlp
Merge branch '30rc1-fixes' into 'master'
A few bug fixes Closes #958 See merge request openlp/openlp!382
This commit is contained in:
commit
4f9ab2aa05
@ -62,7 +62,9 @@ class ServiceItemEditForm(QtWidgets.QDialog, Ui_ServiceItemEditDialog, RegistryP
|
|||||||
# self.data is only true for images
|
# self.data is only true for images
|
||||||
self.item.slides = []
|
self.item.slides = []
|
||||||
for item in self.item_list:
|
for item in self.item_list:
|
||||||
self.item.add_from_image(item['path'], item['title'])
|
thumb = item.get('thumbnail', None)
|
||||||
|
file_hash = item.get('file_hash', None)
|
||||||
|
self.item.add_from_image(item['path'], item['title'], thumb, file_hash)
|
||||||
return self.item
|
return self.item
|
||||||
|
|
||||||
def load_data(self):
|
def load_data(self):
|
||||||
|
@ -762,8 +762,12 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
|
|||||||
"""
|
"""
|
||||||
# If the file_path is a string, this method will fail. Typecase to Path
|
# If the file_path is a string, this method will fail. Typecase to Path
|
||||||
file_path = Path(file_path)
|
file_path = Path(file_path)
|
||||||
|
try:
|
||||||
if not file_path.exists():
|
if not file_path.exists():
|
||||||
return False
|
return False
|
||||||
|
except OSError:
|
||||||
|
# if the filename, directory name, or volume label syntax is incorrect it can cause an exception
|
||||||
|
return False
|
||||||
service_data = None
|
service_data = None
|
||||||
self.application.set_busy_cursor()
|
self.application.set_busy_cursor()
|
||||||
try:
|
try:
|
||||||
|
@ -84,8 +84,8 @@ def test_get_service_item(form):
|
|||||||
assert item is form.item, 'The returned item should be form.item'
|
assert item is form.item, 'The returned item should be form.item'
|
||||||
# FYI: list should be empty because it was cleared but never filled again due to the mock
|
# FYI: list should be empty because it was cleared but never filled again due to the mock
|
||||||
assert item.slides == [], 'The list of slides should have been cleared'
|
assert item.slides == [], 'The list of slides should have been cleared'
|
||||||
assert item.add_from_image.call_args_list == [call('../slide1.jpg', 'slide1.jpg'),
|
assert item.add_from_image.call_args_list == [call('../slide1.jpg', 'slide1.jpg', None, None),
|
||||||
call('../slide2.jpg', 'slide2.jpg')]
|
call('../slide2.jpg', 'slide2.jpg', None, None)]
|
||||||
|
|
||||||
|
|
||||||
@patch('openlp.core.ui.serviceitemeditform.QtWidgets.QListWidgetItem')
|
@patch('openlp.core.ui.serviceitemeditform.QtWidgets.QListWidgetItem')
|
||||||
|
Loading…
Reference in New Issue
Block a user