Bug 372638 - "the file was created by another program"
Summary: "the file was created by another program"
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.27.0
Platform: Compiled Sources All
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-18 16:48 UTC by RJVB
Modified: 2022-01-08 23:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2016-11-18 16:48:13 UTC
Maybe it's because of the new kind of external modification alerts, but I find the message that "the file X has been created by another program" quite weird when I know that I've been having this file open possibly even for days in the same editor that posts the alert.

While the message may be technically correct when some other application replaced the file with an edited version it isn't how we think of it semantically. What counts for the user is whether the document contents have changed on disk compared to what is in the editor buffer. 

OTOH, the message may in fact be correct if the document was indeed created by another application (tar, for instance), but that's hardly relevant to the situation to which the alert draws attention.
Comment 1 Edward Kigwana 2019-05-25 14:52:27 UTC
This one is a little tricky. Open file that is not on disk then use some other process to create the file e.g. touch <file> and you'll find that the current code makes sense. Perhaps if a file exists and is open generate a modified event instead. If the file did not exist on disk when opening generate created event.
Comment 2 Lothar 2019-05-26 05:41:41 UTC
I'm also annoyed by this warning when I have some file in more that one instance of Kate open. But no idea how to fix that. Some communication may needed in that case.
Comment 3 Christoph Cullmann 2019-05-26 13:21:00 UTC
This are the strings we use ATM:


    switch (m_modOnHdReason) {
    case OnDiskModified:
        return i18n("The file '%1' was modified by another program.", str);
        break;
    case OnDiskCreated:
        return i18n("The file '%1' was created by another program.", str);
        break;
    case OnDiskDeleted:
        return i18n("The file '%1' was deleted by another program.", str);
        break;
    default:
        return QString();
    }

We can improve on that easily, beside that I think this is overkill for such a minor inconvenience.
Comment 4 Lothar 2019-05-26 13:34:21 UTC
I have already lost some changes due to this warning, so it's not only "a minor inconvenience"
Comment 5 Christoph Cullmann 2022-01-08 22:06:09 UTC
Git commit 1d696d7571196e12c4c81981aa431a6a7d957b47 by Christoph Cullmann.
Committed on 08/01/2022 at 22:04.
Pushed by cullmann into branch 'master'.

improve wording for modified on disk warnings

M  +3    -3    src/document/katedocument.cpp
M  +3    -3    src/include/ktexteditor/modificationinterface.h
M  +1    -1    src/view/katestatusbar.cpp
M  +1    -1    src/vimode/appcommands.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/1d696d7571196e12c4c81981aa431a6a7d957b47
Comment 6 RJVB 2022-01-08 23:23:23 UTC
Ah, the diplomatic approach ... and now we wait for someone to complain that s/he doesn't know what a disk is? ;)