Skip to content
Permalink
Browse files

More default path fixes

  • Loading branch information
NathanW2 committed Dec 3, 2015
1 parent 22523a0 commit 3cbad7db8af1863890fb8eb2f3d7cc4820f2a5b2
@@ -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() )
{
@@ -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( '|' );
@@ -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( '|' );
@@ -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( '|' );
@@ -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 )
@@ -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" ),
@@ -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" ),
@@ -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(
@@ -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" ),
@@ -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" ),
@@ -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" ),

0 comments on commit 3cbad7d

Please sign in to comment.
You can’t perform that action at this time.