[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5
    Maximiliano Curia 
    maxy at moszumanska.debian.org
       
    Sat May 28 00:05:23 UTC 2016
    
    
  
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=c19091c
The following commit has been merged in the master branch:
commit c19091cf520a5301620a9c6568edd718233e2db5
Author: Oskar Jauch <oskar.jauch at gmail.com>
Date:   Fri Nov 22 18:49:41 2013 +0100
    "Register new account" should not be available when editing jabber accounts
    
    Now the register check box is only on add account screen of Jabber and KDETalk visible, not on edit screen.
    
    BUG: 326078
    FIXED-IN: 0.8.0
---
 plugins/gabble/main-options-widget-kde-talk.cpp | 10 ++++++++--
 plugins/gabble/main-options-widget.cpp          | 14 ++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/plugins/gabble/main-options-widget-kde-talk.cpp b/plugins/gabble/main-options-widget-kde-talk.cpp
index 4ce723f..af449f6 100644
--- a/plugins/gabble/main-options-widget-kde-talk.cpp
+++ b/plugins/gabble/main-options-widget-kde-talk.cpp
@@ -36,13 +36,19 @@ MainOptionsWidgetKDETalk::MainOptionsWidgetKDETalk(ParameterEditModel *model,
     m_ui->setupUi(this);
 
     Tp::ProtocolParameter parameter = parameterModel()->parameter(QLatin1String("account"));
-    QModelIndex index = parameterModel()->indexForParameter(parameter);
+    const QModelIndex index = parameterModel()->indexForParameter(parameter);
+    QString account;
     if (index.isValid()) {
-        QString account = index.data().toString();
+        account = index.data().toString();
         //strip off any "@kdetalk.net" from the parameter when displaying it in the text edit.
         account = account.left(account.indexOf(QLatin1Char('@')));
         m_ui->accountLineEdit->setText(account);
     }
+    
+    // test if account name is set -> don't show registerCheckBox in edit mode
+    if (!account.isEmpty()) {
+	m_ui->registerCheckBox->setVisible(false);
+    }
 
     handleParameter(QLatin1String("password"), QVariant::String, m_ui->passwordLineEdit, m_ui->passwordLabel);
     handleParameter(QLatin1String("register"), QVariant::Bool, m_ui->registerCheckBox, 0);
diff --git a/plugins/gabble/main-options-widget.cpp b/plugins/gabble/main-options-widget.cpp
index f2c62f5..752de32 100644
--- a/plugins/gabble/main-options-widget.cpp
+++ b/plugins/gabble/main-options-widget.cpp
@@ -19,6 +19,7 @@
  */
 
 #include "main-options-widget.h"
+#include <KCMTelepathyAccounts/ParameterEditModel>
 
 MainOptionsWidget::MainOptionsWidget(ParameterEditModel *model,
                                      QWidget *parent)
@@ -28,6 +29,19 @@ MainOptionsWidget::MainOptionsWidget(ParameterEditModel *model,
     m_ui = new Ui::MainOptionsWidget;
     m_ui->setupUi(this);
 
+    Tp::ProtocolParameter parameter = parameterModel()->parameter(QLatin1String("account"));
+    const QModelIndex index = parameterModel()->indexForParameter(parameter);
+    
+    QString account;
+    if (index.isValid()) {
+	account = index.data().toString();
+    }
+    
+    // test if account name is set -> don't show registerCheckBox in edit mode
+    if (!account.isEmpty()) {
+	m_ui->registerCheckBox->setVisible(false);
+    }
+    
     handleParameter(QLatin1String("account"), QVariant::String, m_ui->accountLineEdit, m_ui->accountLabel);
     handleParameter(QLatin1String("password"), QVariant::String, m_ui->passwordLineEdit, m_ui->passwordLabel);
     handleParameter(QLatin1String("register"), QVariant::Bool, m_ui->registerCheckBox, 0);
-- 
ktp-accounts-kcm packaging
    
    
More information about the pkg-kde-commits
mailing list