Skip to content
Browse files

Fix another signal/slot mismatch. This re-enables the error messages

for the 'Help:Check Qgis Version' function.

git-svn-id: c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Dec 22, 2006
1 parent 020a1ce commit 77a394125788d87affb37244c60fc3896537f1b5
Showing with 17 additions and 9 deletions.
  1. +15 −7 src/gui/qgisapp.cpp
  2. +2 −2 src/gui/qgisapp.h
@@ -4037,7 +4037,8 @@ void QgisApp::checkQgisVersion()
connect(mSocket, SIGNAL(connected()), SLOT(socketConnected()));
connect(mSocket, SIGNAL(connectionClosed()), SLOT(socketConnectionClosed()));
connect(mSocket, SIGNAL(readyRead()), SLOT(socketReadyRead()));
connect(mSocket, SIGNAL(error(int)), SLOT(socketError(int)));
connect(mSocket, SIGNAL(error(QAbstractSocket::SocketError)),
mSocket->connectToHost("", 80);

@@ -4108,25 +4109,32 @@ void QgisApp::socketConnectionClosed()
QMessageBox::warning(this, tr("QGIS Version Information"), tr("Unable to get current version information from server"));
void QgisApp::socketError(int e)
void QgisApp::socketError(QAbstractSocket::SocketError e)
if (e == QAbstractSocket::RemoteHostClosedError)

// get error type
QString detail;
switch (e)
case QTcpSocket::ErrConnectionRefused:
case QAbstractSocket::ConnectionRefusedError:
detail = tr("Connection refused - server may be down");
case QTcpSocket::ErrHostNotFound:
case QAbstractSocket::HostNotFoundError:
detail = tr("QGIS server was not found");
case QTcpSocket::ErrSocketRead:
detail = tr("Error reading from server");
case QAbstractSocket::NetworkError:
detail = tr("Network error while communicating with server");
detail = tr("Unknown network socket error");

// show version message from server
QMessageBox::critical(this, tr("QGIS Version Information"), tr("Unable to connect to the QGIS Version server") + "\n" + detail);
QMessageBox::critical(this, tr("QGIS Version Information"), tr("Unable to communicate with QGIS Version server") + "\n" + detail);

void QgisApp::socketReadyRead()
@@ -54,7 +54,7 @@ class QgsComposer;

#include <ui_qgisappbase.h>
#include <QMainWindow>

#include <QAbstractSocket>

/*! \class QgisApp
* \brief Main window for the Qgis application
@@ -273,7 +273,7 @@ public slots:
void socketConnected();
void socketConnectionClosed();
void socketReadyRead();
void socketError(int e);
void socketError(QAbstractSocket::SocketError e);
//! Set project properties, including map untis
void projectProperties();
//! Open project properties dialog and show the projections tab

0 comments on commit 77a3941

Please sign in to comment.
You can’t perform that action at this time.