File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1350,7 +1350,7 @@ void QgsProject::dumpProperties() const
13501350// return the absolute path from a filename read from project file
13511351QString QgsProject::readPath ( QString src ) const
13521352{
1353- if ( readBoolEntry ( " Paths" , " /Absolute" , true ) )
1353+ if ( readBoolEntry ( " Paths" , " /Absolute" , false ) )
13541354 {
13551355 return src;
13561356 }
@@ -1395,6 +1395,11 @@ QString QgsProject::readPath( QString src ) const
13951395 QString srcPath = src;
13961396 QString projPath = fileName ();
13971397
1398+ if ( projPath.isEmpty () )
1399+ {
1400+ return src;
1401+ }
1402+
13981403#if defined(Q_OS_WIN)
13991404 srcPath.replace ( " \\ " , " /" );
14001405 projPath.replace ( " \\ " , " /" );
@@ -1440,14 +1445,19 @@ QString QgsProject::readPath( QString src ) const
14401445// return the absolute or relative path to write it to the project file
14411446QString QgsProject::writePath ( QString src ) const
14421447{
1443- if ( readBoolEntry ( " Paths" , " /Absolute" , true ) || src.isEmpty () )
1448+ if ( readBoolEntry ( " Paths" , " /Absolute" , false ) || src.isEmpty () )
14441449 {
14451450 return src;
14461451 }
14471452
14481453 QString srcPath = src;
14491454 QString projPath = fileName ();
14501455
1456+ if ( projPath.isEmpty () )
1457+ {
1458+ return src;
1459+ }
1460+
14511461#if defined( Q_OS_WIN )
14521462 const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
14531463
You can’t perform that action at this time.
0 commit comments