Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 14, 2025
1 parent af37d39 commit 9a6a7a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/src/core/testqgsproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ QString getProjectXmlContent( const QString &projectPath )
return file.readAll();
}

QString getLayerSourceFromProjectXml(const QString &projectPath, const QString &layerName)
QString getLayerSourceFromProjectXml( const QString &projectPath, const QString &layerName )
{
// Get XML content
const QString xmlContent = getProjectXmlContent( projectPath );
Expand Down Expand Up @@ -1245,7 +1245,7 @@ void TestQgsProject::testSymlinks2LayerFolder()
// ++Verify paths after re-opening++
// XML datasource is "./data/points.shp" NOT "../../../data/points.shp"
const QString layerSource = getLayerSourceFromProjectXml( projectPath, QStringLiteral( "Points" ) );
QCOMPARE( layerSource, QStringLiteral( "./data/points.shp") );
QCOMPARE( layerSource, QStringLiteral( "./data/points.shp" ) );

// Absolute layer source still in projectDir
project = std::make_unique<QgsProject>();
Expand Down Expand Up @@ -1425,14 +1425,14 @@ void TestQgsProject::testSymlinks5ProjectFile()
// ++Verify that moved project behaves well++
// Move project file and create symlink
QVERIFY( QFile::rename( originalPath, symlinkprojDir + "/project.qgs" ) );
QVERIFY( QFile::rename( originalAttachPath , symlinkprojDir + "/project_attachments.zip" ) );
QVERIFY( QFile::rename( originalAttachPath, symlinkprojDir + "/project_attachments.zip" ) );
QVERIFY( QFile::link( symlinkprojDir + "/project.qgs", originalPath ) );
QVERIFY( QFile::link( symlinkprojDir + "/project_attachments.zip", originalAttachPath ) );

// Open symlinked project and verify paths
project = std::make_unique<QgsProject>();
project->read( originalPath );
QgsVectorLayer* loadedLayer = qobject_cast<QgsVectorLayer*>( project->mapLayersByName( QStringLiteral( "Points" ) ).at( 0 ) );
QgsVectorLayer *loadedLayer = qobject_cast<QgsVectorLayer *>( project->mapLayersByName( QStringLiteral( "Points" ) ).at( 0 ) );
QCOMPARE( loadedLayer->source(), projectDir + "/points.shp" );

// Save and verify XML content
Expand Down

0 comments on commit 9a6a7a0

Please sign in to comment.