From 0ba56e60f400621ddc291669dc2c03a8e461c224 Mon Sep 17 00:00:00 2001 From: genius3000 Date: Thu, 27 Jul 2017 02:00:05 -0600 Subject: [PATCH] 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. --- src/uisupport/bufferview.cpp | 17 ----------------- src/uisupport/bufferview.h | 1 - 2 files changed, 18 deletions(-) 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 *); -- 2.20.1