Changeset View
Changeset View
Standalone View
Standalone View
dataengines/geolocation/location_gps.cpp
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "location_gps.h" | 18 | #include "location_gps.h" | ||
19 | #include <QDebug> | 19 | #include "geolocdebug.h" | ||
20 | 20 | | |||
21 | Gpsd::Gpsd(gps_data_t* gpsdata) | 21 | Gpsd::Gpsd(gps_data_t* gpsdata) | ||
22 | : m_gpsdata(gpsdata) | 22 | : m_gpsdata(gpsdata) | ||
23 | , m_abort(false) | 23 | , m_abort(false) | ||
24 | { | 24 | { | ||
25 | } | 25 | } | ||
26 | 26 | | |||
27 | Gpsd::~Gpsd() | 27 | Gpsd::~Gpsd() | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
85 | { | 85 | { | ||
86 | #if GPSD_API_MAJOR_VERSION >= 5 | 86 | #if GPSD_API_MAJOR_VERSION >= 5 | ||
87 | m_gpsdata = new gps_data_t; | 87 | m_gpsdata = new gps_data_t; | ||
88 | if (gps_open("localhost", DEFAULT_GPSD_PORT, m_gpsdata) != -1) { | 88 | if (gps_open("localhost", DEFAULT_GPSD_PORT, m_gpsdata) != -1) { | ||
89 | #else | 89 | #else | ||
90 | gps_data_t* m_gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT); | 90 | gps_data_t* m_gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT); | ||
91 | if (m_gpsdata) { | 91 | if (m_gpsdata) { | ||
92 | #endif | 92 | #endif | ||
93 | qDebug() << "gpsd found."; | 93 | qDebug(DATAENGINE_GEOLOCATION)<< "gpsd found."; | ||
94 | m_gpsd = new Gpsd(m_gpsdata); | 94 | m_gpsd = new Gpsd(m_gpsdata); | ||
95 | connect(m_gpsd, SIGNAL(dataReady(Plasma::DataEngine::Data)), | 95 | connect(m_gpsd, SIGNAL(dataReady(Plasma::DataEngine::Data)), | ||
96 | this, SLOT(setData(Plasma::DataEngine::Data))); | 96 | this, SLOT(setData(Plasma::DataEngine::Data))); | ||
97 | } else { | 97 | } else { | ||
98 | qDebug() << "gpsd not found"; | 98 | qWarning(DATAENGINE_GEOLOCATION) << "gpsd not found"; | ||
meven: Change to qCWarning | |||||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | setIsAvailable(m_gpsd); | 101 | setIsAvailable(m_gpsd); | ||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | Gps::~Gps() | 104 | Gps::~Gps() | ||
105 | { | 105 | { | ||
106 | delete m_gpsd; | 106 | delete m_gpsd; | ||
Show All 15 Lines |
Change to qCWarning