Skip to content
Permalink
Browse files

fix #5544

  • Loading branch information
jef-n committed May 21, 2012
1 parent 45dc105 commit 19e2286bf1e8320ce144d9ea1139586017a07831
Showing with 12 additions and 5 deletions.
  1. +0 −1 src/app/main.cpp
  2. +12 −4 src/python/qgspythonutilsimpl.cpp
@@ -320,7 +320,6 @@ int main( int argc, char *argv[] )
else if ( i + 1 < argc && ( arg == "--configpath" || arg == "-c" ) )
{
configpath = argv[++i];
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configpath );
}
else
{
@@ -73,14 +73,14 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
{
pluginpaths << '"' + p + '"';
}
pluginpaths << "os.path.expanduser(\"~/.qgis/python/plugins\")";
pluginpaths << homePluginsPath();
pluginpaths << '"' + pluginsPath() + '"';

// expect that bindings are installed locally, so add the path to modules
// also add path to plugins
QStringList newpaths;
newpaths << '"' + pythonPath() + '"';
newpaths << "os.path.expanduser(\"~/.qgis/python\")";
newpaths << homePythonPath();
newpaths << pluginpaths;
runString( "sys.path = [" + newpaths.join( "," ) + "] + sys.path" );

@@ -447,12 +447,20 @@ QString QgsPythonUtilsImpl::pluginsPath()

QString QgsPythonUtilsImpl::homePythonPath()
{
return QgsApplication::qgisSettingsDirPath() + "python";
QString settingsDir = QgsApplication::qgisSettingsDirPath();
if( settingsDir == QDir::homePath() + "/.qgis/" )
{
return "os.path.expanduser(\"~/.qgis/python\")";
}
else
{
return '"' + settingsDir + "python\"";
}
}

QString QgsPythonUtilsImpl::homePluginsPath()
{
return homePythonPath() + "/plugins";
return homePythonPath() + " + \"/plugins\"";
}

QStringList QgsPythonUtilsImpl::extraPluginsPaths()

0 comments on commit 19e2286

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