Skip to content

Commit

Permalink
Add qInfo macros link for Qt4, add url output for network error
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Dryabzhinsky committed Oct 5, 2020
1 parent 777df67 commit aa6a33c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include <QDebug>
#include "config.h"
#include "qinfo.h"
#include "mainwindow.h"
#include "qwk_webpage.h"

Expand Down
15 changes: 15 additions & 0 deletions src/qinfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Add debug macros for QT < 5.5.0
*/

#ifndef __QINFO_H
#define __QINFO_H

#if QT_VERSION < 0x050500
#define qInfo qDebug
#define qWarning qDebug
#define qFatal qDebug
#define qCritical qDebug
#endif

#endif
2 changes: 2 additions & 0 deletions src/qwk_webpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "config.h"

#include <QtDebug>
#include "qinfo.h"

#include <QtGui>
#include <QtWebKit>
#include "webview.h"
Expand Down
3 changes: 2 additions & 1 deletion src/webview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ void WebView::handleSslErrors(QNetworkReply* reply, const QList<QSslError> &erro

void WebView::handleNetworkReply(QNetworkReply* reply)
{
if( reply ) {
if ( reply ) {
qDebug() << QDateTime::currentDateTime().toString() << "handleNetworkReply URL:" << reply->request().url().toString();
if( reply->error()) {
QString errStr = reply->errorString();
qWarning() << QDateTime::currentDateTime().toString() << "handleNetworkReply ERROR:" << reply->error() << "=" << errStr;
qWarning() << QDateTime::currentDateTime().toString() << "on URL:" << reply->request().url().toString();
emit qwkNetworkError(reply->error(), reply->errorString());
} else {
qDebug() << QDateTime::currentDateTime().toString() << "handleNetworkReply OK";
Expand Down

0 comments on commit aa6a33c

Please sign in to comment.