Summary: | kdialog --getopenfilename filter argument text is unclear, needs updated documentation change | ||
---|---|---|---|
Product: | [Applications] kdialog | Reporter: | Michael <kde> |
Component: | general | Assignee: | Brad Hards <bradh> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | john.b.little, naringas, shenlebantongying |
Priority: | NOR | ||
Version: | 22.12.3 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Michael
2023-03-28 01:42:38 UTC
> 2. To test this, type: > kdialog --getopenfilename ~/Downloads "*.jpg" The related code for wildcard match still exists, and this syntax still works: kdialog --getopenfilename ~/Downloads "Some Strings (*.jpg)" This is KDE's file dialog's bug. --- It seems plasma's file dialog doesn't support simple filter like "*.jpg" https://doc.qt.io/qt-6.4/qfiledialog.html#setNameFilter Compile code below with Qt5 will reproduce this bug ``` #include <QApplication> #include <QFileDialog> int main(int argc, char *argv[]) { QApplication a(argc, argv); // Doesn't work on KDE (only have problem on KDE) auto *dlg1 = new QFileDialog(); dlg1->setNameFilter("*.txt"); dlg1->exec(); // Works auto *dlg2 = new QFileDialog(); dlg2->setNameFilter("Force to work with KDE (*.txt)"); dlg2->exec(); return QApplication::exec(); } ``` Yes, it is KDE's file dialog bug. `kdialog --getopenfilename ~/Downloads "*.jpg"` works on xfce which has a different file dialog. Very good sleuthing. So how would we reassign this bug so that the developers in charge of the file dialog will see it? > So how would we reassign this bug so that the developers in charge of the file dialog will see it? I created a new one: https://bugs.kde.org/show_bug.cgi?id=470893 I think I found a related bug with --getexistingdirectory this used to work, I just updated to kdialog 23.04.3 and it no longer works as it used to (In reply to Baltasar Sanchez from comment #5) > I think I found a related bug with --getexistingdirectory > > this used to work, I just updated to kdialog 23.04.3 and it no longer works > as it used to I can verify that it doesn't seem to work, but maybe it should have it's own bug report to be tracked as a separate issue? This may have been fixed in: https://bugs.kde.org/show_bug.cgi?id=470893 Test this with the new KF6 release. The functionality is fixed in KF6: kdialog 24.02.0 works with both file extensions and mime-types. However, the docstring still says: --getopenfilename File dialog to open an existing file (arguments [startDir] [filter]) ...and "filter" is not clarified. It can now be "*.jpg" or "image/jpeg". Instead of just "[filter]", it would be clearer to say: "[Mimetype or file extension filter]" Do you mind sending a merge request on KDE's GitLab? It should be simple since it is just a string change. (In reply to shenlebantongying from comment #9) > Do you mind sending a merge request on KDE's GitLab? It should be simple > since it is just a string change. Thank you for the invitation, but I don't know how to do a merge request. A possibly relevant merge request was started @ https://invent.kde.org/documentation/develop-kde-org/-/merge_requests/351 A possibly relevant merge request was started @ https://invent.kde.org/utilities/kdialog/-/merge_requests/37 Great! Thank you so much and even for updating the documentation 🙏 |