Skip to content

Commit 19e2286

Browse files
committed
fix #5544
1 parent 45dc105 commit 19e2286

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/app/main.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ int main( int argc, char *argv[] )
320320
else if ( i + 1 < argc && ( arg == "--configpath" || arg == "-c" ) )
321321
{
322322
configpath = argv[++i];
323-
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configpath );
324323
}
325324
else
326325
{

src/python/qgspythonutilsimpl.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
7373
{
7474
pluginpaths << '"' + p + '"';
7575
}
76-
pluginpaths << "os.path.expanduser(\"~/.qgis/python/plugins\")";
76+
pluginpaths << homePluginsPath();
7777
pluginpaths << '"' + pluginsPath() + '"';
7878

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

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

448448
QString QgsPythonUtilsImpl::homePythonPath()
449449
{
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+
}
451459
}
452460

453461
QString QgsPythonUtilsImpl::homePluginsPath()
454462
{
455-
return homePythonPath() + "/plugins";
463+
return homePythonPath() + " + \"/plugins\"";
456464
}
457465

458466
QStringList QgsPythonUtilsImpl::extraPluginsPaths()

0 commit comments

Comments
 (0)