Skip to content
Permalink
Browse files

handle projects path with apostrophe (fixes #12691)

  • Loading branch information
jef-n committed May 6, 2015
1 parent aa377a0 commit b49b49232a598ac22b60be398e5d8e125b53a3d6
Showing with 7 additions and 3 deletions.
  1. +6 −2 src/app/qgisapp.cpp
  2. +1 −1 src/core/qgsfield.h
@@ -10065,11 +10065,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 );
}
@@ -163,7 +163,7 @@ Q_DECLARE_METATYPE( QgsField );
*
* In addition to storing a list of QgsField instances, it also:
* - allows quick lookups of field names to index in the list
*- keeps track of where the field definition comes from (vector data provider, joined layer or newly added from an editing operation)
* - keeps track of where the field definition comes from (vector data provider, joined layer or newly added from an editing operation)
* \note QgsFields objects are implicitly shared.
*/
class CORE_EXPORT QgsFields

0 comments on commit b49b492

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