From 7205c84da2941ad8a583bc14d1fffb6e191c03a9 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Jan 2011 08:39:52 +0100 Subject: [PATCH] qt4projectmanager: make it compile with -no-stl'd Qt. --- .../qt-s60/s60symbiancertificate.cpp | 32 ++++++++++++---------- .../qt-s60/s60symbiancertificate.h | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp b/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp index 1ae6d8d388..79e5d1f679 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp @@ -46,8 +46,10 @@ #include #include #include + #include #include +#include using namespace Botan; using namespace Qt4ProjectManager; @@ -421,7 +423,7 @@ public: * encoded certificate. * @param filename the name of the certificate file */ - S60SymbianCertificatePrivate(const std::string& filename); + S60SymbianCertificatePrivate(const QByteArray &filename); private: Botan::X509_DN createDn(const Botan::Data_Store& info) const; @@ -457,8 +459,8 @@ std::vector lookup_oids(const std::vector& in) /* * S60SymbianCertificate Constructor */ -S60SymbianCertificatePrivate::S60SymbianCertificatePrivate(const std::string& in) : - X509_Object(in, "CERTIFICATE/X509 CERTIFICATE") +S60SymbianCertificatePrivate::S60SymbianCertificatePrivate(const QByteArray &in) : + X509_Object(in.constData(), "CERTIFICATE/X509 CERTIFICATE") { m_selfSigned = false; @@ -740,7 +742,7 @@ S60SymbianCertificate::S60SymbianCertificate(const QString &filename) : m_d(0) { S60SymbianCertificatePrivate *certificate = 0; try { - certificate = new S60SymbianCertificatePrivate(filename.toStdString()); + certificate = new S60SymbianCertificatePrivate(filename.toLatin1()); m_d = certificate; certificate = 0; } catch (Botan::Exception &e) { @@ -769,10 +771,11 @@ QStringList S60SymbianCertificate::subjectInfo(const QString &name) Q_ASSERT(m_d); QStringList result; try { - std::vector subjectInfo(m_d->subjectInfo(name.toStdString())); + std::vector subjectInfo = + m_d->subjectInfo(name.toLatin1().constData()); std::vector::const_iterator i; - for(i = subjectInfo.begin(); i != subjectInfo.end(); ++i) - result << QString::fromStdString(*i); + for (i = subjectInfo.begin(); i != subjectInfo.end(); ++i) + result << QString::fromLatin1(i->c_str()); } catch (Botan::Exception &e) { m_errorString = QString::fromLatin1(e.what()); } @@ -784,23 +787,24 @@ QStringList S60SymbianCertificate::issuerInfo(const QString &name) Q_ASSERT(m_d); QStringList result; try { - std::vector issuerInfo(m_d->issuerInfo(name.toStdString())); + std::vector issuerInfo = + m_d->issuerInfo(name.toLatin1().constData()); std::vector::const_iterator i; - for(i = issuerInfo.begin(); i != issuerInfo.end(); ++i) - result << QString::fromStdString(*i); + for (i = issuerInfo.begin(); i != issuerInfo.end(); ++i) + result << QString::fromLatin1(i->c_str()); } catch (Botan::Exception &e) { m_errorString = QString::fromLatin1(e.what()); } return result; } -QDateTime S60SymbianCertificate::parseTime(const std::string &time) +QDateTime S60SymbianCertificate::parseTime(const QByteArray &time) { QDateTime result; try { const char * const CERTIFICATE_DATE_FORMAT = "yyyy/M/d h:mm:ss UTC"; - QDateTime dateTime = QDateTime::fromString(QString::fromStdString(time), + QDateTime dateTime = QDateTime::fromString(QString::fromLatin1(time), QLatin1String(CERTIFICATE_DATE_FORMAT)); result = QDateTime(dateTime.date(), dateTime.time(), Qt::UTC); } catch (Botan::Exception &e) { @@ -812,13 +816,13 @@ QDateTime S60SymbianCertificate::parseTime(const std::string &time) QDateTime S60SymbianCertificate::startTime() { Q_ASSERT(m_d); - return parseTime(m_d->startTime()); + return parseTime(m_d->startTime().c_str()); } QDateTime S60SymbianCertificate::endTime() { Q_ASSERT(m_d); - return parseTime(m_d->endTime()); + return parseTime(m_d->endTime().c_str()); } quint32 S60SymbianCertificate::certificateVersion() diff --git a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h b/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h index 5880638898..e7148aa352 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h @@ -63,7 +63,7 @@ public: bool isCaCert(); private: - QDateTime parseTime(const std::string &time); + QDateTime parseTime(const QByteArray &time); protected: S60SymbianCertificatePrivate const *m_d; -- 2.11.0