mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
ignore case sensitivity of extension in files widget
This commit is contained in:
parent
538064800e
commit
20ea1c8212
2 changed files with 10 additions and 3 deletions
|
|
@ -541,6 +541,13 @@ class FileDefItem(object):
|
|||
return ext
|
||||
return None
|
||||
|
||||
@property
|
||||
def lower_ext(self):
|
||||
ext = self.ext
|
||||
if ext is not None:
|
||||
return ext.lower()
|
||||
return ext
|
||||
|
||||
@property
|
||||
def is_dir(self):
|
||||
if self.is_empty:
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ class FilesModel(QtGui.QStandardItemModel):
|
|||
item.setData(file_item.filenames, FILENAMES_ROLE)
|
||||
item.setData(file_item.directory, DIRPATH_ROLE)
|
||||
item.setData(icon_pixmap, ITEM_ICON_ROLE)
|
||||
item.setData(file_item.ext, EXT_ROLE)
|
||||
item.setData(file_item.lower_ext, EXT_ROLE)
|
||||
item.setData(file_item.is_dir, IS_DIR_ROLE)
|
||||
item.setData(file_item.is_sequence, IS_SEQUENCE_ROLE)
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ class FilesProxyModel(QtCore.QSortFilterProxyModel):
|
|||
for filepath in filepaths:
|
||||
if os.path.isfile(filepath):
|
||||
_, ext = os.path.splitext(filepath)
|
||||
if ext in self._allowed_extensions:
|
||||
if ext.lower() in self._allowed_extensions:
|
||||
return True
|
||||
|
||||
elif self._allow_folders:
|
||||
|
|
@ -475,7 +475,7 @@ class FilesProxyModel(QtCore.QSortFilterProxyModel):
|
|||
for filepath in filepaths:
|
||||
if os.path.isfile(filepath):
|
||||
_, ext = os.path.splitext(filepath)
|
||||
if ext in self._allowed_extensions:
|
||||
if ext.lower() in self._allowed_extensions:
|
||||
filtered_paths.append(filepath)
|
||||
|
||||
elif self._allow_folders:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue