Skip to content

Commit

Permalink
grass: fix relative path support for working database and vector laye…
Browse files Browse the repository at this point in the history
…rs (fixes #12725)

(cherry picked from commit e5dbd18)
  • Loading branch information
jef-n committed May 27, 2015
1 parent f68cfc7 commit 3dd8008
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -1479,7 +1479,7 @@ QString QgsProject::writePath( QString src, QString relativeBasePath ) const


QFileInfo srcFileInfo( src ); QFileInfo srcFileInfo( src );
QFileInfo projFileInfo( fileName() ); QFileInfo projFileInfo( fileName() );
QString srcPath = srcFileInfo.canonicalFilePath(); QString srcPath = srcFileInfo.exists() ? srcFileInfo.canonicalFilePath() : src;
QString projPath = projFileInfo.canonicalFilePath(); QString projPath = projFileInfo.canonicalFilePath();


if ( !relativeBasePath.isNull() ) if ( !relativeBasePath.isNull() )
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -310,7 +310,7 @@ void QgsGrassPlugin::saveMapset()


// Save working mapset in project file // Save working mapset in project file
QgsProject::instance()->writeEntry( "GRASS", "/WorkingGisdbase", QgsProject::instance()->writeEntry( "GRASS", "/WorkingGisdbase",
QgsGrass::getDefaultGisdbase() ); QgsProject::instance()->writePath( QgsGrass::getDefaultGisdbase() ) );


QgsProject::instance()->writeEntry( "GRASS", "/WorkingLocation", QgsProject::instance()->writeEntry( "GRASS", "/WorkingLocation",
QgsGrass::getDefaultLocation() ); QgsGrass::getDefaultLocation() );
Expand Down Expand Up @@ -802,8 +802,10 @@ void QgsGrassPlugin::projectRead()
QgsDebugMsg( "entered." ); QgsDebugMsg( "entered." );


bool ok; bool ok;
QString gisdbase = QgsProject::instance()->readEntry( QString gisdbase = QgsProject::instance()->readPath(
"GRASS", "/WorkingGisdbase", "", &ok ).trimmed(); QgsProject::instance()->readEntry(
"GRASS", "/WorkingGisdbase", "", &ok ).trimmed()
);
QString location = QgsProject::instance()->readEntry( QString location = QgsProject::instance()->readEntry(
"GRASS", "/WorkingLocation", "", &ok ).trimmed(); "GRASS", "/WorkingLocation", "", &ok ).trimmed();
QString mapset = QgsProject::instance()->readEntry( QString mapset = QgsProject::instance()->readEntry(
Expand Down

0 comments on commit 3dd8008

Please sign in to comment.