Skip to content

Commit

Permalink
Make Kde File Chooser process filters in a better way.
Browse files Browse the repository at this point in the history
    This algo better process the filters for display/usage under
    the latest KDE,  this also works around a bug that was under
    plasma 5x.
  • Loading branch information
akshayaurora committed Jan 8, 2025
1 parent a54a29b commit 46b035a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plyer/platforms/linux/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,18 @@ def _gen_cmdline(self):
cmdline = [which(self.executable)]

filt = []

for f in self.filters:
if isinstance(f, str):
filt += [f]
else:
filt += list(f[1:])
filters = ''
for ext in self.filters:
exts = ''
for y in ext[1:]:
exts += f' {y};'
x = f'{ext[0]} ({exts})|'
filters += x
filt = [filters[:-1]]

if self.mode == "dir":
cmdline += [
Expand Down

0 comments on commit 46b035a

Please sign in to comment.