Bug 87617 - kio file gives confusing error message when opened file is deleted on disc
Summary: kio file gives confusing error message when opened file is deleted on disc
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-20 17:57 UTC by Rinse De Vries
Modified: 2012-11-02 22:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rinse De Vries 2004-08-20 17:57:53 UTC
Version:            (using KDE 3.3.0, SuSE)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.5-7.104-default

Hi, 

Try this:

- open a file with kwrite
- delete the file from disc

kwrite will notice that the file on disc is gone and gives the following error message:
==========================================================
= The file 'file:/home/rinse/Desktop/test.txt' was changed = (deleted) on disc by another proces!
= What do you want to do?
=
= [reload] [ignore changes] [cancel]
==========================================================
Most user I checked would choose [reload] as they expect that this would solve the problem of the missing file on disc.
But in stead of that, reloading the file means that the opened version will be deleted as well.

To avoid this confusion, the error message should be something like this:

==========================================================
= The file 'file:/home/rinse/Desktop/test.txt' was deleted = from the disc by another program!
= What do you want to do?
=
=[recreate file on disc][save file under a new name][cancel]
==========================================================

Kind regards, Rinse
Comment 1 Nicolas Goutte 2004-08-20 23:19:52 UTC
As far as I know, this behaviour is part of Kate and not of kio.

Have a nice day!
Comment 2 Anders Lund 2004-09-28 01:58:35 UTC
CVS commit by alund: 

uninline reasonedMOHString, so that the strings gets translated :\
Backport follows
CCMAIL: 87617-done@bugs.kde.org


  M +13 -0     katedocument.cpp   1.753
  M +3 -14     katedocument.h   1.292


--- kdelibs/kate/part/katedocument.cpp  #1.752:1.753
@@ -5325,4 +5325,17 @@ bool KateDocument::createDigest( QCStrin
 }
 
+QString KateDocument::reasonedMOHString() const
+{
+  QString reason;
+  if ( m_modOnHdReason == 1 )
+    reason = i18n("modified");
+  else if ( m_modOnHdReason == 2 )
+    reason = i18n("created");
+  else if ( m_modOnHdReason == 3 )
+    reason = i18n("deleted");
+
+  return i18n("The file '%1' was changed (%2) on disk by another program.").arg( url().prettyURL() ).arg( reason );
+}
+
 void KateDocument::removeTrailingSpace( uint line )
 {

--- kdelibs/kate/part/katedocument.h  #1.291:1.292
@@ -934,16 +934,5 @@ class KateDocument : public Kate::Docume
      * @since 3.3
      */
-    inline QString reasonedMOHString() const
-    {
-      QString reason;
-      if ( m_modOnHdReason == 1 )
-        reason = i18n("modified");
-      else if ( m_modOnHdReason == 2 )
-        reason = i18n("created");
-      else if ( m_modOnHdReason == 3 )
-        reason = i18n("deleted");
-
-      return i18n("The file '%1' was changed (%2) on disk by another program.").arg( url().prettyURL() ).arg( reason );
-    }
+    QString reasonedMOHString() const;
 
     /**


Comment 3 Rinse De Vries 2004-09-28 22:57:41 UTC
I reopened the bug, Because I fail to see how this patch resolves the problem :o)

Why are those error messages in such a technical way?
Why not just straight ahead error messages that give the correct information about the problem?

I mean not like this:

The file 'hi.txt' was changed (deleted) on disk by another program"

What do you want to do?
|Reload File |Ignore Changes|

But like this:
The file 'hi.txt' was deleted on disk by another program"

What do you want to do?
|Restore File|Ignore Changes|

The first still gives an odd option, since there is no file on disc that can be reloaded.

Also, the dialog has also this option:

The file 'test' was changed (Created) on disk by another program"
What do you want to do?
|Reload File |Ignore Changes|

Now, how can another program create the file on disc if it is already there?


The code is found in kdelibs/kate/part/katedocument.cpp 
(starting at 4443).

Kind regards, Rinse
Comment 4 Anders Lund 2004-09-28 23:28:08 UTC
sorry, i closed the wrong bug
Comment 5 George Goldberg 2008-01-28 07:54:48 UTC
Seems to be fixed in trunk svn #767426
Comment 6 Christoph Cullmann 2012-11-02 22:35:37 UTC
> George Goldberg 2008-01-28 07:54:48 UTC
> Seems to be fixed in trunk svn #767426
Then closing.