Commit 98bdea2b authored by Maik Qualmann's avatar Maik Qualmann
Browse files

fix syncing thumbbar selection

BUGS: 311652
FIXED-IN: 5.5.0
parent 3da1520f
......@@ -13,4 +13,5 @@ BUGFIXES FROM BUGZILLA:
005 ==> 328321 - Image orientation is not maintained when processing RAW image through BQM.
006 ==> 374922 - digiKam crashes when dropping ext. image into fuzzy search target area.
007 ==> 375019 - Error updating scheme from digikam 4.
008 ==>
008 ==> 311652 - THUMBBAR : wrong items selection with shift key.
009 ==>
......@@ -454,9 +454,7 @@ void StackedView::syncSelection(ImageCategorizedView* from, ImageCategorizedView
{
ImageSortFilterModel* const fromModel = from->imageSortFilterModel();
ImageSortFilterModel* const toModel = to->imageSortFilterModel();
// set current info
QModelIndex currentIndex = toModel->indexForImageInfo(from->currentInfo());
to->selectionModel()->setCurrentIndex(currentIndex, QItemSelectionModel::NoUpdate);
// sync selection
QItemSelection selection = from->selectionModel()->selection();
......@@ -470,6 +468,13 @@ void StackedView::syncSelection(ImageCategorizedView* from, ImageCategorizedView
}
d->syncingSelection = true;
if (currentIndex.isValid())
{
// set current info
to->setCurrentIndex(currentIndex);
}
to->selectionModel()->select(newSelection, QItemSelectionModel::ClearAndSelect);
d->syncingSelection = false;
}
......
......@@ -391,19 +391,10 @@ void ImportStackedView::syncSelection(ImportCategorizedView* const from, ImportC
{
ImportSortFilterModel* const fromModel = from->importSortFilterModel();
ImportSortFilterModel* const toModel = to->importSortFilterModel();
if(!fromModel || !toModel)
{
qCWarning(DIGIKAM_IMPORTUI_LOG) << "one or both of the models are null?! from:" << from << "to:" << to;
return;
}
// set current info
QModelIndex currentIndex = toModel->indexForCamItemInfo(from->currentInfo());
to->selectionModel()->setCurrentIndex(currentIndex, QItemSelectionModel::NoUpdate);
QModelIndex currentIndex = toModel->indexForCamItemInfo(from->currentInfo());
// sync selection
QItemSelection selection = from->selectionModel()->selection();
QItemSelection selection = from->selectionModel()->selection();
QItemSelection newSelection;
foreach(const QItemSelectionRange& range, selection)
......@@ -414,6 +405,13 @@ void ImportStackedView::syncSelection(ImportCategorizedView* const from, ImportC
}
d->syncingSelection = true;
if (currentIndex.isValid())
{
// set current info
to->setCurrentIndex(currentIndex);
}
to->selectionModel()->select(newSelection, QItemSelectionModel::ClearAndSelect);
d->syncingSelection = false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment