File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 23
23
#include < QMessageBox>
24
24
#include < QPainter>
25
25
#include < QImageWriter>
26
+ #include < QSettings>
26
27
27
28
#include < cmath>
28
29
#include < iostream>
@@ -493,11 +494,21 @@ QString QgsComposerPicture::pictureDialog ( void )
493
494
}
494
495
filters += " )" ;
495
496
497
+ // Retrieve the last used directory
498
+ QSettings settings;
499
+ QString lastUsedDir = settings.readEntry (" /UI/lastComposerPictureDir" , " ." );
500
+
496
501
QString file = QFileDialog::getOpenFileName (
497
502
0 ,
498
503
tr (" Choose a file" ),
499
- " . " ,
504
+ lastUsedDir ,
500
505
filters );
506
+ if (file.length () != 0 )
507
+ {
508
+ QFileInfo myFile (file);
509
+ QString myPath = myFile.dirPath ();
510
+ settings.writeEntry (" /UI/lastComposerPictureDir" , myPath);
511
+ }
501
512
502
513
return file;
503
514
}
You can’t perform that action at this time.
0 commit comments