[Kompare] Fix the file choosing dialog not handling folders to compare anymore
ClosedPublic

Authored by jsalatas on Mar 18 2017, 11:09 AM.

Details

Summary

Add appropriate buttons to open a QFileDialog in which you could select either files or folders depending on the clicked button.

BUG: 365034

Test Plan

It compiles and works as it should.

Before

After

Diff Detail

Repository
R454 Kompare
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jsalatas created this revision.Mar 18 2017, 11:09 AM
jsalatas edited the test plan for this revision. (Show Details)Mar 18 2017, 11:26 AM
kkofler retitled this revision from [Kompare] The Filechoosing-dialoug cannot handly folders to compare anymore to [Kompare] Fix the file choosing dialog not handling folders to compare anymore.Mar 18 2017, 11:52 AM
kkofler edited the summary of this revision. (Show Details)
kkofler accepted this revision.Mar 18 2017, 11:56 AM

Fine with me. I'm not sure what the VDG would say about the UI design, but I cannot think of a better solution either, so I think this is OK.

This revision is now accepted and ready to land.Mar 18 2017, 11:56 AM
This revision was automatically updated to reflect the committed changes.
wbauer added a subscriber: wbauer.Mar 18 2017, 1:56 PM
wbauer added inline comments.
libdialogpages/filespage.cpp
140

Shouldn't this be an OR ( | ) instead?

This even fails to build with gcc6:
error: invalid conversion from 'int' to 'QFileDialog::Option' [-fpermissive]

Not really relevant for the current functionality, but:

libdialogpages/filespage.cpp
189–193

I think it would be more correct to hide the button if KFile::Directory is not specified, instead of if the mode is (KFile::File | KFile::ExistingOnly).

I.e. something like:
if ( (mode & KFile::Directory) == 0 )
(untested though)

199–203

Same here

jsalatas marked 3 inline comments as done.Mar 18 2017, 8:04 PM
jsalatas added inline comments.
libdialogpages/filespage.cpp
140

My bad. I actually needed just QFileDialog::ReadOnly

Fixed and committed.

189–193

Indeed! It's better this way.

Fixed and committed.