• 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
  • transactions
kgpgchangetrust.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008,2009,2012 Rolf Eike Beer <kde@opensource.sf-tec.de>
3  */
4 
5 /***************************************************************************
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  ***************************************************************************/
13 
14 #include "kgpgchangetrust.h"
15 
16 KGpgChangeTrust::KGpgChangeTrust(QObject *parent, const QString &keyid, const gpgme_validity_t trust)
17  : KGpgEditKeyTransaction(parent, keyid, QLatin1String( "trust" ), false)
18 {
19  setTrust(trust);
20 }
21 
22 KGpgChangeTrust::~KGpgChangeTrust()
23 {
24 }
25 
26 bool
27 KGpgChangeTrust::preStart()
28 {
29  setSuccess(TS_MSG_SEQUENCE);
30 
31  return true;
32 }
33 
34 bool
35 KGpgChangeTrust::nextLine(const QString &line)
36 {
37  if (line.contains(QLatin1String( "edit_ownertrust.value" ))) {
38  write(QByteArray::number(m_trust));
39  setSuccess(TS_OK);
40  } else {
41  return KGpgEditKeyTransaction::nextLine(line);
42  }
43 
44  return false;
45 }
46 
47 KGpgTransaction::ts_boolanswer
48 KGpgChangeTrust::boolQuestion(const QString& line)
49 {
50  if (line == QLatin1String("edit_ownertrust.set_ultimate.okay")) {
51  return BA_YES;
52  } else {
53  return KGpgTransaction::boolQuestion(line);
54  }
55 }
56 
57 void
58 KGpgChangeTrust::setTrust(const gpgme_validity_t trust)
59 {
60  m_trust = trust;
61 }
62 
63 #include "kgpgchangetrust.moc"
KGpgTransaction::BA_YES
answer "YES"
Definition: kgpgtransaction.h:75
KGpgTransaction::TS_OK
everything went fine
Definition: kgpgtransaction.h:60
KGpgTransaction::write
void write(const QByteArray &a, const bool lf=true)
write data to standard input of gpg process
Definition: kgpgtransaction.cpp:413
KGpgEditKeyTransaction
edit a single property of a key
Definition: kgpgeditkeytransaction.h:24
KGpgChangeTrust::preStart
virtual bool preStart()
reset class before next operation starts
Definition: kgpgchangetrust.cpp:27
KGpgChangeTrust::setTrust
void setTrust(const gpgme_validity_t trust)
Definition: kgpgchangetrust.cpp:58
QObject
KGpgChangeTrust::~KGpgChangeTrust
virtual ~KGpgChangeTrust()
Definition: kgpgchangetrust.cpp:22
QByteArray::number
QByteArray number(int n, int base)
KGpgEditKeyTransaction::nextLine
virtual bool nextLine(const QString &line)
handle standard GnuPG prompts
Definition: kgpgeditkeytransaction.cpp:60
KGpgTransaction::boolQuestion
virtual ts_boolanswer boolQuestion(const QString &line)
Called for every boolean question GnuPG answers.
Definition: kgpgtransaction.cpp:457
QString
KGpgTransaction::TS_MSG_SEQUENCE
unexpected sequence of GnuPG messages
Definition: kgpgtransaction.h:62
KGpgTransaction::ts_boolanswer
ts_boolanswer
result codes for GnuPG boolean questions
Definition: kgpgtransaction.h:73
KGpgChangeTrust::KGpgChangeTrust
KGpgChangeTrust(QObject *parent, const QString &keyid, const gpgme_validity_t trust)
Definition: kgpgchangetrust.cpp:16
QString::contains
bool contains(QChar ch, Qt::CaseSensitivity cs) const
kgpgchangetrust.h
KGpgChangeTrust::nextLine
virtual bool nextLine(const QString &line)
handle standard GnuPG prompts
Definition: kgpgchangetrust.cpp:35
QLatin1String
KGpgTransaction::setSuccess
void setSuccess(const int v)
set the success value that will be returned with the done signal
Definition: kgpgtransaction.cpp:448
KGpgChangeTrust::boolQuestion
virtual ts_boolanswer boolQuestion(const QString &line)
Called for every boolean question GnuPG answers.
Definition: kgpgchangetrust.cpp:48
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