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 @@ -1336,7 +1336,7 @@ void QgsProject::dumpProperties() const
1336
1336
// return the absolute path from a filename read from project file
1337
1337
QString QgsProject::readPath ( QString src ) const
1338
1338
{
1339
- if ( readBoolEntry ( " Paths" , " /Absolute" , true ) )
1339
+ if ( readBoolEntry ( " Paths" , " /Absolute" , false ) )
1340
1340
{
1341
1341
return src;
1342
1342
}
@@ -1383,6 +1383,11 @@ QString QgsProject::readPath( QString src ) const
1383
1383
QString srcPath = src;
1384
1384
QString projPath = fileName ();
1385
1385
1386
+ if ( projPath.isEmpty () )
1387
+ {
1388
+ return src;
1389
+ }
1390
+
1386
1391
#if defined(Q_OS_WIN)
1387
1392
srcPath.replace ( " \\ " , " /" );
1388
1393
projPath.replace ( " \\ " , " /" );
@@ -1428,14 +1433,19 @@ QString QgsProject::readPath( QString src ) const
1428
1433
// return the absolute or relative path to write it to the project file
1429
1434
QString QgsProject::writePath ( QString src ) const
1430
1435
{
1431
- if ( readBoolEntry ( " Paths" , " /Absolute" , true ) || src.isEmpty () )
1436
+ if ( readBoolEntry ( " Paths" , " /Absolute" , false ) || src.isEmpty () )
1432
1437
{
1433
1438
return src;
1434
1439
}
1435
1440
1436
1441
QString srcPath = src;
1437
1442
QString projPath = fileName ();
1438
1443
1444
+ if ( projPath.isEmpty () )
1445
+ {
1446
+ return src;
1447
+ }
1448
+
1439
1449
#if defined( Q_OS_WIN )
1440
1450
const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
1441
1451
You can’t perform that action at this time.
0 commit comments