From 0ab052043815891fb4973db8fa4d493f96e73807 Mon Sep 17 00:00:00 2001 From: antonpavanvo Date: Sat, 28 May 2022 00:24:51 +0400 Subject: [PATCH] fix: intialization ui/squawk.cpp before than Core::Squawk::ready --- main/application.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/application.cpp b/main/application.cpp index 216e322..18a62f2 100644 --- a/main/application.cpp +++ b/main/application.cpp @@ -29,6 +29,7 @@ Application::Application(Core::Squawk* p_core): destroyingSquawk(false), storage() { + squawk = new Squawk(roster); connect(&roster, &Models::Roster::unnoticedMessage, this, &Application::notify); connect(&roster, &Models::Roster::unreadMessagesCountChanged, this, &Application::unreadMessagesCountChanged); @@ -53,7 +54,7 @@ Application::Application(Core::Squawk* p_core): connect(&roster, &Models::Roster::localPathInvalid, core, &Core::Squawk::onLocalPathInvalid); - //coonecting backend to myself + //connecting backend to myself connect(core, &Core::Squawk::stateChanged, this, &Application::stateChanged); connect(core, &Core::Squawk::accountMessage, &roster, &Models::Roster::addMessage); @@ -147,8 +148,7 @@ void Application::checkForTheLastWindow() void Application::createMainWindow() { - if (squawk == nullptr) { - squawk = new Squawk(roster); + if (squawk) { connect(squawk, &Squawk::notify, this, &Application::notify); connect(squawk, &Squawk::changeSubscription, this, &Application::changeSubscription);