Skip to content
Permalink
Browse files
Remember the last directory used for the composer image select file
dialog box


git-svn-id: http://svn.osgeo.org/qgis/trunk@5579 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 9, 2006
1 parent b7682ce commit f8025fd6411afe6c20957dc5ce08d00f6a30e5ed
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/composer/qgscomposerpicture.cpp
@@ -23,6 +23,7 @@
#include <QMessageBox>
#include <QPainter>
#include <QImageWriter>
#include <QSettings>

#include <cmath>
#include <iostream>
@@ -493,11 +494,21 @@ QString QgsComposerPicture::pictureDialog ( void )
}
filters += " )";

// Retrieve the last used directory
QSettings settings;
QString lastUsedDir = settings.readEntry("/UI/lastComposerPictureDir", ".");

QString file = QFileDialog::getOpenFileName(
0,
tr("Choose a file"),
".",
lastUsedDir,
filters );
if (file.length() != 0)
{
QFileInfo myFile(file);
QString myPath = myFile.dirPath();
settings.writeEntry("/UI/lastComposerPictureDir", myPath);
}

return file;
}

0 comments on commit f8025fd

Please sign in to comment.