Skip to content

Commit d0060fd

Browse files
committedMay 10, 2020
Address review
1 parent 9be36fd commit d0060fd

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed
 

‎python/core/auto_generated/qgstemporalproperty.sip.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Base class for temporal property.
2424
#include "qgstemporalproperty.h"
2525
%End
2626
public:
27+
2728
enum Flag
2829
{
2930
NoFlags,

‎src/core/qgstemporalproperty.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ class CORE_EXPORT QgsTemporalProperty : public QObject
3737
Q_OBJECT
3838

3939
public:
40+
41+
/**
42+
* Flags attached to the temporal property.
43+
*/
4044
enum Flag
4145
{
4246
NoFlags = 0,
43-
FlagDontInvalidateCachedRendersWhenRangeChanges = 1 //!< Any cached rendering will not be invalidated when temporal range context is modified
47+
FlagDontInvalidateCachedRendersWhenRangeChanges = 1 //!< Any cached rendering will not be invalidated when temporal range context is modified.
4448
};
4549
Q_DECLARE_FLAGS( Flags, Flag )
4650

‎src/gui/qgsmapcanvas.cpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,12 @@ void QgsMapCanvas::rendererJobFinished()
698698
{
699699
mLastLayerRenderTime.insert( it.key()->id(), it.value() );
700700
}
701-
if ( mUsePreviewJobs && !mTemporalRefreshAfterJob )
701+
if ( mUsePreviewJobs && !mRefreshAfterJob )
702702
startPreviewJobs();
703703
}
704704
else
705705
{
706-
mTemporalRefreshAfterJob = false;
706+
mRefreshAfterJob = false;
707707
}
708708

709709
// now we are in a slot called from mJob - do not delete it immediately
@@ -713,9 +713,9 @@ void QgsMapCanvas::rendererJobFinished()
713713

714714
emit mapCanvasRefreshed();
715715

716-
if ( mTemporalRefreshAfterJob )
716+
if ( mRefreshAfterJob )
717717
{
718-
mTemporalRefreshAfterJob = false;
718+
mRefreshAfterJob = false;
719719
clearTemporalCache();
720720
refresh();
721721
}
@@ -801,17 +801,12 @@ void QgsMapCanvas::setTemporalRange( const QgsDateTimeRange &dateTimeRange )
801801

802802
emit temporalRangeChanged();
803803

804+
// we need to discard any previously cached images which have temporal properties enabled, so that these will be updated when
805+
// the canvas is redrawn
804806
if ( !mJob )
805-
{
806-
// we need to discard any previously cached images which have temporal properties enabled, so that these will be updated when
807-
// the canvas is redrawn
808807
clearTemporalCache();
809-
autoRefreshTriggered();
810-
}
811-
else
812-
{
813-
mTemporalRefreshAfterJob = true;
814-
}
808+
809+
autoRefreshTriggered();
815810
}
816811

817812
const QgsDateTimeRange &QgsMapCanvas::temporalRange() const
@@ -2059,9 +2054,9 @@ void QgsMapCanvas::autoRefreshTriggered()
20592054
{
20602055
if ( mJob )
20612056
{
2062-
// canvas is currently being redrawn, so we skip this auto refresh
2063-
// otherwise we could get stuck in the situation where an auto refresh is triggered
2064-
// too often to allow the canvas to ever finish rendering
2057+
// canvas is currently being redrawn, so we defer the last requested
2058+
// auto refresh until current rendering job finishes
2059+
mRefreshAfterJob = true;
20652060
return;
20662061
}
20672062

‎src/gui/qgsmapcanvas.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,8 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
10631063
//! Flag that allows squashing multiple refresh() calls into just one delayed rendering job
10641064
bool mRefreshScheduled = false;
10651065

1066-
//! Flag that triggers a refresh after an ongoing rendering job finishes and clear cache for temporal-enabled layers
1067-
bool mTemporalRefreshAfterJob = false;
1066+
//! Flag that triggers a refresh after an ongoing rendering job triggered by autoRefresh
1067+
bool mRefreshAfterJob = false;
10681068

10691069
//! determines whether user has requested to suppress rendering
10701070
bool mRenderFlag = true;

0 commit comments

Comments
 (0)
Please sign in to comment.