mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 19:35:33 +08:00
Approach to fix "Q_ASSERT(found != end1);" assert as reported by RP
https://swift-project.slack.com/archives/G96QTUBEG/p1546880962000700
This commit is contained in:
committed by
Mat Sutcliffe
parent
ed2acf4d74
commit
33a3984588
@@ -327,7 +327,7 @@ namespace BlackGui
|
|||||||
if (this->isEmpty()) { return 0; }
|
if (this->isEmpty()) { return 0; }
|
||||||
|
|
||||||
const int currentRows = this->rowCount();
|
const int currentRows = this->rowCount();
|
||||||
const ContainerType selected(selectedObjects());
|
const ContainerType selected(this->selectedObjects());
|
||||||
const CVariant deletedObjsVariant = CVariant::from(selected);
|
const CVariant deletedObjsVariant = CVariant::from(selected);
|
||||||
int delta = 0;
|
int delta = 0;
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ContainerType unselectedObjects(container());
|
ContainerType unselectedObjects(this->container());
|
||||||
unselectedObjects.removeIfInSubset(selected);
|
unselectedObjects.removeIfInSubset(selected);
|
||||||
this->updateContainerMaybeAsync(unselectedObjects);
|
this->updateContainerMaybeAsync(unselectedObjects);
|
||||||
delta = currentRows - unselectedObjects.size();
|
delta = currentRows - unselectedObjects.size();
|
||||||
|
|||||||
@@ -466,12 +466,17 @@ namespace BlackGui
|
|||||||
|
|
||||||
QModelIndexList CViewBaseNonTemplate::selectedRows() const
|
QModelIndexList CViewBaseNonTemplate::selectedRows() const
|
||||||
{
|
{
|
||||||
return this->selectionModel()->selectedRows();
|
// make sure this is ordered by row and wee keep the same order as in unselectedRows
|
||||||
|
// if we'd know for sure the indexes are always sorted we can remove the sorting here
|
||||||
|
// Qt docu selectedIndexes: Returns a list of all selected model item indexes. The list contains no duplicates, and is not sorted.
|
||||||
|
QModelIndexList indexes = this->selectionModel()->selectedRows();
|
||||||
|
qSort(indexes);
|
||||||
|
return indexes;
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndexList CViewBaseNonTemplate::unselectedRows() const
|
QModelIndexList CViewBaseNonTemplate::unselectedRows() const
|
||||||
{
|
{
|
||||||
QModelIndexList selected = this->selectedRows();
|
const QModelIndexList selected = this->selectedRows();
|
||||||
QModelIndexList unselected;
|
QModelIndexList unselected;
|
||||||
const int rows = this->rowCount();
|
const int rows = this->rowCount();
|
||||||
for (int r = 0; r < rows; r++)
|
for (int r = 0; r < rows; r++)
|
||||||
|
|||||||
Reference in New Issue
Block a user