Bug 329101 - KDirWatch sends unrequested created / deleted signals for file
Summary: KDirWatch sends unrequested created / deleted signals for file
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kdecore (show other bugs)
Version: 4.12.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-21 23:35 UTC by Lars
Modified: 2023-02-09 03:54 UTC (History)
1 user (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 Lars 2013-12-21 23:35:43 UTC
The problem can be exhibited in kate, but I believe the problem is with KDirWatch.
If a plugin watches the same file as kate is editing, then, when kate removes the file from its own KDirWatch instance before saving ( it adds it back again after ) it receives created/deleted signals for the file.

I haven't proven to my own satisfaction that kate 3.12.0 isn't actually overwritting the file with a temporary every time you safe but still Kate has to my knowledge not requested a dir watch.

These extra signals send messes kate's save dialog up.

I believe, but I'm not sure, this has been fixed in this commit to the frameworks branch. http://osdir.com/ml/kde-commits/2013-11/msg06464.html

If I have handled this bug report wrong, etc. I would be very pleased with any advice on how to report it better.

Reproducible: Always

Steps to Reproduce:
The for me easiest way to reproduce is with kate and python plugins.
1. Enable IPython console in the Pate plugin.
2. Open the console and run the following with a existing file.

 from PyKDE4.kio import KDirWatch; KDirWatch.self().addFile("/home/lars/bugs.txt")

3. Now open the file and change it, notice the dialog about it having been created outside kate.
Actual Results:  
If you watch the console, and have enable KDirWatch debug output you'll see something like:

QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
kate(10268)/kio (KDirWatch) KDirWatchPrivate::KDirWatchPrivate: INotify available:  true
/usr/lib/python3.3/site-packages/IPython/frontend.py:30: UserWarning: The top-level `frontend` package has been deprecated. All its subpackages have been moved to the top `IPython` level.
  warn("The top-level `frontend` package has been deprecated. "
kate(10268)/kdeui (KAction) KSelectAction::setCurrentAction: Action does not have the correct properties to be current: "" 
kate(10268)/kio (KDirWatch) KDirWatchPrivate::addEntry: Added File "/home/lars/bugs.txt" for "" ["KDirWatch-1"]
kate(10268)/kio (KDirWatch) KDirWatchPrivate::addEntry: Added Dir "/home/lars" for "/home/lars/bugs.txt" [""]
kate(10268)/kio (KDirWatch) KDirWatch::setDeleted: "KDirWatch-2" emitting deleted "/home/lars/bugs.txt"
kate(10268)/kio (KDirWatch) KDirWatch::setDeleted: "KDirWatch-1" emitting deleted "/home/lars/bugs.txt"
kate(10268)/kio (KDirWatch) KDirWatch::setCreated: "KDirWatch-2" emitting created "/home/lars/bugs.txt"
kate(10268)/kio (KDirWatch) KDirWatch::setCreated: "KDirWatch-1" emitting created "/home/lars/bugs.txt"
Comment 1 Christoph Feck 2013-12-22 12:46:38 UTC
Kate uses KSaveFile, which could be the cause for what you see.
Comment 2 Lars 2013-12-22 14:30:08 UTC
(In reply to comment #1)
> Kate uses KSaveFile, which could be the cause for what you see.
I agree, it might very well be the cause for the signals, but not for these dir watche's seeing them.

I have modifyed the subject line to reflect that.

Especially the KDirWatch created from IPhython shouldn't see them. I tried again not using KDirWatch::self but a new object instead, still getting the same result.

Using: 
     from PyKDE4.kio import KDirWatch; w = KDirWatch(); w.addFile("/home/lars/bugs.txt")

I got:

QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
kate(25100)/kio (KDirWatch) KDirWatchPrivate::KDirWatchPrivate: INotify available:  true
/usr/lib/python3.3/site-packages/IPython/frontend.py:30: UserWarning: The top-level `frontend` package has been deprecated. All its subpackages have been moved to the top `IPython` level.
  warn("The top-level `frontend` package has been deprecated. "
kate(25100)/kdeui (KAction) KSelectAction::setCurrentAction: Action does not have the correct properties to be current: "" 
kate(25100)/kio (KDirWatch) KDirWatchPrivate::addEntry: Added File "/home/lars/bugs.txt" for "" ["KDirWatch-1"]
kate(25100)/kio (KDirWatch) KDirWatchPrivate::addEntry: Added Dir "/home/lars" for "/home/lars/bugs.txt" [""]
kate(25100)/kio (KDirWatch) KDirWatch::setDeleted: "KDirWatch-2" emitting deleted "/home/lars/bugs.txt"
kate(25100)/kio (KDirWatch) KDirWatch::setDeleted: "KDirWatch-1" emitting deleted "/home/lars/bugs.txt"
kate(25100)/kio (KDirWatch) KDirWatch::setCreated: "KDirWatch-2" emitting created "/home/lars/bugs.txt"
kate(25100)/kio (KDirWatch) KDirWatch::setCreated: "KDirWatch-1" emitting created "/home/lars/bugs.txt"
Comment 3 Andrew Crouthamel 2018-11-11 04:33:23 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Andrew Crouthamel 2018-11-21 04:38:33 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Justin Zobel 2023-01-10 01:52:02 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 6 Bug Janitor Service 2023-01-25 05:05:53 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2023-02-09 03:54:05 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!