Commit 903645a7 authored by Ingo Klöcker's avatar Ingo Klöcker

Add possibility to retrieve a single user id or signature

parent 3324d59c
Pipeline #39645 canceled with stage
......@@ -311,7 +311,17 @@ QVariant UserIDListModel::data(const QModelIndex &index, int role) const
return item->data(index.column());
}
QVector<UserID> UserIDListModel::userIDs (const QModelIndexList &indexs) const {
UserID UserIDListModel::userID(const QModelIndex& index) const
{
if (!index.isValid()) {
return UserID();
}
UIDModelItem *item = static_cast<UIDModelItem*>(index.internalPointer());
return item->uid();
}
QVector<UserID> UserIDListModel::userIDs(const QModelIndexList &indexs) const
{
QVector<GpgME::UserID> ret;
for (const QModelIndex &idx : indexs) {
if (!idx.isValid()) {
......@@ -325,7 +335,17 @@ QVector<UserID> UserIDListModel::userIDs (const QModelIndexList &indexs) const {
return ret;
}
QVector<UserID::Signature> UserIDListModel::signatures (const QModelIndexList &indexs) const {
UserID::Signature UserIDListModel::signature(const QModelIndex& index) const
{
if (!index.isValid()) {
return UserID::Signature();
}
UIDModelItem *item = static_cast<UIDModelItem*>(index.internalPointer());
return item->signature();
}
QVector<UserID::Signature> UserIDListModel::signatures(const QModelIndexList &indexs) const
{
QVector<GpgME::UserID::Signature> ret;
for (const QModelIndex &idx : indexs) {
if (!idx.isValid()) {
......
/* -*- mode: c++; c-basic-offset:4 -*-
models/userIDlistmodel.h
models/useridlistmodel.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
......@@ -32,7 +32,9 @@ public:
GpgME::Key key() const;
public:
GpgME::UserID userID(const QModelIndex &index) const;
QVector<GpgME::UserID> userIDs(const QModelIndexList &indexs) const;
GpgME::UserID::Signature signature(const QModelIndex &index) const;
QVector<GpgME::UserID::Signature> signatures(const QModelIndexList &indexs) const;
void enableRemarks(bool value);
......
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