[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:10:54 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=0e95649

The following commit has been merged in the master branch:
commit 0e9564981e5d42423c700a4375fd7c2aa6ab2b0e
Author: George Kiagiadakis <george.kiagiadakis at collabora.com>
Date:   Wed Jul 11 17:17:37 2012 +0300

    Update to the new AddContactDialog API
---
 main-widget.cpp | 38 +++++---------------------------------
 main-widget.h   |  1 -
 2 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index 2baebe3..5c1021d 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -329,39 +329,11 @@ void MainWidget::showMessageToUser(const QString& text, const MainWidget::System
     notification->sendEvent();
 }
 
-void MainWidget::onAddContactRequest() {
-    QWeakPointer<KTp::AddContactDialog> dialog = new KTp::AddContactDialog(m_contactsListView->accountsModel(), this);
-    if (dialog.data()->exec() == QDialog::Accepted) {
-        Tp::AccountPtr account = dialog.data()->account();
-        if (account.isNull()) {
-            KMessageBox::error(this,
-                               i18n("Seems like you forgot to select an account. Also do not forget to connect it first."),
-                               i18n("No Account Selected"));
-        }
-        else if (account->connection().isNull()) {
-            KMessageBox::error(this,
-                               i18n("An error we did not anticipate just happened and so the contact could not 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();
-}
-
-void MainWidget::onAddContactRequestFoundContacts(Tp::PendingOperation *operation) {
-    Tp::PendingContacts *pendingContacts = qobject_cast<Tp::PendingContacts*>(operation);
-
-    if (! pendingContacts->isError()) {
-        //request subscription
-        pendingContacts->manager()->requestPresenceSubscription(pendingContacts->contacts());
-    }
-    else {
-        kDebug() << pendingContacts->errorName();
-        kDebug() << pendingContacts->errorMessage();
-    }
+void MainWidget::onAddContactRequest()
+{
+    KTp::AddContactDialog *dialog = new KTp::AddContactDialog(m_contactsListView->accountsModel(), this);
+    dialog->setAttribute(Qt::WA_DeleteOnClose);
+    dialog->show();
 }
 
 void MainWidget::onCustomContextMenuRequested(const QPoint &pos)
diff --git a/main-widget.h b/main-widget.h
index 0dfe8b7..dd8f857 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -80,7 +80,6 @@ private Q_SLOTS:
     void toggleSearchWidget(bool show);
     void onAccountManagerReady(Tp::PendingOperation* op);
     void onAddContactRequest();
-    void onAddContactRequestFoundContacts(Tp::PendingOperation *operation);
     void onUseGlobalPresenceTriggered();
     void onUsePerAccountPresenceTriggered();
     void onJoinChatRoomRequested();                 /** join chat room action is triggered */

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list