This should fix most selection-based crashes. Had one caused by something else,
but couldn't reproduce yet. Backtraces welcome :)
_model(model),
_singleBufferScene(false),
_selectingItem(0),
_model(model),
_singleBufferScene(false),
_selectingItem(0),
_selectionStart(-1),
_isSelecting(false),
_fetchingBacklog(false)
_selectionStart(-1),
_isSelecting(false),
_fetchingBacklog(false)
+ // update selection
+ if(_selectionStart >= 0) {
+ int offset = end - start + 1;
+ if(_selectionStart >= start) _selectionStart += offset;
+ if(_selectionEnd >= start) _selectionEnd += offset;
+ if(_firstSelectionRow >= start) _firstSelectionRow += offset;
+ if(_lastSelectionRow >= start) _lastSelectionRow += offset;
+ }
+
if(h > 0) {
_height += h;
for(int i = end+1; i < _lines.count(); i++) {
if(h > 0) {
_height += h;
for(int i = end+1; i < _lines.count(); i++) {
_lines[l]->setSelected(true, minColumn);
}
}
_lines[l]->setSelected(true, minColumn);
}
}
int newstart = qMin(curRow, _firstSelectionRow);
int newend = qMax(curRow, _firstSelectionRow);
int newstart = qMin(curRow, _firstSelectionRow);
int newend = qMax(curRow, _firstSelectionRow);
if(newstart < _selectionStart) {
for(int l = newstart; l < _selectionStart; l++)
_lines[l]->setSelected(true, minColumn);
if(newstart < _selectionStart) {
for(int l = newstart; l < _selectionStart; l++)
_lines[l]->setSelected(true, minColumn);
ColumnHandleItem *firstColHandle, *secondColHandle;
qreal firstColHandlePos, secondColHandlePos;
ColumnHandleItem *firstColHandle, *secondColHandle;
qreal firstColHandlePos, secondColHandlePos;
- ChatItem *_selectingItem, *_lastItem;
- QSet<ChatLine *> _selectedItems;
+ ChatItem *_selectingItem;
int _selectionStartCol, _selectionMinCol;
int _selectionStart;
int _selectionEnd;
int _selectionStartCol, _selectionMinCol;
int _selectionStart;
int _selectionEnd;