Bug 370532 - [kioexec] KIO GDrive doesn't save changes to google docs if another Libreoffice window is open
Summary: [kioexec] KIO GDrive doesn't save changes to google docs if another Libreoffi...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.26.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 379477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-10-12 09:23 UTC by Antonio Rojas
Modified: 2017-05-04 08:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.34


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2016-10-12 09:23:00 UTC
When opening a google doc from kio-drive and modifying it (with libreoffice) usually kio-gdrive prompts to upload the changes when closing it. But this doesn't work if another libreoffice window is open on the system. The changes are silently lost.

Reproducible: Always

Steps to Reproduce:
1.Open a google doc from kio-gdrive with libreoffice while having another LO document open.
2.Modify, save and close the document

Actual Results:  
Changes are silently lost

Expected Results:  
Dialog prompts to upload the changes
Comment 1 Elvis Angelaccio 2016-10-12 16:50:58 UTC
I can reproduce, thanks for reporting. This is handled by kioexec, so for I'm moving it to kio. Might also be related to the old bug 130709
Comment 2 Elvis Angelaccio 2016-10-13 13:23:51 UTC
The problem is that the libreoffice process exits with return code 0 if another instance was already running. So, as far as kioexec is concerned, the process is done and subsequent changes are not detected.

@David: any idea how to fix this? We could use a file system watcher, but that would result in a dialog + CopyJob every time the file is saved...
Comment 3 Elvis Angelaccio 2017-04-15 15:27:15 UTC
Git commit a7758fb66481f05d1791687b415331a4f4af782f by Elvis Angelaccio.
Committed on 15/04/2017 at 15:25.
Pushed by elvisangelaccio into branch 'master'.

kioexec: delegate upload to a kded module

Introduce a kded module that kioexec can use to watch the cached
files for changes. This allows kioexec to be fully functional even with
applications that fork on startup, like libreoffice.

If the kded module is up and running, kioexec tells it (via dbus)
which file should be watched for changes and where to upload it when
it is actually changed. All the files watched by the module are deleted
when the module is destroyed.

As a bonus side effect, the dialog that asks if changes should be uploaded
is now displayed every time the user saves the file.

If dbus is not available or the kded module is otherwise disabled,
then kioexec falls back on the old behavior.
Related: bug 252026
FIXED-IN: 5.34

Differential Revision: D5030

M  +27   -1    src/kioexec/CMakeLists.txt
A  +111  -0    src/kioexec/kioexecd.cpp     [License: LGPL (v2/3+eV)]
A  +53   -0    src/kioexec/kioexecd.h     [License: LGPL (v2/3+eV)]
A  +11   -0    src/kioexec/kioexecd.json
M  +10   -3    src/kioexec/main.cpp
M  +1    -0    src/kioexec/main.h
A  +3    -0    src/kioexec/org.kde.kioexecd.service.in

https://commits.kde.org/kio/a7758fb66481f05d1791687b415331a4f4af782f
Comment 4 Elvis Angelaccio 2017-05-04 08:20:16 UTC
*** Bug 379477 has been marked as a duplicate of this bug. ***