Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 367567 | Differences between
and this patch

Collapse All | Expand All

(-)a/plasma/generic/dataengines/geolocation/location_gps.h (+3 lines)
Lines 58-63 public: Link Here
58
58
59
private:
59
private:
60
    Gpsd* m_gpsd;
60
    Gpsd* m_gpsd;
61
#if GPSD_API_MAJOR_VERSION >= 5
62
    gps_data_t* m_gpsdata;
63
#endif
61
};
64
};
62
65
63
#endif
66
#endif
(-)a/plasma/generic/dataengines/geolocation/location_gps.cpp (-3 / +18 lines)
Lines 51-57 void Gpsd::run() Link Here
51
    while (!m_abort) {
51
    while (!m_abort) {
52
        Plasma::DataEngine::Data d;
52
        Plasma::DataEngine::Data d;
53
53
54
#if GPSD_API_MAJOR_VERSION >= 5
55
	if (gps_read(m_gpsdata) != -1) {
56
#else
54
        if (gps_poll(m_gpsdata) != -1) {
57
        if (gps_poll(m_gpsdata) != -1) {
58
#endif
55
            //kDebug() << "poll ok";
59
            //kDebug() << "poll ok";
56
            if (m_gpsdata->online) {
60
            if (m_gpsdata->online) {
57
                //kDebug() << "online";
61
                //kDebug() << "online";
Lines 73-83 void Gpsd::run() Link Here
73
Gps::Gps(QObject* parent, const QVariantList& args)
77
Gps::Gps(QObject* parent, const QVariantList& args)
74
    : GeolocationProvider(parent, args),
78
    : GeolocationProvider(parent, args),
75
      m_gpsd(0)
79
      m_gpsd(0)
80
#if GPSD_API_MAJOR_VERSION >= 5
81
    , m_gpsdata(0)
82
#endif
76
{
83
{
77
    gps_data_t* gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT);
84
#if GPSD_API_MAJOR_VERSION >= 5
78
    if (gpsdata) {
85
    m_gpsdata = new gps_data_t;
86
    gps_open("localhost", DEFAULT_GPSD_PORT, m_gpsdata);
87
#else
88
    gps_data_t* m_gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT);
89
#endif
90
    if (m_gpsdata) {
79
        kDebug() << "gpsd found.";
91
        kDebug() << "gpsd found.";
80
        m_gpsd = new Gpsd(gpsdata);
92
        m_gpsd = new Gpsd(m_gpsdata);
81
        connect(m_gpsd, SIGNAL(dataReady(const Plasma::DataEngine::Data&)),
93
        connect(m_gpsd, SIGNAL(dataReady(const Plasma::DataEngine::Data&)),
82
                this, SIGNAL(setData(const Plasma::DataEngine::Data&)));
94
                this, SIGNAL(setData(const Plasma::DataEngine::Data&)));
83
    } else {
95
    } else {
Lines 90-95 Gps::Gps(QObject* parent, const QVariantList& args) Link Here
90
Gps::~Gps()
102
Gps::~Gps()
91
{
103
{
92
    delete m_gpsd;
104
    delete m_gpsd;
105
#if GPSD_API_MAJOR_VERSION >= 5
106
    delete m_gpsdata;
107
#endif
93
}
108
}
94
109
95
void Gps::update()
110
void Gps::update()

Return to bug 367567