Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix missing (or incorrect use of) emit
Thanks to Clazy
  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent ce4ac07 commit 3abd0fa
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsbrowsermodel.cpp
Expand Up @@ -569,9 +569,9 @@ void QgsBrowserModel::hidePath( QgsDataItem *item )
else
{
int i = mRootItems.indexOf( item );
emit beginRemoveRows( QModelIndex(), i, i );
beginRemoveRows( QModelIndex(), i, i );
mRootItems.remove( i );
item->deleteLater();
emit endRemoveRows();
endRemoveRows();
}
}
4 changes: 2 additions & 2 deletions src/gui/attributetable/qgsfeaturelistmodel.cpp
Expand Up @@ -197,9 +197,9 @@ void QgsFeatureListModel::setInjectNull( bool injectNull )
{
if ( mInjectNull != injectNull )
{
emit beginResetModel();
beginResetModel();
mInjectNull = injectNull;
emit endResetModel();
endResetModel();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -964,7 +964,7 @@ bool QgsAdvancedDigitizingDockWidget::canvasMoveEvent( QgsMapMouseEvent *e )
}
else
{
popWarning();
emit popWarning();
}

// perpendicular/parallel constraint
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgskeyvaluewidget.cpp
Expand Up @@ -31,13 +31,13 @@ void QgsKeyValueWidget::setMap( const QVariantMap &map )
///@cond PRIVATE
void QgsKeyValueModel::setMap( const QVariantMap &map )
{
emit beginResetModel();
beginResetModel();
mLines.clear();
for ( QVariantMap::const_iterator it = map.constBegin(); it != map.constEnd(); ++it )
{
mLines.append( Line( it.key(), it.value() ) );
}
emit endResetModel();
endResetModel();
}

QVariantMap QgsKeyValueModel::map() const
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgslistwidget.cpp
Expand Up @@ -39,9 +39,9 @@ QgsListModel::QgsListModel( QVariant::Type subType, QObject *parent ) :

void QgsListModel::setList( const QVariantList &list )
{
emit beginResetModel();
beginResetModel();
mLines = list;
emit endResetModel();
endResetModel();
}

QVariantList QgsListModel::list() const
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -676,7 +676,7 @@ void QgsMapToolCapture::validateGeometry()
connect( mValidator, &QgsGeometryValidator::errorFound, this, &QgsMapToolCapture::addError );
connect( mValidator, &QThread::finished, this, &QgsMapToolCapture::validationFinished );
mValidator->start();
messageEmitted( tr( "Validation started" ) );
emit messageEmitted( tr( "Validation started" ) );
}

void QgsMapToolCapture::addError( QgsGeometry::Error e )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology/qgsrulebasedrendererwidget.cpp
Expand Up @@ -1227,7 +1227,7 @@ void QgsRuleBasedRendererModel::willAddRules( const QModelIndex &parent, int cou

void QgsRuleBasedRendererModel::finishedAddingRules()
{
emit endInsertRows();
endInsertRows();
}

void QgsRuleBasedRendererModel::setFeatureCounts( const QHash<QgsRuleBasedRenderer::Rule *, QgsRuleBasedRendererCount> &countMap )
Expand Down
60 changes: 30 additions & 30 deletions src/plugins/gps_importer/qgsgpsplugin.cpp
Expand Up @@ -186,12 +186,12 @@ void QgsGPSPlugin::createGPX()

ofs << "<gpx></gpx>" << std::endl;

emit drawVectorLayer( fileName + "?type=track",
fileInfo.baseName() + ", tracks", QStringLiteral( "gpx" ) );
emit drawVectorLayer( fileName + "?type=route",
fileInfo.baseName() + ", routes", QStringLiteral( "gpx" ) );
emit drawVectorLayer( fileName + "?type=waypoint",
fileInfo.baseName() + ", waypoints", QStringLiteral( "gpx" ) );
drawVectorLayer( fileName + "?type=track",
fileInfo.baseName() + ", tracks", QStringLiteral( "gpx" ) );
drawVectorLayer( fileName + "?type=route",
fileInfo.baseName() + ", routes", QStringLiteral( "gpx" ) );
drawVectorLayer( fileName + "?type=waypoint",
fileInfo.baseName() + ", waypoints", QStringLiteral( "gpx" ) );
}
}

Expand Down Expand Up @@ -230,14 +230,14 @@ void QgsGPSPlugin::loadGPXFile( const QString &fileName, bool loadWaypoints, boo

// add the requested layers
if ( loadTracks )
emit drawVectorLayer( fileName + "?type=track",
fileInfo.baseName() + ", tracks", QStringLiteral( "gpx" ) );
drawVectorLayer( fileName + "?type=track",
fileInfo.baseName() + ", tracks", QStringLiteral( "gpx" ) );
if ( loadRoutes )
emit drawVectorLayer( fileName + "?type=route",
fileInfo.baseName() + ", routes", QStringLiteral( "gpx" ) );
drawVectorLayer( fileName + "?type=route",
fileInfo.baseName() + ", routes", QStringLiteral( "gpx" ) );
if ( loadWaypoints )
emit drawVectorLayer( fileName + "?type=waypoint",
fileInfo.baseName() + ", waypoints", QStringLiteral( "gpx" ) );
drawVectorLayer( fileName + "?type=waypoint",
fileInfo.baseName() + ", waypoints", QStringLiteral( "gpx" ) );

emit closeGui();
}
Expand Down Expand Up @@ -297,14 +297,14 @@ void QgsGPSPlugin::importGPSFile( const QString &inputFileName, QgsBabelFormat *

// add the layer
if ( importTracks )
emit drawVectorLayer( outputFileName + "?type=track",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=track",
layerName, QStringLiteral( "gpx" ) );
if ( importRoutes )
emit drawVectorLayer( outputFileName + "?type=route",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=route",
layerName, QStringLiteral( "gpx" ) );
if ( importWaypoints )
emit drawVectorLayer( outputFileName + "?type=waypoint",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=waypoint",
layerName, QStringLiteral( "gpx" ) );

emit closeGui();
}
Expand Down Expand Up @@ -377,16 +377,16 @@ void QgsGPSPlugin::convertGPSFile( const QString &inputFileName,
{
case 0:
case 3:
emit drawVectorLayer( outputFileName + "?type=waypoint",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=waypoint",
layerName, QStringLiteral( "gpx" ) );
break;
case 1:
emit drawVectorLayer( outputFileName + "?type=route",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=route",
layerName, QStringLiteral( "gpx" ) );
break;
case 2:
emit drawVectorLayer( outputFileName + "?type=track",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=track",
layerName, QStringLiteral( "gpx" ) );
break;
default:
QgsDebugMsg( "Illegal conversion index!" );
Expand Down Expand Up @@ -464,14 +464,14 @@ void QgsGPSPlugin::downloadFromGPS( const QString &device, const QString &port,

// add the layer
if ( downloadWaypoints )
emit drawVectorLayer( outputFileName + "?type=waypoint",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=waypoint",
layerName, QStringLiteral( "gpx" ) );
if ( downloadRoutes )
emit drawVectorLayer( outputFileName + "?type=route",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=route",
layerName, QStringLiteral( "gpx" ) );
if ( downloadTracks )
emit drawVectorLayer( outputFileName + "?type=track",
layerName, QStringLiteral( "gpx" ) );
drawVectorLayer( outputFileName + "?type=track",
layerName, QStringLiteral( "gpx" ) );

// everything was OK, remember the device and port for next time
QgsSettings settings;
Expand Down

0 comments on commit 3abd0fa

Please sign in to comment.