OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.2 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../kdeedu/kdeedu-4.6.2-gpsd-api-v5.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Description: Support the API v5 which is used by recent versions of gpsd
  17. --- kdeedu-4.6.2/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp.orig 2011-05-03 12:12:45.920001223 +0200
  18. +++ kdeedu-4.6.2/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp 2011-05-03 12:17:24.236001222 +0200
  19. @@ -20,6 +20,9 @@
  20. GpsdConnection::GpsdConnection( QObject* parent )
  21. : QObject( parent ),
  22. +#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
  23. + m_gpsd("localhost", DEFAULT_GPSD_PORT),
  24. +#endif
  25. m_timer( 0 )
  26. {
  27. m_oldLocale = setlocale( LC_NUMERIC, NULL );
  28. @@ -35,7 +38,11 @@
  29. void GpsdConnection::initialize()
  30. {
  31. m_timer.stop();
  32. +#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
  33. + gps_data_t* data;
  34. +#else
  35. gps_data_t* data = m_gpsd.open();
  36. +#endif
  37. if ( data ) {
  38. m_status = PositionProviderStatusAcquiring;
  39. emit statusChanged( m_status );
  40. @@ -82,8 +89,16 @@
  41. void GpsdConnection::update()
  42. {
  43. #if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( PACKET_SET )
  44. +#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
  45. + if ( m_gpsd.waiting(0) ) {
  46. +#else
  47. if ( m_gpsd.waiting() ) {
  48. +#endif
  49. +#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
  50. + gps_data_t* data = m_gpsd.read();
  51. +#else
  52. gps_data_t* data = m_gpsd.poll();
  53. +#endif
  54. if ( data && data->set & PACKET_SET ) {
  55. emit gpsdInfo( *data );
  56. }