UPDATE_FAILED,
DATA_RETRIEVAL_FAILED,
ADDRESS_RETRIEVAL_FAILED,
- DOWNLOAD_FAILED
+ DOWNLOAD_FAILED,
+ GPS_INITIALIZATION_FAILED
};
}
case SituareError::DOWNLOAD_FAILED:
m_ui->buildInformationBox(tr("Image download failed"), true);
break;
+ case SituareError::GPS_INITIALIZATION_FAILED:
+ enableGPS(false);
+ m_ui->buildInformationBox(tr("GPS initialization failed"), true);
+ break;
default:
+ qCritical() << "QNetworkReply::NetworkError :" << error;
break;
}
{
qDebug() << __PRETTY_FUNCTION__;
+ connect(m_ui, SIGNAL(error(int)),
+ this, SLOT(error(int)));
+
connect(m_ui, SIGNAL(fetchUsernameFromSettings()),
this, SLOT(fetchUsernameFromSettings()));
connect(m_ui, SIGNAL(refreshUserData()),
this, SLOT(refreshUserData()));
-// connect (m_ui, SIGNAL(notificateUpdateFailing(int)),
-// this, SLOT(error(int)));
-
connect(m_ui, SIGNAL(findUser(QPointF)),
m_mapEngine, SLOT(setViewLocation(QPointF)));
#include <QDebug>
#include <QTimer>
+#include "common.h"
#include "gpscommon.h"
#include "gpsposition.h"
#include "gpspositionprivate.h"
m_gpsSource = QGeoPositionInfoSource::createDefaultSource(this);
if (!m_gpsSource) {
- emit m_parent->error(123);
+ emit m_parent->error(SituareError::GPS_INITIALIZATION_FAILED);
return;
}
}
#include <QDebug>
#include <QTimer>
+#include "common.h"
#include "gpscommon.h"
#include "gpsposition.h"
#include "gpspositionprivateliblocation.h"
m_liblocationWrapper = new LiblocationWrapper(this);
if (!m_liblocationWrapper) {
- emit m_parent->error(123); ///Change to correct error code
+ emit m_parent->error(SituareError::GPS_INITIALIZATION_FAILED);
return;
}
}
Q_UNUSED(errorMessage);
- emit m_parent->error(123);
+ emit m_parent->error(SituareError::GPS_INITIALIZATION_FAILED);
}
void GPSPositionPrivate::setUpdateInterval(int interval)
#include <QDebug>
+#include "common.h"
#include "gpsposition.h"
#include "gpspositionprivatestub.h"
{
qDebug() << __PRETTY_FUNCTION__;
- emit m_parent->error(123);
+ emit m_parent->error(SituareError::GPS_INITIALIZATION_FAILED);
}
void GPSPositionPrivate::stop()
qDebug() << __PRETTY_FUNCTION__;
if(reply->error()) {
- qDebug() << reply->error() << reply->errorString();
+ emit error(reply->error());
toggleProgressIndicator(false);
}
}
void enableAutomaticLocationUpdate(bool enabled, int updateIntervalMsecs);
/**
+ * @brief Signals error
+ *
+ * @param error Error code
+ */
+ void error(const int error);
+
+ /**
* @brief Signal for requesting username from settings
*
*/
*/
void minZoomLevelReached();
-// /**
-// * @brief Signal that used to inform user that his message/location update tp Situare server
-// * was failed.
-// * This signal is originally sended from UserInfo
-// */
-// void notificateUpdateFailing(const QString &message);
-
/**
* @brief Forwarding signal from MapEngine to MapScale
*/