Skip to content
Permalink
Browse files

Use windows path format for project_path/project_folder variables on …

…windows
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent ecae3c9 commit 2745797fcd4fd9f5215d6394a07c8d91c5bdf65c
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsexpressioncontext.cpp
@@ -753,8 +753,8 @@ QgsExpressionContextScope *QgsExpressionContextUtils::projectScope( const QgsPro

//add other known project variables
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_title" ), project->title(), true, true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_path" ), project->fileInfo().filePath(), true, true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_folder" ), project->fileInfo().dir().path(), true, true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_path" ), QDir::toNativeSeparators( project->fileInfo().filePath() ), true, true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_folder" ), QDir::toNativeSeparators( project->fileInfo().dir().path() ), true, true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_filename" ), project->fileInfo().fileName(), true, true ) );
QgsCoordinateReferenceSystem projectCrs = project->crs();
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "project_crs" ), projectCrs.authid(), true, true ) );

0 comments on commit 2745797

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