Bug 53799

Summary: cervisa removes all local files
Product: [Applications] cervisia Reporter: colesen
Component: generalAssignee: Bernd Gehrmann <bernd>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description colesen 2003-02-01 04:16:08 UTC
Version:           3.1.0 (using KDE 3.1.0)
Installed from:    compiled sources
Compiler:          gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
OS:          Linux (i686) release 2.4.18-19.7.x

To reproduce:
checkout a directory of files from CVS. Select that directory in Konqueror as filemanager. Select some of the files. Click the Cervisa toolbar button and select "Remove from repository". Cervisa not only removes the selected files but all files in the directory - fortunately without also commiting the removal.
Comment 1 colesen 2003-02-01 04:57:48 UTC
I was a little too fast. First of all the above should have been "Click the 
Cervisa toolbar button, select some files and select "Remove from repository".
Secondly, I discovered that the (my?) problem was caused by the entire 
directory already having been preselected (highlighted on yellow background) 
upon entry into Cervisa (i.e. it looks to me like Cervisa preselects the entire 
directory by default). I'd have preferred that it did not do that.
Comment 2 Christian Loose 2003-02-05 22:32:41 UTC
Subject: kdesdk/cervisia

CVS commit by cloose: 

The dot for the root directory of the repository is hard to see
in the listbox of the dialog, so we convert it to the absolut path.

This way it's less likely that you accidentally remove all files from
the repository.

CCMAIL: 53799-done@bugs.kde.org


  M +13 -1     addremovedlg.cpp   1.2


--- kdesdk/cervisia/addremovedlg.cpp  #1.1:1.2
@@ -15,4 +15,5 @@
 #include "addremovedlg.h"
 
+#include <qfileinfo.h>
 #include <qlabel.h>
 #include <qlayout.h>
@@ -54,4 +55,15 @@ AddRemoveDialog::AddRemoveDialog(ActionT
 void AddRemoveDialog::setFileList(const QStringList &list)
 {
+    // the dot for the root directory is hard to see, so
+    // we convert it to the absolut path   
+    if( list.find(".") != list.end() )
+    {
+        QStringList copy(list);
+        int idx = copy.findIndex(".");
+        copy[idx] = QFileInfo(".").absFilePath();
+        
+        listbox->insertStringList(copy);
+    }
+    else        
     listbox->insertStringList(list);
 }