Skip to content
Permalink
Browse files

handle projects path with apostrophe (fixes #12691)

(cherry picked from commit b49b492)
  • Loading branch information
jef-n committed May 9, 2015
1 parent a894781 commit 5f4d9d8087f01fbd0179b4bf4a924a57bd67f7e0
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/app/qgisapp.cpp
@@ -9995,11 +9995,15 @@ void QgisApp::projectChanged( const QDomDocument &doc )

QString expr;
if ( !prevProjectDir.isNull() )
expr = QString( "sys.path.remove('%1'); " ).arg( prevProjectDir );
{
QString prev = prevProjectDir;
expr = QString( "sys.path.remove('%1'); " ).arg( prev.replace( "'", "\\'" ) );
}

prevProjectDir = fi.canonicalPath();

expr += QString( "sys.path.append('%1')" ).arg( prevProjectDir );
QString prev = prevProjectDir;
expr += QString( "sys.path.append('%1')" ).arg( prev.replace( "'", "\\'" ) );

QgsPythonRunner::run( expr );
}

0 comments on commit 5f4d9d8

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