Skip to content
Permalink
Browse files

reread cached project file when its contents have changed

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 9be51c43b1113d7d9a3f4fc9c53aae402ddb8143
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgsproject.cpp
@@ -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();

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

prevProjectFilePath = projectFilePath;
prevProjectFileTimestamp = projectFileTimestamp;
}

// does project store pathes absolute or relative?

0 comments on commit 9be51c4

Please sign in to comment.
You can’t perform that action at this time.