projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing crashes when removing buffers from a view
[quassel.git]
/
src
/
uisupport
/
bufferview.cpp
diff --git
a/src/uisupport/bufferview.cpp
b/src/uisupport/bufferview.cpp
index
c168eaa
..
180db0d
100644
(file)
--- a/
src/uisupport/bufferview.cpp
+++ b/
src/uisupport/bufferview.cpp
@@
-191,10
+191,10
@@
void BufferView::joinChannel(const QModelIndex &index) {
}
void BufferView::keyPressEvent(QKeyEvent *event) {
}
void BufferView::keyPressEvent(QKeyEvent *event) {
- if(
event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete
) {
+ if(
(event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete) && !selectionModel()->selectedIndexes().isEmpty()
) {
event->accept();
QModelIndex index = selectionModel()->selectedIndexes().first();
event->accept();
QModelIndex index = selectionModel()->selectedIndexes().first();
- if(index.isValid()) {
+ if(index.isValid()
&& index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType
) {
emit removeBuffer(index);
}
}
emit removeBuffer(index);
}
}