Navigation Menu

Skip to content

Commit

Permalink
Default to homePath if path is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Oct 6, 2021
1 parent 7c8e87d commit 343edc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
Expand Up @@ -222,14 +222,19 @@ void QgsGeometryCheckerResultTab::updateError( QgsGeometryCheckError *error, boo

void QgsGeometryCheckerResultTab::exportErrors()
{
QString initialdir = QgsSettings().value( "/geometry_checker/previous_values/exportDirectory", "" ).toString();
QString initialdir = QgsSettings().value( "/geometry_checker/previous_values/exportDirectory", QDir::homePath() ).toString();
QDir dir = QDir( initialdir );
if ( !dir.exists() )
dir = QFileInfo( mChecker->featurePools().first()->layer()->dataProvider()->dataSourceUri() ).dir();

if ( dir.exists() )
{
initialdir = dir.absolutePath();
}
else
{
initialdir = QDir::homePath();
}

QString selectedFilter;
QString file = QFileDialog::getSaveFileName( this, tr( "Select Output File" ), initialdir, QgsVectorFileWriter::fileFilterString(), &selectedFilter );
Expand Down

0 comments on commit 343edc8

Please sign in to comment.