Skip to content

Commit

Permalink
reread cached project file when its contents have changed
Browse files Browse the repository at this point in the history
When embedding layers, reread the external project file if its lastModified timestamp changed.
  • Loading branch information
SebDieBln committed Dec 26, 2015
1 parent 917dd05 commit 9be51c4
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 9be51c4

Please sign in to comment.