@@ -493,24 +493,24 @@ void QgsGeorefPluginGui::linkGeorefToQGis( bool link )
493493
494494// GCPs slots
495495void QgsGeorefPluginGui::addPoint ( const QgsPoint& pixelCoords, const QgsPoint& mapCoords,
496- bool enable, bool refreshCanvas /* , bool verbose */ )
496+ bool enable, bool finalize )
497497{
498498 QgsGeorefDataPoint* pnt = new QgsGeorefDataPoint ( mCanvas , mIface ->mapCanvas (),
499499 pixelCoords, mapCoords, enable );
500500 mPoints .append ( pnt );
501501 mGCPsDirty = true ;
502- mGCPListWidget ->setGCPList ( &mPoints );
503- if ( refreshCanvas )
502+ if ( finalize )
504503 {
504+ mGCPListWidget ->setGCPList ( &mPoints );
505505 mCanvas ->refresh ();
506506 mIface ->mapCanvas ()->refresh ();
507507 }
508508
509- connect ( mCanvas , SIGNAL ( extentsChanged () ) , pnt, SLOT ( updateCoords () ) );
510- updateGeorefTransform ();
511-
512- // if (verbose)
513- // logRequaredGCPs();
509+ connect ( mCanvas , &QgsMapCanvas:: extentsChanged, pnt, &QgsGeorefDataPoint:: updateCoords );
510+ if ( finalize )
511+ {
512+ updateGeorefTransform ();
513+ }
514514}
515515
516516void QgsGeorefPluginGui::deleteDataPoint ( QPoint coords )
@@ -588,8 +588,9 @@ void QgsGeorefPluginGui::showCoordDialog( const QgsPoint &pixelCoords )
588588 if ( mLayer && !mMapCoordsDialog )
589589 {
590590 mMapCoordsDialog = new QgsMapCoordsDialog ( mIface ->mapCanvas (), pixelCoords, this );
591- connect ( mMapCoordsDialog , SIGNAL ( pointAdded ( const QgsPoint &, const QgsPoint & ) ),
592- this , SLOT ( addPoint ( const QgsPoint &, const QgsPoint & ) ) );
591+ connect ( mMapCoordsDialog , &QgsMapCoordsDialog::pointAdded,
592+ [this ]( const QgsPoint &a, const QgsPoint & b ) { this ->addPoint ( a, b ); }
593+ );
593594 mMapCoordsDialog ->show ();
594595 }
595596}
@@ -1258,18 +1259,13 @@ bool QgsGeorefPluginGui::loadGCPs( /*bool verbose*/ )
12581259
12591260 QgsPoint mapCoords ( ls.at ( 0 ).toDouble (), ls.at ( 1 ).toDouble () ); // map x,y
12601261 QgsPoint pixelCoords ( ls.at ( 2 ).toDouble (), ls.at ( 3 ).toDouble () ); // pixel x,y
1261- QgsGeorefDataPoint* pnt;
12621262 if ( ls.count () == 5 )
12631263 {
12641264 bool enable = ls.at ( 4 ).toInt ();
1265- pnt = new QgsGeorefDataPoint ( mCanvas , mIface -> mapCanvas (), pixelCoords, mapCoords, enable );
1265+ addPoint ( pixelCoords, mapCoords, enable, false );
12661266 }
12671267 else
1268- pnt = new QgsGeorefDataPoint ( mCanvas , mIface ->mapCanvas (), pixelCoords, mapCoords, true );
1269-
1270- mPoints .append ( pnt );
1271- connect ( mCanvas , SIGNAL ( extentsChanged () ), pnt, SLOT ( updateCoords () ) );
1272- mGCPsDirty = true ;
1268+ addPoint ( pixelCoords, mapCoords, true , false );
12731269
12741270 ++i;
12751271 }
0 commit comments