X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore%2Fserver.h;h=32060859df1579590229d2960ba3b5a35c0e58b6;hb=9ac6ae4ee26819874d8843ba09f38a24088d663d;hp=1b92f16dde6f2374d0a0ed34ddf2eb2665295989;hpb=902c95728306e5ba115de84800fc8d5d239c9d62;p=quassel.git diff --git a/src/core/server.h b/src/core/server.h index 1b92f16d..32060859 100644 --- a/src/core/server.h +++ b/src/core/server.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005/06 by The Quassel Team * + * Copyright (C) 2005-07 by the Quassel IRC Team * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -48,7 +48,7 @@ class Server : public QThread { Q_OBJECT public: - Server(UserId uid, uint networkId, QString network); + Server(UserId uid, NetworkId networkId, QString network, const QVariant &previousState = QVariant()); ~Server(); UserId userId() const { return _userId; } @@ -56,13 +56,15 @@ public: // serverState state(); bool isConnected() const { return socket.state() == QAbstractSocket::ConnectedState; } - uint networkId() const; - QString networkName(); // hasbeen getNetwork() + NetworkId networkId() const; + QString networkName() const; // hasbeen getNetwork() - NetworkInfo *networkInfo() { return _networkInfo; } - IrcServerHandler *ircServerHandler() {return _ircServerHandler; } - UserInputHandler *userInputHandler() {return _userInputHandler; } - CtcpHandler *ctcpHandler() {return _ctcpHandler; } + NetworkInfo *networkInfo() const { return _networkInfo; } + IrcServerHandler *ircServerHandler() const { return _ircServerHandler; } + UserInputHandler *userInputHandler() const { return _userInputHandler; } + CtcpHandler *ctcpHandler() const { return _ctcpHandler; } + + QVariant state(); ///< Return data necessary to restore the server's state upon core restart public slots: // void setServerOptions(); @@ -73,7 +75,10 @@ public slots: void putRawLine(QString input); void putCmd(QString cmd, QStringList params, QString prefix = 0); - //void exitThread(); + +private slots: + void threadFinished(); + void sendPerform(); signals: void serverState(QString net, QVariantMap data); @@ -84,6 +89,8 @@ signals: void connected(uint networkId); void disconnected(uint networkId); + void connectionInitialized(); ///< Emitted after receipt of 001 to indicate that we can now send data to the IRC server + void synchronizeClients(); void queryRequested(QString network, QString nick); @@ -94,12 +101,11 @@ private slots: void socketHasData(); void socketError(QAbstractSocket::SocketError); void socketConnected(); - void socketDisconnected(); void socketStateChanged(QAbstractSocket::SocketState); private: UserId _userId; - uint _networkId; + NetworkId _networkId; QTcpSocket socket; @@ -112,6 +118,8 @@ private: QVariantMap networkSettings; QVariantMap identity; + QVariant _previousState; + CoreSession *coreSession() const; class ParseError : public Exception {