! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Logic determining if "Externally modified" dialog is called during "save as" ...
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description alister.hood 2013-11-17 16:55:14 CET
To demonstrate:
1. "save" a new file (e.g. /tmp/test)
2. "save as" a different, new file (e.g. /tmp/test1)
3. "save as" the first file (/tmp/test).  You will get a dialog warning you that the file has been externally modified.  You shouldn't get this dialog - it doesn't make sense in this case.
4. overwrite the current file (/tmp/test if you confirmed the last save) from another program (e.g. `echo "hello">/tmp/test`)
5. "save as" the current file, which has been overwritten.  You don't get the "externally modified" dialogue.  But in this case it does make sense.
Comment 1 Andre Miranda editbugs 2014-11-20 04:33:17 CET
I can't reproduce the step 5. Now it seems to be validating if the file was modified externally on "save" and "save as". Can you confirm this? If so, half of the problem is fixed.

Mousepad from git(717faec) w/ GTK3 Support.
Comment 2 alister.hood 2014-11-20 23:05:06 CET
> I can't reproduce the step 5. Now it seems to be validating if the file was modified externally on "save" and "save as". Can you confirm this?

Yes.
Comment 3 Theo Linkspfeifer editbugs 2019-05-26 18:12:18 CEST
Created attachment 8583 
proposed patch
Comment 4 Git Bot editbugs 2019-05-27 00:28:52 CEST
Theo Linkspfeifer referenced this bugreport in commit e0e86e870e4fc17b73bed48cb1ec984fecb1c179

Reset modification time when new filename is set (Bug #10498)

https://git.xfce.org/apps/mousepad/commit?id=e0e86e870e4fc17b73bed48cb1ec984fecb1c179
Comment 5 Andre Miranda editbugs 2019-05-27 00:29:27 CEST
Works for me, thanks!
Comment 6 Matthew Brush editbugs 2019-05-28 01:06:11 CEST
If anyone feels motivated (it's not important probably), but an `else` branch on the new `if` conditional could be added which just returns straight away, since it's now checking whether the filename changed, it makes no sense to free the old one and reallocate a new one when it's already known to be the same.

Bug #10498

Reported by:
alister.hood
Reported on: 2013-11-17
Last modified on: 2019-05-28

People

Assignee:
Matthew Brush
CC List:
3 users

Version

Target Milestone:
Mousepad 0.4.x

Attachments

proposed patch (815 bytes, patch)
2019-05-26 18:12 CEST , Theo Linkspfeifer
no flags

Additional information