[Git][debian-gis-team/qgis][upstream-ltr] New upstream version 2.18.22+dfsg

Bas Couwenberg gitlab at salsa.debian.org
Fri Jul 20 22:32:26 BST 2018


Bas Couwenberg pushed to branch upstream-ltr at Debian GIS Project / qgis


Commits:
7c8f4241 by Bas Couwenberg at 2018-07-20T20:19:57+02:00
New upstream version 2.18.22+dfsg
- - - - -


20 changed files:

- CMakeLists.txt
- ChangeLog
- cmake/FindSIP.py
- cmake/SIPMacros.cmake
- debian/changelog
- ms-windows/osgeo4w/package-nightly.cmd
- ms-windows/osgeo4w/package.cmd
- python/plugins/db_manager/db_plugins/oracle/plugin.py
- python/plugins/db_manager/db_plugins/plugin.py
- python/plugins/processing/algs/r/RAlgorithm.py
- python/plugins/processing/modeler/ModelerParametersDialog.py
- resources/srs.db
- src/app/composer/qgscomposer.cpp
- src/app/qgsfieldcalculator.h
- src/core/auth/qgsauthmanager.cpp
- src/core/qgsvectordataprovider.cpp
- src/providers/db2/qgsdb2dataitems.cpp
- src/providers/postgres/qgspostgresconn.cpp
- src/providers/spatialite/qgsspatialiteprovider.cpp
- src/server/qgswmsprojectparser.cpp


Changes:

=====================================
CMakeLists.txt
=====================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
 SET(CPACK_PACKAGE_VERSION_MINOR "18")
-SET(CPACK_PACKAGE_VERSION_PATCH "21")
+SET(CPACK_PACKAGE_VERSION_PATCH "22")
 SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
 SET(RELEASE_NAME "Las Palmas")
 IF (POLICY CMP0048) # in CMake 3.0.0+


=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,109 @@
+Blottiere Paul <blottiere.paul at gmail.com>	2018-07-20
+
+    Increases number of pages
+
+Juergen E. Fischer <jef at norbit.de>	2018-07-17
+
+    osgeo4w: support newer cmake versions
+
+Merge: 7ddfaaba46 01c0d20b2c
+Salvatore Larosa <lrssvtml at gmail.com>	2018-07-15
+
+    Merge pull request #7375 from slarosa/fix_19283
+
+    [2.18LTR] Fix  field calculator in not able to add a new field
+
+Radoslaw Guzinski <radosuav at op.pl>	2018-07-10
+
+    [Processing] Display saved value of ParameterTableMultipleField in the modeler.
+
+Salvatore Larosa <lrssvtml at gmail.com>	2018-07-10
+
+    fix indentation
+
+Salvatore Larosa <lrssvtml at gmail.com>	2018-07-09
+
+    fix warning
+
+Juergen E. Fischer <jef at norbit.de>	2018-07-06
+
+    spatialite provider: fix retrieval of unicode name of spatial index on views
+
+Salvatore Larosa <lrssvtml at gmail.com>	2018-07-06
+
+    set precision to 0 if not defined
+
+Even Rouault <even.rouault at spatialys.com>	2018-06-01
+
+    QgsVectorDataProvider::supportedType(): only checks field length and precision against min/max if they are defined (ie > 0). Fixes test_qgsauxiliarystorage.py and qgis_projectstoragetest
+
+Even Rouault <even.rouault at spatialys.com>	2018-06-01
+
+    QgsVectorDataProvider::supportedType(): use -1 as the value for unspecified length/width (this is the default in QgsField constructor and QgsVectorDataProvider::NativeType())
+
+Salvatore Larosa <lrssvtml at gmail.com>	2018-07-06
+
+    resolve conflict
+
+Juergen E. Fischer <jef at norbit.de>	2018-07-05
+
+    db manager: also add newline when adding a unique id field (fixes #19343)
+
+Juergen E. Fischer <jef at norbit.de>	2018-07-04
+
+    fix build with SIP 4.19.11 (fixes #19332)
+
+Juergen E. Fischer <jef at norbit.de>	2018-07-04
+
+    [postgres][db2] username and authcfg are not mutually exclusive (followup 9ce55ca0)
+
+Matthias Kuhn <matthias at opengis.ch>	2018-07-02
+
+    Allow updating SSL cert custom configuration
+
+    So far it was only possible to add a first configuration, changing the configuration later on would fail with a unique constraint error.
+
+Juergen E. Fischer <jef at norbit.de>	2018-06-26
+
+    Add BWTA2017.gsb to srs.db (backport 44eb0f901)
+
+    ie.
+    sqlite3 resources/srs.db "INSERT INTO tbl_datum_transform VALUES(NULL,100017,4314,4258,9615,'BWTA2017.gsb',NULL,NULL,NULL,NULL,NULL,NULL,'Transformation for the German federal state of Baden-Wuerttemberg: Diese NTv2-Datei deckt das Gebiet von Baden-Wuerttemberg ab und ist daher ausschliesslich für die Transformation von Geo(fach)daten innerhalb von Baden-Wuerttemberg geeignet. Dieser Ansatz ist für Geo(fach)daten zu verwenden welche auf Basis der ALKIS Daten gefuehrt und erstellt werden.','For applications requiring an accuracy of better than 1 metre.',1,0,'3339');"
+
+Merge: 294f8accee 70e03951ba
+Matthias Kuhn <matthias at opengis.ch>	2018-06-25
+
+    Merge pull request #7307 from rldhont/processing-r-enconde-string-218
+
+    [Bugfix][Processing] R script: ParameterString has to be encoding
+
+rldhont <rldhont at gmail.com>	2018-06-22
+
+    [Bugfix][Processing] R script: ParameterString has to be encoding
+
+    In Processing R script, each parameter is inserted in the script by rewriting
+    the file. So it's necessary to encode ParameterString to correctly write the
+    processing r script.
+
+Merge: 9fba24a3f2 259290ab32
+rldhont <rldhont at gmail.com>	2018-06-22
+
+    Merge pull request #7303 from rldhont/server-wms-getprint-autoupdate-legend-218
+
+    [Bugfix][Server] Display composer legend with auto update like the Desktop
+
+Juergen E. Fischer <jef at norbit.de>	2018-06-22
+
+    Release of 2.18.21
+
+rldhont <rldhont at gmail.com>	2018-06-22
+
+    [Bugfix][Server] Display composer legend with auto update like the Desktop
+
+    QGIS Server was not able to display auto update legend in composer since
+    2.18.x. To fix it we need to deactivate *auto update* and to provide the
+    the project layer tree.
+
 rldhont <rldhont at gmail.com>	2018-06-21
 
     [Server] Use Project selection color in GetPrint for 2.18


=====================================
cmake/FindSIP.py
=====================================
--- a/cmake/FindSIP.py
+++ b/cmake/FindSIP.py
@@ -39,4 +39,8 @@ print("sip_version_str:%s" % sipcfg.sip_version_str)
 print("sip_bin:%s" % sipcfg.sip_bin)
 print("default_sip_dir:%s" % sipcfg.default_sip_dir)
 print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
-print("sip_mod_dir:%s" % sipcfg.sip_mod_dir)
+if hasattr(sipcfg, "sip_mod_dir"):
+    print("sip_mod_dir:%s" % sipcfg.sip_mod_dir)
+else:
+    # SIP 4.19.10+ has no sipcfg.sip_mod_dir
+    print("sip_mod_dir:%s" % sipcfg.sip_module_dir)


=====================================
cmake/SIPMacros.cmake
=====================================
--- a/cmake/SIPMacros.cmake
+++ b/cmake/SIPMacros.cmake
@@ -96,6 +96,10 @@ MACRO(GENERATE_SIP_PYTHON_MODULE_CODE MODULE_NAME MODULE_SIP CPP_FILES)
     ADD_DEFINITIONS( /bigobj )
   ENDIF(MSVC)
 
+  IF(NOT SIP_VERSION_NUM LESS 267018)
+    SET(_sip_x ${_sip_x} -n sip)
+  ENDIF(NOT SIP_VERSION_NUM LESS 267018)
+
   SET(SIPCMD ${SIP_BINARY_PATH} ${_sip_tags} -w -e ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip})
   SET(SUPPRESS_SIP_WARNINGS FALSE CACHE BOOL "Hide SIP warnings")
   MARK_AS_ADVANCED(SUPPRESS_SIP_WARNINGS)


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
-qgis (2.18.21) UNRELEASED; urgency=medium
+qgis (2.18.22) UNRELEASED; urgency=medium
+
+  * Release of 2.18.22
+
+ -- Jürgen E. Fischer <jef at norbit.de>  Fri, 20 Jul 2018 14:00:10 +0200
+
+qgis (2.18.21) unstable; urgency=medium
 
   * Release of 2.18.21
 
- -- Jürgen E. Fischer <jef at norbit.de>  Fri, 22 Jun 2018 14:00:22 +0200
+ -- Jürgen E. Fischer <jef at norbit.de>  Fri, 20 Jul 2018 14:00:09 +0200
 
 qgis (2.18.20) unstable; urgency=medium
 


=====================================
ms-windows/osgeo4w/package-nightly.cmd
=====================================
--- a/ms-windows/osgeo4w/package-nightly.cmd
+++ b/ms-windows/osgeo4w/package-nightly.cmd
@@ -101,7 +101,9 @@ set GRASS7_VERSION=%GRASS7_VERSION:grass-=%
 set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS7_VERSION%
 
 set PYTHONPATH=
-path %PF86%\CMake\bin;%PATH%;c:\cygwin\bin
+if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;%PROGRAMFILES%\CMake\bin
+if exist "%PF86%\CMake\bin" path %PATH%;%PF86%\CMake\bin
+path %PATH%;c:\cygwin\bin
 
 PROMPT qgis%VERSION%$g 
 


=====================================
ms-windows/osgeo4w/package.cmd
=====================================
--- a/ms-windows/osgeo4w/package.cmd
+++ b/ms-windows/osgeo4w/package.cmd
@@ -97,7 +97,9 @@ set GRASS7_VERSION=%GRASS7_VERSION:grass-=%
 set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS7_VERSION%
 
 set PYTHONPATH=
-path %PF86%\CMake\bin;%PATH%;c:\cygwin\bin
+if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;%PROGRAMFILES%\CMake\bin
+if exist "%PF86%\CMake\bin" path %PATH%;%PF86%\CMake\bin
+path %PATH%;c:\cygwin\bin
 
 PROMPT qgis%VERSION%$g 
 


=====================================
python/plugins/db_manager/db_plugins/oracle/plugin.py
=====================================
--- a/python/plugins/db_manager/db_plugins/oracle/plugin.py
+++ b/python/plugins/db_manager/db_plugins/oracle/plugin.py
@@ -197,7 +197,7 @@ class ORDatabase(Database):
         uri = self.uri()
         con = self.database().connector
 
-        uri.setDataSource(u"", u"({})".format(sql), geomCol, filter, uniqueCol.strip(u'"'))
+        uri.setDataSource(u"", u"({}\n)".format(sql), geomCol, filter, uniqueCol.strip(u'"'))
         if avoidSelectById:
             uri.disableSelectAtId(True)
         provider = self.dbplugin().providerName()
@@ -207,7 +207,7 @@ class ORDatabase(Database):
         if not vlayer.isValid():
 
             wkbType, srid = con.getTableMainGeomType(
-                u"({})".format(sql), geomCol)
+                u"({}\n)".format(sql), geomCol)
             uri.setWkbType(wkbType)
             if srid:
                 uri.setSrid(unicode(srid))


=====================================
python/plugins/db_manager/db_plugins/plugin.py
=====================================
--- a/python/plugins/db_manager/db_plugins/plugin.py
+++ b/python/plugins/db_manager/db_plugins/plugin.py
@@ -274,7 +274,7 @@ class Database(DbItemObject):
                     q = 1
                     while "_subq_%d_" % q in sql:
                         q += 1
-                    sql = "SELECT %s AS _uid_,* FROM (%s) AS _subq_%d_" % (uniqueFct, sql, q)
+                    sql = u"SELECT %s AS _uid_,* FROM (%s\n) AS _subq_%d_" % (uniqueFct, sql, q)
                     uniqueCol = "_uid_"
 
         uri = self.uri()
@@ -293,7 +293,7 @@ class Database(DbItemObject):
     def registerSubPluginActions(self, mainWindow):
         # load plugins!
         try:
-            exec (u"from .%s.plugins import load" % self.dbplugin().typeName(), globals())
+            exec(u"from .%s.plugins import load" % self.dbplugin().typeName(), globals())
         except ImportError:
             pass
         else:


=====================================
python/plugins/processing/algs/r/RAlgorithm.py
=====================================
--- a/python/plugins/processing/algs/r/RAlgorithm.py
+++ b/python/plugins/processing/algs/r/RAlgorithm.py
@@ -27,6 +27,7 @@ __revision__ = '$Format:%H$'
 
 import os
 import json
+import types
 
 from qgis.PyQt.QtGui import QIcon
 
@@ -499,12 +500,20 @@ class RAlgorithm(GeoAlgorithm):
                     commands.append(param.name + '= NULL')
                 else:
                     commands.append(param.name + ' = "' + param.value + '"')
-            elif isinstance(param, (ParameterTableField, ParameterTableMultipleField, ParameterString,
+            elif isinstance(param, (ParameterTableField, ParameterTableMultipleField,
                                     ParameterFile)):
                 if param.value is None:
                     commands.append(param.name + '= NULL')
                 else:
                     commands.append(param.name + '="' + param.value + '"')
+            elif isinstance(param, ParameterString):
+                if param.value is None:
+                    commands.append(param.name + '= NULL')
+                elif type(param.value) == types.StringType:
+                    commands.append(param.name + '="' + param.value + '"')
+                else:
+                    c = unicode(param.name) + u'="' + unicode(param.value) + u'"'
+                    commands.append(c.encode('utf8'))
             elif isinstance(param, (ParameterNumber, ParameterSelection)):
                 if param.value is None:
                     commands.append(param.name + '= NULL')


=====================================
python/plugins/processing/modeler/ModelerParametersDialog.py
=====================================
--- a/python/plugins/processing/modeler/ModelerParametersDialog.py
+++ b/python/plugins/processing/modeler/ModelerParametersDialog.py
@@ -489,6 +489,7 @@ class ModelerParametersDialog(QDialog):
                         ParameterVector,
                         ParameterTable,
                         ParameterTableField,
+                        ParameterTableMultipleField,
                         ParameterSelection,
                         ParameterNumber,
                         ParameterBoolean,


=====================================
resources/srs.db
=====================================
Binary files a/resources/srs.db and b/resources/srs.db differ


=====================================
src/app/composer/qgscomposer.cpp
=====================================
--- a/src/app/composer/qgscomposer.cpp
+++ b/src/app/composer/qgscomposer.cpp
@@ -1053,7 +1053,7 @@ void QgsComposer::updateAtlasPageComboBox( int pageCount )
 
   mAtlasPageComboBox->blockSignals( true );
   mAtlasPageComboBox->clear();
-  for ( int i = 1; i <= pageCount && i < 500; ++i )
+  for ( int i = 1; i <= pageCount && i < 100000; ++i )
   {
     QString name = mComposition->atlasComposition().nameForPage( i - 1 );
     QString fullName = ( !name.isEmpty() ? QString( "%1: %2" ).arg( i ).arg( name ) : QString::number( i ) );


=====================================
src/app/qgsfieldcalculator.h
=====================================
--- a/src/app/qgsfieldcalculator.h
+++ b/src/app/qgsfieldcalculator.h
@@ -66,7 +66,7 @@ class APP_EXPORT QgsFieldCalculator: public QDialog, private Ui::QgsFieldCalcula
                        static_cast< QVariant::Type >( mOutputFieldTypeComboBox->itemData( mOutputFieldTypeComboBox->currentIndex(), Qt::UserRole ).toInt() ),
                        mOutputFieldTypeComboBox->itemData( mOutputFieldTypeComboBox->currentIndex(), Qt::UserRole + 1 ).toString(),
                        mOutputFieldWidthSpinBox->value(),
-                       mOutputFieldPrecisionSpinBox->value() );
+                       mOutputFieldPrecisionSpinBox->isEnabled() ? mOutputFieldPrecisionSpinBox->value() : 0 );
     }
 
     /** Idx of changed attribute*/


=====================================
src/core/auth/qgsauthmanager.cpp
=====================================
--- a/src/core/auth/qgsauthmanager.cpp
+++ b/src/core/auth/qgsauthmanager.cpp
@@ -1872,7 +1872,7 @@ bool QgsAuthManager::storeSslCertCustomConfig( const QgsAuthConfigSslServer &con
   QString certpem( cert.toPem() );
 
   QSqlQuery query( authDbConnection() );
-  query.prepare( QString( "INSERT INTO %1 (id, host, cert, config) "
+  query.prepare( QString( "INSERT OR REPLACE INTO %1 (id, host, cert, config) "
                           "VALUES (:id, :host, :cert, :config)" ).arg( authDbServersTable() ) );
 
   query.bindValue( ":id", id );


=====================================
src/core/qgsvectordataprovider.cpp
=====================================
--- a/src/core/qgsvectordataprovider.cpp
+++ b/src/core/qgsvectordataprovider.cpp
@@ -291,58 +291,39 @@ const QList< QgsVectorDataProvider::NativeType > &QgsVectorDataProvider::nativeT
 
 bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
 {
-  int i;
   QgsDebugMsgLevel( QString( "field name = %1 type = %2 length = %3 precision = %4" )
                     .arg( field.name(),
                           QVariant::typeToName( field.type() ) )
                     .arg( field.length() )
                     .arg( field.precision() ), 2 );
-  for ( i = 0; i < mNativeTypes.size(); i++ )
+  Q_FOREACH ( const NativeType &nativeType, mNativeTypes )
   {
     QgsDebugMsgLevel( QString( "native field type = %1 min length = %2 max length = %3 min precision = %4 max precision = %5" )
-                      .arg( QVariant::typeToName( mNativeTypes[i].mType ) )
-                      .arg( mNativeTypes[i].mMinLen )
-                      .arg( mNativeTypes[i].mMaxLen )
-                      .arg( mNativeTypes[i].mMinPrec )
-                      .arg( mNativeTypes[i].mMaxPrec ), 2 );
+                      .arg( QVariant::typeToName( nativeType.mType ) )
+                      .arg( nativeType.mMinLen )
+                      .arg( nativeType.mMaxLen )
+                      .arg( nativeType.mMinPrec )
+                      .arg( nativeType.mMaxPrec ), 2 );
 
-    if ( field.type() != mNativeTypes[i].mType )
+    if ( field.type() != nativeType.mType )
       continue;
 
-    if ( field.length() == -1 )
-    {
-      // source length unlimited
-      if ( mNativeTypes[i].mMinLen > -1 || mNativeTypes[i].mMaxLen > -1 )
-      {
-        // destination limited
-        continue;
-      }
-    }
-    else
+    if ( field.length() > 0 )
     {
       // source length limited
-      if ( mNativeTypes[i].mMinLen > -1 && mNativeTypes[i].mMaxLen > -1 &&
-           ( field.length() < mNativeTypes[i].mMinLen || field.length() > mNativeTypes[i].mMaxLen ) )
+      if (( nativeType.mMinLen > 0 && field.length() < nativeType.mMinLen ) ||
+          ( nativeType.mMaxLen > 0 && field.length() > nativeType.mMaxLen ) )
       {
         // source length exceeds destination limits
         continue;
       }
     }
 
-    if ( field.precision() == -1 )
-    {
-      // source precision unlimited / n/a
-      if ( mNativeTypes[i].mMinPrec > -1 || mNativeTypes[i].mMaxPrec > -1 )
-      {
-        // destination limited
-        continue;
-      }
-    }
-    else
+    if ( field.precision() > 0 )
     {
-      // source precision unlimited / n/a
-      if ( mNativeTypes[i].mMinPrec > -1 && mNativeTypes[i].mMaxPrec > -1 &&
-           ( field.precision() < mNativeTypes[i].mMinPrec || field.precision() > mNativeTypes[i].mMaxPrec ) )
+      // source precision limited
+      if (( nativeType.mMinPrec > 0 && field.precision() < nativeType.mMinPrec ) ||
+          ( nativeType.mMaxPrec > 0 && field.precision() > nativeType.mMaxPrec ) )
       {
         // source precision exceeds destination limits
         continue;


=====================================
src/providers/db2/qgsdb2dataitems.cpp
=====================================
--- a/src/providers/db2/qgsdb2dataitems.cpp
+++ b/src/providers/db2/qgsdb2dataitems.cpp
@@ -81,22 +81,20 @@ bool QgsDb2ConnectionItem::ConnInfoFromParameters(
                + "dbname='" + database + "' ";
   }
 
+  if ( !username.isEmpty() )
+  {
+    connInfo += "user='" + username + "' ";
+  }
+
   if ( !authcfg.isEmpty() )
   {
     connInfo += "authcfg='" + authcfg + "' ";
   }
-  else  // include user and password if authcfg is empty
+  else if ( !password.isEmpty() )
   {
-    if ( !username.isEmpty() )
-    {
-      connInfo += "user='" + username + "' ";
-    }
-
-    if ( !password.isEmpty() )
-    {
-      connInfo += "password='" + password + "' ";
-    }
+    connInfo += "password='" + password + "' ";
   }
+
   QgsDebugMsg( "connInfo: '" + connInfo + "'" );
   return true;
 }


=====================================
src/providers/postgres/qgspostgresconn.cpp
=====================================
--- a/src/providers/postgres/qgspostgresconn.cpp
+++ b/src/providers/postgres/qgspostgresconn.cpp
@@ -1728,7 +1728,6 @@ QgsDataSourceURI QgsPostgresConn::connUri( const QString& theConnName )
 
   if ( !authcfg.isEmpty() )
   {
-    username.clear();
     password.clear();
   }
 


=====================================
src/providers/spatialite/qgsspatialiteprovider.cpp
=====================================
--- a/src/providers/spatialite/qgsspatialiteprovider.cpp
+++ b/src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -4496,8 +4496,8 @@ void QgsSpatiaLiteProvider::getViewSpatialIndexName()
   {
     for ( i = 1; i <= rows; i++ )
     {
-      mIndexTable = results[( i * columns ) + 0];
-      mIndexGeometry = results[( i * columns ) + 1];
+      mIndexTable = QString::fromUtf8(( const char * ) results[( i * columns ) + 0] );
+      mIndexGeometry = QString::fromUtf8(( const char * ) results[( i * columns ) + 1] );
       mSpatialIndexRTree = true;
     }
   }
@@ -4660,8 +4660,8 @@ bool QgsSpatiaLiteProvider::getViewGeometryDetails()
       QString fType = results[( i * columns ) + 0];
       QString xSrid = results[( i * columns ) + 1];
       QString spatialIndex = results[( i * columns ) + 2];
-      mIndexTable = results[( i * columns ) + 3];
-      mIndexGeometry = results[( i * columns ) + 4];
+      mIndexTable = QString::fromUtf8(( const char * ) results[( i * columns ) + 3] );
+      mIndexGeometry = QString::fromUtf8(( const char * ) results[( i * columns ) + 4] );
 
       if ( fType == "POINT" )
       {


=====================================
src/server/qgswmsprojectparser.cpp
=====================================
--- a/src/server/qgswmsprojectparser.cpp
+++ b/src/server/qgswmsprojectparser.cpp
@@ -599,8 +599,9 @@ QgsComposition* QgsWMSProjectParser::initComposition( const QString& composerTem
 #endif
       if ( legend->autoUpdateModel() )
       {
+        legend->setAutoUpdateModel( false );
         model->setRootGroup( projectLayerTreeGroup() );
-        legend->synchronizeWithModel();
+        legend->updateLegend();
       }
       // if the legend has no map
       // we will load all layers
@@ -2461,6 +2462,41 @@ QgsLayerTreeGroup* QgsWMSProjectParser::projectLayerTreeGroup() const
     return rootGroup;
   }
 
+  /*const QDomDocument* projectDoc = mProjectParser->xmlDocument();
+  if ( projectDoc )
+  {
+  QDomElement qgisElem = projectDoc->documentElement();
+  if ( qgisElem.isNull() )
+  {
+  QDomElement layerTreeElem = qgisElem.firstChildElement( "layer-tree-group" );*/
+  if ( layerTreeElem.isNull() )
+  {
+    const QHash< QString, QDomElement > &projectLayerElements = mProjectParser->projectLayerElementsById();
+    QDomNodeList treeLayerNodeList = layerTreeElem.elementsByTagName( "layer-tree-layer" );
+    for ( int i = 0; i < treeLayerNodeList.size(); ++i )
+    {
+      QDomElement treeLayerElem = treeLayerNodeList.at( i ).toElement();
+      QString layerId = treeLayerElem.attribute( "id" );
+      QgsMapLayer * layer = QgsMapLayerRegistry::instance()->mapLayer( layerId );
+      if ( layer )
+      {
+        continue;
+      }
+
+      QHash< QString, QDomElement >::const_iterator layerElemIt = projectLayerElements.find( layerId );
+      if ( layerElemIt != projectLayerElements.constEnd() )
+      {
+        layer = mProjectParser->createLayerFromElement( layerElemIt.value(), true );
+      }
+      if ( layer )
+      {
+        QgsMapLayerRegistry::instance()->addMapLayer( layer );
+      }
+    }
+  }
+  /*}
+  }*/
+
   return QgsLayerTreeGroup::readXML( layerTreeElem );
 }
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/qgis/commit/7c8f424143bf03126f52db3a65bdcce7bb870f9a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/qgis/commit/7c8f424143bf03126f52db3a65bdcce7bb870f9a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180720/f124a3d0/attachment-0001.html>


More information about the Pkg-grass-devel mailing list