Bug 73379 - Renaming a backup file will not overwrite the original
Summary: Renaming a backup file will not overwrite the original
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 3.2
Platform: Compiled Sources Linux
: VHI normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-24 03:44 UTC by James Richard Tyrer
Modified: 2004-02-22 22:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Widget mentioned in bug report (15.38 KB, image/png)
2004-01-24 03:49 UTC, James Richard Tyrer
Details
Screen shot for Test case #1 (144.23 KB, image/png)
2004-01-29 21:28 UTC, James Richard Tyrer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Richard Tyrer 2004-01-24 03:44:36 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources
Compiler:          GCC 3.3.2 
OS:          Linux

I have a KFM Konqueror open.  I split in to two sections and change the directory in one of them.  I have a file with the same name in both sections.  I drag the file from one section to the other and choose: "Move Here" in the pop-up menu.  Instead of the pop-up to confirm the overwrite, I get a pop-up with the title: "File Already Exists" and asking me to rename it.  A name window and a button: "Suggest New Name".  This is the wrong widget.  But -- much worse -- the name in the window is the name of the directory.

I have also had the same thing when I move a file to trash and it needs to overwrite.  I get the same widget with the file name: "Trash".

--
JRT
Comment 1 James Richard Tyrer 2004-01-24 03:47:10 UTC
I am setting this as very high because KFM is something that is used all the time.

--
JRT
Comment 2 James Richard Tyrer 2004-01-24 03:49:59 UTC
Created attachment 4328 [details]
Widget mentioned in bug report

Note the name: "image".  That is the name of the directory, not the file that I
am trying to overwrite.

--
JRT
Comment 3 Thiago Macieira 2004-01-24 04:14:05 UTC
I don't see how this can be the wrong widget. What is wrong about saying the file already exists and suggesting a new name?

It should, however, offer the option to overwrite as well.

IMO, this is no showstopper for KDE 3.2. Most people don't even know they can divide the window in two.
Comment 4 James Richard Tyrer 2004-01-24 06:33:41 UTC
It is the wrong widget because it doesn't have the: "Overwrite" option.

It is a show stopper because it is the tip of the iceberg.  It is what I have seen wrong that I can reporduce.  I have also had a Konqueror crash dragging a file from the desktop into a a KFM window and a directory has gone missing.  The more serious problem is not that the widget is missing: "Overwrite"; it is that it has the wrong file name in it.

Also, it does the exact same thing if you have the two directories opened in two seperate KFM windows, and drag from one window to the other.

--
JRT
Comment 5 Michael Pyne 2004-01-24 09:17:48 UTC
A simple way to reproduce this:

Create a file in your home directory, using touch for example.
$ touch temp.file

Copy it to a different directory
$ cp temp.file temp/

Use kfmclient to move it into that directory
$ kfmclient move temp.file temp

The problem I see with the Rename Dialog box is 1. No Overwrite and 2. Wrong file name suggested (temp instead of temp_1.file).

This bug isn't nearly as serious as reported.  It is very annoying, though, because if you go through the whole rigamarole of suggesting a different file name and then moving it, it will move to (in this example) $HOME/temp_1 instead of $HOME/temp/temp_1.  That's the wrong directory. 
Comment 6 James Richard Tyrer 2004-01-24 09:34:39 UTC
"This bug isn't nearly as serious as reported." 

I reported what I could reproduce.  I have had other more serious problems which I can not reporduce.  The directory containing the pics for my splash screen disapeared when I deleted a file in it -- similar problem confusing the file with the directory it was in?.  While making the screen capture for the other bug, I saved a file to the DeskTop directory and on the DeskTop it had the wrong name and showed as an empty file with a lock on it.  I restarted KDE and it was correct.  I don't know how serious the problem is but since the file system has lost data for me, I consider this to be the highest priority.

--
JRT
Comment 7 groot 2004-01-24 15:49:59 UTC
When I do kfmclient move bla otherdir/ , as Michael Pyne has described, I get "the wrong widget" (just a lineedit with the filename, a suggest name button, rename and cancel buttons). In a konqueror window, though, I get the File already exists widget, with both an overwrite button and the rest - I suppose that's "the right widget".
Comment 8 Michael Pyne 2004-01-24 21:19:46 UTC
I'm not a Konqueror expert, but the error seems to be somewhere in kdelibs/kio/kio/job.cpp, perhaps having to do with the CopyJob::slotEntries() function, which is supposed to handle case 4 (on line 1986 in job.cpp).  Case 4 is where the source is a file, and the destination is a directory.  According to the comment, slotEntries() will append the filename to the directory.  Does it get called before the dialog box asking for the rename?
Comment 9 Pascal Létourneau 2004-01-24 22:18:18 UTC
*** Bug has been marked as fixed ***.
Comment 10 James Richard Tyrer 2004-01-24 23:43:53 UTC
I have also found the same problem when renaming a file.

For example if you want to go back to a backup file.  Open: "Properties" and remove the "~" and the same problem occurs -- you are asked to rename it and get the name of the directory.  You can't overwrite because that option isn't available.

--
JRT
Comment 11 James Richard Tyrer 2004-01-25 07:26:57 UTC
The patch appears to have fixed 73383, however this bug has not been fixed.

Test Case #1: create a text file with the RMB menu.  Open it in KEdit and type a word so that it has changed.  Save the file and close KEdit.  Now you should have a file and a backup file ending in: "~".  Open RMB properties on the backup and delete the: "~" from the name.  Click OK and a widget pops up with the correct file name :-) but still missing the: "Overwrite" button.

Test Case #2: create a new folder (directory): "Test1".  In that directory ("Test1") create a new folder (directory): "Test2".  Now open both directories with KFM windows and copy the same file to both of them.  Now try to move the file from: "Test2" to: "Test1".  Works perfectly. :-)  However, if you try to move the file from: "Test1 to: "Test2" it still fails with the same problem.  The widget that pops up doesn't have the: "Overwrite" button and it has the name of the directory rather than the file in the window.

--
JRT
Comment 12 James Richard Tyrer 2004-01-27 04:24:20 UTC
Version: 1.370 of: "kdelibs/kio/kio/job.cpp" appears to have fixed Test Case #2.

--
JRT
Comment 13 James Richard Tyrer 2004-01-29 21:25:10 UTC
I am confirming that: "Test case #2" has been fixed in: KDE_3_2_BRANCH

However: "Test case #1" had not been fixed.

Therefore, the title of the bug is changed to reflect:

Test Case #1: create a text file with the RMB menu. Open it in KEdit and type a word so that it has changed. Save the file and close KEdit. Now you should have a file and a backup file ending in: "~". Open RMB properties on the backup file and delete the: "~" from the name. Click OK and a widget pops up with the correct file name :-) but still missing the: "Overwrite" button. 

--
JRT
Comment 14 James Richard Tyrer 2004-01-29 21:28:42 UTC
Created attachment 4419 [details]
Screen shot for Test case #1

Please note that the widget titled: "File Already Exists" does not have an:
"Overwrite" button.

That is the problem.

--
JRT
Comment 15 James Richard Tyrer 2004-01-29 23:21:10 UTC
I should also add that this is a REGRESSION since it works correctly in 3.1.5.

--
JRT
Comment 16 David Faure 2004-02-22 22:17:03 UTC
CVS commit by faure: 

Fixed 73379: renaming a file to a name that already exists, didn't offer "Overwrite"
anymore (since the pre-3.2 fix that added code to make the 'rename dialog' appear
before starting to do the full move+del operation).

Also fixed handling of "Overwrite" for base directories (one had to click 'overwrite'
again for subdirectories). And fixed warnings from observer.cpp due to progressId==0.
CCMAIL: 73379-done@bugs.kde.org


  M +79 -34    job.cpp   1.368.2.5
  M +9 -6      observer.cpp   1.49.2.1