Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vcpkg/ports/qgis/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vcpkg_from_github(
processing.patch # Needed to avoid link issue with tinygltf (ATM embedded into QGIS) and _GEOSQueryCallback defined multiple times
mesh.patch
vector_tiles_dpi_fix.patch
project_load_optimization.patch
)


Expand Down
62 changes: 62 additions & 0 deletions vcpkg/ports/qgis/project_load_optimization.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/src/core/project/qgsproject.cpp b/src/core/project/qgsproject.cpp
index c2220801b7f..8df9e7157a8 100644
--- a/src/core/project/qgsproject.cpp
+++ b/src/core/project/qgsproject.cpp
@@ -2141,32 +2141,37 @@ bool QgsProject::readProjectFile( const QString &filename, Qgis::ProjectReadFlag
return false;
}

- QTextStream textStream( &projectFile );
- QString projectString = textStream.readAll();
- projectFile.close();
-
- for ( int i = 0; i < 32; i++ )
+ if ( !doc->setContent( &projectFile ) )
{
- if ( i == 9 || i == 10 || i == 13 )
+ projectFile.seek( 0 );
+ QTextStream textStream( &projectFile );
+ QString projectString = textStream.readAll();
+ projectFile.close();
+
+ for ( int i = 0; i < 32; i++ )
{
- continue;
+ if ( i == 9 || i == 10 || i == 13 )
+ {
+ continue;
+ }
+ projectString.replace( QChar( i ), u"%1%2%1"_s.arg( FONTMARKER_CHR_FIX, QString::number( i ) ) );
}
- projectString.replace( QChar( i ), u"%1%2%1"_s.arg( FONTMARKER_CHR_FIX, QString::number( i ) ) );
- }

- // location of problem associated with errorMsg
- int line, column;
- QString errorMsg;
- if ( !doc->setContent( projectString, &errorMsg, &line, &column ) )
- {
- const QString errorString = tr( "Project file read error in file %1: %2 at line %3 column %4" ).arg( projectFile.fileName(), errorMsg ).arg( line ).arg( column );
- QgsDebugError( errorString );
- setError( errorString );
+ int line, column;
+ QString errorMsg;
+ if ( !doc->setContent( projectString, &errorMsg, &line, &column ) )
+ {
+ const QString errorString = tr( "Project file read error in file %1: %2 at line %3 column %4" ).arg( projectFile.fileName(), errorMsg ).arg( line ).arg( column );
+ QgsDebugError( errorString );
+ setError( errorString );

- return false;
+ return false;
+ }
+ }
+ else
+ {
+ projectFile.close();
}
-
- projectFile.close();

QgsDebugMsgLevel( "Opened document " + projectFile.fileName(), 2 );

Loading