From e7e564dcf469faa4c47383368a58cedbe3a204e6 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Wed, 20 Jun 2007 13:49:30 +0000 Subject: [PATCH] still continuing separation of gui and data and file reorganisation: bufferviewwidget got split into: - treemodel (a basic tree model for easy inheritance) - buffertreemodel (fancy version of treemodel) - bufferviewwidget (not much more left here then pure gui stuff) bufferview got split into: - bufferviewfilter - bufferview --- src/client/client.cpp | 2 - src/client/client.h | 2 +- src/qtgui/CMakeLists.txt | 8 +- src/qtgui/bufferview.cpp | 54 +---- src/qtgui/bufferview.h | 44 +--- src/qtgui/bufferviewwidget.cpp | 369 --------------------------------- src/qtgui/bufferviewwidget.h | 117 +---------- src/qtgui/mainwin.cpp | 1 - src/qtgui/mainwin.h | 4 +- 9 files changed, 16 insertions(+), 585 deletions(-) diff --git a/src/client/client.cpp b/src/client/client.cpp index 5211214c..a04361cc 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -22,7 +22,6 @@ #include "clientproxy.h" #include "mainwin.h" #include "buffer.h" -#include "bufferviewwidget.h" #include "util.h" Client * Client::instanceptr = 0; @@ -52,7 +51,6 @@ Client::Client() { clientProxy = ClientProxy::instance(); //mainWin = new MainWin(); - _bufferModel = new BufferTreeModel(0); // FIXME connect(this, SIGNAL(bufferSelected(Buffer *)), _bufferModel, SLOT(selectBuffer(Buffer *))); diff --git a/src/client/client.h b/src/client/client.h index 3c6b56f9..82e3e844 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -29,11 +29,11 @@ #include "buffer.h" #include "message.h" #include "clientproxy.h" +#include "buffertreemodel.h" //#include "bufferviewwidget.h" class MainWin; class ClientProxy; -class BufferTreeModel; class Client : public QObject { Q_OBJECT diff --git a/src/qtgui/CMakeLists.txt b/src/qtgui/CMakeLists.txt index 367efa45..99c9de7c 100644 --- a/src/qtgui/CMakeLists.txt +++ b/src/qtgui/CMakeLists.txt @@ -1,15 +1,15 @@ SET(qtgui_SRCS chatwidget.cpp channelwidgetinput.cpp tabcompleter.cpp mainwin.cpp serverlist.cpp bufferwidget.cpp - identities.cpp coreconnectdlg.cpp bufferview.cpp bufferviewwidget.cpp style.cpp settingsdlg.cpp settingspages.cpp) + identities.cpp coreconnectdlg.cpp bufferview.cpp bufferviewwidget.cpp bufferviewfilter.cpp style.cpp settingsdlg.cpp settingspages.cpp) SET(qtgui_HDRS style.h) SET(qtgui_MOCS chatwidget.h channelwidgetinput.h tabcompleter.h mainwin.h serverlist.h identities.h coreconnectdlg.h - bufferview.h bufferwidget.h bufferviewwidget.h settingsdlg.h settingspages.h) + bufferview.h bufferwidget.h bufferviewwidget.h bufferviewfilter.h settingsdlg.h settingspages.h) SET(qtgui_UICS identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui mainwin.ui nickeditdlg.ui serverlistdlg.ui servereditdlg.ui coreconnectdlg.ui ircwidget.ui bufferviewwidget.ui bufferwidget.ui settingsdlg.ui buffermgmntsettingspage.ui connectionsettingspage.ui) -SET(client_SRCS ../client/client.cpp ../client/clientproxy.cpp ../client/buffer.cpp) -SET(client_MOCS ../client/client.h ../client/clientproxy.h ../client/buffer.h) +SET(client_SRCS ../client/client.cpp ../client/clientproxy.cpp ../client/buffer.cpp ../client/treemodel.cpp ../client/buffertreemodel.cpp) +SET(client_MOCS ../client/client.h ../client/clientproxy.h ../client/buffer.h ../client/treemodel.h ../client/buffertreemodel.h) # This prepends ui/ to the UIC names, so we don't have to do this ourselves. FOREACH(ui ${qtgui_UICS}) diff --git a/src/qtgui/bufferview.cpp b/src/qtgui/bufferview.cpp index d30e4da1..f8054189 100644 --- a/src/qtgui/bufferview.cpp +++ b/src/qtgui/bufferview.cpp @@ -19,58 +19,6 @@ ***************************************************************************/ #include "bufferview.h" -#include "bufferviewwidget.h" - -/***************************************** -* The TreeView showing the Buffers -*****************************************/ -BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, Modes filtermode, QStringList nets, QObject *parent) : QSortFilterProxyModel(parent) { - setSourceModel(model); - mode = filtermode; - networks = nets; - - connect(model, SIGNAL(invalidateFilter()), this, SLOT(invalidateMe())); - connect(model, SIGNAL(updateSelection(const QModelIndex &, QItemSelectionModel::SelectionFlags)), this, SLOT(select(const QModelIndex &, QItemSelectionModel::SelectionFlags))); - - connect(this, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), model, SLOT(changeCurrent(const QModelIndex &, const QModelIndex &))); - connect(this, SIGNAL(doubleClicked(const QModelIndex &)), model, SLOT(doubleClickReceived(const QModelIndex &))); -} - -void BufferViewFilter::invalidateMe() { - invalidateFilter(); -} - -void BufferViewFilter::select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) { - emit updateSelection(mapFromSource(index), command); -} - -void BufferViewFilter::changeCurrent(const QModelIndex ¤t, const QModelIndex &previous) { - emit currentChanged(mapToSource(current), mapToSource(previous)); -} - -void BufferViewFilter::doubleClickReceived(const QModelIndex &clicked) { - emit doubleClicked(mapToSource(clicked)); -} - -bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { - QModelIndex child = source_parent.child(source_row, 0); - if(!child.isValid()) - return true; // can't imagine this case but true sounds good :) - - Buffer::Type bufferType = (Buffer::Type) child.data(BufferTreeModel::BufferTypeRole).toInt(); - if((mode & NoChannels) && bufferType == Buffer::ChannelBuffer) return false; - if((mode & NoQueries) && bufferType == Buffer::QueryBuffer) return false; - if((mode & NoServers) && bufferType == Buffer::ServerBuffer) return false; - - bool isActive = child.data(BufferTreeModel::BufferActiveRole).toBool(); - if((mode & NoActive) && isActive) return false; - if((mode & NoInactive) && !isActive) return false; - - QString net = child.data(Qt::DisplayRole).toString(); - if((mode & SomeNets) && !networks.contains(net)) return false; - - return true; -} /***************************************** * The TreeView showing the Buffers @@ -84,6 +32,7 @@ void BufferView::init() { setIndentation(10); header()->hide(); header()->hideSection(1); + expandAll(); setDragEnabled(true); setAcceptDrops(true); @@ -93,7 +42,6 @@ void BufferView::init() { connect(this, SIGNAL(doubleClicked(const QModelIndex &)), model(), SLOT(doubleClickReceived(const QModelIndex &))); connect(model(), SIGNAL(updateSelection(const QModelIndex &, QItemSelectionModel::SelectionFlags)), selectionModel(), SLOT(select(const QModelIndex &, QItemSelectionModel::SelectionFlags))); - expandAll(); } void BufferView::setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QStringList nets) { diff --git a/src/qtgui/bufferview.h b/src/qtgui/bufferview.h index 6fcadf86..561cae72 100644 --- a/src/qtgui/bufferview.h +++ b/src/qtgui/bufferview.h @@ -18,51 +18,13 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _BUFFERVIEWWIDGET_H_ -#define _BUFFERVIEWWIDGET_H_ +#ifndef _BUFFERVIEW_H_ +#define _BUFFERVIEW_H_ #include #include -#include "buffer.h" -/***************************************** - * Buffer View Filter - *****************************************/ -class BufferViewFilter : public QSortFilterProxyModel { - Q_OBJECT - -public: - enum Mode { - NoActive = 0x01, - NoInactive = 0x02, - SomeNets = 0x04, - AllNets = 0x08, - NoChannels = 0x10, - NoQueries = 0x20, - NoServers = 0x40 - }; - Q_DECLARE_FLAGS(Modes, Mode) - - BufferViewFilter(QAbstractItemModel *model, Modes mode, QStringList nets, QObject *parent = 0); - -public slots: - void invalidateMe(); - void changeCurrent(const QModelIndex &, const QModelIndex &); - void doubleClickReceived(const QModelIndex &); - void select(const QModelIndex &, QItemSelectionModel::SelectionFlags); - -signals: - void currentChanged(const QModelIndex &, const QModelIndex &); - void doubleClicked(const QModelIndex &); - void updateSelection(const QModelIndex &, QItemSelectionModel::SelectionFlags); - -private: - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; - - Modes mode; - QStringList networks; -}; -Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes) +#include "bufferviewfilter.h" /***************************************** * The TreeView showing the Buffers diff --git a/src/qtgui/bufferviewwidget.cpp b/src/qtgui/bufferviewwidget.cpp index a78754e7..10b921e4 100644 --- a/src/qtgui/bufferviewwidget.cpp +++ b/src/qtgui/bufferviewwidget.cpp @@ -18,377 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "global.h" #include "bufferviewwidget.h" -/***************************************** - * Buffer Items stored in the Tree Model - *****************************************/ -TreeItem::TreeItem(QList &data, TreeItem *parent) { - itemData = data; - parentItem = parent; - foreground = Qt::black; -} - -TreeItem::TreeItem(TreeItem *parent) { - itemData = QList(); - parentItem = parent; - foreground = Qt::black; -} - -TreeItem::~TreeItem() { - qDeleteAll(childItems); -} - -void TreeItem::appendChild(TreeItem *item) { - childItems.append(item); -} - -void TreeItem::removeChild(int row) { - childItems.removeAt(row); -} - -TreeItem *TreeItem::child(int row) { - return childItems.value(row); -} - -int TreeItem::childCount() const { - return childItems.count(); -} - -int TreeItem::row() const { - if(parentItem) - return parentItem->childItems.indexOf(const_cast(this)); - else - return 0; -} - -TreeItem *TreeItem::parent() { - return parentItem; -} - -int TreeItem::columnCount() const { - return itemData.count(); -} - -void TreeItem::setForeground(QColor newcolor) { - foreground = newcolor; -} - -QVariant TreeItem::data(int column, int role) const { - switch(role) { - case Qt::DisplayRole: - if(column < itemData.count()) - return itemData[column]; - else - return QVariant(); - - case Qt::ForegroundRole: - return foreground; - - default: - return QVariant(); - - } -} - -/***************************************** -* Fancy Buffer Items -*****************************************/ -BufferTreeItem::BufferTreeItem(Buffer *buffer, TreeItem *parent) : TreeItem(parent) { - buf = buffer; - activity = Buffer::NoActivity; -} - -void BufferTreeItem::setActivity(const Buffer::ActivityLevel &level) { - activity = level; -} - -QString BufferTreeItem::text(int column) const { - switch(column) { - case 0: - return buf->displayName(); - case 1: - return buf->networkName(); - default: - return QString(); - } -} - -QColor BufferTreeItem::foreground(int column) const { - // for the time beeing we ignore the column :) - if(activity & Buffer::Highlight) { - return QColor(Qt::red); - } else if(activity & Buffer::NewMessage) { - return QColor(Qt::darkYellow); - } else if(activity & Buffer::OtherActivity) { - return QColor(Qt::darkGreen); - } else { - if(buf->isActive()) - return QColor(Qt::black); - else - return QColor(Qt::gray); - } -} - - -QVariant BufferTreeItem::data(int column, int role) const { - switch(role) { - case Qt::DisplayRole: - return text(column); - case Qt::ForegroundRole: - return foreground(column); - case BufferTreeModel::BufferTypeRole: - return buf->bufferType(); - case BufferTreeModel::BufferActiveRole: - return buf->isActive(); - default: - return QVariant(); - } -} - -/***************************************** - * BufferTreeModel - *****************************************/ -BufferTreeModel::BufferTreeModel(QObject *parent) : QAbstractItemModel(parent) { - QList rootData; - rootData << "Buffer" << "Network"; - rootItem = new TreeItem(rootData, 0); - - connect(this, SIGNAL(fakeUserInput(BufferId, QString)), ClientProxy::instance(), SLOT(gsUserInput(BufferId, QString))); -} - -BufferTreeModel::~BufferTreeModel() { - delete rootItem; -} - -QModelIndex BufferTreeModel::index(int row, int column, const QModelIndex &parent) const { - if(!hasIndex(row, column, parent)) - return QModelIndex(); - - TreeItem *parentItem; - - if(!parent.isValid()) - parentItem = rootItem; - else - parentItem = static_cast(parent.internalPointer()); - - TreeItem *childItem = parentItem->child(row); - if(childItem) - return createIndex(row, column, childItem); - else - return QModelIndex(); -} - -QModelIndex BufferTreeModel::parent(const QModelIndex &index) const { - if(!index.isValid()) - return QModelIndex(); - - TreeItem *childItem = static_cast(index.internalPointer()); - TreeItem *parentItem = childItem->parent(); - - if(parentItem == rootItem) - return QModelIndex(); - - return createIndex(parentItem->row(), 0, parentItem); -} - -int BufferTreeModel::rowCount(const QModelIndex &parent) const { - TreeItem *parentItem; - if(parent.column() > 0) - return 0; - - if(!parent.isValid()) - parentItem = rootItem; - else - parentItem = static_cast(parent.internalPointer()); - - return parentItem->childCount(); -} - -int BufferTreeModel::columnCount(const QModelIndex &parent) const { - if(parent.isValid()) - return static_cast(parent.internalPointer())->columnCount(); - else - return rootItem->columnCount(); -} - -QVariant BufferTreeModel::data(const QModelIndex &index, int role) const { - if(!index.isValid()) - return QVariant(); - - TreeItem *item = static_cast(index.internalPointer()); - return item->data(index.column(), role); -} - -Qt::ItemFlags BufferTreeModel::flags(const QModelIndex &index) const { - if(!index.isValid()) - return 0; - - // I think this is pretty ugly.. - if(isBufferIndex(index)) { - Buffer *buffer = getBufferByIndex(index); - if(buffer->bufferType() == Buffer::QueryBuffer) - return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled; - else - return Qt::ItemIsEnabled | Qt::ItemIsSelectable; - } else { - return Qt::ItemIsEnabled | Qt::ItemIsDropEnabled; - } -} - -QVariant BufferTreeModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) - return rootItem->data(section, role); - else - return QVariant(); -} - -bool BufferTreeModel::removeRow(int row, const QModelIndex &parent) { - beginRemoveRows(parent, row, row); - TreeItem *item = static_cast(parent.internalPointer()); - item->removeChild(row); - endRemoveRows(); - return true; -} - -bool BufferTreeModel::isBufferIndex(const QModelIndex &index) const { - return parent(index) != QModelIndex(); -} - -Buffer *BufferTreeModel::getBufferByIndex(const QModelIndex &index) const { - BufferTreeItem *item = static_cast(index.internalPointer()); - return item->buffer(); -} - -QModelIndex BufferTreeModel::getOrCreateNetworkItemIndex(Buffer *buffer) { - QString net = buffer->networkName(); - - if(networkItem.contains(net)) { - return index(networkItem[net]->row(), 0); - } else { - QList data; - data << net << ""; - - int nextRow = rootItem->childCount(); - - beginInsertRows(QModelIndex(), nextRow, nextRow); - rootItem->appendChild(new TreeItem(data, rootItem)); - endInsertRows(); - - networkItem[net] = rootItem->child(nextRow); - return index(nextRow, 0); - } -} - -QModelIndex BufferTreeModel::getOrCreateBufferItemIndex(Buffer *buffer) { - QModelIndex networkItemIndex = getOrCreateNetworkItemIndex(buffer); - - if(bufferItem.contains(buffer)) { - return index(bufferItem[buffer]->row(), 0, networkItemIndex); - } else { - // first we determine the parent of the new Item - TreeItem *networkItem = static_cast(networkItemIndex.internalPointer()); - - int nextRow = networkItem->childCount(); - - beginInsertRows(networkItemIndex, nextRow, nextRow); - networkItem->appendChild(new BufferTreeItem(buffer, networkItem)); - endInsertRows(); - - bufferItem[buffer] = static_cast(networkItem->child(nextRow)); - return index(nextRow, 0, networkItemIndex); - } -} - -QStringList BufferTreeModel::mimeTypes() const { - QStringList types; - types << "application/Quassel/BufferItem/row" - << "application/Quassel/BufferItem/network"; - return types; -} - -QMimeData *BufferTreeModel::mimeData(const QModelIndexList &indexes) const { - QMimeData *mimeData = new QMimeData(); - - QModelIndex index = indexes.first(); - - mimeData->setData("application/Quassel/BufferItem/row", QByteArray::number(index.row())); - mimeData->setData("application/Quassel/BufferItem/network", getBufferByIndex(index)->networkName().toUtf8()); - return mimeData; -} - -bool BufferTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { - int sourcerow = data->data("application/Quassel/BufferItem/row").toInt(); - QString network = QString::fromUtf8(data->data("application/Quassel/BufferItem/network")); - - if(!networkItem.contains(network)) - return false; - - if(!isBufferIndex(parent)) // dropping at a network -> no merging needed - return false; - - Buffer *sourceBuffer = static_cast(networkItem[network]->child(sourcerow))->buffer(); - Buffer *targetBuffer = getBufferByIndex(parent); - - if(sourceBuffer == targetBuffer) // we won't merge with ourself :) - return false; - - /* - if(QMessageBox::warning(static_cast(QObject::parent()), - tr("Merge Buffers?"), - tr("Do you really want to merge the following Buffers?
%1.%2
%3.%4").arg(sourceBuffer->networkName()).arg(sourceBuffer->bufferName()).arg(targetBuffer->networkName()).arg(targetBuffer->bufferName()), - QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) - return false; - - */ - qDebug() << "merging" << sourceBuffer->bufferName() << "with" << targetBuffer->bufferName(); - bufferItem.remove(getBufferByIndex(parent)); - removeRow(parent.row(), BufferTreeModel::parent(parent)); - - return true; -} - -void BufferTreeModel::bufferUpdated(Buffer *buffer) { - QModelIndex itemindex = getOrCreateBufferItemIndex(buffer); - emit invalidateFilter(); - emit dataChanged(itemindex, itemindex); -} - -// This Slot indicates that the user has selected a different buffer in the gui -void BufferTreeModel::changeCurrent(const QModelIndex ¤t, const QModelIndex &previous) { - if(isBufferIndex(current)) { - currentBuffer = getBufferByIndex(current); - bufferActivity(Buffer::NoActivity, currentBuffer); - emit bufferSelected(currentBuffer); - emit updateSelection(current, QItemSelectionModel::ClearAndSelect); - } -} - -// we received a double click on a buffer, so we're going to join it -void BufferTreeModel::doubleClickReceived(const QModelIndex &clicked) { - if(isBufferIndex(clicked)) { - Buffer *buffer = getBufferByIndex(clicked); - if(!buffer->isStatusBuffer()) - emit fakeUserInput(buffer->bufferId(), QString("/join " + buffer->bufferName())); - } - -} - -void BufferTreeModel::bufferActivity(Buffer::ActivityLevel level, Buffer *buffer) { - if(bufferItem.contains(buffer) and buffer != currentBuffer) - bufferItem[buffer]->setActivity(level); - else - bufferItem[buffer]->setActivity(Buffer::NoActivity); - bufferUpdated(buffer); -} - -void BufferTreeModel::selectBuffer(Buffer *buffer) { - QModelIndex index = getOrCreateBufferItemIndex(buffer); - emit updateSelection(index, QItemSelectionModel::ClearAndSelect); -} - - /***************************************** * This Widget Contains the BufferView *****************************************/ diff --git a/src/qtgui/bufferviewwidget.h b/src/qtgui/bufferviewwidget.h index 81b6455a..e6e21164 100644 --- a/src/qtgui/bufferviewwidget.h +++ b/src/qtgui/bufferviewwidget.h @@ -18,123 +18,15 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _BUFFERVIEW_H_ -#define _BUFFERVIEW_H_ +#ifndef _BUFFERVIEWWIDGET_H_ +#define _BUFFERVIEWWIDGET_H_ #include #include -#include "clientproxy.h" -#include "buffer.h" -#include "ui_bufferviewwidget.h" +#include "bufferviewfilter.h" #include "bufferview.h" - -/***************************************** - * general item used in the Tree Model - *****************************************/ -class TreeItem { -public: - TreeItem(QList &data, TreeItem *parent = 0); - TreeItem(TreeItem *parent = 0); - virtual ~TreeItem(); - - void appendChild(TreeItem *child); - void removeChild(int row); - - TreeItem *child(int row); - int childCount() const; - int columnCount() const; - virtual QVariant data(int column, int role) const; - int row() const; - TreeItem *parent(); - - void setForeground(QColor); - -private: - QList childItems; - TreeItem *parentItem; - QList itemData; - - QColor foreground; -}; - - -/***************************************** - * Fancy Buffer Items - *****************************************/ -class BufferTreeItem : public TreeItem{ -public: - BufferTreeItem(Buffer *, TreeItem *parent = 0); - QVariant data(int column, int role) const; - Buffer *buffer() const { return buf; } - void setActivity(const Buffer::ActivityLevel &); - -private: - QString text(int column) const; - QColor foreground(int column) const; - Buffer *buf; - Buffer::ActivityLevel activity; -}; - - -/***************************************** - * BufferTreeModel - *****************************************/ -class BufferTreeModel : public QAbstractItemModel { - Q_OBJECT - -public: - enum myRoles { - BufferTypeRole = Qt::UserRole, - BufferActiveRole - }; - - - BufferTreeModel(QObject *parent = 0); - ~BufferTreeModel(); - - QVariant data(const QModelIndex &index, int role) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - - void clearActivity(Buffer *buffer); - -public slots: - void bufferUpdated(Buffer *); - void changeCurrent(const QModelIndex &, const QModelIndex &); - void selectBuffer(Buffer *buffer); - void doubleClickReceived(const QModelIndex &); - void bufferActivity(Buffer::ActivityLevel, Buffer *buffer); - -signals: - void bufferSelected(Buffer *); - void invalidateFilter(); - void fakeUserInput(BufferId, QString); - void updateSelection(const QModelIndex &, QItemSelectionModel::SelectionFlags); - -private: - bool isBufferIndex(const QModelIndex &) const; - Buffer *getBufferByIndex(const QModelIndex &) const; - QModelIndex getOrCreateNetworkItemIndex(Buffer *buffer); - QModelIndex getOrCreateBufferItemIndex(Buffer *buffer); - - bool removeRow(int row, const QModelIndex &parent = QModelIndex()); - - QStringList mimeTypes() const; - QMimeData *mimeData(const QModelIndexList &) const; - bool dropMimeData(const QMimeData *, Qt::DropAction, int, int, const QModelIndex &); - TreeItem *rootItem; - - QHash networkItem; - QHash bufferItem; - Buffer *currentBuffer; -}; - - +#include "ui_bufferviewwidget.h" /***************************************** @@ -150,7 +42,6 @@ public: private: Ui::BufferViewWidget ui; - }; diff --git a/src/qtgui/mainwin.cpp b/src/qtgui/mainwin.cpp index ddb23cfe..05cd7d3d 100644 --- a/src/qtgui/mainwin.cpp +++ b/src/qtgui/mainwin.cpp @@ -30,7 +30,6 @@ #include "mainwin.h" #include "buffer.h" -#include "bufferviewwidget.h" #include "serverlist.h" #include "coreconnectdlg.h" #include "settingsdlg.h" diff --git a/src/qtgui/mainwin.h b/src/qtgui/mainwin.h index 1b32cdd2..d8936583 100644 --- a/src/qtgui/mainwin.h +++ b/src/qtgui/mainwin.h @@ -27,10 +27,12 @@ #include "global.h" #include "message.h" #include "chatwidget.h" +#include "bufferviewfilter.h" +#include "bufferviewwidget.h" class ServerListDlg; class CoreConnectDlg; -class BufferViewDock; +//class BufferViewDock; class Buffer; class BufferWidget; class SettingsDlg; -- 2.20.1