https://bugs.kde.org/show_bug.cgi?id=403250

            Bug ID: 403250
           Summary: QFileDialog::getOpenFileName() doesn't show UDisks
                    drives in a places panel
           Product: frameworks-kio
           Version: 5.54.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Places
          Assignee: fa...@kde.org
          Reporter: equ...@gmail.com
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

SUMMARY
If you open QFileDialog in KDE (which uses KFileWidget internally, I believe)
via QFileDialog::getOpenFileName() it doesn't show UDisks drivers. If use
QFileDialog::getOpenFileUrl(), it shows them. I did some research and
discovered this is due to the fact that QFileDialog::getOpenFileName() does
setSupportedSchemes({"file"}) (likely to show only local files) and KFileWidget
shows UDisks drives only if supportedSchemes is empty because device bookmarks
don't have an URL attached to them.
See:
https://github.com/KDE/kio/blob/master/src/filewidgets/kfileplacesmodel.cpp#L680
https://github.com/KDE/kio/blob/master/src/filewidgets/kfileplacesmodel.cpp#L699
https://github.com/KDE/kio/blob/master/src/filewidgets/kfileplacesitem.cpp#L328

I'm not sure if this is intented behaviour, but some programs use
QFileDialog::getOpenFileName() to open files (e.g. qBittorrent) and this is
quite annoying.

STEPS TO REPRODUCE
1. Open a QFileDialog using QFileDialog::getOpenFileName() or call
setSupportedSchemes({"file"}) on it manually.

OBSERVED RESULT
No UDisks drives in a sidebar

EXPECTED RESULT
There should UDisks drivers in a sidebar, since they are local and thus should
be shown by QFileDialog::getOpenFileName().

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.1
Qt Version: 5.11.3

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to