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

KIO

  • sources
  • kde-4.12
  • kdelibs
  • kio
  • kssl
ksslcertificatebox.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #include "ksslcertificatebox.h"
22 
23 #include "ui_certificateparty.h"
24 
25 #include <QtNetwork/QSslCertificate>
26 
27 class KSslCertificateBoxPrivate
28 {
29 public:
30  Ui::CertificateParty ui;
31 };
32 
33 
34 KSslCertificateBox::KSslCertificateBox(QWidget *parent)
35  : QWidget(parent),
36  d(new KSslCertificateBoxPrivate())
37 {
38  d->ui.setupUi(this);
39  // No fooling us with html tags
40  Q_FOREACH(QLabel* label, qFindChildren<QLabel *>(this)) {
41  label->setTextFormat(Qt::PlainText);
42  }
43 }
44 
45 
46 KSslCertificateBox::~KSslCertificateBox()
47 {
48  delete d;
49 }
50 
51 
52 void KSslCertificateBox::setCertificate(const QSslCertificate &cert, CertificateParty party)
53 {
54  if (party == Subject) {
55  d->ui.commonName->setText(cert.subjectInfo(QSslCertificate::CommonName));
56  d->ui.organization->setText(cert.subjectInfo(QSslCertificate::Organization));
57  d->ui.organizationalUnit
58  ->setText(cert.subjectInfo(QSslCertificate::OrganizationalUnitName));
59  d->ui.country->setText(cert.subjectInfo(QSslCertificate::CountryName));
60  d->ui.state->setText(cert.subjectInfo(QSslCertificate::StateOrProvinceName));
61  d->ui.city->setText(cert.subjectInfo(QSslCertificate::LocalityName));
62  } else if (party == Issuer) {
63  d->ui.commonName->setText(cert.issuerInfo(QSslCertificate::CommonName));
64  d->ui.organization->setText(cert.issuerInfo(QSslCertificate::Organization));
65  d->ui.organizationalUnit
66  ->setText(cert.issuerInfo(QSslCertificate::OrganizationalUnitName));
67  d->ui.country->setText(cert.issuerInfo(QSslCertificate::CountryName));
68  d->ui.state->setText(cert.issuerInfo(QSslCertificate::StateOrProvinceName));
69  d->ui.city->setText(cert.issuerInfo(QSslCertificate::LocalityName));
70  }
71 }
72 
73 
74 void KSslCertificateBox::clear()
75 {
76  d->ui.commonName->clear();
77  d->ui.organization->clear();
78  d->ui.organizationalUnit->clear();
79  d->ui.country->clear();
80  d->ui.state->clear();
81  d->ui.city->clear();
82 }
83 
84 
85 #include "ksslcertificatebox.moc"
label
QString label(StandardShortcut id)
QWidget
KSslCertificateBox::clear
void clear()
Definition: ksslcertificatebox.cpp:74
KSslCertificateBox::setCertificate
void setCertificate(const QSslCertificate &cert, CertificateParty party)
Definition: ksslcertificatebox.cpp:52
ksslcertificatebox.h
KSslCertificateBox::KSslCertificateBox
KSslCertificateBox(QWidget *parent=0)
Definition: ksslcertificatebox.cpp:34
KSslCertificateBox::Issuer
Definition: ksslcertificatebox.h:38
KSslCertificateBox::CertificateParty
CertificateParty
Definition: ksslcertificatebox.h:36
KSslCertificateBox::~KSslCertificateBox
~KSslCertificateBox()
Definition: ksslcertificatebox.cpp:46
KSslCertificateBox::d
KSslCertificateBoxPrivate *const d
Definition: ksslcertificatebox.h:47
QLabel
KSslCertificateBox::Subject
Definition: ksslcertificatebox.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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