QNetworkAccessManager man;
connect(&man,SIGNAL(finished(QNetworkReply*)),&loop,SLOT(quit()));
QTimer::singleShot(30000,&loop,SLOT(quit()));
- connect(&man,SIGNAL(sslErrors(QNetworkReply*,const QList<QSslError>&)), this,SLOT(sslErrors(QNetworkReply*,const QList<QSslError>&)));
+ connect(&man,SIGNAL(sslErrors(QNetworkReply*,const QList<QSslError>&)), this,SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
if(useproxy->isChecked())
man.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy,proxyname->text(),proxyport->value(),proxyuser->text(),proxypass->text()));
//query server
sslexcept->savesslexcept();
}
-void MConfigDialog::sslErrors(QNetworkReply*rp,const QList<QSslError>&errs)
+void MConfigDialog::sslErrors(QNetworkReply*rp,QList<QSslError>errs)
{
if(!sslexcept)return;
//check/record/clear
- if(sslexcept->checksslexcept(errs))rp->ignoreSslErrors();
+ if(sslexcept->checksslexcept(errs)){
+ rp->ignoreSslErrors();
+ return;
+ }
//convert to string
QString err=tr("SSL Errors encountered:\n");
for(int i=0;i<errs.size();i++){
+ qDebug()<<"err type"<<(int)errs[i].error();
+ qDebug()<<"err stri"<<errs[i].errorString();
QSslCertificate c=errs[i].certificate();
err+=tr("Certificate \"%1\"\n Fingerprint (sha1): %2\n Error: %3\n")
- .arg(c.subjectInfo(QSslCertificate::CommonName).at(0))
+ .arg(c.subjectInfo(QSslCertificate::CommonName)
+#if QT_VERSION >= 0x50000
+ .value(0)
+#endif
+ )
.arg(QString::fromAscii(c.digest(QCryptographicHash::Sha1).toHex()))
.arg(errs[i].errorString());
}
#include <QCoreApplication>
#include <QDateTime>
+#include <QDebug>
#include <QDir>
#include <QFile>
void initDebug()
{
+ if(QCoreApplication::instance()->arguments().contains("-nolog")){
+ qDebug()<<"-nolog argument was given, will not create a log file";
+ }
//create new log file
QDir(dataDir).mkpath("debuglog");
mylogFile=new QFile(dataDir+"/debuglog/log-"+QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss.zzz")+".txt");