Skip to content

Commit

Permalink
possible fix for 226929
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Kraus committed Feb 20, 2012
1 parent 3124bc5 commit cb789bf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/groupmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ void GroupModelPrivate::modifyInModel(Group &group, bool query)

groups.replace(row, newGroup);

emit q->dataChanged(q->index(row, 0),
q->index(row, GroupModel::NumberOfColumns - 1));

// don't sort if it's the first group or last message date
// hasn't changed
Expand All @@ -230,6 +228,9 @@ void GroupModelPrivate::modifyInModel(Group &group, bool query)
emit q->layoutChanged();
}

emit q->dataChanged(q->index(row, 0),
q->index(row, GroupModel::NumberOfColumns - 1));

qDebug() << __PRETTY_FUNCTION__ << ": updated" << newGroup.toString();
break;
}
Expand Down Expand Up @@ -381,16 +382,17 @@ void GroupModelPrivate::eventsAddedSlot(const QList<Event> &events)
changedRows.append(row);
}

foreach (int row, changedRows) {
emit q->dataChanged(q->index(row, 0),
q->index(row, GroupModel::NumberOfColumns - 1));
}

if (sortNeeded) {
emit q->layoutAboutToBeChanged();
qSort(groups.begin(), groups.end(), groupLessThan);
emit q->layoutChanged();
}

foreach (int row, changedRows) {
emit q->dataChanged(q->index(row, 0),
q->index(row, GroupModel::NumberOfColumns - 1));
}
}

void GroupModelPrivate::groupsAddedSlot(const QList<CommHistory::Group> &addedGroups)
Expand Down

0 comments on commit cb789bf

Please sign in to comment.