Skip to content

Commit

Permalink
Merge pull request #60061 from qgis/backport-59903-to-release-3_40
Browse files Browse the repository at this point in the history
[Backport release-3_40] [Georeferencer] Fix setting target CRS (Fix #59902)
  • Loading branch information
rouault authored Jan 7, 2025
2 parents 51491b6 + 0f66173 commit 3406511
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/georeferencer/qgsgeorefmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const QgsSettingsEntryString *QgsGeoreferencerMainWindow::settingLastSourceFolde

const QgsSettingsEntryString *QgsGeoreferencerMainWindow::settingLastRasterFileFilter = new QgsSettingsEntryString( QStringLiteral( "last-raster-file-filter" ), sTreeGeoreferencer, QString(), QObject::tr( "Last used raster file filter for georeferencer source files" ) );

const QgsSettingsEntryString *QgsGeoreferencerMainWindow::settingLastTargetCrs = new QgsSettingsEntryString( QStringLiteral( "last-target-crs" ), sTreeGeoreferencer, QString(), QObject::tr( "Last used georeferencer target CRS" ) );

QgsGeorefDockWidget::QgsGeorefDockWidget( const QString &title, QWidget *parent, Qt::WindowFlags flags )
: QgsDockWidget( title, parent, flags )
{
Expand All @@ -108,9 +110,6 @@ QgsGeoreferencerMainWindow::QgsGeoreferencerMainWindow( QWidget *parent, Qt::Win
mCentralLayout->setContentsMargins( 0, 0, 0, 0 );

QgsSettings settings;
// default to last used target CRS
QString targetCRSString = settings.value( QStringLiteral( "/Plugin-GeoReferencer/targetsrs" ) ).toString();
mTargetCrs = QgsCoordinateReferenceSystem( targetCRSString );

createActions();
createActionGroups();
Expand Down Expand Up @@ -1376,6 +1375,7 @@ void QgsGeoreferencerMainWindow::readSettings()
mTransformMethod = settingTransformMethod->value();
mSaveGcp = settingSaveGcps->value();
mLoadInQgis = settingLoadInProject->value();
mTargetCrs = QgsCoordinateReferenceSystem( settingLastTargetCrs->value() );
}

void QgsGeoreferencerMainWindow::writeSettings()
Expand All @@ -1389,6 +1389,7 @@ void QgsGeoreferencerMainWindow::writeSettings()
settingUseZeroForTransparent->setValue( mUseZeroForTrans );
settingSaveGcps->setValue( mSaveGcp );
settingLoadInProject->setValue( mLoadInQgis );
settingLastTargetCrs->setValue( mTargetCrs.authid() );
}

bool QgsGeoreferencerMainWindow::loadGCPs( QString &error )
Expand Down
1 change: 1 addition & 0 deletions src/app/georeferencer/qgsgeorefmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class APP_EXPORT QgsGeoreferencerMainWindow : public QMainWindow, private Ui::Qg
static const QgsSettingsEntryBool *settingLoadInProject;
static const QgsSettingsEntryString *settingLastSourceFolder;
static const QgsSettingsEntryString *settingLastRasterFileFilter;
static const QgsSettingsEntryString *settingLastTargetCrs;

QgsGeoreferencerMainWindow( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() );
~QgsGeoreferencerMainWindow() override;
Expand Down

0 comments on commit 3406511

Please sign in to comment.