Bug 287355 - JJ: Read-only mode should not prompt but auto reload when externally edited a file
Summary: JJ: Read-only mode should not prompt but auto reload when externally edited a...
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: editor integration (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2011-11-23 09:52 UTC by Dirk Wallenstein
Modified: 2014-02-01 11:06 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wallenstein 2011-11-23 09:52:39 UTC
Version:           4.2.3 (using KDE 4.7.2) 
OS:                Linux

I thought that the read-only mode could be more useful when editing files in a different editor if the files would be automatically reloaded without prompting the user -- maybe optionally.


Reproducible: Always

Steps to Reproduce:
- turn on read only mode
- edit current file externally
- return to kdevelop

Actual Results:  
prompts for reload

Expected Results:  
flash bang notification telling me file got reloaded. Maybe some thunder sound.
Comment 1 Aleix Pol 2012-01-18 00:58:16 UTC
Made it a Junior Job.
Comment 2 Amarvir Singh 2014-01-31 22:27:17 UTC
Pretty sure this is an issue of katepart, and not kdevplatform.
Comment 3 Kevin Funk 2014-02-01 08:15:56 UTC
Sven might have an idea here, as he did the auto-reload-on-git-changes thingie.
Comment 4 Sven Brauch 2014-02-01 10:13:19 UTC
Could someone enlighten me what the usecase for this is? In which case do you have files in read-only mode and then edit them in another editor? I don't understand the "read-only mode"  thing.

In general I'm strongly against introducing cases of reloading files in cases where potential data loss can occur. What is an "external editor"? Is "cat" an editor? How would you even know how the file was edited?

The "reload?" dialog has saved me from data loss more than once, especially when redirecting output of some tool to the wrong file.

Greetings,
Sven
Comment 5 Sven Brauch 2014-02-01 10:17:40 UTC
If you want to reduce message spam even further (for me it's very reasonable since the git-reload patch), I have had another idea, which would be automatically reloading files on change, but saving a copy of the old file somewhere (e.g. /tmp), and displaying a passive popup in the document that it was reloaded but a copy of the old buffer was saved somewhere. That is potentially problematic for large files, though.
Comment 6 Dirk Wallenstein 2014-02-01 10:29:20 UTC
The idea was to a edit with vim/emacs and use kdevelop for auxiliary tasks like linting, building, etc.  Things kdevelop offers.  Anyway, this was just an idea while exploring kdevelop and and I don't use it right now.  So, given scarcity of resources, don't worry about this too much.
Comment 7 Sven Brauch 2014-02-01 10:53:17 UTC
That's a strange usecase. I don't think there's sufficient interest in this workflow to justify implementing this feature. It's just not within the (large, but still limited) scope of what KDevelop is intended to be used for.
But especially, it would be unreasonably hard to implement this in a way such that it doesn't interfere with other workflows. And doing it only when read-only mode is enabled is -- in my eyes -- a totally arbitrary choice without much logical motivation.

If you really want to do this, you should rather hack it together from outside using our dbus interfaces; e.g. when your external editor changes a file, it could call a script which forces KDevelop to reload that file (there's no force reload method, but you could save the old buffer to /tmp/test.txt and then issue a reload call; would probably work well enough).

I'd close this bug as invalid, ok?

Greetings,
Sven
Comment 8 Dirk Wallenstein 2014-02-01 11:06:01 UTC
Sure

Greetings