Skip to content

Commit

Permalink
gps information widget:
Browse files Browse the repository at this point in the history
* fix crash when satellite markers are remove (fixes #12393)
* also fixes serial port detection on unix

(cherry picked from commit 014f070)
  • Loading branch information
jef-n committed Jun 29, 2015
1 parent cafbef1 commit fab092a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/app/gps/qgsgpsinformationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,10 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
#if (WITH_QWTPOLAR)
if ( mStackedWidget->currentIndex() == 2 && info.satInfoComplete ) //satellites
{
qDeleteAll( mMarkerList );
while ( !mMarkerList.isEmpty() )
{
delete mMarkerList.takeFirst();
}
} //satellites
#endif
if ( mStackedWidget->currentIndex() == 4 ) //debug
Expand Down
8 changes: 4 additions & 4 deletions src/core/gps/qgsgpsdetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()
#ifdef HAVE_QT_MOBILITY_LOCATION
devs << QPair<QString, QString>( "internalGPS", tr( "internal GPS" ) );
#endif

// try local gpsd first
devs << QPair<QString, QString>( "localhost:2947:", tr( "local gpsd" ) );

#ifdef linux
#ifdef Q_OS_LINUX
// look for linux serial devices
foreach ( QString linuxDev, QStringList() << "/dev/ttyS%1" << "/dev/ttyUSB%1" << "/dev/rfcomm%1" << "/dev/ttyACM%1" )
{
Expand All @@ -55,7 +56,7 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()
}
#endif

#ifdef __FreeBSD__ // freebsd
#ifdef Q_OS_FREEBSD
// and freebsd devices (untested)
foreach ( QString freebsdDev, QStringList() << "/dev/cuaa%1" << "/dev/ucom%1" )
{
Expand All @@ -69,7 +70,7 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()
}
#endif

#ifdef sparc
#ifdef Q_OS_SOLARIS
// and solaris devices (also untested)
QString solarisDev( "/dev/cua/%1" );
for ( char i = 'a'; i < 'k'; ++i )
Expand Down Expand Up @@ -161,7 +162,6 @@ void QgsGPSDetector::advance()
qWarning( "QT_MOBILITY_LOCATION not found and mPortList matches internalGPS, this should never happen" );
#endif
}

else
{
QextSerialPort *serial = new QextSerialPort( mPortList[ mPortIndex ].first, QextSerialPort::EventDriven );
Expand Down

0 comments on commit fab092a

Please sign in to comment.