Added error handling to listing of users and showing of user information.
[speedfreak] / Client / maemo5location.cpp
index d869419..535cef3 100755 (executable)
@@ -9,6 +9,7 @@
 //#ifdef Q_WS_MAEMO_5
 #include "maemo5locationprivate.h"
 #include "maemo5location.h"
+#include <QDebug>
 
 /**
   *Default constructor of this class.
@@ -16,6 +17,7 @@
   */
 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
 {
+    qDebug() << "__Maemo5Location";
     ptr = new Maemo5LocationPrivate(this);
 
     connect(ptr, SIGNAL(agnss()), this, SIGNAL(agnss()));
@@ -23,9 +25,9 @@ Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
     connect(ptr, SIGNAL(locationUpdated()), this, SIGNAL(locationUpdated()));
     connect(ptr, SIGNAL(gps_connected()), this, SIGNAL(gps_connected()));
     connect(ptr, SIGNAL(gps_disconnected()), this, SIGNAL(gps_disconnected()));
-    connect(ptr, SIGNAL(gps_err(int)), this, SIGNAL(gps_error(int)));
+    connect(ptr, SIGNAL(gps_error(int)), this, SIGNAL(gps_error(int)));
     connect(ptr, SIGNAL(gpsd_running()), this, SIGNAL(gpsd_running()));
-    connect(ptr, SIGNAL(gpsd_stopped()), this, SIGNAL(gpsd_stopped())); 
+    connect(ptr, SIGNAL(gpsd_stopped()), this, SIGNAL(gpsd_stopped()));
 }
 
 /**
@@ -33,7 +35,9 @@ Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
   */
 Maemo5Location::~Maemo5Location()
 {
-    delete ptr;
+    qDebug() << "__~Maemo5Location";
+    if(ptr)
+        delete ptr;
 }
 
 /**
@@ -41,6 +45,7 @@ Maemo5Location::~Maemo5Location()
   */
 void Maemo5Location::startPollingGPS()
 {
+    qDebug() << "__Maemo5Location: startPollingGPS";
     ptr->get_agnss();
 }
 
@@ -49,6 +54,7 @@ void Maemo5Location::startPollingGPS()
   */
 void Maemo5Location::stopPollingGPS()
 {
+    qDebug() << "__Maemo5Location: stopPollingGPS";
     ptr->stop();
 }