| Summary: | Open and save dialogs always set preview to false at startup | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Akseli Lahtinen <akselmo> |
| Component: | Open/save dialogs | Assignee: | KIO Bugs <kio-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kdedev, kdelibs-bugs-null, nate |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/frameworks/kio/-/commit/e482885ba1ed4d89862821764207c72e4e1833a5 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
On your system, what's the value of `m_viewAdapter->iconSize()` when this happens? It's QIcon(-1,-1) typo, its QSize(-1,-1) I'm not able to reproduce this with Kate built from and run from master 1. Create a new file in Kate. Open the Save As dialog 2. Enable the preview button 3. Save or cancel 4. Open the dialog again The preview button is still shown, and I still see file previews Note that the view is Details View on my system, but I tested Icon and Compact as well, and couldn't reproduce with those either How did it get an invalid QSize? What does `grep -r IconSize ~/.config/kdeglobals` say? (In reply to Nate Graham from comment #5) > How did it get an invalid QSize? What does `grep -r IconSize > ~/.config/kdeglobals` say? Replies empty. Seems i dont have IconSize text there. Which would imply the icon sizes are at their default values, which would imply the fallback value for this use case is broken. Does it stop happening if you change the icon size of the current view and close and re-open the dialog? Nope, the config is still empty too. Not whole config, just the IconSize grep So changing the icon size doesn't write anything to the config file. That seems like a bug too. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1851 Git commit e482885ba1ed4d89862821764207c72e4e1833a5 by Akseli Lahtinen. Committed on 28/03/2025 at 15:56. Pushed by akselmo into branch 'master'. KFileWidget and KDirOperator: Fix saving and loading preview settings KDirOperator would load the iconSize after creating previewGenerator, which asks the iconSize from KDirOperator. This would make the iconSize always be invalid in previewGenerator. KFileWidget would additionally toggle the action again, regardless of what the user setting is. It's better just to explicitly follow what the user setting is and toggle the button accordingly. The previewGenerator value would always override what the user value is otherwise. M +49 -0 autotests/kfilewidgettest.cpp M +1 -1 src/filewidgets/kdiroperator.cpp M +0 -5 src/filewidgets/kfilewidget.cpp https://invent.kde.org/frameworks/kio/-/commit/e482885ba1ed4d89862821764207c72e4e1833a5 |
SUMMARY When opening open-save dialog, the `KFilePreviewGenerator *pg = d->m_ops->previewGenerator();` initialization disables preview images due to invalid iconSize: ``` if (!m_viewAdapter->iconSize().isValid()) { m_previewShown = false; } ``` STEPS TO REPRODUCE 1. Save any file in Kate etc. 2. Enable the preview button 3. Save or cancel 4. Open the dialog again OBSERVED RESULT Preview is turned off. EXPECTED RESULT Preview would save it's state. SOFTWARE/OS VERSIONS Operating System: Fedora Linux 41 KDE Plasma Version: 6.3.80 KDE Frameworks Version: 6.13.0 Qt Version: 6.8.2 Kernel Version: 6.13.6-200.fc41.x86_64 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 3600 6-Core Processor Memory: 16 GiB of RAM (15.5 GiB usable) Graphics Processor: AMD Radeon RX 6600 ADDITIONAL INFORMATION Unsure why this fails to get the iconSize.