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


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

The following commit has been merged in the master branch:
commit c18f4523fb7fdbdabc6229132362e10ac22f2140
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Wed Apr 17 12:47:35 2013 +0200

    Add configuration for additional charsets in ICQ
    
    BUG: 306401
    FIXED-IN: 0.7.0
    REVIEW: 110060
---
 plugins/haze/icq-server-settings-widget.cpp | 86 +++++++++++++++++++++++++++--
 plugins/haze/icq-server-settings-widget.h   |  3 +
 plugins/haze/icq-server-settings-widget.ui  |  5 --
 3 files changed, 85 insertions(+), 9 deletions(-)

diff --git a/plugins/haze/icq-server-settings-widget.cpp b/plugins/haze/icq-server-settings-widget.cpp
index d99b092..bbf6c57 100644
--- a/plugins/haze/icq-server-settings-widget.cpp
+++ b/plugins/haze/icq-server-settings-widget.cpp
@@ -20,6 +20,8 @@
 
 #include "icq-server-settings-widget.h"
 
+#include <KDE/KLocale>
+
 #include <KCMTelepathyAccounts/ParameterEditModel>
 
 IcqServerSettingsWidget::IcqServerSettingsWidget(ParameterEditModel *model,
@@ -35,12 +37,21 @@ IcqServerSettingsWidget::IcqServerSettingsWidget(ParameterEditModel *model,
     handleParameter(QLatin1String("use-ssl"), QVariant::Bool, m_ui->useSslCheckBox, 0);
     handleParameter(QLatin1String("allow-multiple-logins"), QVariant::Bool, m_ui->allowMultipleLoginsCheckBox, 0);
     handleParameter(QLatin1String("always-use-rv-proxy"), QVariant::Bool, m_ui->alwaysUseRvProxyCheckBox, 0);
-    handleParameter(QLatin1String("charset"), QVariant::String, m_ui->charsetComboBox, m_ui->charsetLabel);
 
     // update combo box for charset parameter
-    m_ui->charsetComboBox->setCurrentItem(parameterModel()->data(
-            parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("charset"))),
-            ParameterEditModel::ValueRole).toString());
+    initEncodings();
+    const QString encName = parameterModel()->data(
+        parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("charset"))),
+        ParameterEditModel::ValueRole).toString();
+    QTextCodec *codec = QTextCodec::codecForName(encName.toLatin1());
+    int mib = 106; // UTF-8
+    if (!codec) {
+        codec = KGlobal::locale()->codecForEncoding();
+    }
+    if (codec) {
+        mib = codec->mibEnum();
+    }
+    m_ui->charsetComboBox->setCurrentIndex(m_ui->charsetComboBox->findData(mib));
 }
 
 IcqServerSettingsWidget::~IcqServerSettingsWidget()
@@ -48,4 +59,71 @@ IcqServerSettingsWidget::~IcqServerSettingsWidget()
     delete m_ui;
 }
 
+void IcqServerSettingsWidget::submit()
+{
+    AbstractAccountParametersWidget::submit();
+
+    QTextCodec *codec = QTextCodec::codecForMib(m_ui->charsetComboBox->itemData(
+        m_ui->charsetComboBox->currentIndex()).toInt());
+    if (!codec) {
+        codec = QTextCodec::codecForMib(106); // UTF-8
+    }
+
+    parameterModel()->setData(
+        parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("charset"))),
+        codec->name(), ParameterEditModel::ValueRole);
+}
+
+
+void IcqServerSettingsWidget::initEncodings()
+{
+    m_ui->charsetComboBox->addItem(i18n("Big5"), 2026);
+    m_ui->charsetComboBox->addItem(i18n("Big5-HKSCS"), 2101);
+    m_ui->charsetComboBox->addItem(i18n("euc-JP Japanese"), 18);
+    m_ui->charsetComboBox->addItem(i18n("euc-KR Korean"), 38);
+    m_ui->charsetComboBox->addItem(i18n("GB-2312 Chinese"), 57);
+    m_ui->charsetComboBox->addItem(i18n("GBK Chinese"), 113);
+    m_ui->charsetComboBox->addItem(i18n("GB18030 Chinese"), 114);
+
+    m_ui->charsetComboBox->addItem(i18n("JIS Japanese"), 16);
+    m_ui->charsetComboBox->addItem(i18n("Shift-JIS Japanese"), 17);
+
+    m_ui->charsetComboBox->addItem(i18n("KOI8-R Russian"), 2084);
+    m_ui->charsetComboBox->addItem(i18n("KOI8-U Ukrainian"), 2088);
+
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-1 Western"), 4);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-2 Central European"), 5);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-3 Central European"), 6);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-4 Baltic"), 7);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-5 Cyrillic"), 8);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-6 Arabic"), 9);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-7 Greek") ,10);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-8 Hebrew, visually ordered"), 11 );
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-8-I Hebrew, logically ordered"), 85);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-9 Turkish"), 12);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-10"), 13);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-13"), 109);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-14"), 110);
+    m_ui->charsetComboBox->addItem(i18n("ISO-8859-15 Western"), 111);
+
+    m_ui->charsetComboBox->addItem(i18n("Windows-1250 Central European"), 2250);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1251 Cyrillic"), 2251);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1252 Western"), 2252);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1253 Greek"), 2253);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1254 Turkish"), 2254);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1255 Hebrew"), 2255);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1256 Arabic"), 2256);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1257 Baltic"), 2257);
+    m_ui->charsetComboBox->addItem(i18n("Windows-1258 Viet Nam"), 2258);
+
+    m_ui->charsetComboBox->addItem(i18n("IBM 850"), 2009);
+    m_ui->charsetComboBox->addItem(i18n("IBM 866"), 2085);
+
+    m_ui->charsetComboBox->addItem(i18n("TIS-620 Thai"), 2259);
+
+    m_ui->charsetComboBox->addItem(i18n("UTF-8 Unicode"), 106);
+    m_ui->charsetComboBox->addItem(i18n("UTF-16 Unicode"), 1015);
+}
+
+
 #include "icq-server-settings-widget.moc"
diff --git a/plugins/haze/icq-server-settings-widget.h b/plugins/haze/icq-server-settings-widget.h
index cb581d0..916c742 100644
--- a/plugins/haze/icq-server-settings-widget.h
+++ b/plugins/haze/icq-server-settings-widget.h
@@ -34,7 +34,10 @@ public:
                                        QWidget *parent = 0);
     virtual ~IcqServerSettingsWidget();
 
+    virtual void submit();
 private:
+    void initEncodings();
+
     Q_DISABLE_COPY(IcqServerSettingsWidget);
     Ui::IcqServerSettingsWidget *m_ui;
 };
diff --git a/plugins/haze/icq-server-settings-widget.ui b/plugins/haze/icq-server-settings-widget.ui
index 6fe0a0a..8970d48 100644
--- a/plugins/haze/icq-server-settings-widget.ui
+++ b/plugins/haze/icq-server-settings-widget.ui
@@ -131,11 +131,6 @@
      </item>
      <item row="8" column="1">
       <widget class="KComboBox" name="charsetComboBox">
-       <item>
-        <property name="text">
-         <string>UTF-8</string>
-        </property>
-       </item>
       </widget>
      </item>
     </layout>

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list