Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
handle projects path with apostrophe (fixes #12691)
  • Loading branch information
jef-n committed May 6, 2015
1 parent aa377a0 commit b49b492
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfield.h
Expand Up @@ -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
Expand Down

0 comments on commit b49b492

Please sign in to comment.