make ssldialog aware of custom configs.

This commit is contained in:
Klaas Freitag 2012-06-13 11:36:56 +02:00
parent 5953d36297
commit f0bae07a2c
2 changed files with 9 additions and 2 deletions

View file

@ -37,7 +37,7 @@ SslErrorDialog::SslErrorDialog(QWidget *parent) :
QList<QSslCertificate> SslErrorDialog::storedCACerts()
{
MirallConfigFile cfg;
MirallConfigFile cfg( _customConfigHandle );
QSettings settings( cfg.configFile(), QSettings::IniFormat);
QList<QSslCertificate> cacerts = QSslCertificate::fromData(settings.value(QLatin1String("CaCertificates")).toByteArray());
@ -166,7 +166,8 @@ void SslErrorDialog::accept()
{
// Save the contents of _unknownCerts to the settings file.
if( trustConnection() && _unknownCerts.count() > 0 ) {
MirallConfigFile cfg;
MirallConfigFile cfg( _customConfigHandle );
QSettings settings( cfg.configFile(), QSettings::IniFormat);
QByteArray certs = settings.value(QLatin1String("CaCertificates")).toByteArray();
@ -190,5 +191,9 @@ void SslErrorDialog::accept()
QDialog::accept();
}
void SslErrorDialog::setCustomConfigHandle( const QString& handle )
{
_customConfigHandle = handle;
}
} // end namespace

View file

@ -37,6 +37,7 @@ public:
bool trustConnection();
void setCustomConfigHandle( const QString& );
signals:
public slots:
@ -50,6 +51,7 @@ private:
QString certDiv( QSslCertificate ) const;
QList<QSslCertificate> _unknownCerts;
QString _customConfigHandle;
};
} // end namespace