Skip to content
Permalink
Browse files

Correctly save last used style import/export path

  • Loading branch information
nyalldawson committed Oct 23, 2018
1 parent cb08cd2 commit 8e4d5d564d09ea6d6e1007e0b76db3b1cfb44c99
Showing with 11 additions and 1 deletion.
  1. +5 −1 src/app/qgsvectorlayerloadstyledialog.cpp
  2. +6 −0 src/app/qgsvectorlayersavestyledialog.cpp
@@ -68,9 +68,13 @@ QgsVectorLayerLoadStyleDialog::QgsVectorLayerLoadStyleDialog( QgsVectorLayer *la
mFileWidget->setFilter( tr( "QGIS Layer Style File, SLD File" ) + QStringLiteral( " (*.qml *.sld)" ) );
mFileWidget->setStorageMode( QgsFileWidget::GetFile );
mFileWidget->setDefaultRoot( myLastUsedDir );
connect( mFileWidget, &QgsFileWidget::fileChanged, this, [ = ]( const QString & )
connect( mFileWidget, &QgsFileWidget::fileChanged, this, [ = ]( const QString & path )
{
mStyleCategoriesListView->setEnabled( currentStyleType() != QgsVectorLayerProperties::SLD );
QgsSettings settings;
QFileInfo tmplFileInfo( path );
settings.setValue( QStringLiteral( "style/lastStyleDir" ), tmplFileInfo.absolutePath() );

updateLoadButtonState();
} );

@@ -68,6 +68,12 @@ QgsVectorLayerSaveStyleDialog::QgsVectorLayerSaveStyleDialog( QgsVectorLayer *la
connect( mFileWidget, &QgsFileWidget::fileChanged, this, &QgsVectorLayerSaveStyleDialog::updateSaveButtonState );
mFileWidget->setStorageMode( QgsFileWidget::SaveFile );
mFileWidget->setDefaultRoot( myLastUsedDir );
connect( mFileWidget, &QgsFileWidget::fileChanged, this, [ = ]( const QString & path )
{
QgsSettings settings;
QFileInfo tmplFileInfo( path );
settings.setValue( QStringLiteral( "style/lastStyleDir" ), tmplFileInfo.absolutePath() );
} );

// fill style categories
mModel = new QgsMapLayerStyleCategoriesModel( this );

0 comments on commit 8e4d5d5

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