Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remember the last directory used for the composer image select file
dialog box


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

#include <cmath>
#include <iostream>
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 47a5086

Please sign in to comment.