File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,17 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
77
77
#ifdef Q_OS_WIN
78
78
p = p.replace ( ' \\ ' , " \\\\ " );
79
79
#endif
80
- pluginpaths << ' "' + p + ' "' ;
80
+ if ( !QDir ( p ).exists () )
81
+ {
82
+ QgsMessageOutput* msg = QgsMessageOutput::createMessageOutput ();
83
+ msg->setTitle ( QObject::tr ( " Python error" ) );
84
+ msg->setMessage ( QString ( QObject::tr (" The extra plugin path '%1' does not exist !" ) ).arg (p), QgsMessageOutput::MessageText );
85
+ msg->showMessage ();
86
+ }
87
+ // we store here paths in unicode strings
88
+ // the str constant will contain utf8 code (through runString)
89
+ // so we call '...'.decode('utf-8') to make a unicode string
90
+ pluginpaths << ' "' + p + " \" .decode('utf-8')" ;
81
91
}
82
92
pluginpaths << homePluginsPath ();
83
93
pluginpaths << ' "' + pluginsPath () + ' "' ;
@@ -469,11 +479,11 @@ QString QgsPythonUtilsImpl::homePythonPath()
469
479
QString settingsDir = QgsApplication::qgisSettingsDirPath ();
470
480
if ( QDir::cleanPath ( settingsDir ) == QDir::homePath () + QString ( " /.qgis%1" ).arg ( 2 /* FIXME QGis::QGIS_VERSION_INT / 10000 */ ) )
471
481
{
472
- return QString ( " os.path.expanduser(\" ~/.qgis%1/python\" )" ).arg ( 2 /* FIXME: QGis::QGIS_VERSION_INT / 10000 */ );
482
+ return QString ( " os.path.expanduser(\" ~/.qgis%1/python\" ).decode('utf-8') " ).arg ( 2 /* FIXME: QGis::QGIS_VERSION_INT / 10000 */ );
473
483
}
474
484
else
475
485
{
476
- return ' "' + settingsDir.replace ( ' \\ ' , " \\\\ " ) + " python\" " ;
486
+ return ' "' + settingsDir.replace ( ' \\ ' , " \\\\ " ) + " python\" .decode('utf-8') " ;
477
487
}
478
488
}
479
489
You can’t perform that action at this time.
0 commit comments