[Digikam-devel] [Bug 141940] Image selection bugs (multiple and single selections)
Marcel Wiesweg
marcel.wiesweg at gmx.de
Sun Feb 25 14:01:44 GMT 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=141940
------- Additional Comments From marcel.wiesweg gmx de 2007-02-25 15:01 -------
SVN commit 637131 by mwiesweg:
- Do not reset selection in slotUpdate.
This means that the selection is preserved
- during any resize operations (hiding sidebar)
- while filtering out items with the tag filter
- when items have been changed from outside (AlbumIconView::refreshItems)
- change the misleading name d->firstVisibleItem to d->storedVisibleItem
(it does not always point to the current first visible item - it is usually 0)
CCBUG:141940
M +21 -22 iconview.cpp
--- trunk/extragear/graphics/digikam/digikam/iconview.cpp #637130:637131
@ -65,7 +65,7 @
lastGroup = 0;
currItem = 0;
anchorItem = 0;
- firstVisibleItem = 0;
+ storedVisibleItem = 0;
clearing = false;
spacing = 10;
@ -103,7 +103,7 @
IconItem* toolTipItem;
IconItem* currItem;
IconItem* anchorItem;
- IconItem* firstVisibleItem; // store position for slotUpdate
+ IconItem* storedVisibleItem; // store position for slotUpdate
IconGroupItem* firstGroup;
IconGroupItem* lastGroup;
@ -403,7 +403,7 @
d->lastGroup = group;
}
- d->firstVisibleItem = findFirstVisibleItem();
+ d->storedVisibleItem = findFirstVisibleItem();
startUpdateTimer();
}
@ -415,7 +415,7 @
// this is only to find an alternative visible item if all visible items
// are removed
IconGroupItem *alternativeVisibleGroup = 0;
- d->firstVisibleItem = 0;
+ d->storedVisibleItem = 0;
if (group == d->firstGroup)
{
@ -454,11 +454,11 @
if (!d->clearing)
{
- d->firstVisibleItem = findFirstVisibleItem();
- if (!d->firstVisibleItem && alternativeVisibleGroup)
+ d->storedVisibleItem = findFirstVisibleItem();
+ if (!d->storedVisibleItem && alternativeVisibleGroup)
{
// find an alternative visible item
- d->firstVisibleItem = alternativeVisibleGroup->lastItem();
+ d->storedVisibleItem = alternativeVisibleGroup->lastItem();
}
startUpdateTimer();
}
@ -469,7 +469,7 @
if (!item)
return;
- d->firstVisibleItem = findFirstVisibleItem();
+ d->storedVisibleItem = findFirstVisibleItem();
startUpdateTimer();
}
@ -509,16 +509,16 @
if (!d->clearing)
{
- d->firstVisibleItem = findFirstVisibleItem();
- if (d->firstVisibleItem == item)
- d->firstVisibleItem = d->currItem;
+ d->storedVisibleItem = findFirstVisibleItem();
+ if (d->storedVisibleItem == item)
+ d->storedVisibleItem = d->currItem;
startUpdateTimer();
}
}
void IconView::triggerUpdate()
{
- d->firstVisibleItem = findFirstVisibleItem();
+ d->storedVisibleItem = findFirstVisibleItem();
startUpdateTimer();
}
@ -603,22 +603,21 @
}
d->anchorItem = d->currItem;
- if (d->currItem)
+ // ensure there is a selection
+ if (d->selectedItems.isEmpty())
{
- d->currItem->setSelected(true, true);
+ if (d->currItem)
+ d->currItem->setSelected(true, true);
+ else // no selection
+ emit signalSelectionChanged();
}
- else
- {
- // no selection
- emit signalSelectionChanged();
- }
// set first visible item if they where stored before update was triggered
- if (d->firstVisibleItem)
+ if (d->storedVisibleItem)
{
- ensureItemVisible(d->firstVisibleItem);
+ ensureItemVisible(d->storedVisibleItem);
// reset to 0
- d->firstVisibleItem = 0;
+ d->storedVisibleItem = 0;
}
else
{
More information about the Digikam-devel
mailing list