Summary: | Kdialog returns wrong filter | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Rustam Safin <rustiksnegovik> |
Component: | Open/save dialogs | Assignee: | KIO Bugs <kio-bugs-null> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | cfeck, kdelibs-bugs, peter |
Priority: | NOR | ||
Version: | 5.54.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
URL: | http://pastebin.com/UxNhi88F | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Attaching the file from the pastebin in case the pastebin get deleted |
Description
Rustam Safin
2013-05-08 04:43:42 UTC
Can you clarify why you see this as a KDE bug? Your attached sample only uses QFileDialog. If you read http://qt-project.org/doc/qt-4.8/qfiledialog.html you will see: "The easiest way to create a QFileDialog is to use the static functions. On Windows, Mac OS X, KDE and GNOME, these static functions will call the native file dialog when possible." If you will run code above in Gnome DE it will run Gnome's own file dialog that return correct filter rather than in KDE. Created attachment 79810 [details]
Attaching the file from the pastebin in case the pastebin get deleted
I can reproduce this here. I get the wrong filter.
Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone! Dear Bug Submitter, This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand. Thank you for helping us make KDE software even better for everyone! This is still a problem with kio 5.54 / Qt 5.12.0 / Arch Linux. The important details are: - Two files have the same mask. - The mask is changed by the user before accepting the dialog. The KFileDialog class that is used by plasma-integration does not seem to respect the selected filter. Instead of reporting the actual selected filter, it seems to query for the first filter that has the same mask. The non-native Qt dialog does *not* have this problem. import sys from PyQt5.QtWidgets import QApplication, QFileDialog app = QApplication(sys.argv) filter = 'All Files (*.*);;Image (*.*);;Thing (*.txt)' options = QFileDialog.Option(0) #options = QFileDialog.DontUseNativeDialog name, newfilter = QFileDialog.getSaveFileName(None, "Title", "", filter, "", options) print(name, newfilter) Steps to reproduce: 0. Run the above Python script. 1. Enter any file name 2. Set filter to "Image" 3. Press OK. Expected results: Print the file name and "Image" Actual results: Print the filename and the first filter ("All Files"). |