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


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

The following commit has been merged in the master branch:
commit a3d17c76332cad8ffc24d3bfe5541233d0ff2fce
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Mon Oct 10 17:00:55 2011 +0100

    Added review comments
---
 dialogs/custom-presence-dialog.cpp |  4 ----
 dialogs/custom-presence-dialog.h   |  4 ----
 global-presence-chooser.cpp        | 12 ++----------
 main-widget.cpp                    |  2 ++
 main-widget.ui                     | 20 +++++++++++---------
 presence-model.cpp                 |  8 +++++++-
 6 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/dialogs/custom-presence-dialog.cpp b/dialogs/custom-presence-dialog.cpp
index 1163540..3bca3e2 100644
--- a/dialogs/custom-presence-dialog.cpp
+++ b/dialogs/custom-presence-dialog.cpp
@@ -18,7 +18,6 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-
 #include "custom-presence-dialog.h"
 
 #include "presence-model.h"
@@ -30,8 +29,6 @@
 #include <QtGui/QSortFilterProxyModel>
 #include <QtCore/QModelIndex>
 
-
-
 #include <KDE/KDialog>
 #include <KDE/KLocalizedString>
 #include <KDE/KConfig>
@@ -39,7 +36,6 @@
 
 #include <TelepathyQt4/Presence>
 
-
 class FilteredModel : public QSortFilterProxyModel {
 public:
     FilteredModel(QObject *parent);
diff --git a/dialogs/custom-presence-dialog.h b/dialogs/custom-presence-dialog.h
index 4f689ea..cfb2774 100644
--- a/dialogs/custom-presence-dialog.h
+++ b/dialogs/custom-presence-dialog.h
@@ -38,10 +38,7 @@ public:
     explicit CustomPresenceDialog(PresenceModel *model, QWidget *parent = 0);
 
 private Q_SLOTS:
-    ///Adds a custom presence to the config file
     void addCustomPresence();
-
-    ///Removes a custom presence from the config file
     void removeCustomPresence();
 
 private:
@@ -58,7 +55,6 @@ private:
     KComboBox    *m_statusMessage;
 
     PresenceModel *m_model;
-
 };
 
 #endif // CUSTOM_PRESENCE_DIALOG_H
diff --git a/global-presence-chooser.cpp b/global-presence-chooser.cpp
index 54294e5..fc2818c 100644
--- a/global-presence-chooser.cpp
+++ b/global-presence-chooser.cpp
@@ -68,17 +68,10 @@ int PresenceModelPlusConfig::rowCount(const QModelIndex &parent) const
 
 QVariant PresenceModelPlusConfig::data(const QModelIndex &index, int role) const
 {
-/*    //if it's our new button
-    if (index.row() == rowCount(index.parent())-2) {
-        switch(role) {
-        case Qt::AccessibleDescriptionRole:
-            return QLatin1String("separator");
-        }
-    } else */
     if (index.row() == rowCount(index.parent())-1) {
         switch(role) {
         case Qt::DisplayRole:
-            return i18n("Configure Custom Presences");
+            return i18n("Configure Custom Presences...");
         case Qt::DecorationRole:
             return KIcon("configure");
         }
@@ -134,12 +127,11 @@ void GlobalPresenceChooser::onCurrentIndexChanged(int index)
 
 void GlobalPresenceChooser::onPresenceChanged(const Tp::Presence &presence)
 {
-    kDebug() << "presence changing";
+    kDebug();
     for (int i=0; i < count() ; i++) {
         Tp::Presence itemPresence = itemData(i, PresenceModel::PresenceRole).value<Tp::Presence>();
         if (itemPresence.type() == presence.type() && itemPresence.statusMessage() == presence.statusMessage()) {
             setCurrentIndex(i);
-            kDebug() << "found item";
             return;
         }
     }
diff --git a/main-widget.cpp b/main-widget.cpp
index c10e075..1ae8a5c 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -340,6 +340,8 @@ void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)
     m_accountButtons->setAccountManager(m_accountManager);
     m_presenceChooser->setAccountManager(m_accountManager);
 
+    m_accountButtons->hide();
+
     QList<Tp::AccountPtr> accounts = m_accountManager->allAccounts();
 
     if(accounts.count() == 0) {
diff --git a/main-widget.ui b/main-widget.ui
index d4b4be4..d71a276 100644
--- a/main-widget.ui
+++ b/main-widget.ui
@@ -36,7 +36,7 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="0" rowspan="4">
+      <item row="0" column="0" rowspan="3">
        <widget class="AvatarButton" name="m_avatarButton">
         <property name="minimumSize">
          <size>
@@ -61,11 +61,18 @@
         </property>
        </widget>
       </item>
-      <item row="3" column="1">
+      <item row="2" column="1">
        <widget class="AccountButtonsPanel" name="m_accountButtons" native="true"/>
       </item>
-      <item row="2" column="1">
-       <widget class="GlobalPresenceChooser" name="m_presenceChooser"/>
+      <item row="1" column="1">
+       <widget class="GlobalPresenceChooser" name="m_presenceChooser">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
       </item>
      </layout>
     </item>
@@ -98,11 +105,6 @@
  </widget>
  <customwidgets>
   <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
-  <customwidget>
    <class>FilterBar</class>
    <extends>QWidget</extends>
    <header>filter-bar.h</header>
diff --git a/presence-model.cpp b/presence-model.cpp
index 099ea61..0d0bd42 100644
--- a/presence-model.cpp
+++ b/presence-model.cpp
@@ -34,7 +34,7 @@
 PresenceModel::PresenceModel(QObject *parent) :
     QAbstractListModel(parent)
 {
-    KSharedConfigPtr config = KSharedConfig::openConfig("telepathy-kde-contactlistrc");
+    KSharedConfigPtr config = KSharedConfig::openConfig("ktelepathyrc");
     m_presenceGroup = config->group("Custom Presence List");
 
     loadDefaultPresences();
@@ -132,12 +132,18 @@ void PresenceModel::loadCustomPresences()
         case Tp::ConnectionPresenceTypeBusy:
             addPresence(Tp::Presence::busy(statusMessage));
             break;
+        case Tp::ConnectionPresenceTypeExtendedAway:
+            addPresence(Tp::Presence::xa(statusMessage));
         }
     }
 }
 
 QModelIndex PresenceModel::addPresence(const Tp::Presence &presence)
 {
+    if(m_presences.contains(presence)) {
+        return createIndex(m_presences.indexOf(presence),0);
+    }
+
     QList<KPresence>::iterator i = qLowerBound(m_presences.begin(), m_presences.end(), KPresence(presence));
 
     m_presences.insert(i, presence);

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list