Merge branch 'package'
[speedfreak] / Client / maemo5location.cpp
index a8065fd..9e953e2 100755 (executable)
@@ -9,13 +9,16 @@
 //#ifdef Q_WS_MAEMO_5
 #include "maemo5locationprivate.h"
 #include "maemo5location.h"
+#include <QDebug>
 
 /**
-  *Default constructor of this class.
-  *@param QObject pointer to parent object. By default the value is NULL.
+  * Default constructor of this class.
+  *
+  * @param QObject pointer to parent object. By default the value is NULL.
   */
 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
 {
+    qDebug() << "__Maemo5Location";
     ptr = new Maemo5LocationPrivate(this);
 
     connect(ptr, SIGNAL(agnss()), this, SIGNAL(agnss()));
@@ -29,31 +32,37 @@ Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
 }
 
 /**
-  *Destructor of this class. Should be used to release all allocated resources.
+  * Destructor of this class. Should be used to release all allocated resources.
   */
 Maemo5Location::~Maemo5Location()
 {
-    delete ptr;
+    qDebug() << "__~Maemo5Location";
+    if(ptr)
+        delete ptr;
 }
 
 /**
-  *Start polling gps.
+  * Start polling gps.
   */
 void Maemo5Location::startPollingGPS()
 {
+    qDebug() << "__Maemo5Location: startPollingGPS";
     ptr->get_agnss();
 }
 
 /**
-  *Stop polling gps.
+  * Stop polling gps.
   */
 void Maemo5Location::stopPollingGPS()
 {
+    qDebug() << "__Maemo5Location: stopPollingGPS";
     ptr->stop();
 }
 
 /**
-  *Returns number of satellites in use.
+  * Get number of satellites in use.
+  *
+  * @return int satellites in use
   */
 int Maemo5Location::getSatellitesInUse()
 {
@@ -61,7 +70,9 @@ int Maemo5Location::getSatellitesInUse()
 }
 
 /**
-  *Returns number of satellites in view.
+  * Get number of satellites in view.
+  *
+  * @return int satellites in view
   */
 int Maemo5Location::getSatellitesInView()
 {
@@ -69,7 +80,9 @@ int Maemo5Location::getSatellitesInView()
 }
 
 /**
-  *Returns average signal strength of satellites which are in use.
+  * Get average signal strength of satellites which are in use.
+  *
+  * @return int signal strength
   */
 int Maemo5Location::getSignalStrength()
 {
@@ -77,7 +90,9 @@ int Maemo5Location::getSignalStrength()
 }
 
 /**
-  *Returns gps online.
+  * Get gps online.
+  *
+  * @return bool gps online
   */
 bool Maemo5Location::getGpsOnline()
 {
@@ -85,7 +100,9 @@ bool Maemo5Location::getGpsOnline()
 }
 
 /**
-  *Returns latitude.
+  * Get latitude.
+  *
+  * @return double latitude
   */
 double Maemo5Location::getLatitude()
 {
@@ -93,7 +110,9 @@ double Maemo5Location::getLatitude()
 }
 
 /**
-  *Returns longitude.
+  * Get longitude.
+  *
+  * @return double longitude
   */
 double Maemo5Location::getLongitude()
 {
@@ -101,7 +120,9 @@ double Maemo5Location::getLongitude()
 }
 
 /**
-  *Returns timestamp of the update in seconds.
+  * Get timestamp of the update in seconds.
+  *
+  * @return double time
   */
 double Maemo5Location::getTime()
 {
@@ -109,7 +130,9 @@ double Maemo5Location::getTime()
 }
 
 /**
-  *Returns time accuracy in seconds.
+  * Get time accuracy in seconds.
+  *
+  * @return double ept
   */
 double Maemo5Location::getEpt()
 {
@@ -117,7 +140,9 @@ double Maemo5Location::getEpt()
 }
 
 /**
-  *Returns horizontal position accuracy in cm.
+  * Get horizontal position accuracy in cm.
+  *
+  * @return double eph
   */
 double Maemo5Location::getEph()
 {
@@ -125,7 +150,9 @@ double Maemo5Location::getEph()
 }
 
 /**
-  *Returns fix altitude in meters.
+  * Get fix altitude in meters.
+  *
+  * @return double altitude
   */
 double Maemo5Location::getAltitude()
 {
@@ -133,7 +160,9 @@ double Maemo5Location::getAltitude()
 }
 
 /**
-  *Returns altitude accuracy in meters.
+  * Get altitude accuracy in meters.
+  *
+  * @return double epv
   */
 double Maemo5Location::getEpv()
 {
@@ -141,7 +170,9 @@ double Maemo5Location::getEpv()
 }
 
 /**
-  *Returns direction of motion in degrees(0-359).
+  * Get direction of motion in degrees(0-359).
+  *
+  * @return double track
   */
 double Maemo5Location::getTrack()
 {
@@ -149,7 +180,9 @@ double Maemo5Location::getTrack()
 }
 
 /**
-  *Returns track accuracy in degrees.
+  * Get track accuracy in degrees.
+  *
+  * @return double epd
   */
 double Maemo5Location::getEpd()
 {
@@ -157,7 +190,9 @@ double Maemo5Location::getEpd()
 }
 
 /**
-  *Returns current speed in km/h.
+  * Get current speed in km/h.
+  *
+  * @return double speed
   */
 double Maemo5Location::getSpeed()
 {
@@ -165,7 +200,9 @@ double Maemo5Location::getSpeed()
 }
 
 /**
-  *Returns speed accuracy in km/h.
+  * Get speed accuracy in km/h.
+  *
+  * @return double eps
   */
 double Maemo5Location::getEps()
 {
@@ -173,7 +210,9 @@ double Maemo5Location::getEps()
 }
 
 /**
-  *Returns current rate of climb in m/s.
+  * Get current rate of climb in m/s.
+  *
+  * @return double climb
   */
 double Maemo5Location::getClimb()
 {
@@ -181,7 +220,9 @@ double Maemo5Location::getClimb()
 }
 
 /**
-  *Returns climb accuracy in m/s.
+  * Get climb accuracy in m/s.
+  *
+  * @return double epc
   */
 double Maemo5Location::getEpc()
 {
@@ -189,11 +230,13 @@ double Maemo5Location::getEpc()
 }
 
 /**
-  *Returns distance between two points in kilometers.
-  *@param latitude of first point
-  *@param longitude of first point
-  *@param latitude of second point
-  *@param longitude of second point
+  * Get distance between two points in kilometers.
+  *
+  * @param double latitude of first point
+  * @param double longitude of first point
+  * @param double latitude of second point
+  * @param double longitude of second point
+  * @return double distance
   */
 double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
 {