package monav tag 632650 patch thanks Hi,
I reported this to upstream and they fixed it in a day! :-) See http://code.google.com/p/monav/source/detail?r=3ec821f2cdf0# I backported the fix. Patches against pkg-osm/monav git are attached. -Timo
>From ec1cd174feff4b0b125a196feee9f096467c60c8 Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors <timo.lindf...@iki.fi> Date: Thu, 21 Jul 2011 11:34:18 +0000 Subject: [PATCH 1/2] Backport fix to avoid freezing if GPSD is not available. --- debian/patches/06-implement_gpsd_interface.patch | 46 ++++++++++++++-------- 1 files changed, 30 insertions(+), 16 deletions(-) diff --git a/debian/patches/06-implement_gpsd_interface.patch b/debian/patches/06-implement_gpsd_interface.patch index b39dde2..4ea4d7f 100644 --- a/debian/patches/06-implement_gpsd_interface.patch +++ b/debian/patches/06-implement_gpsd_interface.patch @@ -1,6 +1,7 @@ From: bedl...@gmail.com Subject: implement GPSd interface in MoNav Origin: upstream, http://code.google.com/p/monav/issues/detail?id=39 + and fixes from http://code.google.com/p/monav/source/detail?r=3ec821f2cdf0 Forwarded: not-needed --- @@ -12,9 +13,9 @@ Forwarded: not-needed client/routinglogic.cpp | 4 6 files changed, 824 insertions(+) ---- monav.orig/client/client.pro -+++ monav/client/client.pro -@@ -27,6 +27,8 @@ SOURCES += main.cpp \ +--- a/client/client.pro ++++ b/client/client.pro +@@ -27,6 +27,8 @@ placechooser.cpp \ globalsettings.cpp \ streetchooser.cpp \ @@ -23,7 +24,7 @@ Forwarded: not-needed worldmapchooser.cpp HEADERS += \ -@@ -57,6 +59,8 @@ HEADERS += \ +@@ -57,6 +59,8 @@ placechooser.h \ globalsettings.h \ streetchooser.h \ @@ -32,9 +33,9 @@ Forwarded: not-needed worldmapchooser.h FORMS += \ ---- monav.orig/client/routinglogic.cpp -+++ monav/client/routinglogic.cpp -@@ -22,6 +22,7 @@ along with MoNav. If not, see <http://w +--- a/client/routinglogic.cpp ++++ b/client/routinglogic.cpp +@@ -22,6 +22,7 @@ #include "mapdata.h" #include "utils/qthelpers.h" #include "logger.h" @@ -42,19 +43,19 @@ Forwarded: not-needed #include <QtDebug> #include <QSettings> -@@ -66,6 +67,9 @@ RoutingLogic::RoutingLogic() : +@@ -66,6 +67,9 @@ #ifndef NOQTMOBILE d->gpsSource = QGeoPositionInfoSource::createDefaultSource( this ); + if ( d->gpsSource == NULL ) -+ d->gpsSource = new GpsdPositionInfoSource( this ); ++ d->gpsSource = GpsdPositionInfoSource::create( this ); + if ( d->gpsSource == NULL ) { qDebug() << "No GPS Sensor found! GPS Updates are not available"; } else { --- /dev/null -+++ monav/client/gpsdpositioninfosource.cpp -@@ -0,0 +1,176 @@ ++++ b/client/gpsdpositioninfosource.cpp +@@ -0,0 +1,188 @@ +/**************************************************************************** +** GpsdPositionInfoSource +** (c) 2011 by Till Harbaum <t...@harbaum.org> @@ -231,9 +232,21 @@ Forwarded: not-needed +int GpsdPositionInfoSource::minimumUpdateInterval() const { + return 1000; +} ++ ++GpsdPositionInfoSource * GpsdPositionInfoSource::create(QObject *parent) ++{ ++ GpsdPositionInfoSource* source = new GpsdPositionInfoSource( parent ); ++ if ( !source->m_tcpSocket->waitForConnected( 100 ) ) ++ { ++ if ( !source->m_tcpSocket->waitForConnected( 100 ) ) ++ source->deleteLater(); ++ return NULL; ++ } ++ return source; ++} --- /dev/null -+++ monav/client/gpsdpositioninfosource.h -@@ -0,0 +1,46 @@ ++++ b/client/gpsdpositioninfosource.h +@@ -0,0 +1,47 @@ +/**************************************************************************** +** GpsdPositionInfoSource +** (c) 2011 by Till Harbaum <t...@harbaum.org> @@ -253,7 +266,7 @@ Forwarded: not-needed + Q_OBJECT + + public: -+ GpsdPositionInfoSource(QObject *parent = 0); ++ static GpsdPositionInfoSource* create(QObject *parent = NULL); + ~GpsdPositionInfoSource(); + + void setUpdateInterval(int msec); @@ -272,6 +285,7 @@ Forwarded: not-needed + void displayError(QAbstractSocket::SocketError); + + private: ++ GpsdPositionInfoSource(QObject *parent = 0); + qreal getReal(const QMap<QString, QVariant> &, const QString &); + void setAttribute(QGeoPositionInfo &, QGeoPositionInfo::Attribute, const QMap<QString, QVariant> &, const QString &); + void parse(const QString &); @@ -281,7 +295,7 @@ Forwarded: not-needed + +#endif --- /dev/null -+++ monav/client/json.cpp ++++ b/client/json.cpp @@ -0,0 +1,433 @@ + +/** @@ -717,7 +731,7 @@ Forwarded: not-needed + return JsonTokenNone; +} --- /dev/null -+++ monav/client/json.h ++++ b/client/json.h @@ -0,0 +1,161 @@ +/** + * \file json.h -- 1.7.5.4
>From 9e74dfff3bff513c1d5e2f59633f80c4838bc0a0 Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors <timo.lindf...@iki.fi> Date: Thu, 21 Jul 2011 11:34:25 +0000 Subject: [PATCH 2/2] Update changelog --- debian/changelog | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/debian/changelog b/debian/changelog index aee487d..83921ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +monav (0.3-4lindi0) unstable; urgency=low + + * Backport fix to avoid freezing if GPSD is not available. + (Closes: #632650) + + -- Timo Juhani Lindfors <timo.lindf...@iki.fi> Thu, 21 Jul 2011 10:07:01 +0000 + monav (0.3-4) unstable; urgency=low * Drop -march=native from the compilation (Closes: #626671) -- 1.7.5.4