X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=ae39dc18c45b9818207c0bec8e9d23ce536774f7;hp=eef6a2f03514ccafae7c1a6e405905bf650a33f2;hb=1989f165c2b754a42d3f06dfb5c33afd6111d820;hpb=06a03c2c69ee934aaeec83512bae2fffee83a340 diff --git a/src/core/core.h b/src/core/core.h index eef6a2f0..ae39dc18 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005/06 by The Quassel Team * + * Copyright (C) 2005-08 by the Quassel Project * * 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 * @@ -27,6 +27,7 @@ #include #include "global.h" +#include "types.h" class CoreSession; class Storage; @@ -45,20 +46,25 @@ class Core : public QObject { static QVariant connectLocalClient(QString user, QString passwd); static void disconnectLocalClient(); + static void saveState(); + static void restoreState(); + private slots: - //void recvProxySignal(CoreSignal, QVariant, QVariant, QVariant); - bool startListening(uint port = DEFAULT_PORT); + bool startListening(uint port = Global::defaultPort); void stopListening(); void incomingConnection(); void clientHasData(); void clientDisconnected(); + bool initStorage(QVariantMap dbSettings, bool setup); + bool initStorage(QVariantMap dbSettings); + private: Core(); ~Core(); void init(); static Core *instanceptr; - + //! Initiate a session for the user with the given credentials if one does not already exist. /** This function is called during the init process for a new client. If there is no session for the * given user, one is created. @@ -66,15 +72,19 @@ class Core : public QObject { * \return A QVariant containing the session data, e.g. global data and buffers */ QVariant initSession(UserId userId); - void processClientInit(QTcpSocket *socket, const QVariant &v); + void processClientInit(QTcpSocket *socket, const QVariantMap &msg); + void processCoreSetup(QTcpSocket *socket, QVariantMap &msg); + + QStringList availableStorageProviders(); UserId guiUser; QHash sessions; Storage *storage; QTcpServer server; // TODO: implement SSL - QHash validClients; QHash blockSizes; + + bool configured; }; #endif