X-Git-Url: http://git.maemo.org/git/?p=googlelatitude;a=blobdiff_plain;f=src%2Fgps.cpp;h=e5c88693af92607c1f6828b1fe0a407d41ad1369;hp=833e4386d4a4231e39aa9fc538c1c89cc2b63d1b;hb=f66076c2991b0519cde383b2d09167333d55f5d6;hpb=02be583c183b90011cf9eb4b3f9a069ab2b6a8b7 diff --git a/src/gps.cpp b/src/gps.cpp index 833e438..e5c8869 100644 --- a/src/gps.cpp +++ b/src/gps.cpp @@ -3,7 +3,7 @@ GpsMaemo5::GpsMaemo5(QObject *parent) : QObject(parent), latitude(0), longitude(0), accuracy(0), - interval(1800), wait(30), usegps(false), + interval(1800), wait(30), method("cell"), emitfix(false), stopgps(true) { #ifdef Q_WS_MAEMO_5 control = location_gpsd_control_get_default(); @@ -32,9 +32,14 @@ void GpsMaemo5::refresh() { #endif #ifdef Q_WS_MAEMO_5 - g_object_set(G_OBJECT(control), "preferred-method", LOCATION_METHOD_ACWP, NULL); - if (usegps) { + if ( method == QString("cell") ) { + g_object_set(G_OBJECT(control), "preferred-method", LOCATION_METHOD_ACWP, NULL); + } else if ( method == QString("both") ) { + g_object_set(G_OBJECT(control), "preferred-method", LOCATION_METHOD_USER_SELECTED, NULL); + } else if ( method == QString("agps") ) { g_object_set(G_OBJECT(control), "preferred-method", LOCATION_METHOD_AGNSS, NULL); + } else { + g_object_set(G_OBJECT(control), "preferred-method", LOCATION_METHOD_ACWP, NULL); } location_gpsd_control_start(control); #else @@ -61,12 +66,12 @@ void GpsMaemo5::forcestop() { stop(); } -int GpsMaemo5::config(int i, int w, bool g) { +int GpsMaemo5::config(int i, int w, QString m) { qDebug() << "GpsMaemo5: config"; stopgps = false; interval = i; wait = w; - usegps = g; + method = m; return 0; }