Q4Wine file selectors filters files with upper case extension #94

Closed
knochenhans opened this Issue Oct 28, 2016 · 10 comments

Projects

None yet

3 participants

@knochenhans

Hi, hope this is the right place for bugs :)

The file selectors in Q4Wine filters away files which extension are in uppercase (e.g. "WINWORD.EXE"), which makes it cumbersome or even impossible to select such files, because there's no way to turn of the filter completely in the file selector.

I'm using Q4Wine 1.3.2.0 (git via AUR) on Arch Linux with MATE Desktop 1.16.1.

@brezerk
Owner
brezerk commented Oct 29, 2016

Hi Andre

Thank you for bug report.

Just wonder which one Qt library (4.x or 5.x) you are using with q4wine?

On Oct 29, 2016 1:38 AM, "Andre" notifications@github.com wrote:

Hi, hope this is the right place for bugs :)

The file selectors in Q4Wine filters away files which extension are in
uppercase (e.g. "WINWORD.EXE"), which makes it cumbersome or even
impossible to select such files, because there's no way to turn of the
filter completely in the file selector.

I'm using Q4Wine 1.3.2.0 (git via AUR) on Arch Linux with MATE Desktop
1.16.1.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#94, or mute the thread
https://github.com/notifications/unsubscribe-auth/AABdDNu9FMWJLb5CobxLc9fMTbrHECzbks5q4nlcgaJpZM4Kj7U_
.

@brezerk brezerk added the Bug label Oct 29, 2016
@brezerk brezerk self-assigned this Oct 29, 2016
@knochenhans

Hi, Q4Wine uses Qt 5.7.0 for me.

@brezerk
Owner
brezerk commented Oct 29, 2016

Hi @knochenhans

I just tried and I am able to see 'TEST.EXE' file in file selector.
screenshot_20161029_141343

Was testing both: File -> Run and Programs -> Run -> Browse...

Are you getting this error in some specific place?
Apparently it is good idea to have ability to disable the filters through =)

@knochenhans

I didn't do anything specific, happens to me with File -> Run and Programs -> Run -> Browse.... Here is a screenshot (with a lot files ending on EXE hidden). Not sure why my file selector looks completely different, seems the standard file selector from GTK3 is used in my case. Could this have something to do with the problem?

q4wine

@brezerk
Owner
brezerk commented Oct 29, 2016 edited

Yeah. Here can be an issue with this...

By default, the native file dialog is used unless you use a subclass of QFileDialog that contains the Q_OBJECT macro, or the platform does not have a native dialog of the type that you require.

So for KDE you will see File Dialog selector created by KDE team instead of Qt build-in.

Also, by default, file filters used with Qt/KDE file selectors are case insensitive: http://doc.qt.io/qt-5/qdir.html#Filter-enum unless QDir::CaseSensitive is set.

I have added All files (*) to all file selectors: 848783a so at least now, you will be able to workaround this.

Also, there is a possibility to force to use Qt build-in dialog, so if you wish, I can add an option for this.

@kakurasan
Contributor

I have the same problem (MATE 1.16.0, GTK+ filechooser). It seems uppercase extensions are needed in the filters, for example:

--- a/src/q4wine-gui/run.cpp
+++ b/src/q4wine-gui/run.cpp
@@ -340,7 +340,7 @@ void Run::cmdGetProgram_Click(){
     dialog.setWindowTitle(tr("Open Exe file"));
     dialog.setDirectory(searchPath);
     dialog.setFileMode(QFileDialog::ExistingFile);
-    dialog.setNameFilter(tr("Exe, MSI, BAT files (*.exe *.msi *.bat);;Exe files (*.exe);;MSI files (*.msi);;BAT files (*.bat);;All files (*)"));
+    dialog.setNameFilter(tr("Exe, MSI, BAT files (*.exe *.msi *.bat *.EXE *.MSI *.BAT);;Exe files (*.exe *.EXE);;MSI files (*.msi *.MSI);;BAT files (*.bat *.BAT);;All files (*)"));
     //dialog.setSidebarUrls(prefix_urls);

 #if QT_VERSION >= 0x040500
@brezerk
Owner
brezerk commented Oct 30, 2016

Hi @kakurasan

I have examined sources for some other Qt projects and none are defining filters with uppercase separately.

I believe this should be fixed in the MATE's file chooser code instead.

I can add uppercase definitions as a temporary workaround, but I will need you to provide a link to bug report for MATE project :)

@kakurasan
Contributor

This is a bug in Qt, not a DE-related bug.

I can see the files with uppercase extensions only when the filter "All files" is selected. This is not the expected behavior because all other filters don't work as expected (but I think adding "All files" is an enhancement).

there is a possibility to force to use Qt built-in dialog

This is easy but sounds not user-friendly for GTK+ Desktop Environment users.

@brezerk
Owner
brezerk commented Nov 1, 2016

ic. Anyway thanks for the link. Will add an workaround as requested.

@brezerk
Owner
brezerk commented Nov 1, 2016

workaround for https://bugreports.qt.io/browse/QTBUG-51712 has been added as requested: b7ae42c

Thanks for reporting. Reopen if needed.

@brezerk brezerk closed this Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment