Bug 401064 - Temp files created instead open real files when comparing file content differences
Summary: Temp files created instead open real files when comparing file content differ...
Status: CONFIRMED
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: 2.7.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-15 11:36 UTC by Rafael Linux User
Modified: 2020-05-15 23:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Linux User 2018-11-15 11:36:13 UTC
SUMMARY
Usually I compared files using Kompare, Kdiff and, the best one for me, Meld. I have installed kio-extras. Problem is that krusader, when comparing remote files (ftp) only works really with original files when using Kdiff. When using Kompare or Meld, Krusader creates temporal files (/tmp/krusader.XXXXX) instead open real one, so any change I save to the files, really will not be saved on the original paths. This is a big issue.

STEPS TO REPRODUCE
1. Configure Krusader to use Kompare or Meld as file comparing tool
2. Select two remote (ftp or sftp) files and compare then with "File, Compare by content"
3. Observe filenames of opened files in Kompare / Meld
4. Make any change to one or both files
5. Close Kompare / Meld
6. Open saved files to check your changes

OBSERVED RESULT
Changes are not saved to original files.

EXPECTED RESULT
Changes made to files should be saved to original ones

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Plasma 5.12.6
KDE Frameworks 5.45.0
Qt 5.9.4 (compilado con 5.9.4)

ADDITIONAL INFORMATION
Comment 1 Davide Gianforte 2019-07-12 16:50:29 UTC
The code confirm your analysis (KRslots::compareContent(const QUrl&, const QUrl&)). Only Kdiff works on remote files - and their url must not have spaces.

I thought two ways to solve this situation:

- we can let the diff utility to handle files with the original path, anyway any password would be cleared and you'll have to insert it again; less code to write, any bugs should be opened to the util devs;

- whenever the local file changes are saved, Krusader will ask to copy it on the original location; this will require to write more code;

I'll investigate and make some test for the first solution.
Comment 2 Alex Bikadorov 2019-10-20 19:55:18 UTC
Kompare is supporting KIO protocols. So simply doing the same "whitelisting" as for kdiff would make it work as well. (Done in KRslots::compareContent() i think).

But Meld (actually also my favourite diff app) is GTK based and adding write support for it (and other diff tools) is complicated as Davide wrote.
Comment 3 Rafael Linux User 2019-10-21 08:34:32 UTC
I understand that indeed, is not a bug of Krusader, but of Plasma. I reported and discussed about it several times in some threads like this 
https://bugs.kde.org/show_bug.cgi?id=75324 
It's October now, so ... it's supposed it should be solved but, is it?? I understand that is not, cause the linked thread is not closed. I'm bored to claim for a fix for a bug that affect to all work depending on KIO, including Krusader.

Thank you anyway for your consideration
Comment 4 Alex Bikadorov 2019-10-27 19:12:14 UTC
Kompare will be added as application supporting KIO (https://phabricator.kde.org/D24987).

For the write support for non-KIO applications KioFuse (https://techbase.kde.org/Projects/KioFuse) would be -as you pointed out- the general solution. So to be honest i don't think somebody will implement this as new feature in Krusader.
Comment 5 Rafael Linux User 2019-10-27 21:17:22 UTC
Thank you @Alex. I understand your situation. If you read  the thread I posted, you will understand why I'm more frustated each day with KDE (Plasma) and Gnome. Instead of work togheter to solve issues, they let developers and users to fight with system base issues at their own. That is not the best way to get more users to use Linux desktops. Very sad.  :(
Comment 6 Toni Asensi Esteve 2020-05-15 23:51:47 UTC
Git commit d8a5556e65ab376f3096859932d6956c0f471675 by Toni Asensi Esteve, on behalf of Alexander Bikadorov.
Committed on 15/05/2020 at 23:47.
Pushed by asensi into branch 'master'.

Add Kompare as compare application with KIO support

It can use the original KIO URLs. No need for using temporary local files.
And remove the obsolete space character check for file paths for KDiff3.

Differential Revision: https://phabricator.kde.org/D24987

M  +3    -3    krusader/krslots.cpp

https://commits.kde.org/krusader/d8a5556e65ab376f3096859932d6956c0f471675