Remove old 'remove buffer' KeyPress code
authorgenius3000 <genius3000@g3k.solutions>
Thu, 27 Jul 2017 08:00:05 +0000 (02:00 -0600)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 4 Feb 2018 22:42:24 +0000 (23:42 +0100)
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
src/uisupport/bufferview.h

index bee4c74..700e7a9 100644 (file)
@@ -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);
 }
 
index 26102fd..187b697 100644 (file)
@@ -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 *);