| Summary: |
Document in API for KRecentFilesAction::addAction that temp files are ignored |
| Product: |
[Frameworks and Libraries] frameworks-kconfigwidgets
|
Reporter: |
Rick Wagner <rjwgnr27> |
| Component: |
general | Assignee: |
kdelibs bugs <kdelibs-bugs-null> |
| Status: |
RESOLVED
FIXED
|
|
|
| Severity: |
wishlist
|
CC: |
a.samirh78
|
| Priority: |
NOR
|
|
|
| Version First Reported In: |
5.70.0 | |
|
| Target Milestone: |
--- | |
|
| Platform: |
Fedora RPMs | |
|
| OS: |
Linux | |
|
|
Latest Commit:
|
https://invent.kde.org/frameworks/kconfigwidgets/commit/c12e0b8b858119b6c6a66ad6016fe92ffe998e02
|
Version Fixed/Implemented In:
|
|
|
Sentry Crash Report:
|
|
| |
SUMMARY Developing an app which uses KRecentFilesAction, I did my debug testing storing a file in /tmp/xxx.json, where added it to a KRecentFilesAction, using addUrl(). When I went to the associated "Open Recent..." menu entry, and found it greyed out. Spent hours looking at the creation of the action (through KXmlGuiClien::actionCollection()->addAction() and other permutations). Finally looked at the source for KRecentFilesAction::addAction() and found where the code quietly discards files in the temp directory: if (url.isLocalFile() && url.toLocalFile().startsWith(QDir::tempPath())) { return; } While this makes some sense, "favors" done by the code should be documented. Some note to this effect should be in the API for the widget. STEPS TO REPRODUCE 1. create an app using a KRecentFilesAction action 2. add a QUrl to a local file stored in the temp path 3. wonder why it does not show up in the recent files list OBSERVED RESULT 1. File mysteriously does not show up in the recents list EXPECTED RESULT 1. It should not be a mystery, as behavior should be documented. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION