File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,6 @@ int main( int argc, char *argv[] )
320
320
else if ( i + 1 < argc && ( arg == " --configpath" || arg == " -c" ) )
321
321
{
322
322
configpath = argv[++i];
323
- QSettings::setPath ( QSettings::IniFormat, QSettings::UserScope, configpath );
324
323
}
325
324
else
326
325
{
Original file line number Diff line number Diff line change @@ -73,14 +73,14 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
73
73
{
74
74
pluginpaths << ' "' + p + ' "' ;
75
75
}
76
- pluginpaths << " os.path.expanduser( \" ~/.qgis/python/plugins \" ) " ;
76
+ pluginpaths << homePluginsPath () ;
77
77
pluginpaths << ' "' + pluginsPath () + ' "' ;
78
78
79
79
// expect that bindings are installed locally, so add the path to modules
80
80
// also add path to plugins
81
81
QStringList newpaths;
82
82
newpaths << ' "' + pythonPath () + ' "' ;
83
- newpaths << " os.path.expanduser( \" ~/.qgis/python \" ) " ;
83
+ newpaths << homePythonPath () ;
84
84
newpaths << pluginpaths;
85
85
runString ( " sys.path = [" + newpaths.join ( " ," ) + " ] + sys.path" );
86
86
@@ -447,12 +447,20 @@ QString QgsPythonUtilsImpl::pluginsPath()
447
447
448
448
QString QgsPythonUtilsImpl::homePythonPath ()
449
449
{
450
- return QgsApplication::qgisSettingsDirPath () + " python" ;
450
+ QString settingsDir = QgsApplication::qgisSettingsDirPath ();
451
+ if ( settingsDir == QDir::homePath () + " /.qgis/" )
452
+ {
453
+ return " os.path.expanduser(\" ~/.qgis/python\" )" ;
454
+ }
455
+ else
456
+ {
457
+ return ' "' + settingsDir + " python\" " ;
458
+ }
451
459
}
452
460
453
461
QString QgsPythonUtilsImpl::homePluginsPath ()
454
462
{
455
- return homePythonPath () + " /plugins" ;
463
+ return homePythonPath () + " + \" /plugins\" " ;
456
464
}
457
465
458
466
QStringList QgsPythonUtilsImpl::extraPluginsPaths ()
You can’t perform that action at this time.
0 commit comments