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";
21 glatitude->update(gps->get_lat(),
26 void Daemon::set_config() {
27 qDebug() << "Daemon: set_config";
28 glatitude->set_login(setting->value("user","my_username").toString(),
29 setting->value("pass","my_password").toString());
31 gps->config(setting->value("interval",1800).toInt(),
32 setting->value("wait",30).toInt(),
33 setting->value("usegps",false).toBool());
36 void Daemon::daemon_ok() {
37 qDebug() << "Daemon: ok";
40 void Daemon::daemon_error() {
41 qDebug() << "Daemon: no auth";
42 QCoreApplication::exit();