Skip to content
Permalink
Browse files

Fix missing (or incorrect use of) emit

Thanks to Clazy
  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent ce4ac07 commit 3abd0fa5309f833a833ffe5f8f87073552e6377c
@@ -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();
}
}
@@ -197,9 +197,9 @@ void QgsFeatureListModel::setInjectNull( bool injectNull )
{
if ( mInjectNull != injectNull )
{
emit beginResetModel();
beginResetModel();
mInjectNull = injectNull;
emit endResetModel();
endResetModel();
}
}

@@ -964,7 +964,7 @@ bool QgsAdvancedDigitizingDockWidget::canvasMoveEvent( QgsMapMouseEvent *e )
}
else
{
popWarning();
emit popWarning();
}

// perpendicular/parallel constraint
@@ -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
@@ -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
@@ -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 )
@@ -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 )
@@ -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" ) );
}
}

@@ -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();
}
@@ -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();
}
@@ -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!" );
@@ -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;

0 comments on commit 3abd0fa

Please sign in to comment.
You can’t perform that action at this time.