account removal bugfix, some testing

This commit is contained in:
Blue 2022-04-13 22:02:48 +03:00
parent f64e5c2df0
commit ce686e121b
Signed by: blue
GPG Key ID: 9B203B252A63EE38
3 changed files with 17 additions and 6 deletions

View File

@ -2,11 +2,18 @@
## Squawk 0.2.2 (UNRELEASED) ## Squawk 0.2.2 (UNRELEASED)
### Bug fixes ### Bug fixes
- now when you remove an account it actually gets removed
- segfault on unitialized Availability in some rare occesions
### Improvements ### 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 features
- new "About" window with links, license, gratitudes
## Squawk 0.2.1 (Apr 02, 2022) ## Squawk 0.2.1 (Apr 02, 2022)
### Bug fixes ### Bug fixes

View File

@ -139,8 +139,10 @@ void Core::Squawk::addAccount(
bool active, bool active,
Shared::AccountPassword passwordType) 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); Account* acc = new Account(login, server, password, name, active, &network);
acc->setResource(resource); acc->setResource(resource);
acc->setPasswordType(passwordType); acc->setPasswordType(passwordType);
@ -198,8 +200,10 @@ void Core::Squawk::addAccount(
switch (passwordType) { switch (passwordType) {
case Shared::AccountPassword::alwaysAsk: case Shared::AccountPassword::alwaysAsk:
case Shared::AccountPassword::kwallet: case Shared::AccountPassword::kwallet:
acc->invalidatePassword(); if (password == "") {
break; acc->invalidatePassword();
break;
}
default: default:
break; break;
} }

View File

@ -564,7 +564,7 @@ void Squawk::onRosterContextMenu(const QPoint& point)
connect(card, &QAction::triggered, std::bind(&Squawk::onActivateVCard, this, name, acc->getBareJid(), true)); connect(card, &QAction::triggered, std::bind(&Squawk::onActivateVCard, this, name, acc->getBareJid(), true));
QAction* remove = contextMenu->addAction(Shared::icon("edit-delete"), tr("Remove")); 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; break;
case Models::Item::contact: { case Models::Item::contact: {