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

Collapse All | Expand All

(-)kdeedu-4.6.5/marble/src/plugins/positionprovider/gpsd//GpsdConnection.cpp (-2 / +18 lines)
Lines 20-25 Link Here
20
20
21
GpsdConnection::GpsdConnection( QObject* parent )
21
GpsdConnection::GpsdConnection( QObject* parent )
22
    : QObject( parent ),
22
    : QObject( parent ),
23
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
24
      m_gpsd( "localhost", DEFAULT_GPSD_PORT ),
25
#endif
23
      m_timer( 0 )
26
      m_timer( 0 )
24
{
27
{
25
    m_oldLocale = setlocale( LC_NUMERIC, NULL );
28
    m_oldLocale = setlocale( LC_NUMERIC, NULL );
Lines 35-42 Link Here
35
void GpsdConnection::initialize()
38
void GpsdConnection::initialize()
36
{
39
{
37
    m_timer.stop();
40
    m_timer.stop();
41
    bool success = false;
42
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
43
    success = true;
44
#else
38
    gps_data_t* data = m_gpsd.open();
45
    gps_data_t* data = m_gpsd.open();
39
    if ( data ) {
46
    success = ( data != 0 );
47
#endif
48
    if ( success ) {
40
        m_status = PositionProviderStatusAcquiring;
49
        m_status = PositionProviderStatusAcquiring;
41
        emit statusChanged( m_status );
50
        emit statusChanged( m_status );
42
51
Lines 81-87 Link Here
81
90
82
void GpsdConnection::update()
91
void GpsdConnection::update()
83
{
92
{
84
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( PACKET_SET )
93
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
94
    if ( m_gpsd.waiting( 0 ) ) {
95
        gps_data_t* data = m_gpsd.read();
96
        if ( data && data->set & PACKET_SET ) {
97
            emit gpsdInfo( *data );
98
        }
99
    }
100
#elif defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( PACKET_SET )
85
    if ( m_gpsd.waiting() ) {
101
    if ( m_gpsd.waiting() ) {
86
        gps_data_t* data = m_gpsd.poll();
102
        gps_data_t* data = m_gpsd.poll();
87
        if ( data && data->set & PACKET_SET ) {
103
        if ( data && data->set & PACKET_SET ) {

Return to bug 367571