[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/lib/gps
From:       Andrew Manson <g.real.ate () gmail ! com>
Date:       2009-05-04 11:50:45
Message-ID: 1241437845.487569.31549.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 963279 by mansona:

creating a signal that notifies with the new current location


 M  +8 -3      GpsTracking.cpp  
 M  +6 -0      GpsTracking.h  


--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsTracking.cpp #963278:963279
@@ -43,6 +43,8 @@
     //for ip address evaluation
     connect( &host, SIGNAL( done(  bool ) ),
              this,  SLOT( getData( bool ) ) ) ;
+    connect( this, SIGNAL(gpsLocation(GeoDataCoordinates)),
+             this, SLOT(notifyPosition(GeoDataCoordinates)) );
     m_downloadFinished = false;
 
 #ifdef HAVE_LIBGPS
@@ -139,6 +141,11 @@
     }
 }
 
+void GpsTracking::notifyPosition( GeoDataCoordinates pos )
+{
+    qDebug() << "Position from gpsd: " << pos.toString();
+}
+
 void GpsTracking::updateIp( )
 {
 //         QTextStream out(&gmlFile);
@@ -202,9 +209,6 @@
             m_gpsTracking->setPosition( m_gpsdData->fix.latitude,
                                         m_gpsdData->fix.longitude );
 
-            qDebug() << "Position from gpsd: " << m_gpsdData->fix.latitude
-                << m_gpsdData->fix.longitude;
-
             if (m_gpsTrackSeg == 0 ){
                 m_gpsTrackSeg = new TrackSegment();
                 m_gpsTrack->append( m_gpsTrackSeg );
@@ -216,6 +220,7 @@
                 m_gpsPreviousPosition = m_gpsCurrentPosition;
                 m_gpsCurrentPosition = new TrackPoint( *m_gpsTracking);
                 reg = genRegion( canvasSize, viewParams );
+                emit gpsLocation( m_gpsTracking->position() );
                 return true;
             } else {
                 return false;
--- trunk/KDE/kdeedu/marble/src/lib/gps/GpsTracking.h #963278:963279
@@ -17,6 +17,7 @@
 #include <QtCore/QTemporaryFile>
 #include <QtNetwork/QHttp>
 
+
 #include "config-libgps.h" // krazy:exclude=includes
 
 
@@ -34,6 +35,7 @@
 class TrackSegment;
 class ViewParams;
 class Waypoint;
+class GeoDataCoordinates;
 
 /**
 	@author Andrew Manson <g.real.ate@gmail.com>
@@ -94,7 +96,11 @@
  public slots:
     void  updateIp( );
     void  getData( bool error );
+    void  notifyPosition( GeoDataCoordinates );
 
+Q_SIGNALS:
+    void  gpsLocation( GeoDataCoordinates );
+
  private:
     //used to draw the arrow in gps tracking
     GpxFile             *m_currentGpx;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic