Bug 101630

Summary: digikam ui problem selecting images
Product: [Applications] digikam Reporter: olistrut
Component: Albums-IconViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description olistrut 2005-03-16 17:59:51 UTC
Version:            (using KDE KDE 3.3.92)
Installed from:    RedHat RPMs

In the digikam album view (and also in the digikam camera window) there is a problem selecting images with the keyboard: Shift+Cursor correctly selects images but it is not possible to unselect selected images by going back with the cursor.

Example:

 a1 a2 a3
 b1 b2 b3

Use cursor keys to go to image a2. Keep Shift pressed and press right cursor key two times. a2, a3 and b1 are selected. Now (still keeping the shift key pressed) press the left cursor key. In any other application b1 would be unselected. Not so in digikam. There is no visual feedback until the image a1 gets selected.

Not a big issue, but behavior not consistent with other applications. Also when selecting a large number of images it is hard to get the selection right without using the mouse as user does not see the next image to be selected when scrolling and has no way of unselecting a selected image.
Comment 1 Joern Ahrens 2005-03-17 00:26:13 UTC
CVS commit by jahrens: 

This is a workaround, so you can use the keyboard selection. But the whole selection process has to be reworked. So I let this bug open as a reminder.

CCBUG: 101630


  M +1 -1      albumdb.cpp   1.17
  M +38 -2     thumbview.cpp   1.28


--- kdeextragear-3/digikam/digikam/thumbview.cpp  #1.27:1.28
@@ -713,4 +713,10 @@ void ThumbView::contentsMousePressEvent(
                     }
                 }
+//                for (ThumbItem *it = item->next; it; it = it->next) 
+//                {
+//                    if (it->isSelected()) {
+//                        it->setSelected(false, false);
+//                    }
+//                }
             }
             else if (fwdSelection) {
@@ -721,6 +727,14 @@ void ThumbView::contentsMousePressEvent(
                     }
                 }
+//                for (ThumbItem *it = item->prev; it; it = it->prev) 
+//                {
+//                    if (it->isSelected()) {
+//                        it->setSelected(false, false);
+//                    }
+//                }
             }
             else {
+                // No other item is selected, invert the selection 
+                // of the current item
                 item->setSelected(!item->isSelected(), false);
             }
@@ -1311,6 +1325,12 @@ void ThumbView::keyPressEvent(QKeyEvent 
     case Key_Right: {
         ThumbItem *item = currItem ? currItem->next : d->firstItem;
+        
         if (item)
         {
+            if(currItem && currItem->isSelected() && item->isSelected())
+            {
+                currItem->setSelected(false,false);
+            }
+            
             keySelectItem(item, e->state() & Qt::ShiftButton);
             ensureItemVisible(item);
@@ -1322,6 +1342,12 @@ void ThumbView::keyPressEvent(QKeyEvent 
     case Key_Left: {
         ThumbItem *item = currItem ? currItem->prev : d->firstItem;
+        
         if (item)
         {
+            if(currItem && currItem->isSelected() && item->isSelected())
+            {
+                currItem->setSelected(false,false);
+            }
+            
             keySelectItem(item, e->state() & Qt::ShiftButton);
             ensureItemVisible(item);
@@ -1347,4 +1373,9 @@ void ThumbView::keyPressEvent(QKeyEvent 
         if (item)
         {
+            if(currItem && currItem->isSelected() && item->isSelected())
+            {
+                currItem->setSelected(false,false);
+            }
+
             keySelectItem(item, e->state() & Qt::ShiftButton);
             ensureItemVisible(item);
@@ -1371,4 +1402,9 @@ void ThumbView::keyPressEvent(QKeyEvent 
         if (item)
         {
+            if(currItem && currItem->isSelected() && item->isSelected())
+            {
+                currItem->setSelected(false,false);
+            }
+            
             keySelectItem(item, e->state() & Qt::ShiftButton);
             ensureItemVisible(item);
Comment 2 Renchi Raju 2005-04-26 18:06:02 UTC
sensible keyboard handling implemented in experimental branch