3 Daemon::Daemon(QObject *parent) : QObject(parent) {
4 setting = new QSettings();
5 gps = new GpsMaemo5(this);
6 glatitude = new GoogleLatitude(this);
8 connect(gps, SIGNAL(fix()), this, SLOT(set()));
9 connect(glatitude, SIGNAL(glat_ok()), this, SLOT(daemon_ok()));
10 connect(glatitude, SIGNAL(glat_error()), this, SLOT(daemon_error()));
13 if ( 0 ) gps->config(15, 3, 0);
19 qDebug() << "Daemon: set";
20 glatitude->update(gps->get_lat(),
25 void Daemon::set_config() {
26 qDebug() << "Daemon: set_config";
27 glatitude->set_login(setting->value("user","my_username").toString(),
28 setting->value("pass","my_password").toString());
30 gps->config(setting->value("interval",1800).toInt(),
31 setting->value("wait",30).toInt(),
32 setting->value("usegps",false).toBool());
35 void Daemon::daemon_ok() {
36 qDebug() << "Daemon: ok";
39 void Daemon::daemon_error() {
40 qDebug() << "Daemon: no auth";
41 QCoreApplication::exit();