diff options
| author | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-09-23 13:57:11 +0000 |
|---|---|---|
| committer | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-09-23 13:57:11 +0000 |
| commit | 1e0135f9c0029d0d601536cffe02a9ad24224b79 (patch) | |
| tree | e3cae12cd5ac8e6ff2c293163f33c3c371bd9d56 /examples/GuiClient | |
| parent | be21d89ce38ed6efb567e66a4f4cfef2e538cd57 (diff) | |
| download | qxmpp-1e0135f9c0029d0d601536cffe02a9ad24224b79.tar.gz | |
remember last-used account
Diffstat (limited to 'examples/GuiClient')
| -rw-r--r-- | examples/GuiClient/accountsCache.cpp | 4 | ||||
| -rw-r--r-- | examples/GuiClient/mainDialog.cpp | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/examples/GuiClient/accountsCache.cpp b/examples/GuiClient/accountsCache.cpp index e9b51834..fed5e00c 100644 --- a/examples/GuiClient/accountsCache.cpp +++ b/examples/GuiClient/accountsCache.cpp @@ -48,8 +48,8 @@ void accountsCache::addAccount(const QString& bareJid, const QString& passwd) {
if(element.firstChildElement("bareJid").text() == bareJid)
{
- element.firstChildElement("password").setNodeValue(passwd);
- return;
+ m_accountsDocument.documentElement().removeChild(element);
+ break;
}
element = element.nextSiblingElement("account");
}
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp index 13fc6fd1..9891022e 100644 --- a/examples/GuiClient/mainDialog.cpp +++ b/examples/GuiClient/mainDialog.cpp @@ -525,6 +525,13 @@ void mainDialog::loadAccounts() completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion); completer->setCaseSensitivity(Qt::CaseInsensitive); ui->lineEdit_userName->setCompleter(completer); + + if(!list.isEmpty()) + { + ui->lineEdit_userName->setText(list.last()); + ui->lineEdit_password->setText(m_accountsCache. + getPassword(list.last())); + } } void mainDialog::userNameLineEdit_editingFinished() |
