Skip to content

Commit 84c709f

Browse files
committed
Fix #6764 again. Replace backslash for python code only
1 parent e97afe0 commit 84c709f

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

src/app/main.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,6 @@ int main( int argc, char *argv[] )
507507

508508
if ( !optionpath.isEmpty() || !configpath.isEmpty() )
509509
{
510-
#ifdef Q_WS_WIN
511-
//replace backslashes with forward slashes
512-
configpath.replace( "\\", "/" );
513-
optionpath.replace( "\\", "/" );
514-
#endif
515510
// tell QSettings to use INI format and save the file in custom config path
516511
QSettings::setDefaultFormat( QSettings::IniFormat );
517512
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optionpath.isEmpty() ? configpath : optionpath );
@@ -537,11 +532,6 @@ int main( int argc, char *argv[] )
537532
QSettings* customizationsettings;
538533
if ( !optionpath.isEmpty() || !configpath.isEmpty() )
539534
{
540-
#ifdef Q_WS_WIN
541-
//replace backslashes with forward slashes
542-
configpath.replace( "\\", "/" );
543-
optionpath.replace( "\\", "/" );
544-
#endif
545535
// tell QSettings to use INI format and save the file in custom config path
546536
QSettings::setDefaultFormat( QSettings::IniFormat );
547537
QString path = optionpath.isEmpty() ? configpath : optionpath;

src/python/qgspythonutilsimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ QString QgsPythonUtilsImpl::homePythonPath()
457457
}
458458
else
459459
{
460-
return '"' + settingsDir + "python\"";
460+
return '"' + settingsDir.replace( '\\', "\\\\" ) + "python\"";
461461
}
462462
}
463463

0 commit comments

Comments
 (0)