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 authored Jan 8, 2025
1 parent a54a29b commit bad0642
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 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):
if type(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 bad0642

Please sign in to comment.