Summary: | Recently used files cannot be chosen in file pickers | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | ph |
Component: | Open/save dialogs | Assignee: | KIO Bugs <kio-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bugseforuns, kdelibs-bugs, meven29, nate, sephiroth_pk |
Priority: | VHI | Keywords: | regression |
Version: | 5.98.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kio/-/commit/2386f3304c8ea0f2cda0baa0d31ee1f9248951d1 | Version Fixed In: | 5.109 |
Sentry Crash Report: | |||
Attachments: | Screenshot of the error |
Description
ph
2022-09-21 10:27:03 UTC
Are you talking about the KDE file picker or the GTK one? Can you attach a screenshot of it? Created attachment 152360 [details]
Screenshot of the error
(In reply to Nate Graham from comment #1) > Are you talking about the KDE file picker or the GTK one? Can you attach a > screenshot of it? I think I'm talking about the KDE file picker. Firefox showed me the GTK one until I changed FF settings as described in the OP. Screenshot added! Thanks, looks like the KDE one. Can reproduce the issue. *** Bug 459563 has been marked as a duplicate of this bug. *** Is the bug only for portal dialogs ? The screenshot shows the portal File picker is used. (In reply to Méven Car from comment #6) > Is the bug only for portal dialogs ? > The screenshot shows the portal File picker is used. No, the behaviour is the same when using e.g. Kate. Notes for bug resolver: The bug is due to the fact that recentlyused:/ can contain several time a file with the same filename. But those files still need to be identified individually. Furthermore the order is determined by the underlying query to kactivitiesStats. We have a mechanism in KIO to hide the technical name to the user, when we fill UDS_DISPLAY_NAME, the name is only revealed when displaying its real url or path. Currently recentlyused:/ code is exploiting this but this can't fulfill the need here. To get to identify files individually (this is also a requirement of using KDirOperator/KDirModel), -n is appended to the url where n is the number of the row is added to the technical name. This allows recentlyused to be able to decode and identify files with urls such `recentlyused:/files/CMakeLists.txt-10` . This mostly works in dolphin. But FileWidget (KIO File picker) needs to return urls or path to its user, so it bluntly return the technical url. recentlyused:/ fills UDS_LOCAL_PATH and UDS_TARGET_URL, but we lack a way to make FileWidget use it instead (this is done is `KDirOperator::selectDir` for instance). FileWidgets also expects those urls to be filled in the selecturl bar correctly and can cause some other incompatibility issues. This behavior (hence) this regression was added in https://invent.kde.org/network/kio-extras/-/merge_requests/158/diffs. (In reply to Méven Car from comment #8) > Notes for bug resolver: > > The bug is due to the fact that recentlyused:/ can contain several time a > file with the same filename. But those files still need to be identified > individually. Furthermore the order is determined by the underlying query to > kactivitiesStats. > We have a mechanism in KIO to hide the technical name to the user, when we > fill UDS_DISPLAY_NAME, the name is only revealed when displaying its real > url or path. Currently recentlyused:/ code is exploiting this but this can't > fulfill the need here. To get to identify files individually (this is also a > requirement of using KDirOperator/KDirModel), -n is appended to the url > where n is the number of the row is added to the technical name. This allows > recentlyused to be able to decode and identify files with urls such > `recentlyused:/files/CMakeLists.txt-10` . > > This mostly works in dolphin. But FileWidget (KIO File picker) needs to > return urls or path to its user, so it bluntly return the technical url. > recentlyused:/ fills UDS_LOCAL_PATH and UDS_TARGET_URL, but we lack a way to > make FileWidget use it instead (this is done is `KDirOperator::selectDir` > for instance). FileWidgets also expects those urls to be filled in the > selecturl bar correctly and can cause some other incompatibility issues. > > This behavior (hence) this regression was added in > https://invent.kde.org/network/kio-extras/-/merge_requests/158/diffs. Considering the "recent files" functionality is quite essential and we're still without it almost one year later, wouldn't it be advisable to revert the linked merge request to restore the "recent files" functionality? I would argue that having the ability to forget recent files is not useful if we cannot use the main functionality at all. (In reply to Riccardo Robecchi from comment #9) > (In reply to Méven Car from comment #8) > > Notes for bug resolver: > > > > The bug is due to the fact that recentlyused:/ can contain several time a > > file with the same filename. But those files still need to be identified > > individually. Furthermore the order is determined by the underlying query to > > kactivitiesStats. > > We have a mechanism in KIO to hide the technical name to the user, when we > > fill UDS_DISPLAY_NAME, the name is only revealed when displaying its real > > url or path. Currently recentlyused:/ code is exploiting this but this can't > > fulfill the need here. To get to identify files individually (this is also a > > requirement of using KDirOperator/KDirModel), -n is appended to the url > > where n is the number of the row is added to the technical name. This allows > > recentlyused to be able to decode and identify files with urls such > > `recentlyused:/files/CMakeLists.txt-10` . > > > > This mostly works in dolphin. But FileWidget (KIO File picker) needs to > > return urls or path to its user, so it bluntly return the technical url. > > recentlyused:/ fills UDS_LOCAL_PATH and UDS_TARGET_URL, but we lack a way to > > make FileWidget use it instead (this is done is `KDirOperator::selectDir` > > for instance). FileWidgets also expects those urls to be filled in the > > selecturl bar correctly and can cause some other incompatibility issues. > > > > This behavior (hence) this regression was added in > > https://invent.kde.org/network/kio-extras/-/merge_requests/158/diffs. > > Considering the "recent files" functionality is quite essential and we're > still without it almost one year later, wouldn't it be advisable to revert > the linked merge request to restore the "recent files" functionality? I > would argue that having the ability to forget recent files is not useful if > we cannot use the main functionality at all. I have spent some time trying to fix this, it can be fixed. I will get at it again. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1331 (In reply to Méven Car from comment #10) > I have spent some time trying to fix this, it can be fixed. I will get at it > again. Thank you for your work, Méven, it is always deeply appreciated. Git commit ca5e0796f84c37efe69f323f0072a601af34abbf by Méven Car. Committed on 29/06/2023 at 07:24. Pushed by meven into branch 'master'. KFileWidget: Use targetUrl to extract urls, better handle absolute urls cases M +34 -2 autotests/kfilewidgettest.cpp M +23 -16 src/filewidgets/kfilewidget.cpp M +17 -0 tests/kfilewidgettest_gui.cpp https://invent.kde.org/frameworks/kio/-/commit/ca5e0796f84c37efe69f323f0072a601af34abbf (In reply to Méven from comment #13) > Git commit ca5e0796f84c37efe69f323f0072a601af34abbf by Méven Car. > Committed on 29/06/2023 at 07:24. > Pushed by meven into branch 'master'. > > KFileWidget: Use targetUrl to extract urls, better handle absolute urls cases > > M +34 -2 autotests/kfilewidgettest.cpp > M +23 -16 src/filewidgets/kfilewidget.cpp > M +17 -0 tests/kfilewidgettest_gui.cpp > > https://invent.kde.org/frameworks/kio/-/commit/ > ca5e0796f84c37efe69f323f0072a601af34abbf I have a backport to KF5 https://invent.kde.org/frameworks/kio/-/merge_requests/1339 Git commit 2386f3304c8ea0f2cda0baa0d31ee1f9248951d1 by Méven Car, on behalf of Méven Car. Committed on 07/07/2023 at 07:15. Pushed by meven into branch 'kf5'. KFileWidget: Use targetUrl to extract urls, better handle absolute urls cases (cherry picked from commit ca5e0796f84c37efe69f323f0072a601af34abbf) M +34 -2 autotests/kfilewidgettest.cpp M +19 -13 src/filewidgets/kfilewidget.cpp M +18 -0 tests/kfilewidgettest_gui.cpp https://invent.kde.org/frameworks/kio/-/commit/2386f3304c8ea0f2cda0baa0d31ee1f9248951d1 not fixed in frameworks 5.108. Operating System: Arch Linux KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.108.0 Qt Version: 5.15.10 Graphics Platform: Wayland (In reply to Patrick Silva from comment #16) > not fixed in frameworks 5.108. > > Operating System: Arch Linux > KDE Plasma Version: 5.27.6 > KDE Frameworks Version: 5.108.0 > Qt Version: 5.15.10 > Graphics Platform: Wayland The fix did not make it to 5.108, it will be in 5.109. |