debugging account removal
This commit is contained in:
parent
234697050b
commit
b845518ced
@ -310,6 +310,9 @@ void Core::Squawk::removeAccountRequest(const QString& name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Account* acc = itr->second;
|
Account* acc = itr->second;
|
||||||
|
if (acc->getState() != Shared::disconnected) {
|
||||||
|
acc->disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
for (Accounts::const_iterator aItr = accounts.begin(); aItr != accounts.end(); ++aItr) {
|
for (Accounts::const_iterator aItr = accounts.begin(); aItr != accounts.end(); ++aItr) {
|
||||||
if (*aItr == acc) {
|
if (*aItr == acc) {
|
||||||
@ -319,7 +322,6 @@ void Core::Squawk::removeAccountRequest(const QString& name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
amap.erase(itr);
|
amap.erase(itr);
|
||||||
delete acc;
|
|
||||||
|
|
||||||
QString path(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
|
QString path(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
|
||||||
path += "/" + name;
|
path += "/" + name;
|
||||||
@ -327,4 +329,5 @@ void Core::Squawk::removeAccountRequest(const QString& name)
|
|||||||
dir.removeRecursively();
|
dir.removeRecursively();
|
||||||
|
|
||||||
emit removeAccount(name);
|
emit removeAccount(name);
|
||||||
|
acc->deleteLater();
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@ void Accounts::onAccountAccepted()
|
|||||||
{
|
{
|
||||||
Account* acc = static_cast<Account*>(sender());
|
Account* acc = static_cast<Account*>(sender());
|
||||||
QMap<QString, QVariant> map = acc->value();
|
QMap<QString, QVariant> map = acc->value();
|
||||||
const Models::Account* mAcc = model->getAccount(m_ui->tableView->selectionModel()->selectedRows().at(0).row());
|
|
||||||
if (editing) {
|
if (editing) {
|
||||||
|
const Models::Account* mAcc = model->getAccount(m_ui->tableView->selectionModel()->selectedRows().at(0).row());
|
||||||
emit changeAccount(mAcc->getName(), map);
|
emit changeAccount(mAcc->getName(), map);
|
||||||
} else {
|
} else {
|
||||||
emit newAccount(map);
|
emit newAccount(map);
|
||||||
|
@ -67,7 +67,6 @@ Conversation::Conversation(Models::Contact* p_contact, QWidget* parent):
|
|||||||
|
|
||||||
Conversation::~Conversation()
|
Conversation::~Conversation()
|
||||||
{
|
{
|
||||||
disconnect(contact, SIGNAL(childChanged(Models::Item*, int, int)), this, SLOT(onContactChanged(Models::Item*, int, int)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Conversation::setName(const QString& name)
|
void Conversation::setName(const QString& name)
|
||||||
|
@ -132,8 +132,9 @@ void Models::Contact::removePresence(const QString& name)
|
|||||||
qDebug() << "an attempt to remove non existing presence " << name << " from the contact " << jid << " of account " << getAccountName() << ", skipping";
|
qDebug() << "an attempt to remove non existing presence " << name << " from the contact " << jid << " of account " << getAccountName() << ", skipping";
|
||||||
} else {
|
} else {
|
||||||
Presence* pr = itr.value();
|
Presence* pr = itr.value();
|
||||||
presences.erase(itr);
|
|
||||||
removeChild(pr->row());
|
removeChild(pr->row());
|
||||||
|
presences.erase(itr);
|
||||||
|
pr->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ QModelIndex Models::Roster::parent (const QModelIndex& child) const
|
|||||||
Item *parentItem = childItem->parentItem();
|
Item *parentItem = childItem->parentItem();
|
||||||
|
|
||||||
if (parentItem == root) {
|
if (parentItem == root) {
|
||||||
return QModelIndex();
|
return createIndex(0, 0, parentItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
return createIndex(parentItem->row(), 0, parentItem);
|
return createIndex(parentItem->row(), 0, parentItem);
|
||||||
@ -455,6 +455,7 @@ void Models::Roster::onChildIsAboutToBeRemoved(Models::Item* parent, int first,
|
|||||||
if (parent != root) {
|
if (parent != root) {
|
||||||
row = parent->row();
|
row = parent->row();
|
||||||
}
|
}
|
||||||
|
qDebug() << "Removing row" << parent->child(first)->getName() << "from" << parent->getName() << "index is" << first;
|
||||||
beginRemoveRows(createIndex(row, 0, parent), first, last);
|
beginRemoveRows(createIndex(row, 0, parent), first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,6 +526,7 @@ void Models::Roster::removeAccount(const QString& account)
|
|||||||
int index = acc->row();
|
int index = acc->row();
|
||||||
root->removeChild(index);
|
root->removeChild(index);
|
||||||
accountsModel->removeAccount(index);
|
accountsModel->removeAccount(index);
|
||||||
|
accounts.erase(itr);
|
||||||
|
|
||||||
std::multimap<ElId, Contact*>::const_iterator cItr = contacts.begin();
|
std::multimap<ElId, Contact*>::const_iterator cItr = contacts.begin();
|
||||||
while (cItr != contacts.end()) {
|
while (cItr != contacts.end()) {
|
||||||
@ -548,5 +550,5 @@ void Models::Roster::removeAccount(const QString& account)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete acc;
|
acc->deleteLater();
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ void Squawk::onRosterItemDoubleClicked(const QModelIndex& item)
|
|||||||
conv->show();
|
conv->show();
|
||||||
|
|
||||||
if (res.size() > 0) {
|
if (res.size() > 0) {
|
||||||
itr->second->setPalResource(res);
|
conv->setPalResource(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user