From: genius3000 Date: Thu, 27 Jul 2017 08:00:05 +0000 (-0600) Subject: Remove old 'remove buffer' KeyPress code X-Git-Tag: travis-deploy-test~193 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=0ba56e60f400621ddc291669dc2c03a8e461c224 Remove old 'remove buffer' KeyPress code Since commit 9f33f6e4 a 'hide current buffer' shortcut is available. This is the global application shortcut like Sput referenced in http://bugs.quassel-irc.org/issues/668 Keeping a hard-coded KeyPress event doing the same seems unnecessary. Users have also expressed dislike in the use of 'Backspace' for this buffer removal. Unintentional buffer removals are often for some. This commit removes the 'KeyPress' event and cleans up the 'hideCurrentBuffer' code, removing commented (un-needed) code. Reference: http://bugs.quassel-irc.org/issues/1403 Fixes #1403. Closes GH-299. --- diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index bee4c746..700e7a9d 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -217,16 +217,6 @@ void BufferView::joinChannel(const QModelIndex &index) } -void BufferView::keyPressEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete) { - event->accept(); - removeSelectedBuffers(); - } - TreeViewTouch::keyPressEvent(event); -} - - void BufferView::dropEvent(QDropEvent *event) { QModelIndex index = indexAt(event->pos()); @@ -592,13 +582,6 @@ void BufferView::hideCurrentBuffer() //The check above means we won't be looking at a network, which should always be the first row, so we can just go backwards. changeBuffer(Backward); - /*if(removedRows.contains(bufferId)) - continue; - - removedRows << bufferId;*/ - /*if(permanently) - config()->requestRemoveBufferPermanently(bufferId); - else*/ config()->requestRemoveBuffer(bufferId); } diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 26102fd2..187b6973 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -75,7 +75,6 @@ signals: void removeBufferPermanently(const QModelIndex &); protected: - virtual void keyPressEvent(QKeyEvent *); virtual void dropEvent(QDropEvent *event); virtual void rowsInserted(const QModelIndex &parent, int start, int end); virtual void wheelEvent(QWheelEvent *);