Bug 400190 - No notification (or automatic reload) when file changed on disk
Summary: No notification (or automatic reload) when file changed on disk
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: editor (show other bugs)
Version: 2.9.92
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-23 10:38 UTC by André Nichterlein
Modified: 2018-11-01 06:53 UTC (History)
1 user (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 André Nichterlein 2018-10-23 10:38:20 UTC
SUMMARY
When changing a file on disk, kile behaves oddly (no notification, sometimes a reload)

STEPS TO REPRODUCE
1. Open a document in kile and in kate (or other text editor)
2. Change something in kate and save (change file on disk)
3. Go to kile 
4. Change something in kate and save
5. Go to kile
6. Go to step 4

OBSERVED RESULT
In step 3, Kile reloaded the file and the changes made in kate are displayed.
When 
In step 5, nothing happened (also after repeating steps 4 and 5 a couple of times.)

EXPECTED RESULT
Changes in files should always be notified

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.12.6
KDE Frameworks Version: 5.44.0
Qt Version: 5.9.5

ADDITIONAL INFORMATION
behaviour observed in kile 2.9.91 and 2.9.92 (beta 1 & 2)
In current master branch kile gives a notification every second change and reloads (without notification) every other change.
Comment 1 Michel Ludwig 2018-10-28 16:37:07 UTC
Git commit dcacd830f47f7e942e4c57712bd00a8a93306e3a by Michel Ludwig.
Committed on 28/10/2018 at 16:35.
Pushed by mludwig into branch 'master'.

Don't call 'KDirWatch::stopScan()'

KDirWatch maintains one global watch list per application only. Calling
'stopScan' could therefore affect other code paths that make use of
KDirWatch (other loaded KParts, for example).

M  +11   -5    part.cpp

https://commits.kde.org/okular/dcacd830f47f7e942e4c57712bd00a8a93306e3a
Comment 2 Michel Ludwig 2018-10-28 16:37:49 UTC
To make use of this fix right away, you will have to compile & install Okular's master branch.
Comment 3 Robert Bredereck 2018-10-30 18:07:34 UTC
Thanks Michel for the fix. First tests indicate that it solves the problem.

I've created a backport of the upstream patch for the current okular version in ubuntu lts (18.04):
https://launchpad.net/~rbredereck/+archive/ubuntu/okular-patched-for-kile3

If the problem is really solved, I will annoy the ubuntu maintainers to include it as well.
Comment 4 Michel Ludwig 2018-11-01 06:53:30 UTC
Git commit 2ea44c5291d80300f711fc5adaac833b2297d3d8 by Michel Ludwig.
Committed on 01/11/2018 at 06:48.
Pushed by mludwig into branch 'master'.

Fix KDirWatch problem description in Part::setWatchFileModeEnabled

The problem is actually not the global watch list in KDirWatch, but
KDirWatch::stopScan causes unintended side effects via KDirWatchPrivate::_isStopped.

This bug is tracked in bug report 400541.

M  +2    -3    part.cpp

https://commits.kde.org/okular/2ea44c5291d80300f711fc5adaac833b2297d3d8