47981 Commits

Author SHA1 Message Date
Nyall Dawson
4bb572f4d0 Move licensecheck to external folder 2018-06-04 11:30:32 +10:00
Nyall Dawson
4e0845b4c6 Include licensecheck.pl script in code_layout test folder
Seems to be the only way to get this functional under Travis.

TODO: remove when Travis is upgraded to a reasonably modern
Ubuntu version
2018-06-04 11:30:32 +10:00
Nyall Dawson
48b117e0db Fail check if licensecheck missing 2018-06-04 11:30:32 +10:00
Nyall Dawson
8b44b06ea9 Install more dependencies from repos 2018-06-04 11:30:32 +10:00
Nyall Dawson
43abdf7224 Don't run tests when install modules 2018-06-04 11:30:32 +10:00
Nyall Dawson
3c274036f2 No prompts 2018-06-04 11:30:32 +10:00
Nyall Dawson
d52c698a43 Install licensecheck via cpan 2018-06-04 11:30:32 +10:00
Nyall Dawson
d16ec3e257 Add unit test for license headers 2018-06-04 11:30:32 +10:00
Nyall Dawson
bb2e15c95a More checks 2018-06-04 06:35:10 +10:00
Nyall Dawson
0af5fb9d02 [ogr] Fix combination of filterrect and filterfids ignores filterrect check 2018-06-04 06:35:10 +10:00
Nyall Dawson
4ddf58c01c Add feature source test for combination of filterfids AND filterrect
Both these conditions must be honored when set, i.e. features
with matching IDs but which fail the rect check should not be
returned.
2018-06-04 06:35:10 +10:00
Even Rouault
851319f444
Merge pull request #7151 from rouault/fix_use_after_free_at_qgis_exit
Fix use-after-free at QGIS exist, linked to QgsCoordinateTransform cache
2018-06-03 22:27:36 +02:00
Denis Rouzaud
164f662dc0 fix sipify and run 2018-06-03 11:07:09 -08:00
Denis Rouzaud
1fb02e8d83 concatenate auto_additions files with python module __init__.py.in 2018-06-03 11:07:09 -08:00
Denis Rouzaud
e5b02cd2a8 use dedicated files for auto additions 2018-06-03 11:07:09 -08:00
Denis Rouzaud
7cb18cd5f1 [sipify] allow to define python operator in headers
sipify will take care of injecting them in python/{module}/__init__.py
2018-06-03 11:07:09 -08:00
Even Rouault
6b7504d6cc
Fix use-after-free at QGIS exist, linked to QgsCoordinateTransform cache
This fixes the following warning

==23284== Invalid read of size 4
==23284==    at 0x14911DE5: pj_ctx_get_errno (pj_ctx.c:137)
==23284==    by 0x149104A9: pj_free (pj_malloc.c:188)
==23284==    by 0x88C4DD3: QgsCoordinateTransformPrivate::freeProj() (qgscoordinatetransform_p.cpp:336)
==23284==    by 0x88C29AB: QgsCoordinateTransformPrivate::~QgsCoordinateTransformPrivate() (qgscoordinatetransform_p.cpp:88)
==23284==    by 0x88BEA6E: QExplicitlySharedDataPointer<QgsCoordinateTransformPrivate>::~QExplicitlySharedDataPointer() (qshareddata.h:156)
==23284==    by 0x88B7857: QgsCoordinateTransform::~QgsCoordinateTransform() (qgscoordinatetransform.cpp:139)
==23284==    by 0x88C1827: QHashNode<QPair<QString, QString>, QgsCoordinateTransform>::~QHashNode() (qhash.h:237)
==23284==    by 0x88C18A6: QHash<QPair<QString, QString>, QgsCoordinateTransform>::deleteNode2(QHashData::Node*) (qhash.h:585)
==23284==    by 0xB9CBBF8: QHashData::free_helper(void (*)(QHashData::Node*)) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.5.1)
==23284==    by 0x88C0276: QHash<QPair<QString, QString>, QgsCoordinateTransform>::freeData(QHashData*) (qhash.h:621)
==23284==    by 0x88BF735: QHash<QPair<QString, QString>, QgsCoordinateTransform>::~QHash() (qhash.h:342)
==23284==    by 0x88C1F2B: QMultiHash<QPair<QString, QString>, QgsCoordinateTransform>::~QMultiHash() (qhash.h:994)
==23284==    by 0xC378369: __cxa_finalize (cxa_finalize.c:56)
==23284==    by 0x8110BB2: ??? (in /home/even/qgis/QGIS/build/output/lib/libqgis_core.so.3.1.0)
==23284==    by 0x4010DE6: _dl_fini (dl-fini.c:235)
==23284==    by 0xC377FF7: __run_exit_handlers (exit.c:82)
==23284==    by 0xC378044: exit (exit.c:104)
==23284==    by 0xC35E836: (below main) (libc-start.c:325)
==23284==  Address 0xaed0c6f0 is 0 bytes inside a block of size 32 free'd
==23284==    at 0x4C2ECF0: free (vg_replace_malloc.c:530)
==23284==    by 0x149103FD: pj_dealloc (pj_malloc.c:133)
==23284==    by 0x88C1FB0: QgsProjContextStore::~QgsProjContextStore() (qgscoordinatetransform_p.cpp:45)
==23284==    by 0xBE23DF5: (anonymous namespace)::run(void*) (atexit_thread.cc:71)
==23284==    by 0xC377FF7: __run_exit_handlers (exit.c:82)
==23284==    by 0xC378044: exit (exit.c:104)
==23284==    by 0xC35E836: (below main) (libc-start.c:325)
==23284==  Block was alloc'd at
==23284==    at 0x4C2DBF6: malloc (vg_replace_malloc.c:299)
==23284==    by 0x14911D8A: pj_ctx_alloc (pj_ctx.c:109)
==23284==    by 0x88C1F64: QgsProjContextStore::QgsProjContextStore() (qgscoordinatetransform_p.cpp:40)
==23284==    by 0x88C505B: __tls_init (qgscoordinatetransform_p.cpp:33)
==23284==    by 0x88C5131: TLS wrapper function for QgsCoordinateTransformPrivate::mProjContext (in /home/even/qgis/QGIS/build/output/lib/libqgis_core.so.3.1.0)
==23284==    by 0x88C39F6: QgsCoordinateTransformPrivate::threadLocalProjData() (qgscoordinatetransform_p.cpp:228)
==23284==    by 0x88C33BE: QgsCoordinateTransformPrivate::initialize() (qgscoordinatetransform_p.cpp:162)
2018-06-03 19:36:11 +02:00
Even Rouault
7f97a2f32a
Merge pull request #7146 from rouault/fix_18342
[OGR provider] Improve performance of subLayers(), particularly on FileGDB with the proprietary driver (fixes #18342)
2018-06-03 12:41:53 +02:00
Nyall Dawson
9115d7f2f2 Add note to use QgsApplication::authManager() 2018-06-03 15:50:23 +10:00
Even Rouault
55aa7a86be
[OGR provider] Improve performance of subLayers(), particularly on FileGDB with the proprietary driver (fixes #18342) 2018-06-03 01:35:25 +02:00
Nyall Dawson
477fb89fdf More tests 2018-06-03 09:24:35 +10:00
Nyall Dawson
314942d7a2 Also check geometry in tests 2018-06-03 09:24:35 +10:00
Nyall Dawson
d7d2a1474a [ogr] Only try to add original fid from iterators, not in other cases 2018-06-03 09:24:35 +10:00
Nyall Dawson
ca1262d16b Fix failing test
We need to ensure that the FID column is also fetched for the
unfiltered layer which we use when requesting features by ID
2018-06-03 09:24:35 +10:00
Nyall Dawson
f3bc283cd5 Better tests 2018-06-03 09:24:35 +10:00
Nyall Dawson
6430059876 Remove safety check
Doesn't work correctly - flags valid matches as invalid
2018-06-03 09:24:35 +10:00
Nyall Dawson
2975339073 [ogr] Fix very slow feature requests when filter string set
Follow up 217e7006. Avoid the very expensive iteration to
find matching features when a subset string is set by
instead querying the original, unfiltered layer when
we are doing a FilterFids type request.

Fixes many hangs when using OGR layers with filters in place.
2018-06-03 09:24:35 +10:00
Nyall Dawson
bab8b78c0f Use correct member variable prefix 2018-06-03 09:24:35 +10:00
Alessandro Pasotti
79ba0eee1a
Merge pull request #7143 from elpaso/bugfix-19050-field-calc-save-real-as-int
Do not set min/max precision for int fields
2018-06-02 22:55:24 +02:00
Even Rouault
f68f288dea
Merge pull request #7145 from rouault/fix_18596
[OGR provider] When editing a GeoJSON file, close and re-open the file at end of editing session (fixes #18596)
2018-06-02 17:32:12 +02:00
Even Rouault
754018a477
[OGR provider] When editing a GeoJSON file, close and re-open the file at end of editing session (fixes #18596) 2018-06-02 12:00:15 +02:00
Even Rouault
7e2ca8f61b
Merge pull request #7144 from rouault/fix_18976
[Postgres provider] Speed up feature insertion when pkid column is not set (fixes #18976)
2018-06-02 11:27:27 +02:00
Even Rouault
a9a8fbdb17
[cleanup] use for range based loop 2018-06-01 23:09:32 +02:00
Even Rouault
2ed200a8f2
Merge pull request #7142 from rouault/fix_18996
QgsSvgCache::svgAsPicture(): make sure the returned picture is not shared (fixes #18996)
2018-06-01 22:33:49 +02:00
Even Rouault
cc25727a18
[Postgres provider] Speed up feature insertion when pkid column is not set (fixes #18976)
When inserting features whose attribute column corresponding to the pkid
is empty, and tat this pkid column has a default value using a sequence,
then we can remove it from the INSERT statement completely, which save us
from doing a SELECT nextval(...) for each row. On the provided test case
of that ticket, on a debug build, this cuts down the insertion time from 5 minutes
to 1 minute 10s.
2018-06-01 22:31:09 +02:00
Even Rouault
75b7edf1d2
QgsSvgCache::svgAsPicture(): make sure the returned picture is not shared (fixes #18996)
For some reason QPicture.detach() doesn't seem to always work as intended, at
least with QT 5.5 on Ubuntu 16.04
Serialization/deserialization is a safe way to be ensured we don't
share a copy.

Relates to a6eea7205c72a1be837ab43b79aad0c67a92a9b2
2018-06-01 22:00:07 +02:00
Alessandro Pasotti
033071ae50 Do not set min/max precision for int fields
Fixes #19050

QGIS saves integer field when I create a new real
field through field calculator (Update field works as intended)

backport required
2018-06-01 18:07:41 +02:00
Even Rouault
9d3f8d44f5
Merge pull request #7140 from rouault/fix_19009
Assorted set of fixes regarding field length for OGR provider
2018-06-01 17:42:59 +02:00
Even Rouault
3b29102627
Merge pull request #7141 from rouault/fix_18563
QgsVectorFileWriter: workaround a bug in GDAL where appending to an existing BNA crashes it (fixes #18563)
2018-06-01 15:17:10 +02:00
Even Rouault
43f796e78e
QgsVectorFileWriter: workaround a bug in GDAL where appending to an existing BNA crashes it (fixes #18563)
Upstream fixes done in GDAL as well to fix the crash itself:
GDAL master: a36939afd5
GDAL 2.3 branch: f9af14bc04
2018-06-01 14:28:30 +02:00
Even Rouault
e4d5899bb2
Merge pull request #7131 from rouault/fix_linux_build_qca
QCAMacros.cmake: fix Linux build
2018-06-01 14:19:42 +02:00
Even Rouault
b9003ffa12
QgsVectorDataProvider::supportedType(): only checks field length and precision against min/max if they are defined (ie > 0). Fixes test_qgsauxiliarystorage.py and qgis_projectstoragetest 2018-06-01 14:06:04 +02:00
Denis Rouzaud
dc9fb90b01 add note on how to invalidate results 2018-06-01 03:31:39 -08:00
Denis Rouzaud
a15d8903ed [locator] add a way to invalidate results from python API
otherwise if you access the config of the filter (or change app settings) from outside the main application settings dialog, results are not invalidate

for instance, if you update a URL of a service, results won't be updated
2018-06-01 03:31:39 -08:00
Even Rouault
917a6e3cdc
QCAMacros.cmake: re-add 25ba36180cfbf836b9458beb98e28f62349c4260 for FreeBSD 2018-06-01 13:23:49 +02:00
Even Rouault
1a4f80428d
QCAMacros.cmake: fix Linux build
25ba36180c causes
build failures on Ubuntu 16.04 and 18.04 with gcc

{{{
/usr/bin/c++    -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/usr/include/Qca-qt5/QtCrypto  -fPIE   -std=gnu++11 -o CMakeFiles/cmTC_3b936.dir/qcaossl.cpp.o -c /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp/qcaossl.cpp
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qchar.h:37:0,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:41,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QString:1,
                 from /usr/include/Qca-qt5/QtCrypto/qca_core.h:36,
                 from /usr/include/Qca-qt5/QtCrypto/qca.h:36,
                 from /usr/include/Qca-qt5/QtCrypto/QtCrypto:1,
                 from /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp/qcaossl.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1067:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."
 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
    ^
}}}

qtglobal.h doesn't like -fPIC and -fPIE together

See https://github.com/qgis/QGIS/pull/6093#issuecomment-393518711
2018-06-01 13:22:48 +02:00
Even Rouault
a3e527d8ff
[OGR provider] Advertize correct supported data types, length and with for GPKG; and advertize Date, Time, DateTime based on driver capabilities 2018-06-01 13:19:29 +02:00
Even Rouault
bad1ab4ea5
QgsVectorDataProvider::supportedType(): use -1 as the value for unspecified length/width (this is the default in QgsField constructor and QgsVectorDataProvider::NativeType()) 2018-06-01 13:18:48 +02:00
Even Rouault
04a55b2578
[cleanup] QgsFieldCalculator: avoid use of hardcoded magic indices 2018-06-01 13:17:13 +02:00
Even Rouault
f4bf1ec907
[OGR provider] GPKG: allow repeated creation of int fields with len != 0 (fixes #19009) 2018-06-01 13:15:41 +02:00