Skip to content

Commit a2a1c37

Browse files
committedDec 26, 2015
Merge pull request #2614 from SebDieBln/UpdateCachedProjectEmbedLayers
Re-Read the cached project file when its contents have changed
2 parents 917dd05 + 9be51c4 commit a2a1c37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/core/qgsproject.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,9 +1667,12 @@ bool QgsProject::createEmbeddedLayer( const QString &layerId, const QString &pro
16671667
QgsDebugCall;
16681668

16691669
static QString prevProjectFilePath;
1670+
static QDateTime prevProjectFileTimestamp;
16701671
static QDomDocument projectDocument;
16711672

1672-
if ( projectFilePath != prevProjectFilePath )
1673+
QDateTime projectFileTimestamp = QFileInfo( projectFilePath ).lastModified();
1674+
1675+
if ( projectFilePath != prevProjectFilePath || projectFileTimestamp != prevProjectFileTimestamp )
16731676
{
16741677
prevProjectFilePath.clear();
16751678

@@ -1685,6 +1688,7 @@ bool QgsProject::createEmbeddedLayer( const QString &layerId, const QString &pro
16851688
}
16861689

16871690
prevProjectFilePath = projectFilePath;
1691+
prevProjectFileTimestamp = projectFileTimestamp;
16881692
}
16891693

16901694
// does project store pathes absolute or relative?

0 commit comments

Comments
 (0)
Please sign in to comment.