Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/network/ssl/qsslerror.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the QtNetwork module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4747
    4848    \reentrant
    49     \ingroup io
     49    \ingroup
    5050    \ingroup ssl
    5151    \inmodule QtNetwork
     
    9292
    9393#include "qsslerror.h"
     94
    9495#ifndef QT_NO_DEBUG_STREAM
    9596#include <QtCore/qdebug.h>
     
    106107
    107108/*!
    108     Constructs a QSslError object. The two optional arguments specify the \a
     109    Constructs a QSslError object with no error and default certificate.
     110
     111*/
     112
     113// RVCT compiler in debug build does not like about default values in const-
     114// So as an workaround we define all constructor overloads here explicitly
     115QSslError::QSslError()
     116    : d(new QSslErrorPrivate)
     117{
     118    d->error = QSslError::NoError;
     119    d->certificate = QSslCertificate();
     120}
     121
     122/*!
     123    Constructs a QSslError object. The argument specifies the \a
     124    error that occurred.
     125
     126*/
     127QSslError::QSslError(SslError error)
     128    : d(new QSslErrorPrivate)
     129{
     130    d->error = error;
     131    d->certificate = QSslCertificate();
     132}
     133
     134/*!
     135    Constructs a QSslError object. The two arguments specify the \a
    109136    error that occurred, and which \a certificate the error relates to.
    110137
     
    124151    : d(new QSslErrorPrivate)
    125152{
    126     *d = *other.d;
     153    *d;
    127154}
    128155
     
    132159QSslError::~QSslError()
    133160{
    134     delete d;
    135161}
    136162
     
    142168QSslError &QSslError::operator=(const QSslError &other)
    143169{
    144     *d = *other.d;
     170    *d;
    145171    return *this;
    146172}
     
    185211    switch (d->error) {
    186212    case NoError:
    187         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "No error"));
     213        errStr = Q);
    188214        break;
    189215    case UnableToGetIssuerCertificate:
    190         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The issuer certificate could not be found"));
     216        errStr = Q);
    191217        break;
    192218    case UnableToDecryptCertificateSignature:
    193         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate signature could not be decrypted"));
     219        errStr = Q);
    194220        break;
    195221    case UnableToDecodeIssuerPublicKey:
    196         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The public key in the certificate could not be read"));
     222        errStr = Q);
    197223        break;
    198224    case CertificateSignatureFailed:
    199         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The signature of the certificate is invalid"));
     225        errStr = Q);
    200226        break;
    201227    case CertificateNotYetValid:
    202         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate is not yet valid"));
     228        errStr = Q);
    203229        break;
    204230    case CertificateExpired:
    205         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate has expired"));
     231        errStr = Q);
    206232        break;
    207233    case InvalidNotBeforeField:
    208         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate's notBefore field contains an invalid time"));
     234        errStr = Q);
    209235        break;
    210236    case InvalidNotAfterField:
    211         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate's notAfter field contains an invalid time"));
     237        errStr = Q);
    212238        break;
    213239    case SelfSignedCertificate:
    214         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate is self-signed, and untrusted"));
     240        errStr = Q);
    215241        break;
    216242    case SelfSignedCertificateInChain:
    217         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The root certificate of the certificate chain is self-signed, and untrusted"));
     243        errStr = Q);
    218244        break;
    219245    case UnableToGetLocalIssuerCertificate:
    220         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The issuer certificate of a locally looked up certificate could not be found"));
     246        errStr = Q);
    221247        break;
    222248    case UnableToVerifyFirstCertificate:
    223         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "No certificates could be verified"));
     249        errStr = Q);
    224250        break;
    225251    case InvalidCaCertificate:
    226         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "One of the CA certificates is invalid"));
     252        errStr = Q);
    227253        break;
    228254    case PathLengthExceeded:
    229         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The basicConstraints pathlength parameter has been exceeded"));
     255        errStr = Q);
    230256        break;
    231257    case InvalidPurpose:
    232         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The supplied certificate is unsuited for this purpose"));
     258        errStr = Q);
    233259        break;
    234260    case CertificateUntrusted:
    235         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The root CA certificate is not trusted for this purpose"));
     261        errStr = Q);
    236262        break;
    237263    case CertificateRejected:
    238         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The root CA certificate is marked to reject the specified purpose"));
     264        errStr = Q);
    239265        break;
    240266    case SubjectIssuerMismatch: // hostname mismatch
    241         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError,
    242                                                "The current candidate issuer certificate was rejected because its"
    243                                                " subject name did not match the issuer name of the current certificate"));
     267        errStr = QSslSocket::tr("The current candidate issuer certificate was rejected because its"
     268                                " subject name did not match the issuer name of the current certificate");
    244269        break;
    245270    case AuthorityIssuerSerialNumberMismatch:
    246         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The current candidate issuer certificate was rejected because"
    247                                                " its issuer name and serial number was present and did not match the"
    248                                                " authority key identifier of the current certificate"));
     271        errStr = Q"The current candidate issuer certificate was rejected because"
     272                             " its issuer name and serial number was present and did not match the"
     273                             );
    249274        break;
    250275    case NoPeerCertificate:
    251         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The peer did not present any certificate"));
     276        errStr = Q);
    252277        break;
    253278    case HostNameMismatch:
    254         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError,
    255                                                "The host name did not match any of the valid hosts"
    256                                                " for this certificate"));
     279        errStr = QSslSocket::tr("The host name did not match any of the valid hosts"
     280                             " for this certificate");
    257281        break;
    258282    case NoSslSupport:
    259283        break;
    260284    default:
    261         errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "Unknown error"));
     285        errStr = Q);
    262286        break;
    263287    }
Note: See TracChangeset for help on using the changeset viewer.