Skip to content

Commit c5bd5ae

Browse files
tsic404deepin-bot[bot]
authored andcommitted
fix: WeChat and WXChat are recognized as the same
The model's boundary processing error causes the data to be changed out of bounds log: as title pms: BUG-292027
1 parent 448ac00 commit c5bd5ae

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

panels/dock/taskmanager/abstractwindowmonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ QVariant AbstractWindowMonitor::data(const QModelIndex &index, int role) const
5757

5858
void AbstractWindowMonitor::trackWindow(AbstractWindow *window)
5959
{
60-
beginInsertRows(QModelIndex(), m_trackedWindows.size(), m_trackedWindows.size() + 1);
60+
beginInsertRows(QModelIndex(), m_trackedWindows.size(), m_trackedWindows.size());
6161
m_trackedWindows.append(window);
6262
endInsertRows();
6363

panels/dock/taskmanager/rolecombinemodel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RoleCombineModel::RoleCombineModel(QAbstractItemModel *major, QAbstractItemModel
2525

2626
connect(sourceModel(), &QAbstractItemModel::rowsInserted, this, [this, majorRoles, func](const QModelIndex &parent, int first, int last) {
2727
beginInsertRows(index(parent.row(), parent.column()), first, last);
28-
for (int i = first; i < last; i++) {
28+
for (int i = first; i <= last; i++) {
2929
QModelIndex majorIndex = sourceModel()->index(i, 0);
3030
QModelIndex minorIndex = func(majorIndex.data(majorRoles), m_minor);
3131
if (majorIndex.isValid() && minorIndex.isValid())
@@ -35,7 +35,7 @@ RoleCombineModel::RoleCombineModel(QAbstractItemModel *major, QAbstractItemModel
3535
});
3636
connect(sourceModel(), &QAbstractItemModel::columnsInserted, this, [this, majorRoles, func](const QModelIndex &parent, int first, int last) {
3737
beginInsertColumns(index(parent.row(), parent.column()), first, last);
38-
for (int j = first; j < last; j++) {
38+
for (int j = first; j <= last; j++) {
3939
QModelIndex majorIndex = sourceModel()->index(0, j);
4040
QModelIndex minorIndex = func(majorIndex.data(majorRoles), m_minor);
4141
if (majorIndex.isValid() && minorIndex.isValid())
@@ -46,7 +46,7 @@ RoleCombineModel::RoleCombineModel(QAbstractItemModel *major, QAbstractItemModel
4646

4747
connect(sourceModel(), &QAbstractItemModel::rowsRemoved, this, [this](const QModelIndex &parent, int first, int last) {
4848
beginRemoveRows(index(parent.row(), parent.column()), first, last);
49-
for (int i = first; i < last; i++) {
49+
for (int i = first; i <= last; i++) {
5050
if (m_indexMap.contains(qMakePair(i, 0))) {
5151
m_indexMap.remove(qMakePair(i, 0));
5252
}
@@ -55,7 +55,7 @@ RoleCombineModel::RoleCombineModel(QAbstractItemModel *major, QAbstractItemModel
5555
});
5656
connect(sourceModel(), &QAbstractItemModel::columnsRemoved, this, [this](const QModelIndex &parent, int first, int last) {
5757
beginRemoveColumns(index(parent.row(), parent.column()), first, last);
58-
for (int j = first; j < last; j++) {
58+
for (int j = first; j <= last; j++) {
5959
if (m_indexMap.contains(qMakePair(0, j))) {
6060
m_indexMap.remove(qMakePair(0, j));
6161
}

0 commit comments

Comments
 (0)