[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 23:59:58 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=b7d8b7f

The following commit has been merged in the master branch:
commit b7d8b7f07e7c0952beec254d9d3cea2203ac2be7
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date:   Mon Sep 19 17:07:13 2011 +0100

    Filter out salut from profile selection dialog
    
    We filter out salut and not local-xmpp because it might want to be
    able to see local-xmpp using haze later.
    On the kcm_telepathy_account we filter using "local-xmpp" and not using
    "salut" because in this way we can see on top also local-xmpp accounts
    configured using haze
---
 src/KCMTelepathyAccounts/profile-list-model.cpp    |  6 ++++++
 src/KCMTelepathyAccounts/profile-list-model.h      |  5 +++++
 src/KCMTelepathyAccounts/profile-select-widget.cpp | 11 +++++++++--
 src/KCMTelepathyAccounts/profile-select-widget.h   |  2 +-
 src/kcm-telepathy-accounts.cpp                     |  3 +++
 5 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/KCMTelepathyAccounts/profile-list-model.cpp b/src/KCMTelepathyAccounts/profile-list-model.cpp
index c7536ab..98ee880 100644
--- a/src/KCMTelepathyAccounts/profile-list-model.cpp
+++ b/src/KCMTelepathyAccounts/profile-list-model.cpp
@@ -68,6 +68,12 @@ QVariant ProfileListModel::data(const QModelIndex &index, int role) const
     case Qt::DecorationRole:
         data = QVariant(m_profileItems.at(index.row())->icon());
         break;
+    case ProfileListModel::ProfileProtocolNameRole:
+        data = QVariant(m_profileItems.at(index.row())->protocolName());
+        break;
+    case ProfileListModel::ProfileCmNameRole:
+        data = QVariant(m_profileItems.at(index.row())->cmName());
+        break;
     default:
         break;
     }
diff --git a/src/KCMTelepathyAccounts/profile-list-model.h b/src/KCMTelepathyAccounts/profile-list-model.h
index 63e5a16..dbc2f19 100644
--- a/src/KCMTelepathyAccounts/profile-list-model.h
+++ b/src/KCMTelepathyAccounts/profile-list-model.h
@@ -38,6 +38,11 @@ class ProfileListModel : public QAbstractListModel
     Q_DISABLE_COPY(ProfileListModel);
 
 public:
+    enum Roles {
+        ProfileProtocolNameRole = Qt::UserRole+1,
+        ProfileCmNameRole = Qt::UserRole+2
+    };
+
     explicit ProfileListModel(QObject *parent = 0);
     virtual ~ProfileListModel();
 
diff --git a/src/KCMTelepathyAccounts/profile-select-widget.cpp b/src/KCMTelepathyAccounts/profile-select-widget.cpp
index 0d5c804..8786dc9 100644
--- a/src/KCMTelepathyAccounts/profile-select-widget.cpp
+++ b/src/KCMTelepathyAccounts/profile-select-widget.cpp
@@ -33,7 +33,7 @@
 #include <TelepathyQt4/Feature>
 
 #include <QSortFilterProxyModel>
-#include <qitemselectionmodel.h>
+#include <QItemSelectionModel>
 
 class ProfileSelectWidget::Private
 {
@@ -53,7 +53,7 @@ public:
     ProfileListModel *sourceModel;
 };
 
-ProfileSelectWidget::ProfileSelectWidget(QWidget *parent)
+ProfileSelectWidget::ProfileSelectWidget(QWidget *parent, bool enableSalut)
  : QWidget(parent),
    d(new Private)
 {
@@ -67,6 +67,13 @@ ProfileSelectWidget::ProfileSelectWidget(QWidget *parent)
     d->sortModel->setDynamicSortFilter(true);
     d->sortModel->setSortCaseSensitivity(Qt::CaseInsensitive);
 
+    // Here we filter out salut and not local-xmpp because it might want to be
+    // able to see local-xmpp using haze later.
+    if(!enableSalut) {
+        d->sortModel->setFilterRole(ProfileListModel::ProfileCmNameRole);
+        d->sortModel->setFilterRegExp(QLatin1String("^((?!salut).)*$"));
+    }
+
     // Set up the widget
     d->ui = new Ui::ProfileSelectWidget;
     d->ui->setupUi(this);
diff --git a/src/KCMTelepathyAccounts/profile-select-widget.h b/src/KCMTelepathyAccounts/profile-select-widget.h
index 4bb92a1..516cc57 100644
--- a/src/KCMTelepathyAccounts/profile-select-widget.h
+++ b/src/KCMTelepathyAccounts/profile-select-widget.h
@@ -40,7 +40,7 @@ class KCM_TELEPATHY_ACCOUNTS_EXPORT ProfileSelectWidget : public QWidget
     Q_OBJECT
 
 public:
-    explicit ProfileSelectWidget(QWidget *parent = 0);
+    explicit ProfileSelectWidget(QWidget *parent = 0, bool enableSalut = false);
     ~ProfileSelectWidget();
 
     ProfileItem *selectedProfile();
diff --git a/src/kcm-telepathy-accounts.cpp b/src/kcm-telepathy-accounts.cpp
index b2b1836..a1d3172 100644
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@ -94,6 +94,9 @@ KCMTelepathyAccounts::KCMTelepathyAccounts(QWidget *parent, const QVariantList&
     m_ui->salutEnableCheckbox->setIconSize(QSize(32, 32));
     m_accountsListModel = new AccountsListModel(this);
 
+    // On the kcm_telepathy_account we filter using "local-xmpp" and not using
+    // "salut" because in this way we can see on top also local-xmpp accounts
+    // configured using haze
     m_salutFilterModel = new QSortFilterProxyModel(this);
     m_salutFilterModel->setSourceModel(m_accountsListModel);
     m_salutFilterModel->setFilterRole(AccountsListModel::ConnectionProtocolNameRole);

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list