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


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

The following commit has been merged in the master branch:
commit 88d1c49d86c2c81ce4da0a47cbec16ce52332043
Merge: b4d2708c0aeec0ca7cd73637573d22132dc496ad d3784b941d385911f0bce474d56a033b49a52da3
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Sun Jan 20 18:12:47 2013 +0100

    Merge branch 'kde-telepathy-0.5'
    
    Conflicts:
    	plugins/butterfly/ktpaccountskcm_plugin_butterfly.desktop
    	plugins/gabble/ktpaccountskcm_plugin_gabble.desktop
    	plugins/haze/ktpaccountskcm_plugin_haze.desktop
    	plugins/idle/ktpaccountskcm_plugin_idle.desktop
    	plugins/rakia/ktpaccountskcm_plugin_rakia.desktop
    	plugins/salut/ktpaccountskcm_plugin_salut.desktop
    	plugins/sunshine/ktpaccountskcm_plugin_sunshine.desktop
    	src/kcm-telepathy-accounts.cpp

 .../ktpaccountskcm_plugin_butterfly.desktop        |  2 +-
 .../gabble/ktpaccountskcm_plugin_gabble.desktop    |  2 +-
 plugins/haze/ktpaccountskcm_plugin_haze.desktop    |  2 +-
 plugins/idle/ktpaccountskcm_plugin_idle.desktop    |  2 +-
 plugins/rakia/ktpaccountskcm_plugin_rakia.desktop  |  2 +-
 plugins/salut/ktpaccountskcm_plugin_salut.desktop  |  2 +-
 .../ktpaccountskcm_plugin_sunshine.desktop         |  2 +-
 src/kcm-telepathy-accounts.cpp                     | 40 +++++++++++++++-------
 src/kcm-telepathy-accounts.h                       |  2 +-
 9 files changed, 35 insertions(+), 21 deletions(-)

diff --cc src/kcm-telepathy-accounts.cpp
index 9ca5949,f035c83..06ae8ba
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@@ -69,7 -57,9 +69,9 @@@ K_EXPORT_PLUGIN(KCMTelepathyAccountsFac
  
  KCMTelepathyAccounts::KCMTelepathyAccounts(QWidget *parent, const QVariantList& args)
   : KCModule(KCMTelepathyAccountsFactory::componentData(), parent, args),
-    m_accountsListModel(new KTp::AccountsListModel(this))
 -   m_accountsListModel(0),
++   m_accountsListModel(new KTp::AccountsListModel(this)),
+    m_currentModel(0),
+    m_currentListView(0)
  {
      //set up component data.
      KAboutData *aboutData = new KAboutData(I18N_NOOP("telepathy_accounts"), 0, ki18n("Instant Messaging and VOIP Accounts"), "0.5.2", KLocalizedString(), KAboutData::License_GPL);
@@@ -303,17 -253,18 +307,18 @@@ void KCMTelepathyAccounts::onSelectedIt
  {
      Q_UNUSED(previous);
  
-     m_ui->removeAccountButton->setEnabled(current.isValid());
-     m_ui->editAccountButton->setEnabled(current.isValid());
+     /* Only change m_currentModel and "Edit Identity" button state when
+      * "current" is a selected item, not deselected */
+     if (current.isValid()) {
+         m_currentModel = qobject_cast<const QSortFilterProxyModel*>(current.model());
  
-     if (current.isValid() && current.data(KTp::AccountsListModel::ConnectionStateRole).toInt() == Tp::ConnectionStatusConnected) {
-         m_ui->editAccountIdentityButton->setEnabled(true);
-     } else {
-         m_ui->editAccountIdentityButton->setEnabled(false);
 -        if (current.data(AccountsListModel::ConnectionStateRole).toInt() == Tp::ConnectionStatusConnected) {
++        if (current.data(KTp::AccountsListModel::ConnectionStateRole).toInt() == Tp::ConnectionStatusConnected) {
+             m_ui->editAccountIdentityButton->setEnabled(true);
+         } else {
+             m_ui->editAccountIdentityButton->setEnabled(false);
+         }
      }
  
-     m_currentModel = qobject_cast<const QSortFilterProxyModel*>(current.model());
- 
      if (m_currentModel == m_salutFilterModel) {
          m_currentListView = m_ui->salutListView;
          m_ui->accountsListView->clearSelection();
@@@ -389,35 -342,16 +397,35 @@@ void KCMTelepathyAccounts::onRemoveAcco
  {
      QModelIndex index = m_currentListView->currentIndex();
  
 -     if ( KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to remove the account \"%1\"?", m_currentModel->data(index, Qt::DisplayRole).toString()),
 -                                        i18n("Remove Account"), KGuiItem(i18n("Remove Account"), QLatin1String("edit-delete")), KStandardGuiItem::cancel(),
 -                                        QString(), KMessageBox::Notify | KMessageBox::Dangerous) == KMessageBox::Continue)
 -    {
 -        AccountItem *item = index.data(AccountsListModel::AccountItemRole).value<AccountItem*>();
 -        item->remove();
 -     }
 +    QString accountName = index.data(Qt::DisplayRole).toString();
 +
 +    KDialog *dialog = new KDialog(this); /* will be deleted by KMessageBox::createKMessageBox */
 +    dialog->setButtons(KDialog::Yes | KDialog::Cancel);
 +    dialog->setWindowTitle(i18n("Remove Account"));
 +    dialog->setButtonGuiItem(KDialog::Yes, KGuiItem(i18n("Remove Account"), QLatin1String("edit-delete")));
 +    bool removeLogs = false;
 +    if (KMessageBox::createKMessageBox(dialog, QMessageBox::Warning, i18n("Are you sure you want to remove the account \"%1\"?", accountName),
 +			QStringList(),  i18n("Remove conversations logs"), &removeLogs,
 +			KMessageBox::Dangerous | KMessageBox::Notify) == KDialog::Yes) {
 +
 +	Tp::AccountPtr account = index.data(KTp::AccountsListModel::AccountRole).value<Tp::AccountPtr>();
 +	if (account.isNull()) {
 +	    return;
 +	}
 +
 +	if (removeLogs) {
 +	    Tpl::LogManagerPtr logManager = Tpl::LogManager::instance();
 +	    logManager->clearAccountHistory(account);
 +	}
 +
 +         QList<Tp::PendingOperation*> ops;
 +         ops.append(KTp::WalletUtils::removeAccountPassword(account));
 +         ops.append(account->remove());
 +         connect(new Tp::PendingComposite(ops, account), SIGNAL(finished(Tp::PendingOperation*)), SLOT(onOperationFinished(Tp::PendingOperation*)));
 +    }
  }
  
- void KCMTelepathyAccounts::onModelDataChanged()
+ void KCMTelepathyAccounts::onModelDataChanged(const QModelIndex &index)
  {
      bool salutEnabled = m_salutFilterModel->rowCount() == 0;
      m_ui->salutListView->setHidden(salutEnabled);

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list