Skip to content
Permalink
Browse files

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

for the 'Help:Check Qgis Version' function.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6302 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Dec 22, 2006
1 parent c6938bd commit 82c8f137b7663272696a414fc5f93bf41f1176b0
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)),
SLOT(socketError(QAbstractSocket::SocketError)));
mSocket->connectToHost("mrcc.com", 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)
return;

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

// 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 82c8f13

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