Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Georeferencer] Fix setting target CRS (Fix #59902) #59903

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading