From 08aac67d4dc813ed541a81d06fb83d9c4fec5834 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Mon, 28 Jan 2008 16:26:45 +0000 Subject: [PATCH] replaced Client::fakeInput() with Client::userInpt() (now static but no longer a slot) if you need sig/slot usage: connect your SIGNAL directly to Client::instance(), SIGNAL(sendInput(BufferInfo, QString)) --- src/client/buffer.cpp | 8 +------- src/client/buffer.h | 4 ---- src/client/client.cpp | 16 ++-------------- src/client/client.h | 4 +--- src/uisupport/bufferview.cpp | 8 +++++--- src/uisupport/nickview.cpp | 2 +- version.inc | 2 +- 7 files changed, 11 insertions(+), 33 deletions(-) diff --git a/src/client/buffer.cpp b/src/client/buffer.cpp index 10f395cf..a316ae15 100644 --- a/src/client/buffer.cpp +++ b/src/client/buffer.cpp @@ -32,8 +32,7 @@ Buffer::Buffer(BufferInfo bufferid, QObject *parent) } BufferInfo Buffer::bufferInfo() const { - // still needed to process user input... *sigh* - // ... and for the gui *sigh* to request the backlogs *sigh* + // still needed by the gui *sigh* to request the backlogs *sigh* return _bufferInfo; } @@ -60,8 +59,3 @@ bool Buffer::layoutMsg() { return layoutQueue.count(); } -void Buffer::processUserInput(QString msg) { - // TODO User Input processing (plugins) -> well, this goes through MainWin into Core for processing... so... - emit userInput(_bufferInfo, msg); -} - diff --git a/src/client/buffer.h b/src/client/buffer.h index f7439137..9bf4b783 100644 --- a/src/client/buffer.h +++ b/src/client/buffer.h @@ -44,8 +44,6 @@ public: QList contents() const; signals: - void userInput(const BufferInfo &, QString); - void msgAppended(AbstractUiMsg *); void msgPrepended(AbstractUiMsg *); void layoutQueueEmpty(); @@ -55,8 +53,6 @@ public slots: void prependMsg(const Message &); bool layoutMsg(); - void processUserInput(QString); - private: BufferInfo _bufferInfo; diff --git a/src/client/client.cpp b/src/client/client.cpp index e7ddd7f1..8cc87e41 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -150,9 +150,6 @@ Buffer *Client::buffer(BufferInfo id) { if(!buff) { Client *client = Client::instance(); buff = new Buffer(id, client); - - connect(buff, SIGNAL(userInput(BufferInfo, QString)), - client, SLOT(userInput(BufferInfo, QString))); connect(buff, SIGNAL(destroyed()), client, SLOT(bufferDestroyed())); client->_buffers[id.uid()] = buff; @@ -243,13 +240,8 @@ void Client::coreIdentityRemoved(IdentityId id) { } /*** ***/ - -void Client::fakeInput(BufferId bufferUid, QString message) { - Buffer *buff = buffer(bufferUid); - if(!buff) - qWarning() << "No Buffer with uid" << bufferUid << "can't send Input" << message; - else - instance()->userInput(buff->bufferInfo(), message); +void Client::userInput(BufferInfo bufferInfo, QString message) { + emit instance()->sendInput(bufferInfo, message); } /*** core connection stuff ***/ @@ -454,7 +446,3 @@ AbstractUiMsg *Client::layoutMsg(const Message &msg) { return instance()->mainUi->layoutMsg(msg); } -void Client::userInput(BufferInfo id, QString msg) { - emit sendInput(id, msg); -} - diff --git a/src/client/client.h b/src/client/client.h index c1567642..4df6685d 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -97,7 +97,7 @@ public: static bool isConnected(); static bool isSynced(); - static void fakeInput(BufferId bufferUid, QString message); + static void userInput(BufferInfo bufferInfo, QString message); static void storeSessionData(const QString &key, const QVariant &data); static QVariant retrieveSessionData(const QString &key, const QVariant &def = QVariant()); @@ -154,8 +154,6 @@ public slots: void setCoreConfiguration(const QVariantMap &settings); - void userInput(BufferInfo, QString); - private slots: void recvSessionData(const QString &key, const QVariant &data); diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 37d0be52..db28ae42 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -19,7 +19,6 @@ ***************************************************************************/ #include "client.h" -//#include "buffer.h" #include "bufferview.h" #include "networkmodel.h" @@ -84,12 +83,15 @@ void BufferView::setModel(QAbstractItemModel *model) { } void BufferView::joinChannel(const QModelIndex &index) { - BufferItem::Type bufferType = (BufferItem::Type)index.data(NetworkModel::BufferTypeRole).toInt(); + BufferItem::Type bufferType = (BufferItem::Type)index.data(NetworkModel::BufferTypeRole).value(); if(bufferType != BufferItem::ChannelType) return; + + BufferInfo bufferInfo = index.data(NetworkModel::BufferInfoRole).value(); - Client::fakeInput(index.data(NetworkModel::BufferIdRole).value(), QString("/JOIN %1").arg(index.sibling(index.row(), 0).data().toString())); + Client::userInput(bufferInfo, QString("/JOIN %1").arg(bufferInfo.buffer())); + // Client::fakeInput(index.data(NetworkModel::BufferIdRole).value(), QString("/JOIN %1").arg(index.sibling(index.row(), 0).data().toString())); } void BufferView::keyPressEvent(QKeyEvent *event) { diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index 0b4a7410..0c4e853b 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -80,6 +80,6 @@ void NickView::showContextMenu(const QPoint & pos ) { QAction *result = nickContextMenu.exec(QCursor::pos()); if (result == whoisAction ) { - Client::instance()->userInput(bufferInfo, "/WHOIS "+username); + Client::userInput(bufferInfo, "/WHOIS "+username); } } diff --git a/version.inc b/version.inc index 6d99efc8..2d21bb26 100644 --- a/version.inc +++ b/version.inc @@ -5,7 +5,7 @@ quasselVersion = "0.2.0-pre"; quasselDate = "2008-01-28"; - quasselBuild = 393; + quasselBuild = 395; //! Minimum client build number the core needs clientBuildNeeded = 358; -- 2.20.1