X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.cpp;fp=src%2Fuisupport%2Fbufferviewfilter.cpp;h=4c5d4a9c6e3673472bceee45bec89d4a50f764f6;hp=c829267a7bc9e822097dfdeae4e47b02395dae72;hb=30cc5367bf38d8720e55ece5cab218c4b52e0dbf;hpb=bd2417d2ac819a46436c4f029c880d7f26b9e2a2 diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index c829267a..4c5d4a9c 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -33,13 +33,6 @@ #include "networkmodel.h" #include "uistyle.h" -class CheckRemovalEvent : public QEvent -{ -public: - CheckRemovalEvent(const QModelIndex &source_index) : QEvent(QEvent::User), index(source_index) {}; - QPersistentModelIndex index; -}; - /***************************************** * The Filter for the Tree View @@ -57,9 +50,6 @@ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig * setDynamicSortFilter(true); - connect(this, SIGNAL(_dataChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(_q_sourceDataChanged(QModelIndex, QModelIndex))); - _enableEditMode.setCheckable(true); _enableEditMode.setChecked(_editMode); connect(&_enableEditMode, SIGNAL(toggled(bool)), this, SLOT(enableEditMode(bool))); @@ -542,34 +532,6 @@ bool BufferViewFilter::setCheckedState(const QModelIndex &index, Qt::CheckState } -void BufferViewFilter::checkPreviousCurrentForRemoval(const QModelIndex ¤t, const QModelIndex &previous) -{ - Q_UNUSED(current); - if (previous.isValid()) - QCoreApplication::postEvent(this, new CheckRemovalEvent(previous)); -} - - -void BufferViewFilter::customEvent(QEvent *event) -{ - if (event->type() != QEvent::User) - return; - - CheckRemovalEvent *removalEvent = static_cast(event); - checkItemForRemoval(removalEvent->index); - - event->accept(); -} - - -void BufferViewFilter::checkItemsForRemoval(const QModelIndex &topLeft, const QModelIndex &bottomRight) -{ - QModelIndex source_topLeft = mapToSource(topLeft); - QModelIndex source_bottomRight = mapToSource(bottomRight); - emit _dataChanged(source_topLeft, source_bottomRight); -} - - bool BufferViewFilter::bufferIdLessThan(const BufferId &left, const BufferId &right) { Q_CHECK_PTR(Client::networkModel());