X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fcoreconnection.h;h=7902022015e1ec098fffea21042f728efcfe0c24;hp=c6b2e2612f1ca86c8b6df9fa2f5e6e9b446fe45f;hb=158443f71d48215eea8b47b836b61afd77654b78;hpb=e50ae7a06fc4e5d3a911c361d30953410deab609 diff --git a/src/client/coreconnection.h b/src/client/coreconnection.h index c6b2e261..79020220 100644 --- a/src/client/coreconnection.h +++ b/src/client/coreconnection.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,11 +18,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CORECONNECTION_H_ -#define CORECONNECTION_H_ +#pragma once -#include "QPointer" -#include "QTimer" +#include "client-export.h" + +#include +#include +#include #ifdef HAVE_SSL # include @@ -30,10 +32,6 @@ # include #endif -#ifdef HAVE_KDE4 -# include -#endif - #include "coreaccount.h" #include "remotepeer.h" #include "types.h" @@ -45,7 +43,7 @@ class Network; class Peer; class SignalProxy; -class CoreConnection : public QObject +class CLIENT_EXPORT CoreConnection : public QObject { Q_OBJECT @@ -58,7 +56,7 @@ public: Synchronized }; - CoreConnection(QObject *parent = 0); + CoreConnection(QObject *parent = nullptr); void init(); @@ -77,6 +75,8 @@ public: //! Check if we consider the last connect as reconnect bool wasReconnect() const { return _wasReconnect; } + QPointer peer() const; + public slots: bool connectToCore(AccountId = 0); void reconnectToCore(); @@ -99,12 +99,11 @@ signals: void progressValueChanged(int value); void progressTextChanged(const QString &); - void startCoreSetup(const QVariantList &backendInfo); + void startCoreSetup(const QVariantList &backendInfo, const QVariantList &authenticatorInfo); void coreSetupSuccess(); void coreSetupFailed(const QString &error); - void startInternalCore(); - void connectToInternalCore(InternalPeer *connection); + void connectToInternalCore(QPointer connection); // These signals MUST be handled synchronously! void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage = QString()); @@ -148,29 +147,29 @@ private slots: void reconnectIntervalChanged(const QVariant &interval); void reconnectTimeout(); -#ifdef HAVE_KDE4 - void solidNetworkStatusChanged(Solid::Networking::Status status); -#endif + void onlineStateChanged(bool isOnline); private: QPointer _authHandler; QPointer _peer; - ConnectionState _state; + ConnectionState _state{Disconnected}; QTimer _reconnectTimer; - bool _wantReconnect; - bool _wasReconnect; + bool _wantReconnect{false}; + bool _wasReconnect{false}; QSet _netsToSync; int _numNetsToSync; - int _progressMinimum, _progressMaximum, _progressValue; + int _progressMinimum{0}, _progressMaximum{-1}, _progressValue{-1}; QString _progressText; - bool _resetting; + bool _resetting{false}; CoreAccount _account; CoreAccountModel *accountModel() const; + QPointer _qNetworkConfigurationManager; + friend class CoreConfigWizard; }; @@ -186,5 +185,3 @@ inline QString CoreConnection::progressText() const { return _progressText; } inline CoreConnection::ConnectionState CoreConnection::state() const { return _state; } inline bool CoreConnection::isConnected() const { return state() >= Connected; } inline CoreAccount CoreConnection::currentAccount() const { return _account; } - -#endif