Skip to content

Commit f4eca22

Browse files
committed
Fix #12881 - Fix loading of QLR files with the same layers
Using just date stamps wasn't fine enough Funded By TechnologyOne, Australia - Backported to 2.8.3 - Cherry-picked from a316290
1 parent fedced8 commit f4eca22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/qgslayerdefinition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsLayerTreeGrou
4949
// Strip the date part because we will replace it.
5050
QString layername = oldid.left( oldid.length() - 17 );
5151
QDateTime dt = QDateTime::currentDateTime();
52-
QString newid = layername + dt.toString( "yyyyMMddhhmmsszzz" );
52+
QString newid = layername + dt.toString( "yyyyMMddhhmmsszzz" ) + QString::number( qrand() );
5353
idElem.firstChild().setNodeValue( newid );
5454
QDomNodeList treeLayerNodes = doc.elementsByTagName( "layer-tree-layer" );
5555

0 commit comments

Comments
 (0)