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


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

The following commit has been merged in the master branch:
commit c7a18b329ebdadc57e97c89453bf243892fa46c6
Author: Ian Monroe <imonroe at kde.org>
Date:   Sat Apr 27 17:22:19 2013 -0700

    Now playing shouldn't be disabled on pause
    
    Fix requires corresponding commit in ktp-kded-module
    Needed to separate things done for every presence change
    from those actions only to be done on user-initiated presence changes
---
 global-presence-chooser.cpp | 21 +++++++++++++++------
 global-presence-chooser.h   |  3 ++-
 presence-model.h            |  2 +-
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/global-presence-chooser.cpp b/global-presence-chooser.cpp
index 59d972d..55a30b9 100644
--- a/global-presence-chooser.cpp
+++ b/global-presence-chooser.cpp
@@ -191,7 +191,8 @@ GlobalPresenceChooser::GlobalPresenceChooser(QWidget *parent) :
     m_changePresenceMessageButton->setFlat(true);
     m_changePresenceMessageButton->setToolTip(i18n("Click to change your presence message"));
 
-    connect(this, SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int)));
+    connect(this, SIGNAL(currentIndexChanged(int)), SLOT(onAllComboChanges(int)));
+    connect(this, SIGNAL(activated(int)), SLOT(onUserActivatedComboChange(int)));
     connect(m_globalPresence, SIGNAL(currentPresenceChanged(KTp::Presence)), SLOT(onPresenceChanged(KTp::Presence)));
     connect(m_globalPresence, SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)), SLOT(onConnectionStatusChanged(Tp::ConnectionStatus)));
     connect(m_changePresenceMessageButton, SIGNAL(clicked(bool)), this, SLOT(onChangePresenceMessageClicked()));
@@ -310,7 +311,7 @@ void GlobalPresenceChooser::setEditable(bool editable)
     KComboBox::setEditable(editable);
 }
 
-void GlobalPresenceChooser::onCurrentIndexChanged(int index)
+void GlobalPresenceChooser::onUserActivatedComboChange(int index)
 {
     if (index == -1) {
         return;
@@ -360,6 +361,13 @@ void GlobalPresenceChooser::onCurrentIndexChanged(int index)
                                                           QLatin1String( "org.kde.Telepathy"),
                                                           QLatin1String("deactivateNowPlaying"));
         QDBusConnection::sessionBus().send(message);
+    }
+}
+
+void GlobalPresenceChooser::onAllComboChanges(int index)
+{
+    int lastPresenceIndex = m_model->rowCount();
+    if(index < lastPresenceIndex) {
         KTp::Presence presence = itemData(index, PresenceModel::PresenceRole).value<KTp::Presence>();
         m_globalPresence->setPresence(presence);
         if ((presence.type() == Tp::ConnectionPresenceTypeOffline) ||
@@ -369,8 +377,10 @@ void GlobalPresenceChooser::onCurrentIndexChanged(int index)
             m_changePresenceMessageButton->show();
         }
     }
+
 }
 
+
 void GlobalPresenceChooser::onPresenceChanged(const KTp::Presence &presence)
 {
     if (presence.type() == Tp::ConnectionPresenceTypeUnknown) {
@@ -443,10 +453,9 @@ void GlobalPresenceChooser::onConfirmPresenceMessageClicked()
     QModelIndex newPresence = m_model->addPresence(presence); //m_model->addPresence(presence);
     setEditable(false);
     setCurrentIndex(newPresence.row());
-    //this is needed because currentIndexChanged signal is not connected and that is to not crash contact list
-    //because this signal is emitted once there is a valid model and that happens before AccountManager is ready
-    //and thus crashes contact list. Therefore it's called manually here.
-    onCurrentIndexChanged(newPresence.row());
+
+    onUserActivatedComboChange(newPresence.row());
+    onAllComboChanges(newPresence.row());
 }
 
 
diff --git a/global-presence-chooser.h b/global-presence-chooser.h
index 678681c..c240682 100644
--- a/global-presence-chooser.h
+++ b/global-presence-chooser.h
@@ -50,7 +50,8 @@ protected:
     virtual void setEditable(bool editable); /** Hides overlay and calls ancestor's method. */
 
 private Q_SLOTS:
-    void onCurrentIndexChanged(int index);
+    void onUserActivatedComboChange(int index);
+    void onAllComboChanges(int index);
     void onPresenceChanged(const KTp::Presence &presence);
     void onConnectionStatusChanged(Tp::ConnectionStatus connectionStatus);
     void onChangePresenceMessageClicked();
diff --git a/presence-model.h b/presence-model.h
index 2ce652f..dcb9ccc 100644
--- a/presence-model.h
+++ b/presence-model.h
@@ -52,7 +52,7 @@ public:
 
     //protected:
     virtual QVariant data(const QModelIndex &index, int role) const;
-    virtual int rowCount(const QModelIndex &parent) const;
+    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
 
 private:
 

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list