Skip to content

Commit

Permalink
More default path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Dec 3, 2015
1 parent 22523a0 commit 3cbad7d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/qgshandlebadlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void QgsHandleBadLayers::browseClicked()
QString title = tr( "Select new directory of selected files" );

QSettings settings;
QString lastDir = settings.value( "/UI/missingDirectory", "" ).toString();
QString lastDir = settings.value( "/UI/missingDirectory", QDir::homePath() ).toString();
QString selectedFolder = QFileDialog::getExistingDirectory( this, title, lastDir );
if ( selectedFolder.isEmpty() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
}

//local directories to search when looking for an SVG with a given basename
myPaths = settings.value( "svg/searchPathsForSVG", "" ).toString();
myPaths = settings.value( "svg/searchPathsForSVG", QDir::homePath() ).toString();
if ( !myPaths.isEmpty() )
{
QStringList myPathList = myPaths.split( '|' );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ QStringList QgsApplication::svgPaths()
//defined by user in options dialog
QSettings settings;
QStringList myPathList;
QString myPaths = settings.value( "svg/searchPathsForSVG", "" ).toString();
QString myPaths = settings.value( "svg/searchPathsForSVG", QDir::homePath() ).toString();
if ( !myPaths.isEmpty() )
{
myPathList = myPaths.split( '|' );
Expand All @@ -699,7 +699,7 @@ QStringList QgsApplication::composerTemplatePaths()
//defined by user in options dialog
QSettings settings;
QStringList myPathList;
QString myPaths = settings.value( "composer/searchPathsForTemplates", "" ).toString();
QString myPaths = settings.value( "composer/searchPathsForTemplates", QDir::homePath() ).toString();
if ( !myPaths.isEmpty() )
{
myPathList = myPaths.split( '|' );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace QgisGui

QSettings settings;
QString lastUsedFilter = settings.value( "/UI/" + filterName, "" ).toString();
QString lastUsedDir = settings.value( "/UI/" + filterName + "Dir", "." ).toString();
QString lastUsedDir = settings.value( "/UI/" + filterName + "Dir", QDir::homePath() ).toString();

QgsDebugMsg( "Opening file dialog with filters: " + filters );
if ( !cancelAll )
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/gps_importer/qgsgpsplugingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void QgsGPSPluginGui::on_buttonBox_accepted()
void QgsGPSPluginGui::on_pbnDLOutput_clicked()
{
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", QDir::homePath() ).toString();
QString myFileNameQString =
QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save under" ),
Expand Down Expand Up @@ -251,7 +251,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked()
{
QgsLogger::debug( " GPS File Importer::pbnGPXSelectFile_clicked() " );
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", QDir::homePath() ).toString();
QString myFileNameQString = QFileDialog::getOpenFileName(
this,
tr( "Select GPX file" ),
Expand All @@ -267,7 +267,7 @@ void QgsGPSPluginGui::on_pbnGPXSelectFile_clicked()
void QgsGPSPluginGui::on_pbnIMPInput_clicked()
{
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/importdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/importdirectory", QDir::homePath() ).toString();
QString tf = mBabelFilter.split( ";;" ).first();
QString myFileType = settings.value( "/Plugin-GPS/lastImportFilter", tf ).toString();
QString myFileName = QFileDialog::getOpenFileName(
Expand Down Expand Up @@ -308,7 +308,7 @@ void QgsGPSPluginGui::on_pbnIMPInput_clicked()
void QgsGPSPluginGui::on_pbnIMPOutput_clicked()
{
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", QDir::homePath() ).toString();
QString myFileNameQString =
QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save under" ),
Expand Down Expand Up @@ -399,7 +399,7 @@ void QgsGPSPluginGui::populateIMPBabelFormats()
void QgsGPSPluginGui::on_pbnCONVInput_clicked()
{
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", QDir::homePath() ).toString();
QString myFileNameQString = QFileDialog::getOpenFileName(
this,
tr( "Select GPX file" ),
Expand All @@ -415,7 +415,7 @@ void QgsGPSPluginGui::on_pbnCONVInput_clicked()
void QgsGPSPluginGui::on_pbnCONVOutput_clicked()
{
QSettings settings;
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", "." ).toString();
QString dir = settings.value( "/Plugin-GPS/gpxdirectory", QDir::homePath() ).toString();
QString myFileNameQString =
QFileDialog::getSaveFileName( this,
tr( "Choose a file name to save under" ),
Expand Down

0 comments on commit 3cbad7d

Please sign in to comment.