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


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

The following commit has been merged in the master branch:
commit 3e6738faff42f5eeb962fa9854da47c349b527a6
Author: Thomas Richard <thomas9999 at gmail.com>
Date:   Sat Jan 15 00:41:13 2011 +0100

    Implement reviewboard suggestions
---
 .../abstract-account-parameters-widget.cpp            | 12 +-----------
 .../abstract-account-parameters-widget.h              |  2 --
 src/KCMTelepathyAccounts/abstract-account-ui-plugin.h |  2 +-
 src/KCMTelepathyAccounts/abstract-account-ui.cpp      |  2 --
 src/KCMTelepathyAccounts/abstract-account-ui.h        |  2 --
 src/KCMTelepathyAccounts/account-edit-widget.cpp      | 19 +++++++++----------
 .../generic-advanced-options-widget.cpp               |  2 +-
 src/KCMTelepathyAccounts/parameter-edit-widget.cpp    |  2 +-
 src/KCMTelepathyAccounts/plugin-manager.cpp           |  5 +++--
 src/KCMTelepathyAccounts/plugin-manager.h             |  2 +-
 src/KCMTelepathyAccounts/profile-item.cpp             | 14 +++++++-------
 src/KCMTelepathyAccounts/profile-list-model.cpp       |  4 ++--
 src/KCMTelepathyAccounts/profile-select-widget.cpp    |  4 ++--
 src/add-account-assistant.cpp                         | 11 ++++++-----
 src/edit-account-dialog.cpp                           |  2 +-
 src/kcm-telepathy-accounts.cpp                        |  1 -
 16 files changed, 35 insertions(+), 51 deletions(-)

diff --git a/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp b/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp
index 541a465..95091e6 100644
--- a/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp
+++ b/src/KCMTelepathyAccounts/abstract-account-parameters-widget.cpp
@@ -43,12 +43,10 @@ public:
     }
     ParameterEditModel *parameterModel;
     QDataWidgetMapper *mapper;
-    QString profile;
     Tp::ProtocolParameterList parameters;
 };
 
 AbstractAccountParametersWidget::AbstractAccountParametersWidget(ParameterEditModel *parameterModel,
-                                                                 const QString &profile,
                                                                  QWidget *parent)
         : QWidget(parent),
           d(new Private)
@@ -61,8 +59,6 @@ AbstractAccountParametersWidget::AbstractAccountParametersWidget(ParameterEditMo
     d->mapper->setModel(d->parameterModel);
 
     d->mapper->setOrientation(Qt::Vertical);
-
-    d->profile = profile;
 }
 
 AbstractAccountParametersWidget::~AbstractAccountParametersWidget()
@@ -116,7 +112,7 @@ void AbstractAccountParametersWidget::handleParameter(const QString &parameterNa
     if(!foundParameter.isValid() || foundParameter.type() != parameterType)
     {
         // hide widgets because they are not needed
-        kDebug() << "WARNING: Field" << parameterName << "hidden";
+        kDebug() << "Field" << parameterName << "hidden";
         dataWidget->hide();
         foreach(QWidget *label, labelWidgets)
         {
@@ -142,11 +138,5 @@ ParameterEditModel* AbstractAccountParametersWidget::parameterModel() const
     return d->parameterModel;
 }
 
-QString AbstractAccountParametersWidget::profile() const
-{
-    return d->profile;
-}
-
-
 #include "abstract-account-parameters-widget.moc"
 
diff --git a/src/KCMTelepathyAccounts/abstract-account-parameters-widget.h b/src/KCMTelepathyAccounts/abstract-account-parameters-widget.h
index d43705e..6071de3 100644
--- a/src/KCMTelepathyAccounts/abstract-account-parameters-widget.h
+++ b/src/KCMTelepathyAccounts/abstract-account-parameters-widget.h
@@ -43,7 +43,6 @@ class KDE_EXPORT AbstractAccountParametersWidget : public QWidget
 
 public:
     explicit AbstractAccountParametersWidget(ParameterEditModel *parameterModel,
-                                             const QString &profile,
                                              QWidget *parent = 0);
     virtual ~AbstractAccountParametersWidget();
 
@@ -62,7 +61,6 @@ protected:
                          QWidget *labelWidget);
 
     ParameterEditModel *parameterModel() const;
-    QString profile() const;
 
 private:
     Q_DISABLE_COPY(AbstractAccountParametersWidget);
diff --git a/src/KCMTelepathyAccounts/abstract-account-ui-plugin.h b/src/KCMTelepathyAccounts/abstract-account-ui-plugin.h
index 87eddd9..ee095f2 100644
--- a/src/KCMTelepathyAccounts/abstract-account-ui-plugin.h
+++ b/src/KCMTelepathyAccounts/abstract-account-ui-plugin.h
@@ -39,7 +39,7 @@ public:
 
     virtual const QMap<QString, QString> &providedProtocols() const;
 
-    virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol) = 0;
+    virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName) = 0;
 
 protected:
     virtual void registerProvidedProtocol(const QString &connectionManager, const QString &protocol);
diff --git a/src/KCMTelepathyAccounts/abstract-account-ui.cpp b/src/KCMTelepathyAccounts/abstract-account-ui.cpp
index 66285b2..500452b 100644
--- a/src/KCMTelepathyAccounts/abstract-account-ui.cpp
+++ b/src/KCMTelepathyAccounts/abstract-account-ui.cpp
@@ -54,12 +54,10 @@ bool AbstractAccountUi::hasAdvancedOptionsWidget() const
 }
 
 AbstractAccountParametersWidget* AbstractAccountUi::advancedOptionsWidget(ParameterEditModel *parameterModel,
-                                                                          const QString &profile,
                                                                           QWidget *parent) const
 {
     Q_UNUSED(parameterModel);
     Q_UNUSED(parent);
-    Q_UNUSED(profile);
     return 0;
 }
 
diff --git a/src/KCMTelepathyAccounts/abstract-account-ui.h b/src/KCMTelepathyAccounts/abstract-account-ui.h
index 48628ef..a86ce69 100644
--- a/src/KCMTelepathyAccounts/abstract-account-ui.h
+++ b/src/KCMTelepathyAccounts/abstract-account-ui.h
@@ -45,12 +45,10 @@ public:
 
     virtual AbstractAccountParametersWidget
               *mainOptionsWidget(ParameterEditModel *parameterModel,
-                                 const QString &profile,
                                  QWidget *parent = 0) const = 0;
     virtual bool hasAdvancedOptionsWidget() const;
     virtual AbstractAccountParametersWidget
               *advancedOptionsWidget(ParameterEditModel *parameterModel,
-                                     const QString &profile,
                                      QWidget *parent = 0) const;
 
 protected:
diff --git a/src/KCMTelepathyAccounts/account-edit-widget.cpp b/src/KCMTelepathyAccounts/account-edit-widget.cpp
index 8ac0f64..a6673c9 100644
--- a/src/KCMTelepathyAccounts/account-edit-widget.cpp
+++ b/src/KCMTelepathyAccounts/account-edit-widget.cpp
@@ -45,7 +45,7 @@ public:
 
     QString connectionManager;
     QString protocol;
-    QString profileName;
+    QString serviceName;
 
     ParameterEditModel *parameterModel;
 
@@ -67,22 +67,22 @@ AccountEditWidget::AccountEditWidget(const Tp::ProfilePtr &profile,
     d->ui->setupUi(this);
 
     d->parameterModel = parameterModel;
-    d->profileName = profile.data()->serviceName();
-    d->connectionManager = profile.data()->cmName();
-    d->protocol = profile.data()->protocolName();
+    d->serviceName = profile->serviceName();
+    d->connectionManager = profile->cmName();
+    d->protocol = profile->protocolName();
 
     connect(d->ui->advancedButton, SIGNAL(clicked()),
             this, SLOT(onAdvancedClicked()));
 
     d->ui->advancedButton->setIcon(KIcon("configure"));
     //FIXME: Dictionary should not be needed anymore when distros ship profiles
-    QString localizedName = Dictionary::instance()->string(profile.data()->name());
+    QString localizedName = Dictionary::instance()->string(profile->name());
     if(localizedName.isEmpty()) {
-        localizedName = profile.data()->name();
+        localizedName = profile->name();
     }
     d->ui->titleLabel->setText(localizedName);
     d->ui->iconLabel->setText("");
-    d->ui->iconLabel->setPixmap(KIcon(profile.data()->iconName()).pixmap(32));
+    d->ui->iconLabel->setPixmap(KIcon(profile->iconName()).pixmap(32));
 
     loadWidgets();
 }
@@ -122,13 +122,13 @@ void AccountEditWidget::loadWidgets()
 
     // Get the AccountsUi for the plugin, and get the optional parameter widgets for it.
     d->accountUi = PluginManager::instance()->accountUiForProtocol(d->connectionManager,
-                                                                   d->protocol);
+                                                                   d->protocol,
+                                                                   d->serviceName);
 
     // Create the custom UI or generic UI depending on available parameters.
     if (d->accountUi) {
         // UI does exist, set it up.
         d->mainOptionsWidget = d->accountUi->mainOptionsWidget(d->parameterModel,
-                                                               d->profileName,
                                                                this);
         //Widgets wrapped in a layout should not have double margins
         d->mainOptionsWidget->layout()->setContentsMargins(0, 0, 0, 0);
@@ -186,7 +186,6 @@ void AccountEditWidget::onAdvancedClicked()
 
     AbstractAccountParametersWidget *advancedWidget;
     advancedWidget = d->accountUi->advancedOptionsWidget(d->parameterModel,
-                                                         d->profileName,
                                                          &dialog);
     dialog.setMainWidget(advancedWidget);
 
diff --git a/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp b/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp
index cf1444c..afef04c 100644
--- a/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp
+++ b/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp
@@ -42,7 +42,7 @@ public:
 
 GenericAdvancedOptionsWidget::GenericAdvancedOptionsWidget(ParameterEditModel *parameterModel,
                                                            QWidget *parent)
- : AbstractAccountParametersWidget(parameterModel, QString(), parent),
+ : AbstractAccountParametersWidget(parameterModel, parent),
    d(new Private)
 {
     QHBoxLayout *layout = new QHBoxLayout(this);
diff --git a/src/KCMTelepathyAccounts/parameter-edit-widget.cpp b/src/KCMTelepathyAccounts/parameter-edit-widget.cpp
index 41bb255..34e161a 100644
--- a/src/KCMTelepathyAccounts/parameter-edit-widget.cpp
+++ b/src/KCMTelepathyAccounts/parameter-edit-widget.cpp
@@ -43,7 +43,7 @@ public:
 
 ParameterEditWidget::ParameterEditWidget(ParameterEditModel *parameterModel,
                                          QWidget *parent)
- : AbstractAccountParametersWidget(parameterModel, QString(), parent),
+ : AbstractAccountParametersWidget(parameterModel, parent),
    d(new Private)
 {
     kDebug();
diff --git a/src/KCMTelepathyAccounts/plugin-manager.cpp b/src/KCMTelepathyAccounts/plugin-manager.cpp
index e04088f..9ca6630 100644
--- a/src/KCMTelepathyAccounts/plugin-manager.cpp
+++ b/src/KCMTelepathyAccounts/plugin-manager.cpp
@@ -89,7 +89,8 @@ void PluginManager::loadPlugins()
 }
 
 AbstractAccountUi *PluginManager::accountUiForProtocol(const QString &connectionManager,
-                                                       const QString &protocol)
+                                                       const QString &protocol,
+                                                       const QString &serviceName)
 {
     kDebug();
 
@@ -97,7 +98,7 @@ AbstractAccountUi *PluginManager::accountUiForProtocol(const QString &connection
     // and protocol combination we were provided with.
 
     foreach (AbstractAccountUiPlugin *plugin, m_plugins) {
-        AbstractAccountUi *ui = plugin->accountUi(connectionManager, protocol);
+        AbstractAccountUi *ui = plugin->accountUi(connectionManager, protocol, serviceName);
 
         // FIXME: Bug https://bugs.kde.org/201797 - we should check here to see which plugin
         // provides the closest match for the desired parameters in the case that more than one
diff --git a/src/KCMTelepathyAccounts/plugin-manager.h b/src/KCMTelepathyAccounts/plugin-manager.h
index 8f6ff41..6ac4df6 100644
--- a/src/KCMTelepathyAccounts/plugin-manager.h
+++ b/src/KCMTelepathyAccounts/plugin-manager.h
@@ -39,7 +39,7 @@ public:
 
     virtual ~PluginManager();
 
-    AbstractAccountUi *accountUiForProtocol(const QString &connectionManager, const QString &protocol);
+    AbstractAccountUi *accountUiForProtocol(const QString &connectionManager, const QString &protocol, const QString &serviceName);
 
 private:
     explicit PluginManager(QObject *parent = 0);
diff --git a/src/KCMTelepathyAccounts/profile-item.cpp b/src/KCMTelepathyAccounts/profile-item.cpp
index 6f71888..99ff61f 100644
--- a/src/KCMTelepathyAccounts/profile-item.cpp
+++ b/src/KCMTelepathyAccounts/profile-item.cpp
@@ -32,9 +32,9 @@ ProfileItem::ProfileItem(const Tp::ProfilePtr &profile, ProfileListModel *parent
    m_profile(profile)
 {
     //FIXME: Dictionary should not be needed anymore when distros ship profiles
-    m_localizedName = Dictionary::instance()->string(profile.data()->name());
+    m_localizedName = Dictionary::instance()->string(profile->name());
     if(m_localizedName.isEmpty()) {
-        m_localizedName = profile.data()->name();
+        m_localizedName = profile->name();
     }
 }
 
@@ -47,12 +47,12 @@ ProfileItem::~ProfileItem()
 
 QString ProfileItem::serviceName() const
 {
-    return m_profile.data()->serviceName();
+    return m_profile->serviceName();
 }
 
 QString ProfileItem::name() const
 {
-    return m_profile.data()->name();
+    return m_profile->name();
 }
 
 QString ProfileItem::localizedName() const
@@ -62,17 +62,17 @@ QString ProfileItem::localizedName() const
 
 QString ProfileItem::iconName() const
 {
-    return m_profile.data()->iconName();
+    return m_profile->iconName();
 }
 
 QString ProfileItem::cmName() const
 {
-    return m_profile.data()->cmName();
+    return m_profile->cmName();
 }
 
 QString ProfileItem::protocolName() const
 {
-    return m_profile.data()->protocolName();
+    return m_profile->protocolName();
 }
 
 Tp::ProfilePtr ProfileItem::profile() const
diff --git a/src/KCMTelepathyAccounts/profile-list-model.cpp b/src/KCMTelepathyAccounts/profile-list-model.cpp
index c5d8fa9..bb68338 100644
--- a/src/KCMTelepathyAccounts/profile-list-model.cpp
+++ b/src/KCMTelepathyAccounts/profile-list-model.cpp
@@ -86,8 +86,8 @@ void ProfileListModel::setProfileManager(Tp::ProfileManagerPtr profileManager)
         item = 0;
     }
 
-    beginInsertRows(QModelIndex(), 0, profileManager.data()->profiles().size());
-    foreach(Tp::ProfilePtr ptr, profileManager.data()->profiles()) {
+    beginInsertRows(QModelIndex(), 0, profileManager->profiles().size());
+    foreach(Tp::ProfilePtr ptr, profileManager->profiles()) {
         m_profileItems.append(new ProfileItem(ptr, this));
     }
 
diff --git a/src/KCMTelepathyAccounts/profile-select-widget.cpp b/src/KCMTelepathyAccounts/profile-select-widget.cpp
index 7a87a2f..ad6dcf7 100644
--- a/src/KCMTelepathyAccounts/profile-select-widget.cpp
+++ b/src/KCMTelepathyAccounts/profile-select-widget.cpp
@@ -70,8 +70,8 @@ ProfileSelectWidget::ProfileSelectWidget(QWidget *parent)
 
     d->profileManager = Tp::ProfileManager::create(QDBusConnection::sessionBus());
 
-    // Until all distros ship correct profile files, we should fake them
-    connect(d->profileManager.data()->becomeReady(Tp::Features() << Tp::ProfileManager::FeatureFakeProfiles),
+    // FIXME: Until all distros ship correct profile files, we should fake them
+    connect(d->profileManager->becomeReady(Tp::Features() << Tp::ProfileManager::FeatureFakeProfiles),
             SIGNAL(finished(Tp::PendingOperation*)),
             SLOT(onProfileManagerReady(Tp::PendingOperation*)));
 }
diff --git a/src/add-account-assistant.cpp b/src/add-account-assistant.cpp
index 61b2315..9931f90 100644
--- a/src/add-account-assistant.cpp
+++ b/src/add-account-assistant.cpp
@@ -125,7 +125,7 @@ void AddAccountAssistant::next()
             d->currentProfileItem = selectedItem;
 
             d->connectionManager = Tp::ConnectionManager::create(selectedItem->cmName());
-            connect(d->connectionManager.data()->becomeReady(),
+            connect(d->connectionManager->becomeReady(),
                     SIGNAL(finished(Tp::PendingOperation*)),
                     SLOT(onConnectionManagerReady(Tp::PendingOperation*)));
         }
@@ -163,6 +163,8 @@ void AddAccountAssistant::accept()
         }
     }
 
+    // FIXME: In some next version of tp-qt4 there should be a convenience class for this
+    // https://bugs.freedesktop.org/show_bug.cgi?id=33153
     QVariantMap properties;
 
     properties.insert("org.freedesktop.Telepathy.Account.Service", d->currentProfileItem->serviceName());
@@ -178,7 +180,6 @@ void AddAccountAssistant::accept()
     connect(pa,
             SIGNAL(finished(Tp::PendingOperation*)),
             SLOT(onAccountCreated(Tp::PendingOperation*)));
-
 }
 
 void AddAccountAssistant::reject()
@@ -221,7 +222,7 @@ void AddAccountAssistant::onConnectionManagerReady(Tp::PendingOperation *op)
         kWarning() << "Creating ConnectionManager failed:" << op->errorName() << op->errorMessage();
     }
 
-    if(!d->connectionManager.data()->isValid()) {
+    if(!d->connectionManager->isValid()) {
         kWarning() << "Invalid ConnectionManager";
     }
 
@@ -238,14 +239,14 @@ void AddAccountAssistant::onProfileSelected(bool value)
 void AddAccountAssistant::pageTwo()
 {
     // Get the protocol's parameters and values.
-    Tp::ProtocolInfo protocolInfo = d->connectionManager.data()->protocol(d->currentProfileItem->protocolName());
+    Tp::ProtocolInfo protocolInfo = d->connectionManager->protocol(d->currentProfileItem->protocolName());
     Tp::ProtocolParameterList parameters = protocolInfo.parameters();
 
     // Add the parameters to the model.
     ParameterEditModel *parameterModel = new ParameterEditModel(this);
     parameterModel->addItems(parameters);
 
-    foreach(const Tp::Profile::Parameter &parameter, d->currentProfileItem->profile().data()->parameters()) {
+    foreach(const Tp::Profile::Parameter &parameter, d->currentProfileItem->profile()->parameters()) {
         parameterModel->setData(parameterModel->indexForParameter(parameter), parameter.value(), Qt::EditRole);
     }
 
diff --git a/src/edit-account-dialog.cpp b/src/edit-account-dialog.cpp
index a716259..6f88e7c 100644
--- a/src/edit-account-dialog.cpp
+++ b/src/edit-account-dialog.cpp
@@ -70,7 +70,7 @@ EditAccountDialog::EditAccountDialog(AccountItem *item, QWidget *parent)
     parameterModel->addItems(parameters, parameterValues);
 
     // Set up the interface
-    d->widget = new AccountEditWidget(d->item->account().data()->profile(),
+    d->widget = new AccountEditWidget(d->item->account()->profile(),
                                       parameterModel,
                                       this);
     setMainWidget(d->widget);
diff --git a/src/kcm-telepathy-accounts.cpp b/src/kcm-telepathy-accounts.cpp
index e323df7..5723319 100644
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@ -53,7 +53,6 @@ KCMTelepathyAccounts::KCMTelepathyAccounts(QWidget *parent, const QVariantList&
     Tp::registerTypes();
 
     // Start setting up the Telepathy AccountManager.
-
     Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
                                                                        Tp::Features() << Tp::Account::FeatureCore
                                                                        << Tp::Account::FeatureAvatar

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list