[Pkg-osm-maint] Bug#632650: [PATCH] Backport fix to avoid freezing if GPSD is not available.

Timo Juhani Lindfors timo.lindfors at iki.fi
Tue Aug 23 17:59:42 UTC 2011


---
 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: bedlore at 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 <till at 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 <till at 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






More information about the Pkg-osm-maint mailing list