From 99bb415ad593ce4b5943a0cc9c8ae8034bf3b4a2 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 15 Jan 2017 17:34:48 +0100 Subject: [PATCH] changed initialization order of account --- ircmanager.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ircmanager.cpp b/ircmanager.cpp index f11da49b..68aa157b 100644 --- a/ircmanager.cpp +++ b/ircmanager.cpp @@ -10,7 +10,7 @@ #include "ircconnection.h" #include "qnetworkrequest.h" -Account *IrcManager::account = const_cast(Account::anon()); +Account *IrcManager::account = nullptr; IrcConnection *IrcManager::connection = NULL; QMutex IrcManager::connectionMutex; long IrcManager::connectionIteration = 0; @@ -35,6 +35,8 @@ IrcManager::connect() void IrcManager::beginConnecting() { + IrcManager::account = const_cast(Account::anon()); + int iteration = ++connectionIteration; auto c = new IrcConnection(); @@ -207,8 +209,8 @@ IrcManager::tryAddIgnoredUser(QString const &username, QString &errorMessage) return true; } - errorMessage = "Error while ignoring user \"" + username + - "\": " + reply->errorString(); + errorMessage = "Error while ignoring user \"" + username + "\": " + + reply->errorString(); return false; } @@ -241,8 +243,8 @@ IrcManager::tryRemoveIgnoredUser(QString const &username, QString &errorMessage) return true; } - errorMessage = "Error while unignoring user \"" + username + - "\": " + reply->errorString(); + errorMessage = "Error while unignoring user \"" + username + "\": " + + reply->errorString(); return false; }