From ce686e121b7f29b3fe5d9c05c85f205185734089 Mon Sep 17 00:00:00 2001 From: blue Date: Wed, 13 Apr 2022 22:02:48 +0300 Subject: [PATCH] account removal bugfix, some testing --- CHANGELOG.md | 9 ++++++++- core/squawk.cpp | 12 ++++++++---- ui/squawk.cpp | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f563c85..410ff11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,18 @@ ## Squawk 0.2.2 (UNRELEASED) ### Bug fixes +- now when you remove an account it actually gets removed +- segfault on unitialized Availability in some rare occesions ### Improvements +- there is a way to disable an account and it wouldn't connect when you change availability +- if you cancel password query an account becomes inactive and doesn't annoy you anymore +- if you filled password field and chose KWallet as a storage Squawk wouldn't ask you again for the same password +- if left the password field empty and chose KWallet as a storage Squawk will try to get that passord from KWallet before asking you to input it +- accounts now connect to the server asyncronously - if one is stopped on password prompt another is connecting ### New features - +- new "About" window with links, license, gratitudes ## Squawk 0.2.1 (Apr 02, 2022) ### Bug fixes diff --git a/core/squawk.cpp b/core/squawk.cpp index d594553..49a2b34 100644 --- a/core/squawk.cpp +++ b/core/squawk.cpp @@ -139,8 +139,10 @@ void Core::Squawk::addAccount( bool active, Shared::AccountPassword passwordType) { - QSettings settings; - + if (amap.count(name) > 0) { + qDebug() << "An attempt to add account" << name << "but an account with such name already exist, ignoring"; + return; + } Account* acc = new Account(login, server, password, name, active, &network); acc->setResource(resource); acc->setPasswordType(passwordType); @@ -198,8 +200,10 @@ void Core::Squawk::addAccount( switch (passwordType) { case Shared::AccountPassword::alwaysAsk: case Shared::AccountPassword::kwallet: - acc->invalidatePassword(); - break; + if (password == "") { + acc->invalidatePassword(); + break; + } default: break; } diff --git a/ui/squawk.cpp b/ui/squawk.cpp index 3a3d1d9..a447458 100644 --- a/ui/squawk.cpp +++ b/ui/squawk.cpp @@ -564,7 +564,7 @@ void Squawk::onRosterContextMenu(const QPoint& point) connect(card, &QAction::triggered, std::bind(&Squawk::onActivateVCard, this, name, acc->getBareJid(), true)); QAction* remove = contextMenu->addAction(Shared::icon("edit-delete"), tr("Remove")); - connect(remove, &QAction::triggered, std::bind(&Squawk::removeAccount, this, name)); + connect(remove, &QAction::triggered, std::bind(&Squawk::removeAccountRequest, this, name)); } break; case Models::Item::contact: {