1 /****************************************************************************
3 ** Copyright (C) 2011 Tito Eritja Real <jtitoo@gmail.com>
5 ** This program is free software: you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation, either version 3 of the License, or
8 ** (at your option) any later version.
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ****************************************************************************/
22 Settings::Settings(Log *log)
23 :servicesStarted(false),isConfigured(false),log(log),autosaveInterval(5){
25 horizontalAccuracy=ACCURACY_H_MIN; //200
26 verticalAccuracy=ACCURACY_V_MIN; //100
27 trackToSniffColor="#ff0000";
31 Settings::Settings(const Settings& set, Log *log):
32 activity(set.activity),gpsInterval(set.gpsInterval),mapType(set.mapType),isOnline(set.isOnline)
33 ,xmlFile(set.xmlFile),servicesStarted(set.servicesStarted),isConfigured(set.isConfigured),log(log){
34 log->debug("--Settings 2n constuctor ---");
35 log->debug("isConfigured:" + isConfigured);
36 horizontalAccuracy=ACCURACY_H_MIN;
37 verticalAccuracy=ACCURACY_V_MIN;
38 trackToSniffColor="#ff0000";
44 QString Settings::toString(){
49 Settings& Settings::operator= (const Settings &set){
50 activity=set.activity;
51 gpsInterval=set.gpsInterval;
53 isOnline=set.isOnline;
55 servicesStarted=set.servicesStarted;
60 int operator== (const Settings& a, const Settings& b)
62 if (a.activity==b.activity&&a.gpsInterval==b.gpsInterval&&a.mapType==b.mapType&&a.isOnline==b.isOnline&&a.xmlFile==b.xmlFile &&a.servicesStarted==b.servicesStarted)
68 int operator!= (const Settings& a, const Settings& b)
70 if (a.activity!=b.activity||a.gpsInterval!=b.gpsInterval||a.mapType!=b.mapType||a.isOnline!=b.isOnline||a.xmlFile!=b.xmlFile || a.servicesStarted!=b.servicesStarted)
76 QDataStream& operator << (QDataStream &stream, const Settings &a)
78 QString settings = QString("Settings{latitude=%1, longitude=%2}").arg(a.activity).arg(a.gpsInterval);