Bug 362440 - can not choose files to compare
Summary: can not choose files to compare
Status: RESOLVED FIXED
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: 4.1.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kompare developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-28 20:00 UTC by RJ
Modified: 2017-03-18 15:00 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 17.04


Attachments
Patch to allow selecting files (1.01 KB, patch)
2016-05-25 18:15 UTC, Wolfgang Bauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJ 2016-04-28 20:00:17 UTC
Can not choose files to compare with "Compare files" on panel.



Reproducible: Always

Steps to Reproduce:
1. Start Kompare
2. Choose 2 files to compare (ex. txt file foermat)
3. Click "Compare files" on panel
4. Click "Browse file" on Source
5. No ability to choose any txt file

Actual Results:  
No ability to choose files

Expected Results:  
Ability to choose files.
Comment 1 Laptander 2016-05-17 13:20:31 UTC
I can confirm.
First time you start application, you are able to choose files in dialog.
But when you want to compare another files while main window of application exists, you cannot see files in dialog.
You can still type file name manually in name field, if you remember how file is named.
I suspect that wrong filter (or how it is called) is used. It displays only catalogs, but not files.
Comment 2 Wolfgang Bauer 2016-05-25 18:15:23 UTC
Created attachment 99190 [details]
Patch to allow selecting files

It's the same problem as in bug#351782.

Making the same change in slotFileCompareFiles() and slotFileBlendURLAndDiff() (in kompare_shell.cpp) would "fix" it (see attached patch), but then you can't open/compare directories any more.

Also, IMHO kompare does nothing wrong. It does set the options to allow selecting files *and* folders, somehow this results in files not being displayed.
For me it seems to be a bug in the file dialog/KUrlRequester. Maybe this is not supported any more, KUrlRequester uses QFileDialog in KF5, while it used KFileDialog in KDE4... QFileDialog apparently just does not allow to select files and directories at the same time.

Maybe an acceptable fix would be to offer two buttons in the "Compare Files" dialog, one to choose a file and one to choose a directory?
Comment 3 Laptander 2016-05-25 20:43:13 UTC
Thank you for patch.
I think adding additional button called "Compare Directories" is nice solution for now. But I think the whole behavior of comparing directories should be changed. I mean now when I prompt from terminal "konsole dir_a dir_b", then it only will show one file at a time. I cannot see directory structiure, but can only swith to next file. 
I saw how it was implemented in Beyond Compare (proprietary analog of Kompare). It uses tree structure view, base directories are located in left and right separated panels (there is such view in dolphin), and directories, which contains not-identical files are markered with special color. And when you click file in that structure, actuall diff will open in new tab. And some other cool features, like choosing what to show: only non-identical, only identical or all.

But for now, we should at least recover broken functionality. Do you know how to add a new button? Btw, in start dialog you should be able to start from comparing folder dialog.
Comment 4 Kevin Kofler 2016-05-27 10:56:20 UTC
You shouldn't be able to select directories. Kompare used to just crash if you tried to compare directories.
Comment 5 Laptander 2016-05-27 14:54:45 UTC
(In reply to Kevin Kofler from comment #4)
> You shouldn't be able to select directories. Kompare used to just crash if
> you tried to compare directories.

No, I am able to compare two directories if I use terminal.
Also, in wikipedia they say about it: https://en.wikipedia.org/wiki/Kompare#Comparing_directories
Comment 6 Wolfgang Bauer 2017-03-18 15:00:17 UTC
(In reply to Wolfgang Bauer from comment #2)
> Maybe an acceptable fix would be to offer two buttons in the "Compare Files"
> dialog, one to choose a file and one to choose a directory?

This has been done now:
https://phabricator.kde.org/D5096

And that fixes the problem reported here as well.
(it also reverts the "fix" for bug#351782, as it is possible to choose both files *and* folders now)