@@ -409,7 +409,7 @@ void QgsSingleBandPseudoColorRendererWidget::on_mLoadFromFileButton_clicked()
409
409
bool importError = false ;
410
410
QString badLines;
411
411
QSettings settings;
412
- QString lastDir = settings.value ( " lastRasterFileFilterDir " , QDir::homePath () ).toString ();
412
+ QString lastDir = settings.value ( " lastColorMapDir " , QDir::homePath () ).toString ();
413
413
QString fileName = QFileDialog::getOpenFileName ( this , tr ( " Open file" ), lastDir, tr ( " Textfile (*.txt)" ) );
414
414
QFile inputFile ( fileName );
415
415
if ( inputFile.open ( QFile::ReadOnly ) )
@@ -478,6 +478,9 @@ void QgsSingleBandPseudoColorRendererWidget::on_mLoadFromFileButton_clicked()
478
478
}
479
479
populateColormapTreeWidget ( colorRampItems );
480
480
481
+ QFileInfo fileInfo ( fileName );
482
+ settings.setValue ( " lastColorMapDir" , fileInfo.absoluteDir ().absolutePath () );
483
+
481
484
if ( importError )
482
485
{
483
486
QMessageBox::warning ( this , tr ( " Import Error" ), tr ( " The following lines contained errors\n\n " ) + badLines );
@@ -492,7 +495,7 @@ void QgsSingleBandPseudoColorRendererWidget::on_mLoadFromFileButton_clicked()
492
495
void QgsSingleBandPseudoColorRendererWidget::on_mExportToFileButton_clicked ()
493
496
{
494
497
QSettings settings;
495
- QString lastDir = settings.value ( " lastRasterFileFilterDir " , QDir::homePath () ).toString ();
498
+ QString lastDir = settings.value ( " lastColorMapDir " , QDir::homePath () ).toString ();
496
499
QString fileName = QFileDialog::getSaveFileName ( this , tr ( " Save file" ), lastDir, tr ( " Textfile (*.txt)" ) );
497
500
if ( !fileName.isEmpty () )
498
501
{
@@ -544,6 +547,9 @@ void QgsSingleBandPseudoColorRendererWidget::on_mExportToFileButton_clicked()
544
547
}
545
548
outputStream.flush ();
546
549
outputFile.close ();
550
+
551
+ QFileInfo fileInfo ( fileName );
552
+ settings.setValue ( " lastColorMapDir" , fileInfo.absoluteDir ().absolutePath () );
547
553
}
548
554
else
549
555
{
0 commit comments