1 |
dilfridge 11/05/28 22:06:43 |
2 |
|
3 |
Added: plasma-workspace-4.6.3-gpsdapi.patch |
4 |
Log: |
5 |
Fix compilation against sci-geosciences/gpsd-2.96, bug 367567 |
6 |
|
7 |
(Portage version: 2.1.9.49/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 kde-base/plasma-workspace/files/plasma-workspace-4.6.3-gpsdapi.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/plasma-workspace/files/plasma-workspace-4.6.3-gpsdapi.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/plasma-workspace/files/plasma-workspace-4.6.3-gpsdapi.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: plasma-workspace-4.6.3-gpsdapi.patch |
16 |
=================================================================== |
17 |
From: Rafael Fernández López <ereslibre@×××.org> |
18 |
Date: Thu, 28 Apr 2011 11:35:53 +0000 |
19 |
Subject: gpsd api has changed and for GPSD_API_MAJOR_VERSION >=5 there are |
20 |
X-Git-Url: http://quickgit.kde.org/?p=kde-workspace.git&a=commitdiff&h=a3009dd96e8519bcc205d75c29e18bbbb81fce03 |
21 |
--- |
22 |
gpsd api has changed and for GPSD_API_MAJOR_VERSION >=5 there are |
23 |
some calls that are slightly different. Make the dataengine compile |
24 |
against this version and previous one by adding conditional code. |
25 |
|
26 |
REVIEW: 101247 |
27 |
--- |
28 |
|
29 |
|
30 |
--- a/plasma/generic/dataengines/geolocation/location_gps.cpp |
31 |
+++ b/plasma/generic/dataengines/geolocation/location_gps.cpp |
32 |
@@ -51,7 +51,11 @@ void Gpsd::run() |
33 |
while (!m_abort) { |
34 |
Plasma::DataEngine::Data d; |
35 |
|
36 |
+#if GPSD_API_MAJOR_VERSION >= 5 |
37 |
+ if (gps_read(m_gpsdata) != -1) { |
38 |
+#else |
39 |
if (gps_poll(m_gpsdata) != -1) { |
40 |
+#endif |
41 |
//kDebug() << "poll ok"; |
42 |
if (m_gpsdata->online) { |
43 |
//kDebug() << "online"; |
44 |
@@ -73,11 +77,19 @@ void Gpsd::run() |
45 |
Gps::Gps(QObject* parent, const QVariantList& args) |
46 |
: GeolocationProvider(parent, args), |
47 |
m_gpsd(0) |
48 |
+#if GPSD_API_MAJOR_VERSION >= 5 |
49 |
+ , m_gpsdata(0) |
50 |
+#endif |
51 |
{ |
52 |
- gps_data_t* gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT); |
53 |
- if (gpsdata) { |
54 |
+#if GPSD_API_MAJOR_VERSION >= 5 |
55 |
+ m_gpsdata = new gps_data_t; |
56 |
+ gps_open("localhost", DEFAULT_GPSD_PORT, m_gpsdata); |
57 |
+#else |
58 |
+ gps_data_t* m_gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT); |
59 |
+#endif |
60 |
+ if (m_gpsdata) { |
61 |
kDebug() << "gpsd found."; |
62 |
- m_gpsd = new Gpsd(gpsdata); |
63 |
+ m_gpsd = new Gpsd(m_gpsdata); |
64 |
connect(m_gpsd, SIGNAL(dataReady(const Plasma::DataEngine::Data&)), |
65 |
this, SIGNAL(setData(const Plasma::DataEngine::Data&))); |
66 |
} else { |
67 |
@@ -90,6 +102,9 @@ Gps::Gps(QObject* parent, const QVariant |
68 |
Gps::~Gps() |
69 |
{ |
70 |
delete m_gpsd; |
71 |
+#if GPSD_API_MAJOR_VERSION >= 5 |
72 |
+ delete m_gpsdata; |
73 |
+#endif |
74 |
} |
75 |
|
76 |
void Gps::update() |
77 |
|
78 |
--- a/plasma/generic/dataengines/geolocation/location_gps.h |
79 |
+++ b/plasma/generic/dataengines/geolocation/location_gps.h |
80 |
@@ -58,6 +58,9 @@ public: |
81 |
|
82 |
private: |
83 |
Gpsd* m_gpsd; |
84 |
+#if GPSD_API_MAJOR_VERSION >= 5 |
85 |
+ gps_data_t* m_gpsdata; |
86 |
+#endif |
87 |
}; |
88 |
|
89 |
#endif |