Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2614 from SebDieBln/UpdateCachedProjectEmbedLayers
Re-Read the cached project file when its contents have changed
  • Loading branch information
jef-n committed Dec 26, 2015
2 parents 917dd05 + 9be51c4 commit a2a1c37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -1667,9 +1667,12 @@ bool QgsProject::createEmbeddedLayer( const QString &layerId, const QString &pro
QgsDebugCall;

static QString prevProjectFilePath;
static QDateTime prevProjectFileTimestamp;
static QDomDocument projectDocument;

if ( projectFilePath != prevProjectFilePath )
QDateTime projectFileTimestamp = QFileInfo( projectFilePath ).lastModified();

if ( projectFilePath != prevProjectFilePath || projectFileTimestamp != prevProjectFileTimestamp )
{
prevProjectFilePath.clear();

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

prevProjectFilePath = projectFilePath;
prevProjectFileTimestamp = projectFileTimestamp;
}

// does project store pathes absolute or relative?
Expand Down

0 comments on commit a2a1c37

Please sign in to comment.