[QGIS Commit] r15113 - trunk/qgis/src/plugins/raster_terrain_analysis

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Feb 1 03:43:21 EST 2011


Author: mhugent
Date: 2011-02-01 00:43:21 -0800 (Tue, 01 Feb 2011)
New Revision: 15113

Modified:
   trunk/qgis/src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp
Log:
Fix #3411

Modified: trunk/qgis/src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp
===================================================================
--- trunk/qgis/src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp	2011-02-01 08:07:50 UTC (rev 15112)
+++ trunk/qgis/src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp	2011-02-01 08:43:21 UTC (rev 15113)
@@ -164,7 +164,9 @@
 
 void QgsRasterTerrainAnalysisDialog::on_mOutputLayerPushButton_clicked()
 {
-  QString saveFileName = QFileDialog::getSaveFileName( 0, tr( "Enter result file" ) );
+  QSettings s;
+  QString lastDir = s.value( "/RasterTerrainAnalysis/lastOutputDir" ).toString();
+  QString saveFileName = QFileDialog::getSaveFileName( 0, tr( "Enter result file" ), lastDir );
   if ( !saveFileName.isNull() )
   {
     mOutputLayerLineEdit->setText( saveFileName );
@@ -181,6 +183,13 @@
   //save last output format
   QSettings s;
   s.setValue( "/RasterTerrainAnalysis/lastOutputFormat", QVariant( mOutputFormatComboBox->currentText() ) );
+
+  //save last output directory
+  QFileInfo outputFileInfo( mOutputLayerLineEdit->text() );
+  if ( outputFileInfo.exists() )
+  {
+    s.setValue( "/RasterTerrainAnalysis/lastOutputDir", QVariant( outputFileInfo.absolutePath() ) );
+  }
 }
 
 void QgsRasterTerrainAnalysisDialog::on_mOutputLayerLineEdit_textChanged( const QString& text )



More information about the QGIS-commit mailing list