Commit 26460581 authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid
Browse files

Adapt to poppler API change

and fix a leak meanwhile ^_^
parent b09e23f6
......@@ -97,16 +97,16 @@ void CertificateTools::setCertificates(const QStringList & /*items*/)
}
*/
Poppler::setNSSDir(CertificateSettings::certificatePath());
QVector<Poppler::CertificateInfo *> nssCerts = Poppler::getAvailableSigningCertificates();
const QVector<Poppler::CertificateInfo> nssCerts = Poppler::getAvailableSigningCertificates();
foreach (auto cert, nssCerts) {
QListWidgetItem *listEntry = new QListWidgetItem(
cert->subjectInfo(Poppler::CertificateInfo::EntityInfoKey::CommonName) + "\t\t" + cert->subjectInfo(Poppler::CertificateInfo::EntityInfoKey::EmailAddress) + "\t\t(" + cert->validityEnd().toString("yyyy-MM-dd") + ")", m_list);
cert.subjectInfo(Poppler::CertificateInfo::EntityInfoKey::CommonName) + "\t\t" + cert.subjectInfo(Poppler::CertificateInfo::EntityInfoKey::EmailAddress) + "\t\t(" + cert.validityEnd().toString("yyyy-MM-dd") + ")", m_list);
QJsonObject json;
json["NickName"] = cert->nickName();
json["CommonName"] = cert->subjectInfo(Poppler::CertificateInfo::EntityInfoKey::CommonName);
json["EMail"] = cert->subjectInfo(Poppler::CertificateInfo::EntityInfoKey::EmailAddress);
json["ValidUntil"] = cert->validityEnd().toString();
json["NickName"] = cert.nickName();
json["CommonName"] = cert.subjectInfo(Poppler::CertificateInfo::EntityInfoKey::CommonName);
json["EMail"] = cert.subjectInfo(Poppler::CertificateInfo::EntityInfoKey::EmailAddress);
json["ValidUntil"] = cert.validityEnd().toString();
listEntry->setData(Qt::UserRole, QJsonDocument(json).toJson());
}
......
......@@ -1921,10 +1921,10 @@ struct CertificateStoreImpl : public Okular::CertificateStore {
virtual QList<Okular::CertificateInfo *> getSigningCertificates() const
{
Poppler::setNSSDir(CertificateSettings::certificatePath());
QVector<Poppler::CertificateInfo *> certs = Poppler::getAvailableSigningCertificates();
const QVector<Poppler::CertificateInfo> certs = Poppler::getAvailableSigningCertificates();
QList<Okular::CertificateInfo *> vReturnCerts;
for (auto cert : certs)
vReturnCerts.append(new PopplerCertificateInfo(*cert));
vReturnCerts.append(new PopplerCertificateInfo(cert));
return vReturnCerts;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment