Skip to content

Commit

Permalink
fix #5544
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 17, 2012
1 parent 783b67f commit ed0cb5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
16 changes: 12 additions & 4 deletions src/python/qgspythonutilsimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ed0cb5d

Please sign in to comment.