Bug 279997 - Dolphin replaces directories without a warning
Summary: Dolphin replaces directories without a warning
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: kfile (show other bugs)
Version: 4.6
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-13 00:31 UTC by Christopher Yeleighton
Modified: 2011-12-12 20:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Yeleighton 2011-08-13 00:31:54 UTC
Version:           1.6.1 (using KDE 4.6.4) 
OS:                Linux

Setting the name of a directory to a name of an already existing directory wipes the latter directory without warning even if it is nonempty.

Reproducible: Always

Steps to Reproduce:
  1. Tell Dolphin to create a new directory named "a".
  2. Tell Dolphin to create a new directory named "b".
  3. Tell Dolphin to show properties of directory "b".
  4. Tell the properties window to change the name from "b" to "a".

Actual Results:  
  1. a
  2. a b
  3. Name: b
  4. a

Expected Results:  
  4. 
Are you sure?  Directory "a" already exists.  If you proceed, you will irretrievably LOSE ALL DATA THERE!!!

OS: Linux (x86_64) release 2.6.37.6-0.7-desktop
Compiler: gcc
Comment 1 Dawit Alemayehu 2011-12-12 20:11:46 UTC
(In reply to comment #0)
> Version:           1.6.1 (using KDE 4.6.4) 
> OS:                Linux
> 
> Setting the name of a directory to a name of an already existing directory
> wipes the latter directory without warning even if it is nonempty.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
>   1. Tell Dolphin to create a new directory named "a".
>   2. Tell Dolphin to create a new directory named "b".
>   3. Tell Dolphin to show properties of directory "b".
>   4. Tell the properties window to change the name from "b" to "a".
> 
> Actual Results:  
>   1. a
>   2. a b
>   3. Name: b
>   4. a

Not exactly though that is what seems to happen. What actually happens, at least for me here, is that "b" is moved into "a" which is still wrong. It needs to prompt me for the action to take just like when I choose "Rename" from the RMB. This bug is actually in kio/kfile/kpropertiesdialog.cpp (KFilePropsPlugin::applyChanges).
Comment 2 Dawit Alemayehu 2011-12-12 20:34:08 UTC
Git commit f246c7451ab0c2a68b42f5ce16e2cb6357ecd1d2 by Dawit Alemayehu.
Committed on 12/12/2011 at 21:29.
Pushed by adawit into branch 'KDE/4.7'.

* Use KIO::copyAs and KIO::moveAs to rename/move files so that the
  user is properly prompted when an existing name is used.

* Changed assert calls to Q_ASSERT calls.

BUG: 279997
FIXED-IN: 4.8.0

M  +10   -11   kio/kfile/kpropertiesdialog.cpp

http://commits.kde.org/kdelibs/f246c7451ab0c2a68b42f5ce16e2cb6357ecd1d2