• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

kgpg

  • sources
  • kde-4.14
  • kdeutils
  • kgpg
  • core
KGpgSignNode.cpp
Go to the documentation of this file.
1 /* Copyright 2008,2009,2010,2013 Rolf Eike Beer <kde@opensource.sf-tec.de>
2  *
3  * This program is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU General Public License as
5  * published by the Free Software Foundation; either version 2 of
6  * the License or (at your option) version 3 or any later version
7  * accepted by the membership of KDE e.V. (or its successor approved
8  * by the membership of KDE e.V.), which shall act as a proxy
9  * defined in Section 14 of version 3 of the license.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #include "KGpgSignNode.h"
20 
21 #include "KGpgSignableNode.h"
22 
23 #include <KLocale>
24 
25 class KGpgSignNodePrivate {
26 public:
27  KGpgSignNodePrivate(const QStringList &sl);
28 
29  QDateTime m_creation;
30  QDateTime m_expiration;
31  bool m_local;
32  bool m_revocation;
33 };
34 
35 KGpgSignNodePrivate::KGpgSignNodePrivate(const QStringList &sl)
36  : m_local(false)
37 {
38  Q_ASSERT(!sl.isEmpty());
39  m_revocation = (sl.at(0) == QLatin1String("rev"));
40  if (sl.count() < 6)
41  return;
42  m_creation = QDateTime::fromTime_t(sl.at(5).toUInt());
43  if (sl.count() < 7)
44  return;
45  if (!sl.at(6).isEmpty())
46  m_expiration = QDateTime::fromTime_t(sl.at(6).toUInt());
47  if (sl.count() < 11)
48  return;
49  m_local = sl.at(10).endsWith(QLatin1Char( 'l' ));
50 }
51 
52 KGpgSignNode::KGpgSignNode(KGpgSignableNode *parent, const QStringList &s)
53  : KGpgRefNode(parent, s.at(4)),
54  d_ptr(new KGpgSignNodePrivate(s))
55 {
56 }
57 
58 KGpgSignNode::~KGpgSignNode()
59 {
60  delete d_ptr;
61 }
62 
63 QDateTime
64 KGpgSignNode::getExpiration() const
65 {
66  const Q_D(KGpgSignNode);
67 
68  return d->m_expiration;
69 }
70 
71 QDateTime
72 KGpgSignNode::getCreation() const
73 {
74  const Q_D(KGpgSignNode);
75 
76  return d->m_creation;
77 }
78 
79 QString
80 KGpgSignNode::getName() const
81 {
82  const Q_D(KGpgSignNode);
83  const QString name = KGpgRefNode::getName();
84 
85  if (!d->m_local)
86  return name;
87 
88  return i18n("%1 [local signature]", name);
89 }
90 
91 KgpgCore::KgpgItemType
92 KGpgSignNode::getType() const
93 {
94  return KgpgCore::ITYPE_SIGN;
95 }
KGpgSignNode.h
KGpgSignNode::getName
virtual QString getName() const
Definition: KGpgSignNode.cpp:80
QList::at
const T & at(int i) const
KGpgSignNode::getExpiration
virtual QDateTime getExpiration() const
Definition: KGpgSignNode.cpp:64
QObject::name
const char * name() const
QDateTime::fromTime_t
QDateTime fromTime_t(uint seconds)
QList::count
int count(const T &value) const
QList::isEmpty
bool isEmpty() const
KGpgRefNode
Class for child objects that are only a reference to a primary key.
Definition: KGpgRefNode.h:39
KGpgSignNode::~KGpgSignNode
virtual ~KGpgSignNode()
Definition: KGpgSignNode.cpp:58
QString
QStringList
QLatin1Char
KgpgCore::ITYPE_SIGN
signature (to a key, uid or uat)
Definition: kgpgkey.h:102
QLatin1String
KGpgSignNode::KGpgSignNode
KGpgSignNode(KGpgSignableNode *parent, const QStringList &s)
constructor for KGpgSignNode
Definition: KGpgSignNode.cpp:52
KGpgSignableNode.h
KGpgSignNode::getType
virtual KgpgCore::KgpgItemType getType() const
Returns the item type of this object.
Definition: KGpgSignNode.cpp:92
KGpgSignNode
A signature to another key object.
Definition: KGpgSignNode.h:31
KGpgSignNode::getCreation
virtual QDateTime getCreation() const
Definition: KGpgSignNode.cpp:72
KGpgRefNode::getName
virtual QString getName() const
Definition: KGpgRefNode.cpp:124
KGpgSignableNode
An object that may have KGpgSignNode children.
Definition: KGpgSignableNode.h:31
QDateTime
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgpg

Skip menu "kgpg"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal