From 4ccba157efd91e531a3106012f5d54ba372a0292 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 19 Jun 2007 23:42:47 +0000 Subject: [PATCH] Two hours of bughunting ending between keyboard and chair. Or something like that. Fixed. --- gui/bufferview.cpp | 4 +++- gui/bufferview.h | 2 +- gui/bufferviewwidget.h | 2 +- gui/gui.cpp | 17 +++++++++-------- gui/gui.h | 3 ++- gui/mainwin.cpp | 3 +-- gui/mainwin.h | 12 +++++------- 7 files changed, 22 insertions(+), 21 deletions(-) diff --git a/gui/bufferview.cpp b/gui/bufferview.cpp index 017ce259..d30e4da1 100644 --- a/gui/bufferview.cpp +++ b/gui/bufferview.cpp @@ -92,6 +92,8 @@ void BufferView::init() { connect(selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), model(), SLOT(changeCurrent(const QModelIndex &, const QModelIndex &))); 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) { @@ -110,6 +112,6 @@ void BufferView::dragEnterEvent(QDragEnterEvent *event) { } void BufferView::rowsInserted(const QModelIndex & parent, int start, int end) { - if(parent.parent() == QModelIndex()) setExpanded(parent, true); qDebug() << "expanded"; + if(parent.parent() == QModelIndex()) setExpanded(parent, true); QTreeView::rowsInserted(parent, start, end); } diff --git a/gui/bufferview.h b/gui/bufferview.h index 9daee9f1..6fcadf86 100644 --- a/gui/bufferview.h +++ b/gui/bufferview.h @@ -78,7 +78,7 @@ class BufferView : public QTreeView { void dragEnterEvent(QDragEnterEvent *); - protected slots: + protected: void rowsInserted (const QModelIndex & parent, int start, int end); }; diff --git a/gui/bufferviewwidget.h b/gui/bufferviewwidget.h index a14d173d..24523aed 100644 --- a/gui/bufferviewwidget.h +++ b/gui/bufferviewwidget.h @@ -26,7 +26,7 @@ #include "guiproxy.h" #include "buffer.h" -#include "ui_bufferviewwidget.h" +#include "gui/ui_bufferviewwidget.h" #include "bufferview.h" /***************************************** diff --git a/gui/gui.cpp b/gui/gui.cpp index 9f38d199..1924001b 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -22,7 +22,7 @@ #include "guiproxy.h" #include "mainwin.h" #include "buffer.h" -#include "bufferview.h" +//#include "bufferview.h" #include "bufferviewwidget.h" #include "util.h" @@ -41,6 +41,7 @@ Client *Client::instance() { if(instanceptr) return instanceptr; instanceptr = new Client(); instanceptr->init(); + return instanceptr; } void Client::destroy() { @@ -51,8 +52,9 @@ void Client::destroy() { Client::Client() { clientProxy = ClientProxy::instance(); - mainWin = new MainWin(); - _bufferModel = new BufferTreeModel(mainWin); // FIXME + //mainWin = new MainWin(); + + _bufferModel = new BufferTreeModel(0); // FIXME connect(this, SIGNAL(bufferSelected(Buffer *)), _bufferModel, SLOT(selectBuffer(Buffer *))); connect(this, SIGNAL(bufferUpdated(Buffer *)), _bufferModel, SLOT(bufferUpdated(Buffer *))); @@ -72,10 +74,9 @@ void Client::init() { connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(serverError(QAbstractSocket::SocketError))); connect(Global::instance(), SIGNAL(dataPutLocally(UserId, QString)), this, SLOT(updateCoreData(UserId, QString))); - connect(ClientProxy::instance(), SIGNAL(csUpdateGlobalData(QString, QVariant)), this, SLOT(updateLocalData(QString, QVariant))); - - connect(ClientProxy::instance(), SIGNAL(send(ClientSignal, QVariant, QVariant, QVariant)), this, SLOT(recvProxySignal(ClientSignal, QVariant, QVariant, QVariant))); + connect(clientProxy, SIGNAL(csUpdateGlobalData(QString, QVariant)), this, SLOT(updateLocalData(QString, QVariant))); + connect(clientProxy, SIGNAL(send(ClientSignal, QVariant, QVariant, QVariant)), this, SLOT(recvProxySignal(ClientSignal, QVariant, QVariant, QVariant))); connect(clientProxy, SIGNAL(csServerState(QString, QVariant)), this, SLOT(recvNetworkState(QString, QVariant))); connect(clientProxy, SIGNAL(csServerConnected(QString)), this, SLOT(networkConnected(QString))); connect(clientProxy, SIGNAL(csServerDisconnected(QString)), this, SLOT(networkDisconnected(QString))); @@ -106,15 +107,15 @@ void Client::init() { emit requestBacklog(id, -1, -1); // TODO: use custom settings for backlog request } - //mainWin = new MainWin(); + mainWin = new MainWin(); mainWin->init(); } Client::~Client() { delete mainWin; - foreach(Buffer *buf, buffers.values()) delete buf; delete _bufferModel; + foreach(Buffer *buf, buffers.values()) delete buf; ClientProxy::destroy(); } diff --git a/gui/gui.h b/gui/gui.h index 6ec1dbad..2bf9c02f 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -29,10 +29,11 @@ #include "buffer.h" #include "message.h" #include "guiproxy.h" +#include "bufferviewwidget.h" class MainWin; class ClientProxy; -class BufferTreeModel; +//class BufferTreeModel; class Client : public QObject { Q_OBJECT diff --git a/gui/mainwin.cpp b/gui/mainwin.cpp index 3d2df39b..0adce3db 100644 --- a/gui/mainwin.cpp +++ b/gui/mainwin.cpp @@ -36,8 +36,6 @@ #include "settingsdlg.h" #include "settingspages.h" -LayoutThread *layoutThread; - MainWin::MainWin() : QMainWindow() { ui.setupUi(this); //widget = 0; @@ -144,6 +142,7 @@ void MainWin::setupMenus() { } void MainWin::setupViews() { + BufferTreeModel *model = Client::bufferModel(); // FIXME Where is the delete for that? :p connect(model, SIGNAL(bufferSelected(Buffer *)), this, SLOT(showBuffer(Buffer *))); //connect(this, SIGNAL(bufferSelected(Buffer *)), model, SLOT(selectBuffer(Buffer *))); diff --git a/gui/mainwin.h b/gui/mainwin.h index 41d1a2f7..7876b50d 100644 --- a/gui/mainwin.h +++ b/gui/mainwin.h @@ -35,8 +35,6 @@ class Buffer; class BufferWidget; class SettingsDlg; -extern LayoutThread *layoutThread; - //!\brief The main window and central object of Quassel GUI. /** In addition to displaying the main window including standard stuff like a menubar, * dockwidgets and of course the chat window, this class also stores all data it @@ -99,9 +97,9 @@ class MainWin : public QMainWindow { void setupSettingsDlg(); //void syncToCore(); // implemented in main_mono.cpp or main_gui.cpp //Buffer * getBuffer(QString net, QString buf); - Buffer *getBuffer(BufferId); - BufferId getStatusBufferId(QString net); - BufferId getBufferId(QString net, QString buf); + //Buffer *getBuffer(BufferId); + //BufferId getStatusBufferId(QString net); + //BufferId getBufferId(QString net, QString buf); //void buffersUpdated(); QSystemTrayIcon *systray; @@ -126,8 +124,8 @@ class MainWin : public QMainWindow { QList netViews; - QTimer *layoutTimer; - QList layoutQueue; + //QTimer *layoutTimer; + //QList layoutQueue; }; #endif -- 2.20.1