Commit 6d534a11 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

fix several issues coming up when different key id length were stored for group members

Especially happening when the full fingerprint was saved.
parent e9d77b1f
/* Copyright 2008,2009 Rolf Eike Beer <kde@opensource.sf-tec.de>
/* Copyright 2008,2009,2010,2013 Rolf Eike Beer <kde@opensource.sf-tec.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -95,7 +95,7 @@ KGpgRefNode::keyUpdated(KGpgKeyNode *nkey)
Q_ASSERT(m_keynode == NULL);
Q_ASSERT(nkey != NULL);
if (nkey->getId().right(m_id.length()) == m_id) {
if (nkey->compareId(m_id)) {
disconnect(sender(), NULL, this, SLOT(keyUpdated(KGpgKeyNode*)));
m_keynode = nkey;
m_keynode->addRef(this);
......
......@@ -107,7 +107,7 @@ groupEdit::groupRemove()
continue;
KGpgNode *nd = m_in->nodeForIndex(sel.at(i));
for (int j = 0; j < members->count(); j++)
if (members->at(j)->getId() == nd->getId()) {
if (nd->toKeyNode()->compareId(members->at(j)->getId())) {
members->removeAt(j);
break;
}
......@@ -129,9 +129,9 @@ void
groupEdit::groupRemove(const QModelIndex &index)
{
Q_ASSERT(!members->isEmpty());
KGpgNode *nd = m_in->nodeForIndex(index);
KGpgKeyNode *nd = m_in->nodeForIndex(index)->toKeyNode();
for (int i = 0; i < members->count(); i++)
if (members->at(i)->getId() == nd->getId()) {
if (nd->compareId(members->at(i)->getId())) {
members->removeAt(i);
break;
}
......
/* Copyright 2008 Rolf Eike Beer <kde@opensource.sf-tec.de>
/* Copyright 2008,2010,2012,2013 Rolf Eike Beer <kde@opensource.sf-tec.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -60,8 +60,9 @@ GroupEditProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_
if (l->getTrust() < m_mintrust)
return false;
const KGpgKeyNode * const lk = l->toKeyNode();
for (int i = 0; i < m_ids->count(); i++)
if (m_ids->at(i)->getId() == l->getId())
if (lk->compareId(m_ids->at(i)->getId()))
return !m_invert;
return m_invert;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment