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


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

The following commit has been merged in the master branch:
commit 05474e5bcdd4b7bb86d1aa51b9a3f455505f9295
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Fri Apr 1 01:40:44 2011 +0100

    Review comments in AccountButton
    
    Convert QActions to KActions in AccountButton
    Added const references to several methods
    Tidied unused includes
---
 account-button.cpp | 29 +++++++++++++++--------------
 account-button.h   | 10 +++++-----
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/account-button.cpp b/account-button.cpp
index 690c98e..296802b 100644
--- a/account-button.cpp
+++ b/account-button.cpp
@@ -18,15 +18,16 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <QAction>
-#include <QPainter>
-#include <QPixmap>
+#include <QtGui/QPainter>
+#include <QtGui/QPixmap>
 
+#include <KAction>
 #include <KIcon>
 #include <KLocale>
 #include <KPixmapSequenceOverlayPainter>
 #include <KPixmapSequence>
 
+#include <TelepathyQt4/Account>
 #include <TelepathyQt4/PendingOperation>
 
 #include "account-button.h"
@@ -62,14 +63,14 @@ AccountButton::AccountButton(const Tp::AccountPtr &account, QWidget* parent)
     QActionGroup *presenceActions = new QActionGroup(this);
     presenceActions->setExclusive(true);
 
-    QAction *onlineAction =     new QAction(KIcon("user-online"), i18nc("@action:inmenu", "Available"), this);
-    QAction *awayAction =       new QAction(KIcon("user-away"), i18nc("@action:inmenu", "Away"), this);
-    QAction *brbAction =        new QAction(KIcon("user-busy"), i18nc("@action:inmenu", "Be right back"), this);
-    QAction *busyAction =       new QAction(KIcon("user-busy"), i18nc("@action:inmenu", "Busy"), this);
-    QAction *dndAction =        new QAction(KIcon("user-busy"), i18nc("@action:inmenu", "Do not disturb"), this);
-    QAction *xaAction =         new QAction(KIcon("user-away-extended"), i18nc("@action:inmenu", "Extended Away"), this);
-    QAction *invisibleAction =  new QAction(KIcon("user-invisible"), i18nc("@action:inmenu", "Invisible"), this);
-    QAction *offlineAction =    new QAction(KIcon("user-offline"), i18nc("@action:inmenu", "Offline"), this);
+    KAction *onlineAction =     new KAction(KIcon("user-online"), i18nc("@action:inmenu", "Available"), this);
+    KAction *awayAction =       new KAction(KIcon("user-away"), i18nc("@action:inmenu", "Away"), this);
+    KAction *brbAction =        new KAction(KIcon("user-busy"), i18nc("@action:inmenu", "Be right back"), this);
+    KAction *busyAction =       new KAction(KIcon("user-busy"), i18nc("@action:inmenu", "Busy"), this);
+    KAction *dndAction =        new KAction(KIcon("user-busy"), i18nc("@action:inmenu", "Do not disturb"), this);
+    KAction *xaAction =         new KAction(KIcon("user-away-extended"), i18nc("@action:inmenu", "Extended Away"), this);
+    KAction *invisibleAction =  new KAction(KIcon("user-invisible"), i18nc("@action:inmenu", "Invisible"), this);
+    KAction *offlineAction =    new KAction(KIcon("user-offline"), i18nc("@action:inmenu", "Offline"), this);
 
     //let's set the presences as data so we can easily just use the Tp::Presence when the action has been triggered
     onlineAction->setData(qVariantFromValue(Tp::Presence::available()));
@@ -158,7 +159,7 @@ void AccountButton::updateToolTip()
     }
 }
 
-void AccountButton::connectionChanged(Tp::ConnectionStatus status)
+void AccountButton::connectionChanged(const Tp::ConnectionStatus &status)
 {
     switch (status) {
     case Tp::ConnectionStatusConnecting:
@@ -183,7 +184,7 @@ void AccountButton::hideBusyIndicator()
     m_busyOverlay->stop();
 }
 
-void AccountButton::presenceChanged(Tp::Presence presence)
+void AccountButton::presenceChanged(const Tp::Presence &presence)
 {
     foreach (QAction *a, actions()) {
         if (presence.status() == qVariantValue<Tp::Presence>(a->data()).status()) {
@@ -197,7 +198,7 @@ void AccountButton::presenceChanged(Tp::Presence presence)
 /*  since there is no easy way to get this string by Tp::Presence,
     we need to loop through all the actions and return the right one.
     This will also get us i18n strings for free. */
-QString AccountButton::presenceDisplayString(const Tp::Presence)
+QString AccountButton::presenceDisplayString(const Tp::Presence &presence)
 {
     foreach (QAction *a, actions()) {
         if (m_account->currentPresence().status() == qVariantValue<Tp::Presence>(a->data()).status()) {
diff --git a/account-button.h b/account-button.h
index 296b38f..b48fcae 100644
--- a/account-button.h
+++ b/account-button.h
@@ -22,9 +22,9 @@
 #define TELEPATHY_ACCOUNTBUTTON_H
 
 #include <QToolButton>
-#include <QLineEdit>
 
-#include <TelepathyQt4/Account>
+#include <TelepathyQt4/Types>
+#include <TelepathyQt4/Presence>
 
 class QAction;
 class KPixmapSequenceOverlayPainter;
@@ -40,7 +40,7 @@ public:
     QString accountId();
 
     ///Returns the action (menu item) string for displaying elsewhere on the screen
-    QString presenceDisplayString(const Tp::Presence);
+    QString presenceDisplayString(const Tp::Presence &presence);
 
 public Q_SLOTS:
     ///Sets the account status contained in action (connects to triggered(QAction*) signal)
@@ -50,7 +50,7 @@ public Q_SLOTS:
     void updateToolTip();
 
     ///Called when the connection status changes
-    void connectionChanged(Tp::ConnectionStatus status);
+    void connectionChanged(const Tp::ConnectionStatus &status);
 
     ///Shows the animated busy icon over the button
     void showBusyIndicator();
@@ -59,7 +59,7 @@ public Q_SLOTS:
     void hideBusyIndicator();
 
     ///Called when the account presence changes
-    void presenceChanged(Tp::Presence presence);
+    void presenceChanged(const Tp::Presence &presence);
 
     ///Sets the custom presence message
     void setCustomPresenceMessage(const QString &message);

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list