const int BufferViewOverlay::_updateEventId = QEvent::registerEventType();
BufferViewOverlay::BufferViewOverlay(QObject *parent)
- : QObject(parent),
- _aboutToUpdate(false),
- _uninitializedViewCount(0),
- _allowedBufferTypes(0),
- _minimumActivity(0)
+ : QObject(parent)
{
}
void updateHelper();
QSet<BufferId> filterBuffersByConfig(const QList<BufferId> &buffers, const BufferViewConfig *config);
- bool _aboutToUpdate;
+ bool _aboutToUpdate{false};
QSet<int> _bufferViewIds;
- int _uninitializedViewCount;
+ int _uninitializedViewCount{0};
QSet<NetworkId> _networkIds;
- int _allowedBufferTypes;
- int _minimumActivity;
+ int _allowedBufferTypes{0};
+ int _minimumActivity{0};
QSet<BufferId> _buffers;
QSet<BufferId> _removedBuffers;
_mainUi(std::move(ui)),
_networkModel(new NetworkModel(this)),
_bufferModel(new BufferModel(_networkModel)),
- _bufferSyncer(nullptr),
- _aliasManager(nullptr),
_backlogManager(new ClientBacklogManager(this)),
- _bufferViewManager(nullptr),
_bufferViewOverlay(new BufferViewOverlay(this)),
_coreInfo(new CoreInfo(this)),
- _dccConfig(nullptr),
_ircListHelper(new ClientIrcListHelper(this)),
_inputHandler(new ClientUserInputHandler(this)),
- _networkConfig(nullptr),
- _ignoreListManager(nullptr),
- _highlightRuleManager(nullptr),
- _transferManager(nullptr),
_transferModel(new TransferModel(this)),
_messageModel(_mainUi->createMessageModel(this)),
_messageProcessor(_mainUi->createMessageProcessor(this)),
_coreAccountModel(new CoreAccountModel(this)),
- _coreConnection(new CoreConnection(this)),
- _connected(false)
+ _coreConnection(new CoreConnection(this))
{
#ifdef EMBED_DATA
Q_INIT_RESOURCE(data);
static void addNetwork(Network *);
- SignalProxy *_signalProxy;
+ SignalProxy *_signalProxy{nullptr};
std::unique_ptr<AbstractUi> _mainUi;
- NetworkModel *_networkModel;
- BufferModel *_bufferModel;
- BufferSyncer *_bufferSyncer;
- ClientAliasManager *_aliasManager;
- ClientBacklogManager *_backlogManager;
- ClientBufferViewManager *_bufferViewManager;
- BufferViewOverlay *_bufferViewOverlay;
- CoreInfo *_coreInfo;
- DccConfig *_dccConfig;
- ClientIrcListHelper *_ircListHelper;
- ClientUserInputHandler *_inputHandler;
- NetworkConfig *_networkConfig;
- ClientIgnoreListManager *_ignoreListManager;
- HighlightRuleManager *_highlightRuleManager;
- ClientTransferManager *_transferManager;
- TransferModel *_transferModel;
-
- MessageModel *_messageModel;
- AbstractMessageProcessor *_messageProcessor;
-
- CoreAccountModel *_coreAccountModel;
- CoreConnection *_coreConnection;
-
- ClientMode clientMode;
+ NetworkModel *_networkModel{nullptr};
+ BufferModel *_bufferModel{nullptr};
+ BufferSyncer *_bufferSyncer{nullptr};
+ ClientAliasManager *_aliasManager{nullptr};
+ ClientBacklogManager *_backlogManager{nullptr};
+ ClientBufferViewManager *_bufferViewManager{nullptr};
+ BufferViewOverlay *_bufferViewOverlay{nullptr};
+ CoreInfo *_coreInfo{nullptr};
+ DccConfig *_dccConfig{nullptr};
+ ClientIrcListHelper *_ircListHelper{nullptr};
+ ClientUserInputHandler *_inputHandler{nullptr};
+ NetworkConfig *_networkConfig{nullptr};
+ ClientIgnoreListManager *_ignoreListManager{nullptr};
+ HighlightRuleManager *_highlightRuleManager{nullptr};
+ ClientTransferManager *_transferManager{nullptr};
+ TransferModel *_transferModel{nullptr};
+
+ MessageModel *_messageModel{nullptr};
+ AbstractMessageProcessor *_messageProcessor{nullptr};
+
+ CoreAccountModel *_coreAccountModel{nullptr};
+ CoreConnection *_coreConnection{nullptr};
+
+ ClientMode clientMode{};
QHash<NetworkId, Network *> _networks;
QHash<IdentityId, Identity *> _identities;
- bool _connected;
+ bool _connected{false};
QList<QPair<BufferInfo, QString> > _userInputBuffer;
#include <QDebug>
ClientBacklogManager::ClientBacklogManager(QObject *parent)
- : BacklogManager(parent),
- _requester(nullptr),
- _initBacklogRequested(false)
+ : BacklogManager(parent)
{
}
void dispatchMessages(const MessageList &messages, bool sort = false);
- BacklogRequester *_requester;
- bool _initBacklogRequested;
+ BacklogRequester *_requester{nullptr};
+ bool _initBacklogRequested{false};
QSet<BufferId> _buffersRequested;
};
CertIdentity::CertIdentity(IdentityId id, QObject *parent)
: Identity(id, parent)
-#ifdef HAVE_SSL
- , _certManager(nullptr),
- _isDirty(false)
-#endif
{
}
CertIdentity::CertIdentity(const Identity &other, QObject *parent)
: Identity(other, parent)
-#ifdef HAVE_SSL
- , _certManager(nullptr),
- _isDirty(false)
-#endif
{
}
CertIdentity::CertIdentity(const CertIdentity &other, QObject *parent)
: Identity(other, parent)
#ifdef HAVE_SSL
- , _certManager(nullptr),
- _isDirty(other._isDirty),
- _sslKey(other._sslKey),
- _sslCert(other._sslCert)
+ , _isDirty(other._isDirty)
+ , _sslKey(other._sslKey)
+ , _sslCert(other._sslCert)
#endif
{
}
void markClean();
private:
- ClientCertManager *_certManager;
- bool _isDirty;
+ ClientCertManager *_certManager{nullptr};
+ bool _isDirty{false};
QSslKey _sslKey;
QSslCertificate _sslCert;
#endif //HAVE_SSL
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include <utility>
+
#include <QStringList>
#include "clientsettings.h"
#include <QHostAddress>
#ifdef HAVE_SSL
#include <QSslSocket>
-#include <utility>
#endif
#include "client.h"
CoreConnection::CoreConnection(QObject *parent)
: QObject(parent),
- _authHandler(nullptr),
- _state(Disconnected),
- _wantReconnect(false),
- _wasReconnect(false),
- _progressMinimum(0),
- _progressMaximum(-1),
- _progressValue(-1),
- _resetting(false)
+ _authHandler(nullptr)
{
qRegisterMetaType<ConnectionState>("CoreConnection::ConnectionState");
}
private:
QPointer<ClientAuthHandler> _authHandler;
QPointer<Peer> _peer;
- ConnectionState _state;
+ ConnectionState _state{Disconnected};
QTimer _reconnectTimer;
- bool _wantReconnect;
- bool _wasReconnect;
+ bool _wantReconnect{false};
+ bool _wasReconnect{false};
QSet<QObject *> _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;
SelectionModelSynchronizer::SelectionModelSynchronizer(QAbstractItemModel *parent)
: QObject(parent),
_model(parent),
- _selectionModel(parent),
- _changeCurrentEnabled(true),
- _changeSelectionEnabled(true)
+ _selectionModel(parent)
{
connect(&_selectionModel, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
this, SLOT(currentChanged(const QModelIndex &, const QModelIndex &)));
private:
QAbstractItemModel *_model;
QItemSelectionModel _selectionModel;
- bool _changeCurrentEnabled;
- bool _changeSelectionEnabled;
+ bool _changeCurrentEnabled{true};
+ bool _changeSelectionEnabled{true};
bool checkBaseModel(QItemSelectionModel *model);
QModelIndex mapFromSource(const QModelIndex &sourceIndex, const QItemSelectionModel *selectionModel);
#include "authhandler.h"
AuthHandler::AuthHandler(QObject *parent)
- : QObject(parent),
- _socket(nullptr),
- _disconnectedSent(false)
+ : QObject(parent)
{
}
private:
void invalidMessage();
- QTcpSocket *_socket; // FIXME: should be a QSharedPointer? -> premature disconnect before the peer has taken over
- bool _disconnectedSent;
+ QTcpSocket *_socket{nullptr}; // FIXME: should be a QSharedPointer? -> premature disconnect before the peer has taken over
+ bool _disconnectedSent{false};
};
BasicHandler::BasicHandler(QObject *parent)
: QObject(parent),
- _defaultHandler(-1),
- _initDone(false),
_methodPrefix("handle")
{
}
BasicHandler::BasicHandler(QString methodPrefix, QObject *parent)
: QObject(parent),
- _defaultHandler(-1),
- _initDone(false),
_methodPrefix(std::move(methodPrefix))
{
}
private:
const QHash<QString, int> &handlerHash();
QHash<QString, int> _handlerHash;
- int _defaultHandler;
- bool _initDone;
+ int _defaultHandler{-1};
+ bool _initDone{false};
QString _methodPrefix;
};
BufferInfo::BufferInfo()
: _bufferId(0),
_netid(0),
- _type(InvalidBuffer),
- _groupId(0),
_bufferName(QString())
{
}
private:
BufferId _bufferId;
NetworkId _netid;
- Type _type;
- uint _groupId;
+ Type _type{InvalidBuffer};
+ uint _groupId{0};
QString _bufferName;
friend uint qHash(const BufferInfo &);
Event::Event(EventManager::EventType type)
: _type(type)
- , _valid(true)
{
}
Event::Event(EventManager::EventType type, QVariantMap &map)
: _type(type)
- , _valid(true)
{
if (!map.contains("flags") || !map.contains("timestamp")) {
qWarning() << "Received invalid serialized event:" << map;
EventManager::EventType _type;
EventManager::EventFlags _flags;
QDateTime _timestamp;
- bool _valid;
+ bool _valid{true};
friend COMMON_EXPORT QDebug operator<<(QDebug dbg, Event *e);
};
struct Server {
QString host;
- uint port;
+ uint port{6667};
QString password;
- bool useSsl;
- bool sslVerify; /// If true, validate SSL certificates
- int sslVersion;
+ bool useSsl{false};
+ bool sslVerify{true}; /// If true, validate SSL certificates
+ int sslVersion{0};
- bool useProxy;
- int proxyType;
+ bool useProxy{false};
+ int proxyType{QNetworkProxy::Socks5Proxy};
QString proxyHost;
- uint proxyPort;
+ uint proxyPort{8080};
QString proxyUser;
QString proxyPass;
// sslVerify only applies when useSsl is true. sslVerify should be enabled by default,
// so enabling useSsl offers a more secure default.
- Server() : port(6667), useSsl(false), sslVerify(true), sslVersion(0), useProxy(false),
- proxyType(QNetworkProxy::Socks5Proxy), proxyHost("localhost"), proxyPort(8080) {}
+ Server() : proxyHost("localhost") {}
Server(QString host, uint port, QString password, bool useSsl,
bool sslVerify)
: host(std::move(host)), port(port), password(std::move(password)), useSsl(useSsl), sslVerify(sslVerify),
- sslVersion(0), useProxy(false), proxyType(QNetworkProxy::Socks5Proxy),
+ proxyType(QNetworkProxy::Socks5Proxy),
proxyHost("localhost"), proxyPort(8080) {}
bool operator==(const Server &other) const;
#include "networkconfig.h"
NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
- : SyncableObject(objectName, parent),
- _pingTimeoutEnabled(true),
- _pingInterval(30),
- _maxPingCount(6),
- _autoWhoEnabled(true),
- _autoWhoInterval(90),
- _autoWhoNickLimit(200),
- _autoWhoDelay(5),
- _standardCtcp(false)
+ : SyncableObject(objectName, parent)
{
}
// void setAutoWhoDelayRequested(int);
private:
- bool _pingTimeoutEnabled;
- int _pingInterval;
- int _maxPingCount;
+ bool _pingTimeoutEnabled{true};
+ int _pingInterval{30};
+ int _maxPingCount{6};
- bool _autoWhoEnabled;
- int _autoWhoInterval;
- int _autoWhoNickLimit;
- int _autoWhoDelay;
+ bool _autoWhoEnabled{true};
+ int _autoWhoInterval{90};
+ int _autoWhoNickLimit{200};
+ int _autoWhoDelay{5};
- bool _standardCtcp;
+ bool _standardCtcp{false};
};
private:
struct Signal {
- QObject *sender;
- int signalId;
+ QObject *sender{nullptr};
+ int signalId{-1};
QByteArray signature;
Signal(QObject *sender, int sigId, QByteArray signature) : sender(sender), signalId(sigId), signature(std::move(signature)) {}
- Signal() : sender(nullptr), signalId(-1) {}
+ Signal() {}
};
SignalProxy *_proxy;
{
public:
MethodDescriptor(const QMetaMethod &method);
- MethodDescriptor() : _returnType(-1), _minArgCount(-1), _receiverMode(SignalProxy::Client) {}
+ MethodDescriptor() {}
inline const QByteArray &methodName() const { return _methodName; }
inline const QList<int> &argTypes() const { return _argTypes; }
private:
QByteArray _methodName;
QList<int> _argTypes;
- int _returnType;
- int _minArgCount;
- SignalProxy::ProxyMode _receiverMode; // Only acceptable as a Sync Call if the receiving SignalProxy is in this mode.
+ int _returnType{-1};
+ int _minArgCount{-1};
+ SignalProxy::ProxyMode _receiverMode{SignalProxy::Client}; // Only acceptable as a Sync Call if the receiving SignalProxy is in this mode.
};
#include "util.h"
SyncableObject::SyncableObject(QObject *parent)
- : QObject(parent),
- _initialized(false),
- _allowClientUpdates(false)
+ : QObject(parent)
{
}
SyncableObject::SyncableObject(const QString &objectName, QObject *parent)
- : QObject(parent),
- _initialized(false),
- _allowClientUpdates(false)
+ : QObject(parent)
{
setObjectName(objectName);
}
bool setInitValue(const QString &property, const QVariant &value);
- bool _initialized;
- bool _allowClientUpdates;
+ bool _initialized{false};
+ bool _allowClientUpdates{false};
QList<SignalProxy *> _signalProxies;
int AbstractSqlStorage::_nextConnectionId = 0;
AbstractSqlStorage::AbstractSqlStorage(QObject *parent)
- : Storage(parent),
- _schemaVersion(0)
+ : Storage(parent)
{
}
// AbstractSqlMigrator
// ========================================
AbstractSqlMigrator::AbstractSqlMigrator()
- : _query(nullptr)
{
}
// AbstractSqlMigrationReader
// ========================================
AbstractSqlMigrationReader::AbstractSqlMigrationReader()
- : AbstractSqlMigrator(),
- _writer(nullptr)
+ : AbstractSqlMigrator()
{
}
void addConnectionToPool();
void dbConnect(QSqlDatabase &db);
- int _schemaVersion;
+ int _schemaVersion{0};
bool _debug;
static int _nextConnectionId;
};
struct SenderMO {
- qint64 senderId;
+ qint64 senderId{0};
QString sender;
QString realname;
QString avatarurl;
- SenderMO() : senderId(0) {}
+ SenderMO() {}
};
struct IdentityMO {
virtual bool commit() = 0;
private:
- QSqlQuery *_query;
+ QSqlQuery *_query{nullptr};
};
template<typename T> bool transferMo(MigrationObject moType, T &mo);
- AbstractSqlMigrationWriter *_writer;
+ AbstractSqlMigrationWriter *_writer{nullptr};
};
CoreSession *_coreSession;
struct CtcpReply {
- CoreNetwork *network;
+ CoreNetwork *network{nullptr};
QString bufferName;
QList<QByteArray> replies;
- CtcpReply() : network(nullptr) {}
+ CtcpReply() {}
CtcpReply(CoreNetwork *net, QString buf) : network(net), bufferName(std::move(buf)) {}
};
#include "oidentdconfiggenerator.h"
OidentdConfigGenerator::OidentdConfigGenerator(QObject *parent) :
- QObject(parent),
- _initialized(false)
+ QObject(parent)
{
if (!_initialized)
init();
bool parseConfig(bool readQuasselStanzas = false);
bool lineByUs(const QByteArray &line);
- bool _initialized;
+ bool _initialized{false};
bool _strict;
QDateTime _lastSync;
QFile *_configFile;
#include "quassel.h"
PostgreSqlStorage::PostgreSqlStorage(QObject *parent)
- : AbstractSqlStorage(parent),
- _port(-1)
+ : AbstractSqlStorage(parent)
{
}
QSqlQuery prepareAndExecuteQuery(const QString &queryname, QSqlDatabase &db) { return prepareAndExecuteQuery(queryname, QString(), db); }
QString _hostName;
- int _port;
+ int _port{-1};
QString _databaseName;
QString _userName;
QString _password;
// SqliteMigration
// ========================================
SqliteMigrationReader::SqliteMigrationReader()
- : SqliteStorage(),
- _maxId(0)
+ : SqliteStorage()
{
}
private:
void setMaxId(MigrationObject mo);
- qint64 _maxId;
+ qint64 _maxId{0};
};
#ifdef HAVE_SSL
SslServer::SslServer(QObject *parent)
- : QTcpServer(parent),
- _isCertValid(false)
+ : QTcpServer(parent)
{
// Keep track if the SSL warning has been mentioned at least once before
static bool sslWarningShown = false;
QSslCertificate _cert;
QSslKey _key;
QList<QSslCertificate> _ca;
- bool _isCertValid;
+ bool _isCertValid{false};
// Used when reloading certificates later
QString _sslCertPath; /// Path to the certificate file
ChannelListDlg::ChannelListDlg(QWidget *parent)
: QDialog(parent),
- _listFinished(true),
_ircListModel(this),
- _sortFilter(this),
- _simpleModeSpacer(nullptr),
- _advancedMode(false)
+ _sortFilter(this)
{
_sortFilter.setSourceModel(&_ircListModel);
_sortFilter.setFilterCaseSensitivity(Qt::CaseInsensitive);
Ui::ChannelListDlg ui;
- bool _listFinished;
+ bool _listFinished{true};
NetworkId _netId;
IrcListModel _ircListModel;
QSortFilterProxyModel _sortFilter;
- QSpacerItem *_simpleModeSpacer;
- bool _advancedMode;
+ QSpacerItem *_simpleModeSpacer{nullptr};
+ bool _advancedMode{false};
};
ShowPreview,
HidePreview
};
- ChatItem *parentItem;
- QGraphicsItem *previewItem;
+ ChatItem *parentItem{nullptr};
+ QGraphicsItem *previewItem{nullptr};
QUrl url;
QRectF urlRect;
- PreviewState previewState;
+ PreviewState previewState{NoPreview};
QTimer timer;
- WebPreview() : parentItem(nullptr), previewItem(nullptr), previewState(NoPreview) {}
+ WebPreview() {}
};
WebPreview webPreview;
#endif // HAVE_WEBKIT || HAVE_WEBENGINE
#include "messagemodel.h"
ChatViewSearchController::ChatViewSearchController(QObject *parent)
- : QObject(parent),
- _scene(nullptr),
- _currentHighlight(0),
- _caseSensitive(false),
- _searchSenders(false),
- _searchMsgs(true),
- _searchOnlyRegularMsgs(true)
+ : QObject(parent)
{
}
private:
QString _searchString;
- ChatScene *_scene;
+ ChatScene *_scene{nullptr};
QList<SearchHighlightItem *> _highlightItems;
- int _currentHighlight;
+ int _currentHighlight{0};
- bool _caseSensitive;
- bool _searchSenders;
- bool _searchMsgs;
- bool _searchOnlyRegularMsgs;
+ bool _caseSensitive{false};
+ bool _searchSenders{false};
+ bool _searchMsgs{true};
+ bool _searchOnlyRegularMsgs{true};
inline Qt::CaseSensitivity caseSensitive() const { return _caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive; }
#include "clientbacklogmanager.h"
DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent)
- : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()), _dock(nullptr), _item(nullptr), _count(0)
+ : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus())
{
NotificationSettings notificationSettings;
_enabled = notificationSettings.value("DockManager/Enabled", false).toBool();
bool _enabled;
bool _available;
QDBusConnection _bus;
- QDBusInterface *_dock;
- QDBusInterface *_item;
- int _count;
+ QDBusInterface *_dock{nullptr};
+ QDBusInterface *_item{nullptr};
+ int _count{0};
};
struct HistoryState {
QStringList history;
QHash<int, QString> tempHistory;
- qint32 idx;
+ qint32 idx{0};
QString inputLine;
- inline HistoryState() : idx(0) {};
+ inline HistoryState() {};
};
QMap<BufferId, HistoryState> historyMap;
#include <QVBoxLayout>
IrcConnectionWizard::IrcConnectionWizard(QWidget *parent, Qt::WindowFlags flags)
- : QWizard(parent, flags),
- _introductionPage(nullptr),
- _identityPage(nullptr),
- _networkPage(nullptr)
+ : QWizard(parent, flags)
{
_introductionPage = createIntroductionPage(this);
_identityPage = new IdentityPage(this);
// Identity Page
IdentityPage::IdentityPage(QWidget *parent)
: QWizardPage(parent),
- _identityEditWidget(new IdentityEditWidget(this)),
- _identity(nullptr)
+ _identityEditWidget(new IdentityEditWidget(this))
{
setTitle(tr("Setup Identity"));
void networkReady(NetworkId id);
private:
- QWizardPage *_introductionPage;
- QWizardPage *_identityPage;
- QWizardPage *_networkPage;
+ QWizardPage *_introductionPage{nullptr};
+ QWizardPage *_identityPage{nullptr};
+ QWizardPage *_networkPage{nullptr};
};
private:
IdentityEditWidget *_identityEditWidget;
- CertIdentity *_identity;
+ CertIdentity *_identity{nullptr};
};
#endif
_msgProcessorStatusWidget(new MsgProcessorStatusWidget(this)),
_coreConnectionStatusWidget(new CoreConnectionStatusWidget(Client::coreConnection(), this)),
- _titleSetter(this),
- _awayLog(nullptr),
- _layoutLoaded(false),
- _activeBufferViewIndex(-1),
- _aboutToQuit(false)
+ _titleSetter(this)
{
setAttribute(Qt::WA_DeleteOnClose, false); // we delete the mainwin manually
QMenu *_toolbarMenu;
QToolBar *_mainToolBar, *_chatViewToolBar, *_nickToolBar;
- QWidget *_awayLog;
+ QWidget *_awayLog{nullptr};
QMessageBox* _migrationWarning{nullptr};
- bool _layoutLoaded;
+ bool _layoutLoaded{false};
QSize _normalSize; //!< Size of the non-maximized window
QPoint _normalPos; //!< Position of the non-maximized window
BufferHotListFilter *_bufferHotList;
QHash<int, BufferId> _jumpKeyMap;
- int _activeBufferViewIndex;
+ int _activeBufferViewIndex{-1};
- bool _aboutToQuit; //closeEvent can occur multiple times on OSX
+ bool _aboutToQuit{false}; //closeEvent can occur multiple times on OSX
friend class QtUi;
};
#include "icon.h"
SettingsDlg::SettingsDlg(QWidget *parent)
- : QDialog(parent),
- _currentPage(nullptr)
+ : QDialog(parent)
{
ui.setupUi(this);
setModal(true);
private:
Ui::SettingsDlg ui;
- SettingsPage *_currentPage;
+ SettingsPage *_currentPage{nullptr};
QHash<SettingsPage *, bool> pageIsLoaded;
enum {
#include "signalproxy.h"
AliasesModel::AliasesModel(QObject *parent)
- : QAbstractItemModel(parent),
- _configChanged(false),
- _modelReady(false)
+ : QAbstractItemModel(parent)
{
// we need this signal for future connects to reset the data;
connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
private:
ClientAliasManager _clonedAliasManager;
- bool _configChanged;
- bool _modelReady;
+ bool _configChanged{false};
+ bool _modelReady{false};
const AliasManager &aliasManager() const;
AliasManager &aliasManager();
#include "util.h"
BufferViewSettingsPage::BufferViewSettingsPage(QWidget *parent)
- : SettingsPage(tr("Interface"), tr("Custom Chat Lists"), parent),
- _ignoreWidgetChanges(false),
- _useBufferViewHint(false),
- _bufferViewHint(0)
+ : SettingsPage(tr("Interface"), tr("Custom Chat Lists"), parent)
{
ui.setupUi(this);
//Hide the hide inactive networks feature on older cores (which won't save the setting)
private:
Ui::BufferViewSettingsPage ui;
- bool _ignoreWidgetChanges;
- bool _useBufferViewHint;
- int _bufferViewHint;
+ bool _ignoreWidgetChanges{false};
+ bool _useBufferViewHint{false};
+ int _bufferViewHint{0};
// list of bufferviews to create
QList<BufferViewConfig *> _newBufferViews;
CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
: SettingsPage(tr("Remote Cores"), QString(), parent),
_lastAccountId(0),
- _lastAutoConnectId(0),
- _standalone(false)
+ _lastAutoConnectId(0)
{
ui.setupUi(this);
initAutoWidgets();
inline FilteredCoreAccountModel *filteredModel() const { return _filteredModel; }
AccountId _lastAccountId, _lastAutoConnectId;
- bool _standalone;
+ bool _standalone{false};
void editAccount(const QModelIndex &);
#include "signalproxy.h"
IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
- : SettingsPage(tr("IRC"), tr("Identities"), parent),
- _editSsl(false)
+ : SettingsPage(tr("IRC"), tr("Identities"), parent)
{
ui.setupUi(this);
ui.renameIdentity->setIcon(icon::get("edit-rename"));
QList<IdentityId> changedIdentities; // for setting the widget changed state
QList<IdentityId> deletedIdentities;
- bool _editSsl;
+ bool _editSsl{false};
void insertIdentity(CertIdentity *identity);
void removeIdentity(Identity *identity);
#include "signalproxy.h"
IgnoreListModel::IgnoreListModel(QObject *parent)
- : QAbstractItemModel(parent),
- _configChanged(false),
- _modelReady(false)
+ : QAbstractItemModel(parent)
{
// we need this signal for future connects to reset the data;
connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
private:
ClientIgnoreListManager _clonedIgnoreListManager;
- bool _configChanged;
- bool _modelReady;
+ bool _configChanged{false};
+ bool _modelReady{false};
const IgnoreListManager &ignoreListManager() const;
IgnoreListManager &ignoreListManager();
/******************************************************************************/
KeySequenceWidget::KeySequenceWidget(QWidget *parent)
- : QWidget(parent),
- _shortcutsModel(nullptr),
- _isRecording(false),
- _modifierKeys(0)
+ : QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setMargin(0);
bool isShiftAsModifierAllowed(int keyQt) const;
bool isKeySequenceAvailable(const QKeySequence &seq);
- ShortcutsModel *_shortcutsModel;
- bool _isRecording;
+ ShortcutsModel *_shortcutsModel{nullptr};
+ bool _isRecording{false};
QKeySequence _keySequence, _oldKeySequence;
- uint _modifierKeys;
+ uint _modifierKeys{0};
QModelIndex _conflictingIndex;
KeySequenceButton *_keyButton;
NetworksSettingsPage::NetworksSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Networks"), parent)
-#ifdef HAVE_SSL
- , _cid(nullptr)
-#endif
{
ui.setupUi(this);
QHash<NetworkId, NetworkInfo> networkInfos;
bool _ignoreWidgetChanges;
#ifdef HAVE_SSL
- CertIdentity *_cid;
+ CertIdentity *_cid{nullptr};
#endif
QIcon connectedIcon, connectingIcon, disconnectedIcon;
#include "qtui.h"
NotificationsSettingsPage::NotificationsSettingsPage(QWidget *parent)
- : SettingsPage(tr("Interface"), tr("Notifications"), parent),
- _hasDefaults(false)
+ : SettingsPage(tr("Interface"), tr("Notifications"), parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
foreach(AbstractNotificationBackend *backend, QtUi::notificationBackends()) {
private:
QList<SettingsPage *> _configWidgets;
- bool _hasDefaults;
+ bool _hasDefaults{false};
};
#include "systemtray.h"
SystrayNotificationBackend::SystrayNotificationBackend(QObject *parent)
- : AbstractNotificationBackend(parent),
- _blockActivation(false)
+ : AbstractNotificationBackend(parent)
{
NotificationSettings notificationSettings;
notificationSettings.initAndNotify("Systray/ShowBubble", this, SLOT(showBubbleChanged(QVariant)), true);
bool _showBubble;
QList<Notification> _notifications;
- bool _blockActivation;
+ bool _blockActivation{false};
};
#include <QDebug>
FlatProxyModel::FlatProxyModel(QObject *parent)
- : QAbstractProxyModel(parent),
- _rootSourceItem(nullptr)
+ : QAbstractProxyModel(parent)
{
}
// SourceItem
// ========================================
FlatProxyModel::SourceItem::SourceItem(int row, SourceItem *parent)
- : _parent(parent),
- _pos(-1),
- _next(nullptr)
+ : _parent(parent)
{
if (parent) {
parent->_childs.insert(row, this);
QList<int> _childCount;
class SourceItem;
- SourceItem *_rootSourceItem;
+ SourceItem *_rootSourceItem{nullptr};
void insertSubTree(const QModelIndex &source_idx, bool emitInsert = true);
SourceItem *insertSubTreeHelper(SourceItem *parentItem, SourceItem *lastItem_, const QModelIndex &source_idx);
SourceItem *_parent;
QList<SourceItem *> _childs;
- int _pos;
- SourceItem *_next;
+ int _pos{-1};
+ SourceItem *_next{nullptr};
friend class FlatProxyModel;
};
const int leftMargin = 3;
MultiLineEdit::MultiLineEdit(QWidget *parent)
- : MultiLineEditParent(parent),
- _idx(0),
- _mode(SingleLine),
- _singleLine(true),
- _minHeight(1),
- _maxHeight(5),
- _scrollBarsEnabled(true),
- _pasteProtectionEnabled(true),
- _emacsMode(false),
- _completionSpace(0),
- _lastDocumentHeight(-1)
+ : MultiLineEditParent(parent)
{
document()->setDocumentMargin(0);
private:
QStringList _history;
QHash<int, QString> _tempHistory;
- qint32 _idx;
- Mode _mode;
- bool _singleLine;
- int _minHeight;
- int _maxHeight;
- bool _scrollBarsEnabled;
- bool _pasteProtectionEnabled;
- bool _emacsMode;
- int _completionSpace;
+ qint32 _idx{0};
+ Mode _mode{SingleLine};
+ bool _singleLine{true};
+ int _minHeight{1};
+ int _maxHeight{5};
+ bool _scrollBarsEnabled{true};
+ bool _pasteProtectionEnabled{true};
+ bool _emacsMode{false};
+ int _completionSpace{0};
QSize _sizeHint;
- qreal _lastDocumentHeight;
+ qreal _lastDocumentHeight{-1};
QMap<QString, QString> _mircColorMap;
NetworkModelController::NetworkModelController(QObject *parent)
: QObject(parent),
- _actionCollection(new ActionCollection(this)),
- _messageFilter(nullptr),
- _receiver(nullptr)
+ _actionCollection(new ActionCollection(this))
{
connect(_actionCollection, SIGNAL(actionTriggered(QAction *)), SLOT(actionTriggered(QAction *)));
}
QHash<ActionType, Action *> _actionByType;
QList<QModelIndex> _indexList;
- MessageFilter *_messageFilter;
+ MessageFilter *_messageFilter{nullptr};
QString _contextItem; ///< Channel name or nick to provide context menu for
- QObject *_receiver;
+ QObject *_receiver{nullptr};
const char *_method;
};
StyledLabel::StyledLabel(QWidget *parent)
: QFrame(parent),
- _wrapMode(QTextOption::NoWrap),
- _alignment(Qt::AlignVCenter|Qt::AlignLeft),
- _toolTipEnabled(true),
- _resizeMode(NoResize)
+ _alignment(Qt::AlignVCenter|Qt::AlignLeft)
{
setMouseTracking(true);
private:
QSize _sizeHint;
- QTextOption::WrapMode _wrapMode;
+ QTextOption::WrapMode _wrapMode{QTextOption::NoWrap};
Qt::Alignment _alignment;
QTextLayout _layout;
ClickableList _clickables;
- bool _toolTipEnabled;
- ResizeMode _resizeMode;
+ bool _toolTipEnabled{true};
+ ResizeMode _resizeMode{NoResize};
QList<QTextLayout::FormatRange> _layoutList;
QVector<QTextLayout::FormatRange> _extraLayoutList;