/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#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
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)));
}
-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<CheckRemovalEvent *>(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());