From b6a855f6d3f7a2b28990d11a3ffa4d82f838bc09 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Mon, 23 Jul 2012 21:54:02 +0200 Subject: [PATCH] fix crash in SSL config --- src/dialogs/configdialog.cpp | 17 +++++++++++++---- src/dialogs/configdialog.h | 2 +- src/misc/debug.cpp | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/dialogs/configdialog.cpp b/src/dialogs/configdialog.cpp index da7bf54..8e8121f 100644 --- a/src/dialogs/configdialog.cpp +++ b/src/dialogs/configdialog.cpp @@ -547,7 +547,7 @@ void MConfigDialog::serverProbe() QNetworkAccessManager man; connect(&man,SIGNAL(finished(QNetworkReply*)),&loop,SLOT(quit())); QTimer::singleShot(30000,&loop,SLOT(quit())); - connect(&man,SIGNAL(sslErrors(QNetworkReply*,const QList&)), this,SLOT(sslErrors(QNetworkReply*,const QList&))); + connect(&man,SIGNAL(sslErrors(QNetworkReply*,const QList&)), this,SLOT(sslErrors(QNetworkReply*,QList))); if(useproxy->isChecked()) man.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy,proxyname->text(),proxyport->value(),proxyuser->text(),proxypass->text())); //query server @@ -568,17 +568,26 @@ void MConfigDialog::serverProbe() sslexcept->savesslexcept(); } -void MConfigDialog::sslErrors(QNetworkReply*rp,const QList&errs) +void MConfigDialog::sslErrors(QNetworkReply*rp,QListerrs) { 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= 0x50000 + .value(0) +#endif + ) .arg(QString::fromAscii(c.digest(QCryptographicHash::Sha1).toHex())) .arg(errs[i].errorString()); } diff --git a/src/dialogs/configdialog.h b/src/dialogs/configdialog.h index 8f5d864..43fbb93 100644 --- a/src/dialogs/configdialog.h +++ b/src/dialogs/configdialog.h @@ -71,7 +71,7 @@ class MConfigDialog:public QDialog void setAppStyle(); //ssl server probe void serverProbe(); - void sslErrors(QNetworkReply*,const QList&); + void sslErrors(QNetworkReply*,QList); void clearSslExceptions(); void sslFillModel(); }; diff --git a/src/misc/debug.cpp b/src/misc/debug.cpp index 6308617..562ba9d 100644 --- a/src/misc/debug.cpp +++ b/src/misc/debug.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -34,6 +35,9 @@ static void mymsghandler(QtMsgType, const char *msg) 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"); -- 1.7.2.5