|
25 | 25 |
|
26 | 26 | #include <QDesktopWidget>
|
27 | 27 | #include <QFileDialog>
|
| 28 | +#include <QFileInfo> |
28 | 29 | #include <QMatrix>
|
29 | 30 | #include <QMessageBox>
|
30 | 31 | #include <QPainter>
|
@@ -542,6 +543,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
|
542 | 543 | QSettings myQSettings; // where we keep last used filter in persistant state
|
543 | 544 | QString myLastUsedFormat = myQSettings.readEntry("/UI/lastSaveAsImageFormat", "PNG" );
|
544 | 545 | QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsImageFile","qgis.png");
|
| 546 | + QFileInfo file(myLastUsedFile); |
545 | 547 |
|
546 | 548 | // get a list of supported output image types
|
547 | 549 | int myCounterInt=0;
|
@@ -573,11 +575,11 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
|
573 | 575 | new QFileDialog(
|
574 | 576 | this,
|
575 | 577 | tr("Choose a filename to save the map image as"),
|
576 |
| - ".", |
| 578 | + file.path(), |
577 | 579 | myFilters
|
578 | 580 | )
|
579 | 581 | );
|
580 |
| - myQFileDialog->selectFile( myLastUsedFile ); |
| 582 | + myQFileDialog->selectFile( file.fileName() ); |
581 | 583 |
|
582 | 584 | // allow for selection of more than one file
|
583 | 585 | myQFileDialog->setMode(QFileDialog::AnyFile);
|
@@ -633,11 +635,12 @@ void QgsComposer::on_mActionExportAsSVG_activated(void)
|
633 | 635 | {
|
634 | 636 | QSettings myQSettings;
|
635 | 637 | QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsSvgFile","qgis.svg");
|
| 638 | + QFileInfo file(myLastUsedFile); |
636 | 639 |
|
637 | 640 | QFileDialog *myQFileDialog = new QFileDialog( this, tr("Choose a filename to save the map as"),
|
638 |
| - ".", "SVG Format (*.svg *SVG)" ); |
| 641 | + file.path(), "SVG Format (*.svg *SVG)" ); |
639 | 642 |
|
640 |
| - myQFileDialog->selectFile( myLastUsedFile ); |
| 643 | + myQFileDialog->selectFile( file.fileName() ); |
641 | 644 | myQFileDialog->setMode(QFileDialog::AnyFile);
|
642 | 645 | myQFileDialog->setAcceptMode(QFileDialog::AcceptSave);
|
643 | 646 |
|
|
0 commit comments