Merge pull request #2614 from SebDieBln/UpdateCachedProjectEmbedLayers

Re-Read the cached project file when its contents have changed
This commit is contained in:
Jürgen Fischer 2015-12-26 15:18:33 +01:00
commit a2a1c374de

View File

@ -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?