-KItemListSelectionManager::KItemListSelectionManager(QObject* parent) :
- QObject(parent),
- m_currentItem(-1),
- m_anchorItem(-1),
- m_selectedItems(),
- m_isAnchoredSelectionActive(false),
- m_model(nullptr)
+KItemListSelectionManager::KItemListSelectionManager(QObject *parent)
+ : QObject(parent)
+ , m_currentItem(-1)
+ , m_anchorItem(-1)
+ , m_selectedItems()
+ , m_isAnchoredSelectionActive(false)
+ , m_model(nullptr)
{
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
{
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
{
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
{
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
for (int oldIndex : previous) {
const int index = indexAfterRangesRemoving(oldIndex, itemRanges, DiscardRemovedIndex);
for (int oldIndex : previous) {
const int index = indexAfterRangesRemoving(oldIndex, itemRanges, DiscardRemovedIndex);
{
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
{
// Store the current selection (needed in the selectionChanged() signal)
const KItemSet previousSelection = selectedItems();
for (int index : previous) {
if (index >= itemRange.index && index < itemRange.index + itemRange.count) {
m_selectedItems.insert(movedToIndexes.at(index - itemRange.index));
for (int index : previous) {
if (index >= itemRange.index && index < itemRange.index + itemRange.count) {
m_selectedItems.insert(movedToIndexes.at(index - itemRange.index));
-int KItemListSelectionManager::indexAfterRangesRemoving(int index, const KItemRangeList& itemRanges,
- const RangesRemovingBehaviour behaviour) const
+int KItemListSelectionManager::indexAfterRangesRemoving(int index, const KItemRangeList &itemRanges, const RangesRemovingBehaviour behaviour) const