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


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

The following commit has been merged in the master branch:
commit 8897c19ba907015b4a0aebbb2f353408fe4f9dcc
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Mon Oct 24 17:27:13 2011 +0200

    Use i18n for 'Ungrouped' group
    
    BUG: 283883
---
 models/groups-model.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/models/groups-model.cpp b/models/groups-model.cpp
index 2f029b1..a61cae0 100644
--- a/models/groups-model.cpp
+++ b/models/groups-model.cpp
@@ -32,18 +32,26 @@
 #include "contact-model-item.h"
 
 #include <KDebug>
+#include <KGlobal>
+#include <KLocale>
+#include <KLocalizedString>
 
 struct GroupsModel::Private
 {
     Private(AccountsModel *am)
         : mAM(am)
     {
+        KGlobal::locale()->insertCatalog(QLatin1String("telepathy-common-internals"));
+        m_ungroupedString = i18n("Ungrouped");
     }
 
     TreeNode *node(const QModelIndex &index) const;
 
     AccountsModel *mAM;
     TreeNode *mTree;
+
+    ///translated string for 'Ungrouped'
+    QString m_ungroupedString;
 };
 
 TreeNode *GroupsModel::Private::node(const QModelIndex &index) const
@@ -56,6 +64,7 @@ GroupsModel::GroupsModel(AccountsModel *am, QObject *parent)
     : QAbstractItemModel(parent),
       mPriv(new GroupsModel::Private(am))
 {
+
     mPriv->mTree = new TreeNode;
 
     connect(mPriv->mTree,
@@ -183,7 +192,7 @@ bool GroupsModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int
 
         kDebug() << contact->contact().data()->alias() << "added to group" << group;
 
-        if (group != QLatin1String("Ungrouped")) { //FIXME: consider i18n
+        if (group != m_ungroupedString) {
             //FIXME: Should we connect this somewhere?
             Tp::PendingOperation *op = contact->contact().data()->manager().data()->addContactsToGroup(group,
                                                                                                        QList<Tp::ContactPtr>() << contact->contact());
@@ -382,7 +391,7 @@ void GroupsModel::addContactToGroups(ContactModelItem* contactItem, QStringList
     bool checkUngrouped = false;
     //if the contact has no groups, create an 'Ungrouped' group for it
     if (groups.isEmpty()) {
-        groups.append("Ungrouped"); //FIXME i18n
+        groups.append(m_ungroupedString);
     } else {
         checkUngrouped = true;
     }
@@ -405,11 +414,11 @@ void GroupsModel::addContactToGroups(ContactModelItem* contactItem, QStringList
                 }
             }
             if (checkUngrouped) {
-                if (savedGroupItem->groupName() == "Ungrouped") {
+                if (savedGroupItem->groupName() == m_ungroupedString) {
                     for (int i = 0; i < savedGroupItem->size(); i++) {
                         ProxyTreeNode *tmpNode = qobject_cast<ProxyTreeNode*>(savedGroupItem->childAt(i));
                         if (tmpNode->data(AccountsModel::ItemRole).value<ContactModelItem*>()->contact()->id() == contactItem->contact()->id()) {
-                            removeContactFromGroup(tmpNode, QString("Ungrouped"));
+                            removeContactFromGroup(tmpNode, m_ungroupedString);
                             if (groupExists) {
                                 break;
                             }

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list