57790 Commits

Author SHA1 Message Date
nirvn
c7aeb4ceb2 [themes] Add disabled state for tree/table/list widgets 2019-09-18 18:06:51 +07:00
Alessandro Pasotti
6146456075
Merge pull request #31865 from elpaso/bugfix-gh31846-server-contextual-legend-no-width-no-height
Server fix getLegendGraphic default WIDTH/HEIGHT when BBOX
2019-09-18 12:09:11 +02:00
Matthias Kuhn
076b988537
Merge pull request #31854 from m-kuhn/gapCheckFixMz
Allow allowed gap layer to be of different ZM type than main layer
2019-09-18 11:45:41 +02:00
Even Rouault
d45c3dd4f1 QgsCoordinateTransform: remove entries from cache when a thread exits (relates to #31762)
Follow-up to https://github.com/qgis/QGIS/pull/31848

When a thread exits, make sure that we iterate over QgsCoordinateTransform::sTransforms
to remove from QgsCoordinateTransformPrivate::mProjProjections objects that
relates to the current thread, in order to free memory.

This is only implemented in the PROJ >= 6 case. In theory, we could probably
now revert //github.com/qgis/QGIS/pull/31848 for its PROJ 6 code paths, but
keeping it doesn't hurt...

A similar fix could potentially be done in PROJ < 6 case, but it would require
probably the starting call to be in QgsProjContextStore::~QgsProjContextStore()
instead of QgsProjContext::~QgsProjContext()
2019-09-18 16:41:20 +07:00
Alessandro Pasotti
10cf18a995 Add mask to getLegendGraphic test and check SRC(HEIGHT/WIDTH) 2019-09-18 11:32:05 +02:00
Alessandro Pasotti
3be3984e8e
Merge pull request #31841 from elpaso/bugfix-gh31799-tid-in-views
PG views: be tolerant for unsupported field type ...
2019-09-18 11:21:48 +02:00
Even Rouault
b5be645ddb Fix crash in QgsCoordinateTransformPrivate at application exit (fixes #31762)
This fixes the following Valgrind reported error:
```
==1703== Invalid read of size 4
==1703==    at 0xE614195: internal_pj_ctx_get_errno (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0xE6116AE: internal_pj_free (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0xE624E78: internal_proj_destroy (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0x7D3EFE7: QgsCoordinateTransformPrivate::freeProj() (qgscoordinatetransform_p.cpp:659)
==1703==    by 0x7D3CD23: QgsCoordinateTransformPrivate::~QgsCoordinateTransformPrivate() (qgscoordinatetransform_p.cpp:120)
==1703==    by 0x7D3AC46: QExplicitlySharedDataPointer<QgsCoordinateTransformPrivate>::~QExplicitlySharedDataPointer() (qshareddata.h:165)
==1703==    by 0x7D36D63: QgsCoordinateTransform::~QgsCoordinateTransform() (qgscoordinatetransform.cpp:148)
==1703==    by 0x7D3C425: QHashNode<QPair<QString, QString>, QgsCoordinateTransform>::~QHashNode() (qhash.h:149)
==1703==    by 0x7D3C459: QHash<QPair<QString, QString>, QgsCoordinateTransform>::deleteNode2(QHashData::Node*) (qhash.h:536)
==1703==    by 0x9BEEB78: QHashData::free_helper(void (*)(QHashData::Node*)) (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==1703==    by 0x7D3B81C: QHash<QPair<QString, QString>, QgsCoordinateTransform>::freeData(QHashData*) (qhash.h:576)
==1703==    by 0x7D3B2B3: QHash<QPair<QString, QString>, QgsCoordinateTransform>::~QHash() (qhash.h:254)
==1703==    by 0x7D3B7DA: QHash<QPair<QString, QString>, QgsCoordinateTransform>::operator=(QHash<QPair<QString, QString>, QgsCoordinateTransform>&&) (qhash.h:260)
==1703==    by 0x7D3B239: QHash<QPair<QString, QString>, QgsCoordinateTransform>::clear() (qhash.h:582)
==1703==    by 0x7D3A685: QgsCoordinateTransform::invalidateCache(bool) (qgscoordinatetransform.cpp:958)
==1703==    by 0x7C73601: QgsApplication::invalidateCaches() (qgsapplication.cpp:365)
==1703==    by 0x7C7A490: QgsApplication::exitQgis() (qgsapplication.cpp:1275)
==1703==    by 0x511BCC5: QgisApp::~QgisApp() (qgisapp.cpp:1662)
==1703==    by 0x511BE73: QgisApp::~QgisApp() (qgisapp.cpp:1664)
==1703==    by 0x418CB4: main (main.cpp:1579)
==1703==  Address 0x48fc4710 is 0 bytes inside a block of size 136 free'd
==1703==    at 0x4C2F440: operator delete(void*) (vg_replace_malloc.c:586)
==1703==    by 0xE625A3A: internal_proj_context_destroy (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0x7F9B78A: QgsProjContext::~QgsProjContext() (qgsprojutils.cpp:48)
==1703==    by 0xA6195FE: __call_tls_dtors (cxa_thread_atexit_impl.c:155)
==1703==    by 0x10A936C7: start_thread (pthread_create.c:343)
==1703==    by 0xA6E641C: clone (clone.S:109)
==1703==  Block was alloc'd at
==1703==    at 0x4C2E709: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:387)
==1703==    by 0xE61445E: internal_pj_ctx_alloc (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==1703==    by 0x7F9B761: QgsProjContext::QgsProjContext() (qgsprojutils.cpp:39)
==1703==    by 0x7F9C6B9: __tls_init (qgsprojutils.cpp:31)
==1703==    by 0x7F9C703: TLS wrapper function for QgsProjContext::sProjContext (in /home/even/qgis/QGIS/build/output/lib/libqgis_core.so.3.9.0)
==1703==    by 0x7F9B796: QgsProjContext::get() (qgsprojutils.cpp:57)
==1703==    by 0x7D3D5AA: QgsCoordinateTransformPrivate::threadLocalProjData() (qgscoordinatetransform_p.cpp:299)
==1703==    by 0x7D3D11A: QgsCoordinateTransformPrivate::initialize() (qgscoordinatetransform_p.cpp:199)
==1703==    by 0x7D368E4: QgsCoordinateTransform::QgsCoordinateTransform(QgsCoordinateReferenceSystem const&, QgsCoordinateReferenceSystem const&, QgsCoordinateTransformContext const&) (qgscoordinatetransform.cpp:75)
==1703==    by 0x8317CBE: QgsRasterProjector::block(int, QgsRectangle const&, int, int, QgsRasterBlockFeedback*) (qgsrasterprojector.cpp:779)
==1703==    by 0x82EBE87: QgsRasterIterator::readNextRasterPartInternal(int, int&, int&, std::unique_ptr<QgsRasterBlock, std::default_delete<QgsRasterBlock> >*, int&, int&, QgsRectangle*) (qgsrasteriterator.cpp:130)
==1703==    by 0x82EB791: QgsRasterIterator::readNextRasterPart(int, int&, int&, std::unique_ptr<QgsRasterBlock, std::default_delete<QgsRasterBlock> >&, int&, int&, QgsRectangle*) (qgsrasteriterator.cpp:80)
==1703==    by 0x8334E8D: QgsRasterDrawer::draw(QPainter*, QgsRasterViewPort*, QgsMapToPixel const*, QgsRasterBlockFeedback*) (qgsrasterdrawer.cpp:60)
==1703==    by 0x830AEE3: QgsRasterLayerRenderer::render() (qgsrasterlayerrenderer.cpp:269)
==1703==    by 0x7E764FB: QgsMapRendererCustomPainterJob::doRender() (qgsmaprenderercustompainterjob.cpp:310)
==1703==    by 0x7E76027: QgsMapRendererCustomPainterJob::staticRender(QgsMapRendererCustomPainterJob*) (qgsmaprenderercustompainterjob.cpp:261)
==1703==    by 0x7E788D6: QtConcurrent::StoredFunctorCall1<void, void (*)(QgsMapRendererCustomPainterJob*), QgsMapRendererCustomPainterJob*>::runFunctor() (qtconcurrentstoredfunctioncall.h:432)
==1703==    by 0x7E76E42: QtConcurrent::RunFunctionTask<void>::run() (qtconcurrentrunbase.h:136)
==1703==    by 0x9B93942: ??? (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==1703==    by 0x9B97658: ??? (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==1703==    by 0x10A936B9: start_thread (pthread_create.c:333)
==1703==    by 0xA6E641C: clone (clone.S:109)
```

This issue is also found on QGIS 3.4 / PROJ 5 with a slighly comparable stack
trace.

The issue here is that the static QgsCoordinateTransform::sTransforms cache map
contains QgsCoordinateTransformPrivate::mProjProjections objects, which themselves
are PJ*/projPJ PROJ objects. Those objects may have been created by a thread,
using a PROJ context, which is a TLS object, and thus has been deleted when
the thread is itself deleted. However sTransforms is cleaned afterwards, and
when destroying a PJ*/projPJ object, the context it is attached to must still
be alive.

This fix of this commit consists in creating a temporary PROJ context and assigning
it to the PJ* object before its destruction.

A proper fix would be to remove from sTransforms the PROJ objects that belong to
a given thread when that thread is deleted (or more exactly QgsProjContext is destroyed),
but that's more involved. Another reason for such a proper fix is to avoid a
kind of memory leak, since currently sTransforms might grow without control when
threads are created and destroyed.
2019-09-18 16:04:39 +07:00
Even Rouault
cd3940df7c
Merge pull request #31813 from rouault/fix_29844
[WFS provider] Fix recovery of GeoServer server error when lack of primary key (fixes #29844)
2019-09-18 11:00:58 +02:00
Alessandro Pasotti
55f89db98f Add some comments for checkParameters function
also set const back
2019-09-18 09:58:12 +02:00
Alessandro Pasotti
55f237911a
code layout 2019-09-18 09:44:55 +02:00
Matthias Kuhn
23bd724546 Add safety check for nullptr to fix a crash 2019-09-18 09:36:14 +02:00
Matthias Kuhn
61812648a3 Add API to hook into resolveReferences 2019-09-18 09:32:02 +02:00
Nyall Dawson
2c69b24ffe Avoid use of deprecated method in test 2019-09-18 10:35:23 +10:00
Nyall Dawson
8157971dd7 Fix API break 2019-09-18 10:35:23 +10:00
Nyall Dawson
fcd21e4850 [reports] Fix predefined scale mode is incompatible with report outputs
Fixes #29196
2019-09-18 10:35:23 +10:00
Nyall Dawson
ffc71c4f57 Remove const_cast 2019-09-18 07:55:46 +10:00
Nyall Dawson
3de0593957 Ensure atlas expression evaluation has access to coverage layer scope
Fixes #31807
2019-09-18 07:55:46 +10:00
Even Rouault
2a2cb87f8e
[OGR provider] Invalid feature count on layer reload (fixes #30518) 2019-09-17 22:33:50 +02:00
Denis Rouzaud
838dbef3c0 [layer tree] dedicated method in QgisApp to determine insertion point
and create bindings to get the current insertion point in QgisInterface
2019-09-17 20:55:40 +02:00
Nyall Dawson
421e68cf5a [layouts] Resizing pages to content should not create empty page size
if no items are present

Fixes #29034
2019-09-18 04:29:35 +10:00
Nyall Dawson
f5afebe5dd [layouts] Fix map rotation does not immediately restore in reports
Fixes #31217
2019-09-18 04:29:14 +10:00
Nyall Dawson
979237515c [properties] Do not return nan values when an assistant is used
with min val == max val

Fixes #31242
2019-09-18 04:28:52 +10:00
Nyall Dawson
f9a47738aa [layouts] Fix label items don't update when their opacity < 100
Fixes #29079
2019-09-18 04:28:29 +10:00
Nyall Dawson
4e6e561135 Be super safe against a stuck project load indicator 2019-09-18 04:28:04 +10:00
Nyall Dawson
40d95b69d9 Fix QgsProject::layerLoaded sometimes emitted with incorrect total layer count
Causes the project load status indicator to get "stuck" after project load
2019-09-18 04:28:04 +10:00
Harrissou Sant-anna
493a8c814f Add empty line for list rendering 2019-09-18 04:13:31 +10:00
Harrissou Sant-anna
b4b2a6e9de Allow better rendering for list items 2019-09-18 04:13:31 +10:00
Alessandro Pasotti
5b3360081b Server getLegendGraphic default WIDTH/HEIGHT when BBOX
is set.

Fixes #31846
2019-09-17 18:55:01 +02:00
Etienne Trimaille
3b95172362
update docstring about QgsDateTimeEdit about NULL values 2019-09-17 17:25:15 +02:00
Matthias Kuhn
e3eb91d25e Allow gap layer to be of different ZM type than main layer 2019-09-17 17:04:13 +02:00
Sandro Santilli
3225f4911a Make apidoc installation optional when building it on demand
Fixes #31842
2019-09-17 15:18:14 +02:00
Alexander Bruy
27b576c794
Merge pull request #31735 from alexbruy/fix-29663
[processing] add support for WFS as input (fix #29663)
2019-09-17 15:54:48 +03:00
Jürgen Fischer
b70d42a6a6
Update qgspostgresprovider.cpp 2019-09-17 14:50:06 +02:00
Jürgen Fischer
562089ed28
Update qgspostgresprovider.cpp 2019-09-17 14:47:28 +02:00
Alessandro Pasotti
4c8bac06c8 Add test for tid key types in PG views 2019-09-17 14:37:58 +02:00
Alessandro Pasotti
f7d1971d01 PG views: be tolerant for unsupported field type ...
... if it's in URI key

Fixes #31799
2019-09-17 14:30:33 +02:00
Sandro Santilli
6942b4b93d
Fix endless loop on curve linearization with maxdistance tolerance higher than arc radius (#31838)
* Test curve linearization with higher than sagitta tolerance
* segmentizeArc: keep max distance tolerance below twice the radius

Fixes #31832
2019-09-17 13:58:17 +02:00
Even Rouault
ea09452b5b
[WFS provider] Fix recovery of GeoServer server error when lack of primary key (fixes #29844) 2019-09-17 11:59:03 +02:00
Denis Rouzaud
68a78059c0
fix adding/removing classes in graduated renderer widget (#31824) 2019-09-17 11:57:48 +02:00
Matthias Kuhn
b7693d1826
Merge pull request #31793 from Gustry/unittest
use a single comment checking unittest in DB Manager SQL window
2019-09-17 10:46:15 +02:00
nirvn
9f479162e2 [wmst] Fix bad allocation exception with high resolution tiled servers (fixes #30634) 2019-09-17 15:36:32 +07:00
nirvn
6fd7d4b6e6 [browser] Do not show the file properties menu action for non-file items 2019-09-17 13:47:15 +07:00
nirvn
0fcba4ed11 Be on the safe side, check for null message bar pointer 2019-09-17 12:35:52 +07:00
nirvn
74c4f8e3f3 Do not show QtSVG warnings for SVG spec implementation gaps 2019-09-17 12:35:52 +07:00
Alexander Bruy
c7c91de52e fix tests 2019-09-17 08:32:01 +03:00
Nyall Dawson
65ac68bb0b Avoid qt warning on project load when thumbnail doesn't exist 2019-09-17 15:12:25 +10:00
Nyall Dawson
676161762a Expand GNSS and CORS acroynms in proj scope text
(I'm sure I'm not the only one who continually reads CORS as
"Cross-origin resource sharing"!)
2019-09-17 14:34:52 +10:00
Even Rouault
bbaa62af0c test_qgsrasterfilewritertask.py: test failure 2019-09-17 08:58:25 +10:00
Even Rouault
5e70084d32 QgsRasterFileWriter: improve error reporting 2019-09-17 08:58:25 +10:00
Even Rouault
7e3c9d98e2 QgsRasterFileWriter: fix crash when exporting to GS7BG driver (fixes #31775), and detect more potential crashing situations 2019-09-17 08:58:25 +10:00