[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:04:29 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=e8d0f18

The following commit has been merged in the master branch:
commit e8d0f18a9b9224f02bf7445d88eb04dff1e19cfc
Author: Florian Reinhard <florian.reinhard at googlemail.com>
Date:   Fri Mar 11 15:53:31 2011 +0100

    Do some code clean-up based on astyle suggests.
---
 models/accounts-model-item.cpp | 104 ++++++++++++++++----------------
 models/accounts-model.cpp      |   3 +-
 models/contact-model-item.cpp  | 133 ++++++++++++++++++++---------------------
 models/tree-node.cpp           |   6 +-
 models/tree-node.h             |   2 +-
 5 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/models/accounts-model-item.cpp b/models/accounts-model-item.cpp
index c80d519..536e513 100644
--- a/models/accounts-model-item.cpp
+++ b/models/accounts-model-item.cpp
@@ -136,57 +136,57 @@ AccountsModelItem::~AccountsModelItem()
 QVariant AccountsModelItem::data(int role) const
 {
     switch (role) {
-        case AccountsModel::ItemRole:
-            return QVariant::fromValue(
-                const_cast<QObject *>(
-                    static_cast<const QObject *>(this)));
-        case AccountsModel::IdRole:
-            return mPriv->mAccount->uniqueIdentifier();
-        case AccountsModel::AvatarRole:
-            return QVariant(); //TODO: Return account icon
-        case AccountsModel::ValidRole:
-            return mPriv->mAccount->isValid();
-        case AccountsModel::EnabledRole:
-            return mPriv->mAccount->isEnabled();
-        case AccountsModel::ConnectionManagerNameRole:
-            return mPriv->mAccount->cmName();
-        case AccountsModel::ProtocolNameRole:
-            return mPriv->mAccount->protocolName();
-        case AccountsModel::DisplayNameRole:
-        case Qt::DisplayRole:
-            return mPriv->mAccount->displayName();
-        case AccountsModel::IconRole:
-            return mPriv->mAccount->iconName();
-        case AccountsModel::NicknameRole:
-            return mPriv->mAccount->nickname();
-        case AccountsModel::ConnectsAutomaticallyRole:
-            return mPriv->mAccount->connectsAutomatically();
-        case AccountsModel::ChangingPresenceRole:
-            return mPriv->mAccount->isChangingPresence();
-        case AccountsModel::AutomaticPresenceRole:
-            return mPriv->mAccount->automaticPresence().status();
-        case AccountsModel::AutomaticPresenceTypeRole:
-            return mPriv->mAccount->automaticPresence().type();
-        case AccountsModel::AutomaticPresenceStatusMessageRole:
-            return mPriv->mAccount->automaticPresence().statusMessage();
-        case AccountsModel::CurrentPresenceRole:
-            return mPriv->mAccount->currentPresence().status();
-        case AccountsModel::CurrentPresenceTypeRole:
-            return mPriv->mAccount->currentPresence().type();
-        case AccountsModel::CurrentPresenceStatusMessageRole:
-            return mPriv->mAccount->currentPresence().statusMessage();
-        case AccountsModel::RequestedPresenceRole:
-            return mPriv->mAccount->requestedPresence().status();
-        case AccountsModel::RequestedPresenceTypeRole:
-            return mPriv->mAccount->requestedPresence().type();
-        case AccountsModel::RequestedPresenceStatusMessageRole:
-            return mPriv->mAccount->requestedPresence().statusMessage();
-        case AccountsModel::ConnectionStatusRole:
-            return mPriv->mAccount->connectionStatus();
-        case AccountsModel::ConnectionStatusReasonRole:
-            return mPriv->mAccount->connectionStatusReason();
-        default:
-            return QVariant();
+    case AccountsModel::ItemRole:
+        return QVariant::fromValue(
+                   const_cast<QObject *>(
+                       static_cast<const QObject *>(this)));
+    case AccountsModel::IdRole:
+        return mPriv->mAccount->uniqueIdentifier();
+    case AccountsModel::AvatarRole:
+        return QVariant(); //TODO: Return account icon
+    case AccountsModel::ValidRole:
+        return mPriv->mAccount->isValid();
+    case AccountsModel::EnabledRole:
+        return mPriv->mAccount->isEnabled();
+    case AccountsModel::ConnectionManagerNameRole:
+        return mPriv->mAccount->cmName();
+    case AccountsModel::ProtocolNameRole:
+        return mPriv->mAccount->protocolName();
+    case AccountsModel::DisplayNameRole:
+    case Qt::DisplayRole:
+        return mPriv->mAccount->displayName();
+    case AccountsModel::IconRole:
+        return mPriv->mAccount->iconName();
+    case AccountsModel::NicknameRole:
+        return mPriv->mAccount->nickname();
+    case AccountsModel::ConnectsAutomaticallyRole:
+        return mPriv->mAccount->connectsAutomatically();
+    case AccountsModel::ChangingPresenceRole:
+        return mPriv->mAccount->isChangingPresence();
+    case AccountsModel::AutomaticPresenceRole:
+        return mPriv->mAccount->automaticPresence().status();
+    case AccountsModel::AutomaticPresenceTypeRole:
+        return mPriv->mAccount->automaticPresence().type();
+    case AccountsModel::AutomaticPresenceStatusMessageRole:
+        return mPriv->mAccount->automaticPresence().statusMessage();
+    case AccountsModel::CurrentPresenceRole:
+        return mPriv->mAccount->currentPresence().status();
+    case AccountsModel::CurrentPresenceTypeRole:
+        return mPriv->mAccount->currentPresence().type();
+    case AccountsModel::CurrentPresenceStatusMessageRole:
+        return mPriv->mAccount->currentPresence().statusMessage();
+    case AccountsModel::RequestedPresenceRole:
+        return mPriv->mAccount->requestedPresence().status();
+    case AccountsModel::RequestedPresenceTypeRole:
+        return mPriv->mAccount->requestedPresence().type();
+    case AccountsModel::RequestedPresenceStatusMessageRole:
+        return mPriv->mAccount->requestedPresence().statusMessage();
+    case AccountsModel::ConnectionStatusRole:
+        return mPriv->mAccount->connectionStatus();
+    case AccountsModel::ConnectionStatusReasonRole:
+        return mPriv->mAccount->connectionStatusReason();
+    default:
+        return QVariant();
     }
 }
 
@@ -212,7 +212,7 @@ bool AccountsModelItem::setData(int role, const QVariant &value)
 
 Tp::AccountPtr AccountsModelItem::account() const
 {
-     return mPriv->mAccount;
+    return mPriv->mAccount;
 }
 
 void AccountsModelItem::setEnabled(bool value)
diff --git a/models/accounts-model.cpp b/models/accounts-model.cpp
index e41bd79..b1f8e03 100644
--- a/models/accounts-model.cpp
+++ b/models/accounts-model.cpp
@@ -283,8 +283,7 @@ QModelIndex AccountsModel::index(TreeNode *node) const
 {
     if (node->parent()) {
         return createIndex(node->parent()->indexOf(node), 0, node);
-    }
-    else {
+    } else {
         return QModelIndex();
     }
 }
diff --git a/models/contact-model-item.cpp b/models/contact-model-item.cpp
index 39bc14f..b24abe3 100644
--- a/models/contact-model-item.cpp
+++ b/models/contact-model-item.cpp
@@ -83,55 +83,54 @@ ContactModelItem::~ContactModelItem()
 
 QVariant ContactModelItem::data(int role) const
 {
-    switch (role)
-    {
-        case AccountsModel::ItemRole:
-            return QVariant::fromValue(
-                const_cast<QObject *>(
-                    static_cast<const QObject *>(this)));
-        case AccountsModel::IdRole:
-            return mPriv->mContact->id();
-        case Qt::DisplayRole:
-        case AccountsModel::AliasRole:
-            return mPriv->mContact->alias();
-        case AccountsModel::PresenceStatusRole:
-            return mPriv->mContact->presence().status();
-        case AccountsModel::PresenceTypeRole:
-            return mPriv->mContact->presence().type();
-        case AccountsModel::PresenceMessageRole:
-            return mPriv->mContact->presence().statusMessage();
-        case AccountsModel::SubscriptionStateRole:
-            return mPriv->mContact->subscriptionState();
-        case AccountsModel::PublishStateRole:
-            return mPriv->mContact->publishState();
-        case AccountsModel::BlockedRole:
-            return mPriv->mContact->isBlocked();
-        case AccountsModel::GroupsRole:
-            return mPriv->mContact->groups();
-        case AccountsModel::AvatarRole:
-            return mPriv->mContact->avatarData().fileName;
-        case Qt::DecorationRole:
-            return QImage(mPriv->mContact->avatarData().fileName);
-        case AccountsModel::TextChatCapabilityRole:
-            return mPriv->mContact->capabilities().textChats();
-        case AccountsModel::MediaCallCapabilityRole:
-            return mPriv->mContact->capabilities().streamedMediaCalls();
-        case AccountsModel::AudioCallCapabilityRole:
-            return mPriv->mContact->capabilities().streamedMediaAudioCalls();
-        case AccountsModel::VideoCallCapabilityRole:
-            return mPriv->mContact->capabilities().streamedMediaVideoCalls();
-        case AccountsModel::UpgradeCallCapabilityRole:
-            return mPriv->mContact->capabilities().upgradingStreamedMediaCalls();
-        case AccountsModel::FileTransferCapabilityRole: {
-            foreach (const Tp::RequestableChannelClassSpec &rccSpec, mPriv->mContact->capabilities().allClassSpecs()) {
-                if (rccSpec.supports(Tp::RequestableChannelClassSpec::fileTransfer())) {
-                    return true;
-                }
+    switch (role) {
+    case AccountsModel::ItemRole:
+        return QVariant::fromValue(
+                   const_cast<QObject *>(
+                       static_cast<const QObject *>(this)));
+    case AccountsModel::IdRole:
+        return mPriv->mContact->id();
+    case Qt::DisplayRole:
+    case AccountsModel::AliasRole:
+        return mPriv->mContact->alias();
+    case AccountsModel::PresenceStatusRole:
+        return mPriv->mContact->presence().status();
+    case AccountsModel::PresenceTypeRole:
+        return mPriv->mContact->presence().type();
+    case AccountsModel::PresenceMessageRole:
+        return mPriv->mContact->presence().statusMessage();
+    case AccountsModel::SubscriptionStateRole:
+        return mPriv->mContact->subscriptionState();
+    case AccountsModel::PublishStateRole:
+        return mPriv->mContact->publishState();
+    case AccountsModel::BlockedRole:
+        return mPriv->mContact->isBlocked();
+    case AccountsModel::GroupsRole:
+        return mPriv->mContact->groups();
+    case AccountsModel::AvatarRole:
+        return mPriv->mContact->avatarData().fileName;
+    case Qt::DecorationRole:
+        return QImage(mPriv->mContact->avatarData().fileName);
+    case AccountsModel::TextChatCapabilityRole:
+        return mPriv->mContact->capabilities().textChats();
+    case AccountsModel::MediaCallCapabilityRole:
+        return mPriv->mContact->capabilities().streamedMediaCalls();
+    case AccountsModel::AudioCallCapabilityRole:
+        return mPriv->mContact->capabilities().streamedMediaAudioCalls();
+    case AccountsModel::VideoCallCapabilityRole:
+        return mPriv->mContact->capabilities().streamedMediaVideoCalls();
+    case AccountsModel::UpgradeCallCapabilityRole:
+        return mPriv->mContact->capabilities().upgradingStreamedMediaCalls();
+    case AccountsModel::FileTransferCapabilityRole: {
+        foreach(const Tp::RequestableChannelClassSpec & rccSpec, mPriv->mContact->capabilities().allClassSpecs()) {
+            if (rccSpec.supports(Tp::RequestableChannelClassSpec::fileTransfer())) {
+                return true;
             }
-            return false;
         }
-        default:
-            break;
+        return false;
+    }
+    default:
+        break;
     }
 
     return QVariant();
@@ -140,29 +139,29 @@ QVariant ContactModelItem::data(int role) const
 bool ContactModelItem::setData(int role, const QVariant &value)
 {
     switch (role) {
-        case AccountsModel::PublishStateRole: {
-            Tp::Contact::PresenceState state;
-            state = (Tp::Contact::PresenceState) value.toInt();
-            switch (state) {
-                case Tp::Contact::PresenceStateYes:
-                    // authorize the contact and request its presence publication
-                    mPriv->mContact->authorizePresencePublication();
-                    mPriv->mContact->requestPresenceSubscription();
-                    return true;
-                case Tp::Contact::PresenceStateNo: {
-                    // reject the presence publication and remove the contact
-                    mPriv->mContact->removePresencePublication();
-                    QList<Tp::ContactPtr> contacts;
-                    contacts << mPriv->mContact;
-                    mPriv->mContact->manager()->removeContacts(contacts);
-                    return true;
-                }
-                default:
-                    return false;
-            }
+    case AccountsModel::PublishStateRole: {
+        Tp::Contact::PresenceState state;
+        state = (Tp::Contact::PresenceState) value.toInt();
+        switch (state) {
+        case Tp::Contact::PresenceStateYes:
+            // authorize the contact and request its presence publication
+            mPriv->mContact->authorizePresencePublication();
+            mPriv->mContact->requestPresenceSubscription();
+            return true;
+        case Tp::Contact::PresenceStateNo: {
+            // reject the presence publication and remove the contact
+            mPriv->mContact->removePresencePublication();
+            QList<Tp::ContactPtr> contacts;
+            contacts << mPriv->mContact;
+            mPriv->mContact->manager()->removeContacts(contacts);
+            return true;
         }
         default:
             return false;
+        }
+    }
+    default:
+        return false;
     }
 }
 
diff --git a/models/tree-node.cpp b/models/tree-node.cpp
index dc370fd..804f439 100644
--- a/models/tree-node.cpp
+++ b/models/tree-node.cpp
@@ -77,11 +77,13 @@ void TreeNode::addChild(TreeNode *node)
             SIGNAL(childrenRemoved(TreeNode*,int,int)));
 }
 
-int TreeNode::indexOf(TreeNode *node) const {
+int TreeNode::indexOf(TreeNode *node) const
+{
     return mPriv->mChildren.indexOf(node);
 }
 
-int TreeNode::size() const {
+int TreeNode::size() const
+{
     return mPriv->mChildren.size();
 }
 
diff --git a/models/tree-node.h b/models/tree-node.h
index 64bcc27..c800621 100644
--- a/models/tree-node.h
+++ b/models/tree-node.h
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
  * Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
- * 
+ *
  * 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

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list