[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-18 Thread Thomas Fischer
https://bugs.kde.org/show_bug.cgi?id=396343

Thomas Fischer  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
   Version Fixed In||0.8.2
 Resolution|--- |FIXED
  Latest Commit||https://commits.kde.org/kbi
   ||btex/f959986e4c582f24c492c9
   ||6d2022c50b52cfc62b

--- Comment #7 from Thomas Fischer  ---
Git commit f959986e4c582f24c492c96d2022c50b52cfc62b by Thomas Fischer.
Committed on 18/07/2018 at 18:34.
Pushed by thomasfischer into branch 'kbibtex/0.8'.

DropBox-synchronized folders no longer cause 'reload' messages

It is strongly suspected that when saving a file in a folder
synchronized via DropBox, the DropBox client modifies(*) the file
right after it was saved in KBibTeX, causing KBibTeX to ask the
user if the file was to be reloaded or on-disk changes to be
ignored.
By delaying resuming watching a local file after it has been saved to
disk by 500ms, this problem is no longer apparent.

(*) The file's content does not seem to be changed, but some filesystem
metadata may get touched/modified, triggering the file watching service.
FIXED-IN: 0.8.2

M  +12   -4src/parts/part.cpp

https://commits.kde.org/kbibtex/f959986e4c582f24c492c96d2022c50b52cfc62b

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-18 Thread Thomas Fischer
https://bugs.kde.org/show_bug.cgi?id=396343

--- Comment #8 from Thomas Fischer  ---
Git commit acac51d20183f6b853223602f0cda4524a3502b6 by Thomas Fischer.
Committed on 18/07/2018 at 18:40.
Pushed by thomasfischer into branch 'master'.

DropBox-synchronized folders no longer cause 'reload' messages

It is strongly suspected that when saving a file in a folder
synchronized via DropBox, the DropBox client modifies(*) the file
right after it was saved in KBibTeX, causing KBibTeX to ask the
user if the file was to be reloaded or on-disk changes to be
ignored.
By delaying resuming watching a local file after it has been saved to
disk by 500ms, this problem is no longer apparent.

(*) The file's content does not seem to be changed, but some filesystem
metadata may get touched/modified, triggering the file watching service.

This commit was cherry-picked from branch 'kbibtex/0.8', commit
f959986e4c582f24c4.

M  +12   -4src/parts/part.cpp

https://commits.kde.org/kbibtex/acac51d20183f6b853223602f0cda4524a3502b6

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-15 Thread Nicolas Vaughan
https://bugs.kde.org/show_bug.cgi?id=396343

--- Comment #6 from Nicolas Vaughan  ---
To create an Arch Linux package which incorporates the patch, do as follows:

1. Clone the Arch AUR repo: git clone https://aur.archlinux.org/kbibtex-git.git
2. CD into the directory: cd kbibtex-git
3. Replace original PKGBUILD with the one I have attached here.
4. Copy the patch file part.patch into the directory.
5. Create the package: makepkg -s (or, if you want to install it immediately:
makepkg -si)
6. Install the package: sudo pacman -U
kbibtex-git-r2888.5d462666-1-x86_64.pkg.tar (or whatever the resulting package
name is).


The changes I made in PKGBUILD are just two lines at the beginning of the
prepare() function:

prepare() {
   cd ..
   patch "$srcdir"/kbibtex/src/parts/part.cpp part.patch
   cd "$srcdir"
   mkdir build
}

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-15 Thread Nicolas Vaughan
https://bugs.kde.org/show_bug.cgi?id=396343

--- Comment #5 from Nicolas Vaughan  ---
Created attachment 113954
  --> https://bugs.kde.org/attachment.cgi?id=113954=edit
New Archi Linux PKGBUILD, modified to run patch file.

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-15 Thread Nicolas Vaughan
https://bugs.kde.org/show_bug.cgi?id=396343

--- Comment #4 from Nicolas Vaughan  ---
Created attachment 113953
  --> https://bugs.kde.org/attachment.cgi?id=113953=edit
Patch to part.cpp

This is Thomas' original patch for part.cpp.

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-15 Thread Thomas Fischer
https://bugs.kde.org/show_bug.cgi?id=396343

Thomas Fischer  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

--- Comment #3 from Thomas Fischer  ---
(In reply to Nicolas Vaughan from comment #2)
> Hi Thomas,
> Thanks for your reply. The patch works perfectly. (I had some trouble
> patching and compiling the Arch package, but in the end everything worked
> fine.)

Sounds good! One more question: my patch uses an arbitrarily chosen delay of
500ms. Does the patch work as well with a delay of, say, 50ms? Please test some
vales between 5 and 500 to find the "breaking point".

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-14 Thread Nicolas Vaughan
https://bugs.kde.org/show_bug.cgi?id=396343

--- Comment #2 from Nicolas Vaughan  ---
Hi Thomas,
Thanks for your reply. The patch works perfectly. (I had some trouble patching
and compiling the Arch package, but in the end everything worked fine.)

-- 
You are receiving this mail because:
You are watching all bug changes.

[KBibTeX] [Bug 396343] When saving the file, I am always warned that file has changed in disk

2018-07-14 Thread Thomas Fischer
https://bugs.kde.org/show_bug.cgi?id=396343

--- Comment #1 from Thomas Fischer  ---
Created attachment 113931
  --> https://bugs.kde.org/attachment.cgi?id=113931=edit
Delay resume watching a file for modifications after saving said file

I suspect the problem you observe is due to the file's location in a directory
synchronized via DropBox (visible in the screenshot). This patch introduces a
500 milliseconds delay between saving a file and resuming watching it for
external modifications. Please test if this patch fixes your problem. Also, try
different time values to find a "sweet spot" when it starts/stops working.

I recommend to apply this patch by building an ArchLinux package based on the
original PKGBUILD file:
https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/kbibtex
Please check the official ArchLinux documentation on how to apply a patch
inside a PKGBUILD file.

-- 
You are receiving this mail because:
You are watching all bug changes.