[SCM] kwallet packaging branch, master, updated. debian/4.8.4-2-2-g9ab9f76
Pino Toscano
pino at alioth.debian.org
Sat Nov 3 20:55:20 UTC 2012
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-sc/kwallet.git;a=commitdiff;h=9ab9f76
The following commit has been merged in the master branch:
commit 9ab9f7667b9d6720ff65bc53859c739950bdc0b9
Author: Pino Toscano <pino at debian.org>
Date: Sat Nov 3 21:54:53 2012 +0100
fix amazingly slow kwalletmanager startup
backport upstream commit e893896200ad352be8d4110f780333f888b0fb94
---
debian/changelog | 4 +
debian/patches/series | 1 +
...Fix-amazingly-slow-kwalletmanager-startup.patch | 159 ++++++++++++++++++++
3 files changed, 164 insertions(+), 0 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index aec6b7b..e6484bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
kwallet (4:4.8.4-3) UNRELEASED; urgency=low
+ [ Pino Toscano ]
+ * Backport upstream commit e893896200ad352be8d4110f780333f888b0fb94 to fix
+ amazingly slow kwalletmanager startup; patch
+ upstream_Fix-amazingly-slow-kwalletmanager-startup.patch.
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Sat, 03 Nov 2012 21:49:47 +0100
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a19cde7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+upstream_Fix-amazingly-slow-kwalletmanager-startup.patch
diff --git a/debian/patches/upstream_Fix-amazingly-slow-kwalletmanager-startup.patch b/debian/patches/upstream_Fix-amazingly-slow-kwalletmanager-startup.patch
new file mode 100644
index 0000000..b8a389f
--- /dev/null
+++ b/debian/patches/upstream_Fix-amazingly-slow-kwalletmanager-startup.patch
@@ -0,0 +1,159 @@
+From e893896200ad352be8d4110f780333f888b0fb94 Mon Sep 17 00:00:00 2001
+From: David Faure <faure at kde.org>
+Date: Mon, 13 Aug 2012 19:48:47 +0200
+Subject: [PATCH] Fix amazingly slow kwalletmanager startup.
+
+Every call to setFlags(), on item creation, triggers itemChanged(), which the
+code wrongly treated as a renaming, so it would make a dbus call for renaming,
+and then process the dbus signal for "this folder has changed" by reloading the
+folder and comparing.
+
+BUG: 279161
+
+I didn't see review 105633 before spending time fixing this :-(
+(cherry picked from commit 0470195d23d46d05c0b4b0c87255c7a854a72270)
+---
+ allyourbase.cpp | 19 ++++++++++++++++---
+ allyourbase.h | 11 ++++++-----
+ kwalleteditor.cpp | 17 ++++++++++-------
+ kwalleteditor.h | 2 +-
+ 4 files changed, 33 insertions(+), 16 deletions(-)
+
+diff --git a/allyourbase.cpp b/allyourbase.cpp
+index f57eb68..08c78f3 100644
+--- a/allyourbase.cpp
++++ b/allyourbase.cpp
+@@ -133,8 +133,9 @@ bool KWalletContainerItem::contains(const QString& key) {
+
+ QTreeWidgetItem *KWalletContainerItem::getItem(const QString& key) {
+ for (int i = 0; i < childCount(); ++i) {
+- if (child(i)->text(0) == key) {
+- return child(i);
++ KWalletEntryItem* entryItem = dynamic_cast<KWalletEntryItem *>(child(i));
++ if (entryItem && entryItem->name() == key) {
++ return entryItem;
+ }
+ }
+ return 0;
+@@ -144,13 +145,25 @@ QTreeWidgetItem *KWalletContainerItem::getItem(const QString& key) {
+ * KWalletEntryItem - ListView items to represent kwallet entries
+ */
+ KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, QTreeWidgetItem* parent, const QString& ename)
+-: QTreeWidgetItem(parent, QStringList() << ename, KWalletEntryItemClass), _wallet(w), _oldName(ename) {
++: QTreeWidgetItem(parent, QStringList() << ename, KWalletEntryItemClass), _wallet(w), m_name(ename) {
+ setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
+ }
+
+ KWalletEntryItem::~KWalletEntryItem() {
+ }
+
++void KWalletEntryItem::setName(const QString& n)
++{
++ m_name = n;
++ QTreeWidgetItem::setText(0, n);
++}
++
++void KWalletEntryItem::restoreName()
++{
++ QTreeWidgetItem::setText(0, m_name);
++}
++
++
+ /****************
+ * KWalletItem - IconView items to represent wallets
+ */
+diff --git a/allyourbase.h b/allyourbase.h
+index d3452cd..88284a3 100644
+--- a/allyourbase.h
++++ b/allyourbase.h
+@@ -48,16 +48,17 @@ class KWalletEntryItem : public QTreeWidgetItem {
+ KWalletEntryItem(KWallet::Wallet *w, QTreeWidgetItem* parent, const QString& ename);
+ virtual ~KWalletEntryItem();
+
+- const QString& oldName() { return _oldName; }
+- QString currentName() { return text(0); }
+-
+- void clearOldName() { _oldName = text(0); }
++ const QString& name() const { return m_name; }
++ void setName(const QString& n);
++ // Cancel renaming
++ void restoreName();
+
+ public:
+ KWallet::Wallet *_wallet;
+
+ private:
+- QString _oldName;
++ void setText(int, const QString&) {} // forbidden
++ QString m_name;
+ };
+
+ class KWalletContainerItem : public QTreeWidgetItem {
+diff --git a/kwalleteditor.cpp b/kwalleteditor.cpp
+index 777ce8d..74c59bd 100644
+--- a/kwalleteditor.cpp
++++ b/kwalleteditor.cpp
+@@ -112,7 +112,7 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent
+ connect(_entryList,
+ SIGNAL(itemChanged(QTreeWidgetItem*,int)),
+ this,
+- SLOT(listItemRenamed(QTreeWidgetItem*)));
++ SLOT(listItemChanged(QTreeWidgetItem*,int)));
+
+ connect(_ww->_passwordValue, SIGNAL(textChanged()),
+ this, SLOT(entryEditted()));
+@@ -762,21 +762,24 @@ void KWalletEditor::renameEntry() {
+
+
+ // Only supports renaming of KWalletEntryItem derived classes.
+-void KWalletEditor::listItemRenamed(QTreeWidgetItem* item) {
+- if (item) {
++void KWalletEditor::listItemChanged(QTreeWidgetItem* item, int column) {
++ if (item && column == 0) {
+ KWalletEntryItem *i = dynamic_cast<KWalletEntryItem*>(item);
+ if (!i) {
+ return;
+ }
+
+ const QString t = item->text(0);
++ if (t == i->name()) {
++ return;
++ }
+ if (!_w || t.isEmpty()) {
+- i->setText(0, i->oldName());
++ i->restoreName();
+ return;
+ }
+
+- if (_w->renameEntry(i->oldName(), t) == 0) {
+- i->clearOldName();
++ if (_w->renameEntry(i->name(), t) == 0) {
++ i->setName(t);
+ KWalletContainerItem *ci = dynamic_cast<KWalletContainerItem*>(item->parent());
+ if (!ci) {
+ KMessageBox::error(this, i18n("An unexpected error occurred trying to rename the entry"));
+@@ -790,7 +793,7 @@ void KWalletEditor::listItemRenamed(QTreeWidgetItem* item) {
+ _ww->_entryName->setText(i18n("Binary Data: %1", item->text(0)));
+ }
+ } else {
+- i->setText(0, i->oldName());
++ i->restoreName();
+ }
+ }
+ }
+diff --git a/kwalleteditor.h b/kwalleteditor.h
+index 6856ccb..4e6b611 100644
+--- a/kwalleteditor.h
++++ b/kwalleteditor.h
+@@ -60,7 +60,7 @@ class KWalletEditor : public KXmlGuiWindow {
+ private slots:
+ void updateFolderList(bool checkEntries = false);
+ void entrySelectionChanged(QTreeWidgetItem *item);
+- void listItemRenamed(QTreeWidgetItem *);
++ void listItemChanged(QTreeWidgetItem *, int column);
+ void listContextMenuRequested(const QPoint& pos);
+ void updateEntries(const QString& folder);
+
+--
+1.7.10.4
+
--
kwallet packaging
More information about the pkg-kde-commits
mailing list