Skip to content

Commit dc697d0

Browse files
committed
Followup 59a0e2
1 parent 59a0e2f commit dc697d0

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

src/plugins/georeferencer/qgsgeorefplugingui.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -493,24 +493,24 @@ void QgsGeorefPluginGui::linkGeorefToQGis( bool link )
493493

494494
// GCPs slots
495495
void 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

516516
void 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
}

src/plugins/georeferencer/qgsgeorefplugingui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
8383

8484
// gcps
8585
void addPoint( const QgsPoint& pixelCoords, const QgsPoint& mapCoords,
86-
bool enable = true, bool refreshCanvas = true/*, bool verbose = true*/ );
86+
bool enable = true, bool finalize = true );
8787
void deleteDataPoint( QPoint pixelCoords );
8888
void deleteDataPoint( int index );
8989
void showCoordDialog( const QgsPoint &pixelCoords );

0 commit comments

Comments
 (0)