[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:12:09 UTC 2016


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

The following commit has been merged in the master branch:
commit 9b66b9f792e9bdfd9a58f68952fe0124fe6411f2
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Mon Jan 28 10:41:58 2013 +0100

    Port to KTp::ContactInfoDialog
    
    REVIEW: 108619
---
 CMakeLists.txt           |   2 -
 context-menu.cpp         |  13 ++--
 dialogs/contact-info.cpp | 102 ----------------------------
 dialogs/contact-info.h   |  46 -------------
 dialogs/contact-info.ui  | 172 -----------------------------------------------
 main-widget.cpp          |   1 +
 6 files changed, 8 insertions(+), 328 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef52f01..5a1c0fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,6 @@ set (ktp_contactlist_SRCS
      main-widget.cpp
      global-presence-chooser.cpp
      dialogs/remove-contact-dialog.cpp
-     dialogs/contact-info.cpp
      dialogs/custom-presence-dialog.cpp
      presence-model.cpp
      tooltips/ktooltip.cpp
@@ -57,7 +56,6 @@ set (ktp_contactlist_SRCS
 kde4_add_ui_files (ktp_contactlist_SRCS
                    main-widget.ui
                    dialogs/remove-contact-dialog.ui
-                   dialogs/contact-info.ui
                    tooltips/contacttooltip.ui
 )
 
diff --git a/context-menu.cpp b/context-menu.cpp
index d8cad05..bbc87f9 100644
--- a/context-menu.cpp
+++ b/context-menu.cpp
@@ -32,6 +32,7 @@
 #include <KTp/Models/contacts-model.h>
 #include <KTp/text-parser.h>
 #include <KTp/Widgets/notificationconfigdialog.h>
+#include <KTp/contact-info-dialog.h>
 
 #include <TelepathyQt/ContactManager>
 #include <TelepathyQt/Account>
@@ -41,7 +42,6 @@
 #include <TelepathyLoggerQt4/Init>
 
 #include "dialogs/remove-contact-dialog.h"
-#include "dialogs/contact-info.h"
 
 #include "contact-list-widget_p.h"
 #include "contacts-model.h"
@@ -333,11 +333,12 @@ void ContextMenu::onShowInfoTriggered()
         return;
     }
 
-    Tp::ContactPtr contact  = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
-    if (contact) {
-        QWeakPointer<ContactInfo> contactInfoDialog = new ContactInfo(contact, m_mainWidget);
-        contactInfoDialog.data()->setAttribute(Qt::WA_DeleteOnClose);
-        contactInfoDialog.data()->show();
+    Tp::AccountPtr account = m_currentIndex.data(ContactsModel::AccountRole).value<Tp::AccountPtr>();
+    Tp::ContactPtr contact = m_currentIndex.data(ContactsModel::ContactRole).value<Tp::ContactPtr>();
+    if (account && contact) {
+        KTp::ContactInfoDialog* contactInfoDialog = new KTp::ContactInfoDialog(account, contact, m_mainWidget);
+        contactInfoDialog->setAttribute(Qt::WA_DeleteOnClose);
+        contactInfoDialog->show();
     }
 }
 
diff --git a/dialogs/contact-info.cpp b/dialogs/contact-info.cpp
deleted file mode 100644
index 1cd346a..0000000
--- a/dialogs/contact-info.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Dialog for showing contact info
- *
- * Copyright (C) 2011 David Edmundson <kde at davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "contact-info.h"
-#include "ui_contact-info.h"
-
-#include <TelepathyQt/AvatarData>
-#include <TelepathyQt/Presence>
-
-#include <QtGui/QPixmap>
-
-#include <KProtocolInfo>
-
-#include <KTp/text-parser.h>
-#include <KDebug>
-
-ContactInfo::ContactInfo(const Tp::ContactPtr &contact, QWidget *parent) :
-    KDialog(parent),
-    ui(new Ui::ContactInfo)
-{
-    QWidget *widget = new QWidget(this);
-    setMainWidget(widget);
-    ui->setupUi(widget);
-
-    setWindowTitle(contact->alias());
-
-    setButtons(KDialog::Close);
-
-    QPixmap avatar(contact->avatarData().fileName);
-    if (avatar.isNull()) {
-        avatar = KIconLoader::global()->loadIcon("im-user", KIconLoader::Desktop, 128);
-    }
-
-    ui->avatarLabel->setPixmap(avatar.scaled(ui->avatarLabel->maximumSize(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
-
-    ui->idLabel->setText(contact->id());
-    ui->nameLabel->setText(contact->alias());
-
-    QString presenceMessage = contact->presence().statusMessage();
-
-    KTp::TextUrlData urls = KTp::TextParser::instance()->extractUrlData(presenceMessage);
-
-    int offset = 0;
-    for (int i = 0; i < urls.fixedUrls.size(); i++) {
-        QString originalText = presenceMessage.mid(urls.urlRanges.at(i).first + offset, urls.urlRanges.at(i).second);
-        QString link = QString("<a href='%1'>%2</a>").arg(urls.fixedUrls.at(i), originalText);
-        presenceMessage.replace(urls.urlRanges.at(i).first + offset, urls.urlRanges.at(i).second, link);
-
-        //after the first replacement is made, the original position values are not valid anymore, this adjusts them
-        offset += link.length() - originalText.length();
-    }
-
-    ui->presenceLabel->setTextFormat(Qt::RichText);
-    ui->presenceLabel->setText(presenceMessage);
-
-    KIcon blockedIcon;
-    if (contact->isBlocked()) {
-        blockedIcon = KIcon("task-complete");
-    } else {
-        blockedIcon = KIcon("task-reject");
-    }
-    ui->blockedLabel->setPixmap(blockedIcon.pixmap(16));
-
-    ui->subscriptionStateLabel->setPixmap(iconForPresenceState(contact->subscriptionState()).pixmap(16));
-    ui->publishStateLabel->setPixmap(iconForPresenceState(contact->publishState()).pixmap(16));
-}
-
-ContactInfo::~ContactInfo()
-{
-    delete ui;
-}
-
-KIcon ContactInfo::iconForPresenceState(Tp::Contact::PresenceState state) const
-{
-    switch (state) {
-    case Tp::Contact::PresenceStateYes:
-        return KIcon("task-complete");
-    case Tp::Contact::PresenceStateNo:
-        return KIcon("task-reject");
-    case Tp::Contact::PresenceStateAsk:
-        /* Drop Through*/
-    default:
-        return KIcon("task-attempt");
-    }
-}
diff --git a/dialogs/contact-info.h b/dialogs/contact-info.h
deleted file mode 100644
index ef81d03..0000000
--- a/dialogs/contact-info.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Dialog for showing contact info
- *
- * Copyright (C) 2011 David Edmundson <kde at davidedmundson.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-
-#ifndef CONTACTINFO_H
-#define CONTACTINFO_H
-
-#include <KDialog>
-#include <TelepathyQt/Contact>
-
-
-namespace Ui {
-    class ContactInfo;
-}
-
-class ContactInfo : public KDialog
-{
-    Q_OBJECT
-
-public:
-    explicit ContactInfo(const Tp::ContactPtr &contact, QWidget *parent = 0);
-    ~ContactInfo();
-
-private:
-    Ui::ContactInfo *ui;
-    KIcon iconForPresenceState(Tp::Contact::PresenceState state) const;
-};
-
-#endif // CONTACTINFO_H
diff --git a/dialogs/contact-info.ui b/dialogs/contact-info.ui
deleted file mode 100644
index 1106fa3..0000000
--- a/dialogs/contact-info.ui
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ContactInfo</class>
- <widget class="QWidget" name="ContactInfo">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>523</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QLabel" name="avatarLabel">
-       <property name="maximumSize">
-        <size>
-         <width>200</width>
-         <height>200</height>
-        </size>
-       </property>
-       <property name="text">
-        <string>Avatar Here</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QLabel" name="idLabel">
-         <property name="text">
-          <string>ContactID</string>
-         </property>
-         <property name="textInteractionFlags">
-          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="nameLabel">
-         <property name="minimumSize">
-          <size>
-           <width>300</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="font">
-          <font>
-           <weight>75</weight>
-           <bold>true</bold>
-          </font>
-         </property>
-         <property name="text">
-          <string>Contact Display Name</string>
-         </property>
-         <property name="textInteractionFlags">
-          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="presenceLabel">
-         <property name="text">
-          <string>Presence String</string>
-         </property>
-         <property name="textFormat">
-          <enum>Qt::RichText</enum>
-         </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-         <property name="openExternalLinks">
-          <bool>true</bool>
-         </property>
-         <property name="textInteractionFlags">
-          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QFormLayout" name="formLayout">
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string>Contact can see when you are online:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLabel" name="publishStateLabel">
-       <property name="text">
-        <string>TextLabel</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label_5">
-       <property name="text">
-        <string>You can see when the contact is online:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLabel" name="subscriptionStateLabel">
-       <property name="text">
-        <string>TextLabel</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_4">
-       <property name="text">
-        <string>Contact is blocked:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="QLabel" name="blockedLabel">
-       <property name="text">
-        <string>TextLabel</string>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <spacer name="verticalSpacer">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/main-widget.cpp b/main-widget.cpp
index 31bb688..d1a38df 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -94,6 +94,7 @@ MainWidget::MainWidget(QWidget *parent)
                                                                       << Tp::Contact::FeatureAvatarData
                                                                       << Tp::Contact::FeatureSimplePresence
                                                                       << Tp::Contact::FeatureCapabilities
+                                                                      << Tp::Contact::FeatureInfo
                                                                       << Tp::Contact::FeatureClientTypes);
 
     Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list