Bug 464350 - Import Torrent "select torrent" filter shows up incorrectly
Summary: Import Torrent "select torrent" filter shows up incorrectly
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: 22.12.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-15 23:56 UTC by enderbyte09
Modified: 2023-06-23 14:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 23.04.3


Attachments
The error (6.33 KB, image/png)
2023-01-15 23:56 UTC, enderbyte09
Details

Note You need to log in before you can comment on or make changes to this bug.
Description enderbyte09 2023-01-15 23:56:14 UTC
Created attachment 155330 [details]
The error

I am trying to import a torrent. When I go to File -> Import Torrent, and open the file select dialog, I cannot select any torrent files. This is because the filter seems to be configured incorrectly. Instead of simply saying "Torrents", the filterbox shows "Torrents (*.torrent);;All files (*) (Torrents (*.torrent);;All files " which is definitely an error. Because of this, I have to type the file name in manually


STEPS TO REPRODUCE
1. Click on File -> Import Torrent
2. Click on the select file button that is next to "Torrent"
3. See error in filter bar near bottom

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2023-06-14 15:41:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1321
Comment 2 Bug Janitor Service 2023-06-14 16:15:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/ktorrent/-/merge_requests/71
Comment 3 Friedrich W. H. Kossebau 2023-06-14 17:32:23 UTC
Git commit c7caa4735d4f8d024029e18ebdc5cdb3cbd87348 by Friedrich W. H. Kossebau.
Committed on 14/06/2023 at 16:14.
Pushed by kossebau into branch 'release/23.04'.

Import Torrent dialog: fix file filter

KUrlRequester::setFilter expected name filters separated by \n, not ;;,
other than QFileDialog. And it also has broken support for the Qt syntax
"Comment (pattern)", only works with old-style kde "pattern|Comment".
FIXED-IN: 23.04.3

M  +1    -1    ktorrent/dialogs/importdialog.cpp
M  +7    -1    libktcore/interfaces/functions.cpp
M  +5    -2    libktcore/interfaces/functions.h

https://invent.kde.org/network/ktorrent/-/commit/c7caa4735d4f8d024029e18ebdc5cdb3cbd87348
Comment 4 Friedrich W. H. Kossebau 2023-06-23 14:23:24 UTC
Git commit 6e945ed1dc01ffbaf30455341cff0ba945877255 by Friedrich W. H. Kossebau.
Committed on 23/06/2023 at 14:04.
Pushed by kossebau into branch 'kf5'.

KUrlRequester::setFilter: note special filter syntax, allow unnamed filters

The API dox referred to QFileDialog::setNameFilters for the syntax to use
which is "Comment (file pattern)". The internal logic though expects
the old KDE style syntax "file pattern|Comment".

For more compatibility with Qt also allow name/comment-less filters by
handling of non-existing "|" hit in the filter parsing.
Related: bug 369542

M  +6    -4    src/widgets/kurlrequester.cpp
M  +8    -2    src/widgets/kurlrequester.h

https://invent.kde.org/frameworks/kio/-/commit/6e945ed1dc01ffbaf30455341cff0ba945877255
Comment 5 Friedrich W. H. Kossebau 2023-06-23 14:31:09 UTC
Git commit a7e865aa41acdb83dd625c68dd8f0d16e7f6dc0d by Friedrich W. H. Kossebau.
Committed on 23/06/2023 at 14:26.
Pushed by kossebau into branch 'master'.

KUrlRequester::setFilter: note special filter syntax, allow unnamed filters

The API dox referred to QFileDialog::setNameFilters for the syntax to use
which is "Comment (file pattern)". The internal logic though expects
the old KDE style syntax "file pattern|Comment".

For more compatibility with Qt also allow name/comment-less filters by
handling of non-existing "|" hit in the filter parsing.
Related: bug 369542
(cherry picked from commit 6e945ed1dc01ffbaf30455341cff0ba945877255)

M  +6    -4    src/widgets/kurlrequester.cpp
M  +8    -2    src/widgets/kurlrequester.h

https://invent.kde.org/frameworks/kio/-/commit/a7e865aa41acdb83dd625c68dd8f0d16e7f6dc0d