1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818 | /* ============================================================
*
* This file is a part of digiKam project
* https://www.digikam.org
*
* Date : 2010-07-17
* Description : A marker tiler operating on item models
*
* SPDX-FileCopyrightText: 2010-2025 by Gilles Caulier <caulier dot gilles at gmail dot com>
* SPDX-FileCopyrightText: 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* ============================================================ */
#include "itemmarkertiler.h"
// Local includes
#include "geomodelhelper.h"
#include "digikam_debug.h"
#include "geoifacecommon.h"
namespace Digikam
{
class Q_DECL_HIDDEN ItemMarkerTiler::MyTile : public Tile
{
public:
MyTile() = default;
~MyTile() = default; // No virtual destructor else crash at in unit-test.
void removeMarkerIndexOrInvalidIndex(const QModelIndex& indexToRemove);
public:
QList<QPersistentModelIndex> markerIndices;
int selectedCount = 0;
private:
MyTile(const MyTile&) = delete;
MyTile& operator=(const MyTile&) = delete;
};
void ItemMarkerTiler::MyTile::removeMarkerIndexOrInvalidIndex(const QModelIndex& indexToRemove)
{
int i = 0;
while (i < markerIndices.count())
{
const QPersistentModelIndex& currentIndex = markerIndices.at(i);
// NOTE: this function is usually called after the model has sent
// an aboutToRemove-signal. It is possible that the persistent
// marker index became invalid before the caller received the signal.
// we remove any invalid indices as we find them.
if (!currentIndex.isValid())
{
markerIndices.takeAt(i);
continue;
}
if (currentIndex == indexToRemove)
{
markerIndices.takeAt(i);
return;
}
++i;
}
}
// -------------------------------------------------------------------------------------------
class Q_DECL_HIDDEN ItemMarkerTiler::Private
{
public:
Private() = default;
GeoModelHelper* modelHelper = nullptr;
QItemSelectionModel* selectionModel = nullptr;
QAbstractItemModel* markerModel = nullptr;
bool activeState = false;
};
ItemMarkerTiler::ItemMarkerTiler(GeoModelHelper* const modelHelper, QObject* const parent)
: AbstractMarkerTiler(parent),
d (new Private)
{
resetRootTile();
setMarkerGeoModelHelper(modelHelper);
}
ItemMarkerTiler::~ItemMarkerTiler()
{
delete d;
}
void ItemMarkerTiler::setMarkerGeoModelHelper(GeoModelHelper* const modelHelper)
{
d->modelHelper = modelHelper;
d->markerModel = modelHelper->model();
d->selectionModel = modelHelper->selectionModel();
if (d->markerModel != nullptr)
{
// TODO: disconnect the old model if there was one
connect(d->markerModel, &QAbstractItemModel::rowsInserted,
this, &ItemMarkerTiler::slotSourceModelRowsInserted);
connect(d->markerModel, &QAbstractItemModel::rowsAboutToBeRemoved,
this, &ItemMarkerTiler::slotSourceModelRowsAboutToBeRemoved);
// TODO: this signal now has to be monitored in the model helper
/*
connect(d->markerModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(slotSourceModelDataChanged(QModelIndex,QModelIndex)));
*/
connect(d->modelHelper, &GeoModelHelper::signalModelChangedDrastically,
this, &ItemMarkerTiler::slotSourceModelReset);
connect(d->markerModel, &QAbstractItemModel::modelReset,
this, &ItemMarkerTiler::slotSourceModelReset);
connect(d->markerModel, &QAbstractItemModel::layoutChanged,
this, &ItemMarkerTiler::slotSourceModelLayoutChanged);
connect(d->modelHelper, &GeoModelHelper::signalThumbnailAvailableForIndex,
this, &ItemMarkerTiler::slotThumbnailAvailableForIndex);
if (d->selectionModel)
{
connect(d->selectionModel, &QItemSelectionModel::selectionChanged,
this, &ItemMarkerTiler::slotSelectionChanged);
}
}
setDirty();
}
QVariant ItemMarkerTiler::getTileRepresentativeMarker(const TileIndex& tileIndex, const int sortKey)
{
const QList<QPersistentModelIndex> modelIndices = getTileMarkerIndices(tileIndex);
if (modelIndices.isEmpty())
{
return QVariant();
}
return QVariant::fromValue(d->modelHelper->bestRepresentativeIndexFromList(modelIndices, sortKey));
}
QPixmap ItemMarkerTiler::pixmapFromRepresentativeIndex(const QVariant& index, const QSize& size)
{
return d->modelHelper->pixmapFromRepresentativeIndex(index.value<QPersistentModelIndex>(), size);
}
QVariant ItemMarkerTiler::bestRepresentativeIndexFromList(const QList<QVariant>& indices, const int sortKey)
{
QList<QPersistentModelIndex> indexList;
for (int i = 0 ; i < indices.count() ; ++i)
{
indexList << indices.at(i).value<QPersistentModelIndex>();
}
return QVariant::fromValue(d->modelHelper->bestRepresentativeIndexFromList(indexList, sortKey));
}
void ItemMarkerTiler::slotSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
{
/*
qCDebug(DIGIKAM_GEOIFACE_LOG)<<selected<<deselected;
*/
if (isDirty())
{
return;
}
/*
d->isDirty=true;
Q_EMIT signalTilesOrSelectionChanged();
return;
*/
for (int i = 0 ; i < selected.count() ; ++i)
{
const QItemSelectionRange selectionRange = selected.at(i);
for (int row = selectionRange.top() ; row <= selectionRange.bottom() ; ++row)
{
// get the coordinates of the item
GeoCoordinates coordinates;
if (!d->modelHelper->itemCoordinates(d->markerModel->index(row, 0, selectionRange.parent()), &coordinates))
{
continue;
}
for (int l = 0 ; l <= TileIndex::MaxLevel ; ++l)
{
const TileIndex tileIndex = TileIndex::fromCoordinates(coordinates, l);
MyTile* const myTile = static_cast<MyTile*>(getTile(tileIndex, true));
if (!myTile)
{
break;
}
myTile->selectedCount++;
/*
qCDebug(DIGIKAM_GEOIFACE_LOG) << l << tileIndex << myTile->selectedCount;
*/
GEOIFACE_ASSERT(myTile->selectedCount <= myTile->markerIndices.count());
if (myTile->childrenEmpty())
{
break;
}
}
}
}
for (int i = 0 ; i < deselected.count() ; ++i)
{
const QItemSelectionRange selectionRange = deselected.at(i);
for (int row = selectionRange.top() ; row <= selectionRange.bottom() ; ++row)
{
// get the coordinates of the item
GeoCoordinates coordinates;
if (!d->modelHelper->itemCoordinates(d->markerModel->index(row, 0, selectionRange.parent()), &coordinates))
{
continue;
}
for (int l = 0 ; l <= TileIndex::MaxLevel ; ++l)
{
const TileIndex tileIndex = TileIndex::fromCoordinates(coordinates, l);
MyTile* const myTile = static_cast<MyTile*>(getTile(tileIndex, true));
if (!myTile)
{
break;
}
myTile->selectedCount--;
GEOIFACE_ASSERT(myTile->selectedCount >= 0);
if (myTile->childrenEmpty())
{
break;
}
}
}
}
Q_EMIT signalTilesOrSelectionChanged();
}
void ItemMarkerTiler::slotSourceModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
{
qCDebug(DIGIKAM_GEOIFACE_LOG) << topLeft << bottomRight;
setDirty();
if (d->activeState)
{
Q_EMIT signalTilesOrSelectionChanged();
}
// TODO: if only a few items were changed, try to see whether they are still in the right tiles
}
void ItemMarkerTiler::slotSourceModelRowsInserted(const QModelIndex& parentIndex, int start, int end)
{
if (isDirty())
{
// rows will be added once the tiles are regenerated
return;
}
// sort the new items into our tiles:
for (int i = start ; i <= end ; ++i)
{
addMarkerIndexToGrid(QPersistentModelIndex(d->markerModel->index(i, 0, parentIndex)));
}
Q_EMIT signalTilesOrSelectionChanged();
}
void ItemMarkerTiler::slotSourceModelRowsAboutToBeRemoved(const QModelIndex& parentIndex, int start, int end)
{
// TODO: Q_EMIT signalTilesOrSelectionChanged(); in rowsWereRemoved
if (isDirty())
{
return;
}
// remove the items from their tiles:
for (int i = start ; i <= end ; ++i)
{
const QModelIndex itemIndex = d->markerModel->index(start, 0, parentIndex);
// remove the marker from the grid, but leave the selection count alone because the
// selection model will send a signal about the deselection of the marker
removeMarkerIndexFromGrid(itemIndex, true);
}
}
void ItemMarkerTiler::slotThumbnailAvailableForIndex(const QPersistentModelIndex& index, const QPixmap& pixmap)
{
Q_EMIT signalThumbnailAvailableForIndex(QVariant::fromValue(index), pixmap);
}
void ItemMarkerTiler::slotSourceModelReset()
{
qCDebug(DIGIKAM_GEOIFACE_LOG) << "----";
setDirty();
}
/**
* @brief Remove a marker from the grid
*
* @param markerIndex The marker index to remove
* @param ignoreSelection Do not remove the marker from the count of selected items.
* This is only used by slotSourceModelRowsAboutToBeRemoved internally,
* because the selection model sends us an extra signal about the deselection.
*/
void ItemMarkerTiler::removeMarkerIndexFromGrid(const QModelIndex& markerIndex, const bool ignoreSelection)
{
if (isDirty())
{
// if the model is dirty, there is no need to remove the marker
// because the tiles will be regenerated on the next call
// that requests data
return;
}
GEOIFACE_ASSERT(markerIndex.isValid());
bool markerIsSelected = false;
if (d->selectionModel)
{
markerIsSelected = d->selectionModel->isSelected(markerIndex);
}
// remove the marker from the grid:
GeoCoordinates markerCoordinates;
if (!d->modelHelper->itemCoordinates(markerIndex, &markerCoordinates))
{
return;
}
const TileIndex tileIndex = TileIndex::fromCoordinates(markerCoordinates, TileIndex::MaxLevel);
QList<MyTile*> tiles;
// here l functions as the number of indices that we actually use, therefore we have to go one more up
// in this case, l==0 returns the root tile
for (int l = 0 ; l <= TileIndex::MaxLevel+1 ; ++l)
{
MyTile* const currentTile = static_cast<MyTile*>(getTile(tileIndex.mid(0, l), true));
if (!currentTile)
{
break;
}
tiles << currentTile;
currentTile->removeMarkerIndexOrInvalidIndex(markerIndex);
if (markerIsSelected&&!ignoreSelection)
{
currentTile->selectedCount--;
GEOIFACE_ASSERT(currentTile->selectedCount >= 0);
}
}
// delete the tiles which are now empty!
for (int l = tiles.count()-1 ; l > 0 ; --l)
{
MyTile* const currentTile = tiles.at(l);
if (!currentTile->markerIndices.isEmpty())
{
break;
}
MyTile* const parentTile = tiles.at(l-1);
parentTile->deleteChild(currentTile);
}
}
int ItemMarkerTiler::getTileMarkerCount(const TileIndex& tileIndex)
{
if (isDirty())
{
regenerateTiles();
}
GEOIFACE_ASSERT(tileIndex.level() <= TileIndex::MaxLevel);
MyTile* const myTile = static_cast<MyTile*>(getTile(tileIndex, true));
if (!myTile)
{
return 0;
}
return myTile->markerIndices.count();
}
int ItemMarkerTiler::getTileSelectedCount(const TileIndex& tileIndex)
{
if (isDirty())
{
regenerateTiles();
}
GEOIFACE_ASSERT(tileIndex.level() <= TileIndex::MaxLevel);
MyTile* const myTile = static_cast<MyTile*>(getTile(tileIndex, true));<--- Variable 'myTile' can be declared as pointer to const
if (!myTile)
{
return 0;
}
return myTile->selectedCount;
}
GeoGroupState ItemMarkerTiler::getTileGroupState(const TileIndex& tileIndex)
{
if (isDirty())
{
regenerateTiles();
}
GEOIFACE_ASSERT(tileIndex.level() <= TileIndex::MaxLevel);
MyTile* const myTile = static_cast<MyTile*>(getTile(tileIndex, true));
if (!myTile)
{
return SelectedNone;
}
const int selectedCount = myTile->selectedCount;
if (selectedCount == 0)
{
return SelectedNone;
}
else if (selectedCount == myTile->markerIndices.count())
{
return SelectedAll;
}
return SelectedSome;
}
AbstractMarkerTiler::Tile* ItemMarkerTiler::getTile(const TileIndex& tileIndex, const bool stopIfEmpty)
{
if (isDirty())
{
regenerateTiles();
}
GEOIFACE_ASSERT(tileIndex.level() <= TileIndex::MaxLevel);
MyTile* tile = static_cast<MyTile*>(rootTile());
for (int level = 0 ; level < tileIndex.indexCount() ; ++level)
{
const int currentIndex = tileIndex.linearIndex(level);
MyTile* childTile = nullptr;
if (tile->childrenEmpty())
{
// if there are any markers in the tile,
// we have to sort them into the child tiles:
if (!tile->markerIndices.isEmpty())
{
for (int i = 0 ; i < tile->markerIndices.count() ; ++i)
{
const QPersistentModelIndex currentMarkerIndex = tile->markerIndices.at(i);
GEOIFACE_ASSERT(currentMarkerIndex.isValid());
// get the tile index for this marker:
GeoCoordinates currentMarkerCoordinates;
if (!d->modelHelper->itemCoordinates(currentMarkerIndex, ¤tMarkerCoordinates))
{
continue;
}
const TileIndex markerTileIndex = TileIndex::fromCoordinates(currentMarkerCoordinates, level);
const int newTileIndex = markerTileIndex.toIntList().constLast();
MyTile* newTile = static_cast<MyTile*>(tile->getChild(newTileIndex));
if (newTile == nullptr)
{
newTile = static_cast<MyTile*>(tileNew());
tile->addChild(newTileIndex, newTile);
}
newTile->markerIndices<<currentMarkerIndex;
if (d->selectionModel)
{
if (d->selectionModel->isSelected(currentMarkerIndex))
{
newTile->selectedCount++;
}
}
}
}
}
childTile = static_cast<MyTile*>(tile->getChild(currentIndex));
if (childTile == nullptr)
{
if (stopIfEmpty)
{
// there will be no markers in this tile, therefore stop
return nullptr;
}
childTile = static_cast<MyTile*>(tileNew());
tile->addChild(currentIndex, childTile);
}
tile = childTile;
}
return tile;
}
QList<QPersistentModelIndex> ItemMarkerTiler::getTileMarkerIndices(const TileIndex& tileIndex)
{
if (isDirty())
{
regenerateTiles();
}
GEOIFACE_ASSERT(tileIndex.level() <= TileIndex::MaxLevel);
MyTile* const myTile = static_cast<MyTile*>(getTile(tileIndex, true));<--- Variable 'myTile' can be declared as pointer to const
if (!myTile)
{
return QList<QPersistentModelIndex>();
}
return myTile->markerIndices;
}
void ItemMarkerTiler::addMarkerIndexToGrid(const QPersistentModelIndex& markerIndex)
{
if (isDirty())
{
// the model is dirty, so let regenerateTiles do the rest
regenerateTiles();
return;
}
GeoCoordinates markerCoordinates;
if (!d->modelHelper->itemCoordinates(markerIndex, &markerCoordinates))
{
return;
}
TileIndex tileIndex = TileIndex::fromCoordinates(markerCoordinates, TileIndex::MaxLevel);
GEOIFACE_ASSERT(tileIndex.level() == TileIndex::MaxLevel);
bool markerIsSelected = false;
if (d->selectionModel)
{
markerIsSelected = d->selectionModel->isSelected(markerIndex);
}
// add the marker to all existing tiles:
MyTile* currentTile = static_cast<MyTile*>(rootTile());
for (int l = 0 ; l <= TileIndex::MaxLevel ; ++l)
{
currentTile->markerIndices<<markerIndex;
if (markerIsSelected)
{
currentTile->selectedCount++;
}
// does the tile have any children?
if (currentTile->childrenEmpty())
{
break;
}
// the tile has children. make sure the tile for our marker exists:
const int nextIndex = tileIndex.linearIndex(l);
MyTile* nextTile = static_cast<MyTile*>(currentTile->getChild(nextIndex));
if (nextTile == nullptr)
{
// we have to create the tile:
nextTile = static_cast<MyTile*>(tileNew());
currentTile->addChild(nextIndex, nextTile);
}
// if this is the last loop iteration, populate the next tile now:
if (l == TileIndex::MaxLevel)
{
nextTile->markerIndices<<markerIndex;
if (markerIsSelected)
{
nextTile->selectedCount++;
}
}
currentTile = nextTile;
}
}
void ItemMarkerTiler::prepareTiles(const GeoCoordinates& /*upperLeft*/, const GeoCoordinates&, int /*level*/)
{
}
void ItemMarkerTiler::regenerateTiles()
{
resetRootTile();
setDirty(false);
if (!d->markerModel)
{
return;
}
// read out all existing markers into tiles:
for (int row = 0 ; row < d->markerModel->rowCount() ; ++row)
{
const QModelIndex modelIndex = d->markerModel->index(row, 0);
addMarkerIndexToGrid(QPersistentModelIndex(modelIndex));
}
}
bool ItemMarkerTiler::indicesEqual(const QVariant& a, const QVariant& b) const
{
return a.value<QPersistentModelIndex>()==b.value<QPersistentModelIndex>();
}
void ItemMarkerTiler::onIndicesClicked(const ClickInfo& clickInfo)
{
QList<QPersistentModelIndex> clickedMarkers;
for (int i = 0 ; i < clickInfo.tileIndicesList.count() ; ++i)
{
const TileIndex tileIndex = clickInfo.tileIndicesList.at(i);
clickedMarkers << getTileMarkerIndices(tileIndex);
}
const QPersistentModelIndex representativeModelIndex = clickInfo.representativeIndex.value<QPersistentModelIndex>();
if ((clickInfo.currentMouseMode == MouseModeSelectThumbnail) && d->selectionModel)
{
const bool doSelect = (clickInfo.groupSelectionState & SelectedMask) != SelectedAll;
const QItemSelectionModel::SelectionFlags selectionFlags = (doSelect ? QItemSelectionModel::Select
: QItemSelectionModel::Deselect) |
QItemSelectionModel::Rows;
for (int i = 0 ; i < clickedMarkers.count() ; ++i)
{
if (d->selectionModel->isSelected(clickedMarkers.at(i)) != doSelect)
{
d->selectionModel->select(clickedMarkers.at(i), selectionFlags);
}
}
if (representativeModelIndex.isValid())
{
d->selectionModel->setCurrentIndex(representativeModelIndex, selectionFlags);
}
/**
* @todo When do we report the clicks to the modelHelper?
* Or do we only report selection changes to the selection model?
*/
/*
d->modelHelper->onIndicesClicked(clickedMarkers);
*/
}
else if (clickInfo.currentMouseMode == MouseModeFilter)
{
/// @todo Also forward the representative index and the mouse mode in this call
d->modelHelper->onIndicesClicked(clickedMarkers);
}
}
void ItemMarkerTiler::onIndicesMoved(const TileIndex::List& tileIndicesList, const GeoCoordinates& targetCoordinates,
const QPersistentModelIndex& targetSnapIndex)
{
QList<QPersistentModelIndex> movedMarkers;
if (tileIndicesList.isEmpty())
{
// complicated case: all selected markers were moved
QModelIndexList selectedIndices = d->selectionModel->selectedIndexes();
for (int i = 0 ; i < selectedIndices.count() ; ++i)
{
// TODO: correctly handle items with multiple columns
QModelIndex movedMarker = selectedIndices.at(i);
if (movedMarker.column() == 0)
{
movedMarkers << movedMarker;
}
}
}
else
{
// only the tiles in tileIndicesList were moved
for (int i = 0 ; i < tileIndicesList.count() ; ++i)
{
const TileIndex tileIndex = tileIndicesList.at(i);
movedMarkers << getTileMarkerIndices(tileIndex);
}
}
d->modelHelper->onIndicesMoved(movedMarkers, targetCoordinates, targetSnapIndex);
}
void ItemMarkerTiler::slotSourceModelLayoutChanged()
{
setDirty();
}
void ItemMarkerTiler::setActive(const bool state)
{
d->activeState = state;
}
AbstractMarkerTiler::Tile* ItemMarkerTiler::tileNew()
{
return new MyTile();
}
AbstractMarkerTiler::TilerFlags ItemMarkerTiler::tilerFlags() const
{
TilerFlags resultFlags = FlagNull;
if (d->modelHelper->modelFlags().testFlag(GeoModelHelper::FlagMovable))
{
resultFlags |= FlagMovable;
}
return resultFlags;
}
GeoGroupState ItemMarkerTiler::getGlobalGroupState()
{
if (d->selectionModel)
{
if (d->selectionModel->hasSelection())
{
return SelectedMask;
}
}
return SelectedNone;
}
} // namespace Digikam
#include "moc_itemmarkertiler.cpp"
|