Open File: Use KEncodingFileDialog only under KDE
ClosedPublic

Authored by kfunk on Dec 3 2015, 12:32 AM.

Details

Summary

User native dialogs elsewhere (uses native file dialogs on other
DEs/platforms)

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kfunk updated this revision to Diff 1438.Dec 3 2015, 12:32 AM
kfunk retitled this revision from to Open File: Use KEncodingFileDialog only under KDE.
kfunk updated this object.
kfunk edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptDec 3 2015, 12:32 AM
kfunk added a reviewer: KDevelop.EditedDec 3 2015, 12:33 AM
kfunk added a project: KDevelop.

Similar approach is used in Krita: https://forum.kde.org/viewtopic.php?f=139&t=122937

amccann accepted this revision.Dec 4 2015, 2:24 AM
amccann added a reviewer: amccann.
amccann added a subscriber: amccann.

Tested on OSX, commented on a minor issue inline.

shell/documentcontroller.cpp
147

On OSX, having tried this patch, this QFileDialog::getOpenFileUrls() does succeed in presenting a native 'open file' dialog.

However, the 'filter' argument doesn't work as desired. It just displays the raw "*|Text File" string, which looks out of place, and doesn't cause any filtering.

http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileNames

QT documentation appears to want a different syntax for filters. I tried the following just to verify understanding:

"Text Files (*);;C Files(*.c)"

It worked.

However, when it is reduced to:

"Text Files (*)"

Something it optimizing away the filter altogether, resulting in no filter functionality. (Which is probably fine).

Given this knowledge: It may make sense to not pass any filter at all, since it isn't actually filtering anything. It appears to simply be a placeholder for the Widget that is present on KDE dialog.

This revision is now accepted and ready to land.Dec 4 2015, 2:24 AM
kfunk added a comment.Dec 4 2015, 7:54 AM

Pushed.

Thanks a lot for the detailed analysis, didn't check thoroughly on my Windows box.

This revision was automatically updated to reflect the committed changes.