[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:07:30 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=d19ba75
The following commit has been merged in the master branch:
commit d19ba7525a6b8e033a6a1e0ad8e548f3d0f186fc
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Tue Sep 13 12:15:53 2011 +0200
Prevent a crash when no account was selected in the Add Contact dialog or when the connection() of that account is null.
BUG: 278757
---
main-widget.cpp | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/main-widget.cpp b/main-widget.cpp
index 51266ee..b2a511c 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -706,10 +706,21 @@ void MainWidget::toggleSearchWidget(bool show)
void MainWidget::onAddContactRequest() {
QWeakPointer<AddContactDialog> dialog = new AddContactDialog(m_model, this);
if (dialog.data()->exec() == QDialog::Accepted) {
- Tp::AccountPtr account = dialog.data()->account();
- QStringList identifiers = QStringList() << dialog.data()->screenName();
- Tp::PendingContacts* pendingContacts = account->connection()->contactManager()->contactsForIdentifiers(identifiers);
- connect(pendingContacts, SIGNAL(finished(Tp::PendingOperation*)), SLOT(onAddContactRequestFoundContacts(Tp::PendingOperation*)));
+ Tp::AccountPtr account = dialog.data()->account();
+ if (account.isNull()) {
+ KMessageBox::error(this,
+ i18n("Seems like you forgot to select an account. Also don't forget to connect it first."),
+ i18n("No Account Selected"));
+ }
+ else if (account->connection().isNull()) {
+ KMessageBox::error(this,
+ i18n("An error we didn't anticipate just happened and so the contact couldn't be added. Sorry."),
+ i18n("Account Error"));
+ } else {
+ QStringList identifiers = QStringList() << dialog.data()->screenName();
+ Tp::PendingContacts* pendingContacts = account->connection()->contactManager()->contactsForIdentifiers(identifiers);
+ connect(pendingContacts, SIGNAL(finished(Tp::PendingOperation*)), SLOT(onAddContactRequestFoundContacts(Tp::PendingOperation*)));
+ }
}
delete dialog.data();
}
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list