forked from openlp/openlp
Fix for samuel_m issue and bug #1672229
This commit is contained in:
parent
df39497cc1
commit
779e95b523
@ -85,7 +85,7 @@ class AppLocation(object):
|
||||
"""
|
||||
# Check if we have a different data location.
|
||||
if Settings().contains('advanced/data path'):
|
||||
path = Settings().value('advanced/data path')
|
||||
path = Path(Settings().value('advanced/data path'))
|
||||
else:
|
||||
path = AppLocation.get_directory(AppLocation.DataDir)
|
||||
check_directory_exists(path)
|
||||
|
@ -341,7 +341,9 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties):
|
||||
else:
|
||||
new_files.append(file_name)
|
||||
if new_files:
|
||||
if 'target' in data:
|
||||
self.validate_and_load(new_files, data['target'])
|
||||
self.validate_and_load(new_files)
|
||||
|
||||
def dnd_move_internal(self, target):
|
||||
"""
|
||||
|
@ -121,7 +121,7 @@ class ListWidgetWithDnD(QtWidgets.QListWidget):
|
||||
for file in listing:
|
||||
files.append(os.path.join(local_file, file))
|
||||
Registry().execute('{mime_data}_dnd'.format(mime_data=self.mime_data_text),
|
||||
{'files': files, 'target': self.itemAt(event.pos())})
|
||||
{'files': files})
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
|
@ -364,7 +364,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
if validate_thumb(image.file_path, thumbnail_path):
|
||||
icon = build_icon(thumbnail_path)
|
||||
else:
|
||||
icon = create_thumb(image.file_path, thumbnail_path)
|
||||
icon = create_thumb(str(image.file_path), str(thumbnail_path))
|
||||
item_name = QtWidgets.QTreeWidgetItem([file_name])
|
||||
item_name.setText(0, file_name)
|
||||
item_name.setIcon(0, icon)
|
||||
@ -388,6 +388,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
:param files: A List of strings containing the filenames of the files to be loaded
|
||||
:param target_group: The QTreeWidgetItem of the group that will be the parent of the added files
|
||||
"""
|
||||
file_paths = [Path(file) for file in file_paths]
|
||||
self.application.set_normal_cursor()
|
||||
self.load_list(file_paths, target_group)
|
||||
last_dir = file_paths[0].parent
|
||||
|
Loading…
Reference in New Issue
Block a user