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

Bas Couwenberg gitlab at salsa.debian.org
Fri Aug 17 17:37:33 BST 2018


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


Commits:
9b0f2d43 by Bas Couwenberg at 2018-08-17T13:12:04Z
New upstream version 2.18.23+dfsg
- - - - -


10 changed files:

- CMakeLists.txt
- ChangeLog
- debian/changelog
- python/plugins/db_manager/ui/DlgSqlLayerWindow.ui
- python/plugins/db_manager/ui/DlgSqlWindow.ui
- python/plugins/processing/gui/Postprocessing.py
- src/app/dwg/qgsdwgimporter.cpp
- src/app/qgsclipboard.cpp
- tests/src/app/testqgisappclipboard.cpp
- tests/src/python/test_qgsfiledownloader.py


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 "22")
+SET(CPACK_PACKAGE_VERSION_PATCH "23")
 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,38 @@
+Radoslaw Guzinski <radosuav at op.pl>	2018-08-09
+
+    [Processing] Fix exception when producing a csv output.
+
+    Previously "name" was not defined.
+
+Nyall Dawson <nyall.dawson at gmail.com>	2018-08-14
+
+    Expand unit test coverage
+
+    (cherry-picked from 079c9fa6b6)
+
+Marco Hugentobler <marco.hugentobler at sourcepole.ch>	2018-08-09
+
+    Fix copy/paste using text format between projects
+
+Faneva <fanevanjanahary at gmail.com>	2018-02-19
+
+    [dbmanager] fix shortcut execute query
+
+Nyall Dawson <nyall.dawson at gmail.com>	2018-08-10
+
+    Fix failing test
+
+    The returned ssl errors have changed due to the external
+    site.
+
+Juergen E. Fischer <jef at norbit.de>	2018-08-02
+
+    dwg import: handle filenames with utf8 characters
+
+Juergen E. Fischer <jef at norbit.de>	2018-07-20
+
+    Release of 2.18.22
+
 Blottiere Paul <blottiere.paul at gmail.com>	2018-07-20
 
     Increases number of pages


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


=====================================
python/plugins/db_manager/ui/DlgSqlLayerWindow.ui
=====================================
--- a/python/plugins/db_manager/ui/DlgSqlLayerWindow.ui
+++ b/python/plugins/db_manager/ui/DlgSqlLayerWindow.ui
@@ -151,11 +151,14 @@ columns</string>
         <layout class="QHBoxLayout">
          <item>
           <widget class="QPushButton" name="btnExecute">
+           <property name="toolTip">
+            <string>Execute query (Ctrl+R)</string>
+           </property>
            <property name="text">
-            <string>&Execute (F5)</string>
+            <string>Execute</string>
            </property>
            <property name="shortcut">
-            <string>F5</string>
+            <string>Ctrl+R</string>
            </property>
           </widget>
          </item>


=====================================
python/plugins/db_manager/ui/DlgSqlWindow.ui
=====================================
--- a/python/plugins/db_manager/ui/DlgSqlWindow.ui
+++ b/python/plugins/db_manager/ui/DlgSqlWindow.ui
@@ -322,11 +322,14 @@ unique values</string>
         <layout class="QHBoxLayout">
          <item>
           <widget class="QPushButton" name="btnExecute">
+           <property name="toolTip">
+            <string>Execute query (Ctrl+R)</string>
+           </property>
            <property name="text">
-            <string>&Execute (F5)</string>
+            <string>Execute</string>
            </property>
            <property name="shortcut">
-            <string>F5</string>
+            <string>Ctrl+R</string>
            </property>
           </widget>
          </item>


=====================================
python/plugins/processing/gui/Postprocessing.py
=====================================
--- a/python/plugins/processing/gui/Postprocessing.py
+++ b/python/plugins/processing/gui/Postprocessing.py
@@ -60,7 +60,8 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
         progress.setPercentage(100 * i / float(len(alg.outputs)))
         if out.hidden or not out.open:
             continue
-        if isinstance(out, (OutputRaster, OutputVector, OutputTable)):
+        if isinstance(out, (OutputRaster, OutputVector, OutputTable)) or \
+           (isinstance(out, OutputFile) and out.ext == 'csv'):
             try:
                 if hasattr(out, "layer") and out.layer is not None:
                     out.layer.setLayerName(out.description)
@@ -80,15 +81,6 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
                 ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
                                        "Error loading result layer:\n" + traceback.format_exc())
                 wrongLayers.append(out.description)
-        elif isinstance(out, OutputFile) and out.ext == 'csv':
-            try:
-                dataobjects.load(out.value, name, alg.crs,
-                                 RenderingStyles.getStyle(alg.commandLineName(),
-                                                          out.name))
-            except Exception:
-                ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
-                                       "Error loading result layer:\n" + traceback.format_exc())
-                wrongLayers.append(out.description)
         elif isinstance(out, OutputHTML):
             ProcessingResults.addResult(out.description, out.value)
             htmlResults = True


=====================================
src/app/dwg/qgsdwgimporter.cpp
=====================================
--- a/src/app/dwg/qgsdwgimporter.cpp
+++ b/src/app/dwg/qgsdwgimporter.cpp
@@ -623,7 +623,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
   if ( fi.suffix().toLower() == "dxf" )
   {
     //loads dxf
-    QScopedPointer<dxfRW> dxf( new dxfRW( drawing.toUtf8() ) );
+    QScopedPointer<dxfRW> dxf( new dxfRW( drawing.toLocal8Bit() ) );
     if ( !dxf->read( this, false ) )
     {
       result = DRW::BAD_UNKNOWN;
@@ -632,7 +632,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
   else if ( fi.suffix().toLower() == "dwg" )
   {
     //loads dwg
-    QScopedPointer<dwgR> dwg( new dwgR( drawing.toUtf8() ) );
+    QScopedPointer<dwgR> dwg( new dwgR( drawing.toLocal8Bit() ) );
     if ( !dwg->read( this, false ) )
     {
       result = dwg->getError();


=====================================
src/app/qgsclipboard.cpp
=====================================
--- a/src/app/qgsclipboard.cpp
+++ b/src/app/qgsclipboard.cpp
@@ -185,27 +185,39 @@ QgsFeatureList QgsClipboard::stringToFeatureList( const QString& string, const Q
   if ( values.isEmpty() || string.isEmpty() )
     return features;
 
+  QgsFields sourceFields = retrieveFields();
+
   Q_FOREACH ( const QString& row, values )
   {
     // Assume that it's just WKT for now. because GeoJSON is managed by
     // previous QgsOgrUtils::stringToFeatureList call
     // Get the first value of a \t separated list. WKT clipboard pasted
     // feature has first element the WKT geom.
-    // This split is to fix te following issue: https://issues.qgis.org/issues/16870
+    // This split is to fix the following issue: https://issues.qgis.org/issues/16870
     // Value separators are set in generateClipboardText
     QStringList fieldValues = row.split( '\t' );
     if ( fieldValues.isEmpty() )
       continue;
 
-    QgsGeometry *geometry = QgsGeometry::fromWkt( fieldValues[0] );
-    if ( !geometry )
-      continue;
-
     QgsFeature feature;
-    if ( !fields.isEmpty() )
-      feature.setFields( fields, true );
+    feature.setFields( sourceFields );
+    feature.initAttributes( fieldValues.size() - 1 );
+
+    //skip header line
+    if ( fieldValues.at( 0 ) == QLatin1String( "wkt_geom" ) )
+    {
+      continue;
+    }
 
-    feature.setGeometry( geometry );
+    for ( int i = 1; i < fieldValues.size(); ++i )
+    {
+      feature.setAttribute( i - 1, fieldValues.at( i ) );
+    }
+    QgsGeometry* geometry = QgsGeometry::fromWkt( fieldValues[0] );
+    if ( geometry )
+    {
+      feature.setGeometry( geometry );
+    }
     features.append( feature );
   }
 
@@ -222,7 +234,35 @@ QgsFields QgsClipboard::retrieveFields() const
   QString string = cb->text( QClipboard::Clipboard );
 #endif
 
-  return QgsOgrUtils::stringToFields( string, QTextCodec::codecForName( "System" ) );
+  QgsFields f = QgsOgrUtils::stringToFields( string, QTextCodec::codecForName( "System" ) );
+  if ( f.size() < 1 )
+  {
+    if ( string.isEmpty() )
+    {
+      return f;
+    }
+    //wkt?
+    QStringList lines = string.split( '\n' );
+    if ( !lines.empty() )
+    {
+      QStringList fieldNames = lines.at( 0 ).split( '\t' );
+      //wkt / text always has wkt_geom as first attribute (however values can be NULL)
+      if ( fieldNames.at( 0 ) != QLatin1String( "wkt_geom" ) )
+      {
+        return f;
+      }
+      for ( int i = 0; i < fieldNames.size(); ++i )
+      {
+        QString fieldName = fieldNames.at( i );
+        if ( fieldName == QLatin1String( "wkt_geom" ) )
+        {
+          continue;
+        }
+        f.append( QgsField( fieldName, QVariant::String ) );
+      }
+    }
+  }
+  return f;
 }
 
 QgsFeatureList QgsClipboard::copyOf( const QgsFields &fields ) const


=====================================
tests/src/app/testqgisappclipboard.cpp
=====================================
--- a/tests/src/app/testqgisappclipboard.cpp
+++ b/tests/src/app/testqgisappclipboard.cpp
@@ -236,10 +236,71 @@ void TestQgisAppClipboard::pasteWkt()
   QCOMPARE( point->x(), 125.0 );
   QCOMPARE( point->y(), 10.0 );
 
-  // only fields => no geom so no feature list is returned
-  mQgisApp->clipboard()->setText( "MNL\t11\t282\tkm\t\nMNL\t11\t347.80000000000001\tkm\t" );
+  //clipboard should support features without geometry
+  mQgisApp->clipboard()->setText( "\tMNL\t11\t282\tkm\t\t\t\n\tMNL\t11\t347.80000000000001\tkm\t\t\t" );
   features = mQgisApp->clipboard()->copyOf();
-  QCOMPARE( features.length(), 0 );
+  QCOMPARE( features.length(), 2 );
+  QCOMPARE( features.at( 0 ).attributes().count(), 7 );
+  QCOMPARE( features.at( 0 ).attributes().at( 0 ).toString(), QString( "MNL" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 1 ).toString(), QString( "11" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 2 ).toString(), QString( "282" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 3 ).toString(), QString( "km" ) );
+  QVERIFY( features.at( 0 ).attributes().at( 4 ).toString().isEmpty() );
+  QVERIFY( features.at( 0 ).attributes().at( 5 ).toString().isEmpty() );
+  QVERIFY( features.at( 0 ).attributes().at( 6 ).toString().isEmpty() );
+  QCOMPARE( features.at( 1 ).attributes().count(), 7 );
+  QCOMPARE( features.at( 1 ).attributes().at( 0 ).toString(), QString( "MNL" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 1 ).toString(), QString( "11" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 2 ).toString(), QString( "347.80000000000001" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 3 ).toString(), QString( "km" ) );
+  QVERIFY( features.at( 1 ).attributes().at( 4 ).toString().isEmpty() );
+  QVERIFY( features.at( 1 ).attributes().at( 5 ).toString().isEmpty() );
+  QVERIFY( features.at( 1 ).attributes().at( 6 ).toString().isEmpty() );
+
+  mQgisApp->clipboard()->setText( QString( "wkt_geom\ta\tb\tc\n\tMNL\t11\t282\tkm\t\t\t\n\tMNL\t11\t347.80000000000001\tkm\t\t\t" ) );
+  features = mQgisApp->clipboard()->copyOf();
+  QCOMPARE( features.length(), 2 );
+  QCOMPARE( features.at( 0 ).fields()->count(), 3 );
+  QCOMPARE( features.at( 0 ).fields()->at( 0 ).name(), QString( "a" ) );
+  QCOMPARE( features.at( 0 ).fields()->at( 1 ).name(), QString( "b" ) );
+  QCOMPARE( features.at( 0 ).fields()->at( 2 ).name(), QString( "c" ) );
+  QCOMPARE( features.at( 0 ).attributes().count(), 7 );
+  QCOMPARE( features.at( 0 ).attributes().at( 0 ).toString(), QString( "MNL" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 1 ).toString(), QString( "11" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 2 ).toString(), QString( "282" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 3 ).toString(), QString( "km" ) );
+  QVERIFY( features.at( 0 ).attributes().at( 4 ).toString().isEmpty() );
+  QVERIFY( features.at( 0 ).attributes().at( 5 ).toString().isEmpty() );
+  QVERIFY( features.at( 0 ).attributes().at( 6 ).toString().isEmpty() );
+  QCOMPARE( features.at( 1 ).attributes().count(), 7 );
+  QCOMPARE( features.at( 1 ).attributes().at( 0 ).toString(), QString( "MNL" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 1 ).toString(), QString( "11" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 2 ).toString(), QString( "347.80000000000001" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 3 ).toString(), QString( "km" ) );
+  QVERIFY( features.at( 1 ).attributes().at( 4 ).toString().isEmpty() );
+  QVERIFY( features.at( 1 ).attributes().at( 5 ).toString().isEmpty() );
+  QVERIFY( features.at( 1 ).attributes().at( 6 ).toString().isEmpty() );
+
+  mQgisApp->clipboard()->setText( QString( "wkt_geom\ta\tb\tc\nNULL\t1\tb\t2\nNULL\t3\tc3\t4\nPoint (5 4)\t2\tb2\t3" ) );
+  features = mQgisApp->clipboard()->copyOf();
+  QCOMPARE( features.length(), 3 );
+  QCOMPARE( features.at( 0 ).fields()->count(), 3 );
+  QCOMPARE( features.at( 0 ).fields()->at( 0 ).name(), QString( "a" ) );
+  QCOMPARE( features.at( 0 ).fields()->at( 1 ).name(), QString( "b" ) );
+  QCOMPARE( features.at( 0 ).fields()->at( 2 ).name(), QString( "c" ) );
+  QCOMPARE( features.at( 0 ).attributes().count(), 3 );
+  QCOMPARE( features.at( 0 ).attributes().at( 0 ).toString(), QString( "1" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 1 ).toString(), QString( "b" ) );
+  QCOMPARE( features.at( 0 ).attributes().at( 2 ).toString(), QString( "2" ) );
+  QCOMPARE( features.at( 1 ).attributes().count(), 3 );
+  QCOMPARE( features.at( 1 ).attributes().at( 0 ).toString(), QString( "3" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 1 ).toString(), QString( "c3" ) );
+  QCOMPARE( features.at( 1 ).attributes().at( 2 ).toString(), QString( "4" ) );
+  QCOMPARE( features.at( 2 ).constGeometry()->exportToWkt(), QStringLiteral( "Point (5 4)" ) );
+  QCOMPARE( features.at( 2 ).attributes().count(), 3 );
+  QCOMPARE( features.at( 2 ).attributes().at( 0 ).toString(), QString( "2" ) );
+  QCOMPARE( features.at( 2 ).attributes().at( 1 ).toString(), QString( "b2" ) );
+  QCOMPARE( features.at( 2 ).attributes().at( 2 ).toString(), QString( "3" ) );
 }
 
 void TestQgisAppClipboard::pasteGeoJson()


=====================================
tests/src/python/test_qgsfiledownloader.py
=====================================
--- a/tests/src/python/test_qgsfiledownloader.py
+++ b/tests/src/python/test_qgsfiledownloader.py
@@ -134,7 +134,7 @@ class TestQgsFileDownloader(unittest.TestCase):
 
     def test_sslExpired(self):
         self.ssl_compare("expired", "https://expired.badssl.com/", "SSL Errors: ;The certificate has expired")
-        self.ssl_compare("self-signed", "https://self-signed.badssl.com/", "SSL Errors: ;The certificate is self-signed, and untrusted")
+        self.ssl_compare("self-signed", "https://self-signed.badssl.com/", "SSL Errors: ;The certificate has expired;The certificate is self-signed, and untrusted")
         self.ssl_compare("untrusted-root", "https://untrusted-root.badssl.com/", "No certificates could be verified;SSL Errors: ;The issuer certificate of a locally looked up certificate could not be found;The root CA certificate is not trusted for this purpose")
 
     def _set_slot(self, *args, **kwargs):



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

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/qgis/commit/9b0f2d43ba97a98232089ad8f48156be788634a9
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/20180817/816a136b/attachment-0001.html>


More information about the Pkg-grass-devel mailing list