[SCM] ktp-send-file packaging branch, master, updated. debian/15.12.1-2-216-g8f07cdf

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:13:53 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-send-file.git;a=commitdiff;h=c42e928

The following commit has been merged in the master branch:
commit c42e928c02ded4417c8a26c466bbcb8fb2338513
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed May 11 01:38:17 2011 +0100

    Add contacts model.
---
 CMakeLists.txt |  5 +++++
 mainwindow.cpp | 33 +++++++++++++++++++++++++++++++++
 mainwindow.h   |  5 +++++
 3 files changed, 43 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98f1c18..ebcfe8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,11 @@ include_directories(
 set(MAINWINDOW_SRCS
     mainwindow.cpp
     main.cpp
+    accounts-model-item.cpp
+    account-filter-model.cpp
+    accounts-model.cpp
+    contact-model-item.cpp
+    tree-node.cpp
 )
 
 set(TELEPATHY_KDE_FILE_TRANSFER_UI
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 97935f5..ff19d87 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -5,6 +5,13 @@
 #include <KFileItemList>
 #include <KIO/PreviewJob>
 
+#include <TelepathyQt4/AccountManager>
+#include <TelepathyQt4/PendingReady>
+
+
+#include "accounts-model.h"
+
+
 MainWindow::MainWindow(QWidget *parent) :
     QWidget(parent),
     ui(new Ui::MainWindow)
@@ -22,6 +29,26 @@ MainWindow::MainWindow(QWidget *parent) :
             this, SLOT(showPreview(KFileItem, QPixmap)));
     connect(job, SIGNAL(failed(KFileItem)),
             this, SLOT(showIcon(KFileItem)));
+
+
+    Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
+                                                                       Tp::Features() << Tp::Account::FeatureCore);
+
+    Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(QDBusConnection::sessionBus());
+    Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
+
+    Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create(Tp::Features()  << Tp::Contact::FeatureAlias
+                                                                      << Tp::Contact::FeatureAvatarData
+                                                                      << Tp::Contact::FeatureSimplePresence
+                                                                      << Tp::Contact::FeatureCapabilities);
+
+    m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
+                                                                      accountFactory,
+                                                                      connectionFactory,
+                                                                      channelFactory,
+                                                                      contactFactory);
+
+    connect(m_accountManager->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)), SLOT(onAccountManagerReady()));
 }
 
 MainWindow::~MainWindow()
@@ -40,3 +67,9 @@ void MainWindow::showIcon(const KFileItem &file)
     //icon is     file.iconName();
 
 }
+
+void MainWindow::onAccountManagerReady()
+{
+    AccountsModel *model = new AccountsModel(m_accountManager, this);
+    ui->listView->setModel(model);
+}
diff --git a/mainwindow.h b/mainwindow.h
index ce95587..ff4eda6 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -3,6 +3,9 @@
 
 #include <QWidget>
 
+#include <TelepathyQt4/AccountManager>
+
+
 namespace Ui {
     class MainWindow;
 }
@@ -20,10 +23,12 @@ public:
 private slots:
     void showPreview(const KFileItem &file, const QPixmap &pixmap);
     void showIcon(const KFileItem &file);
+    void onAccountManagerReady();
 
 
 private:
     Ui::MainWindow *ui;
+    Tp::AccountManagerPtr m_accountManager;
 };
 
 #endif // MAINWINDOW_H

-- 
ktp-send-file packaging



More information about the pkg-kde-commits mailing list