Skip to content
Permalink
Browse files

Address review

  • Loading branch information
nirvn committed May 10, 2020
1 parent 9be36fd commit d0060fd89a27eb143713f88f764c0b7abe9b7bea
@@ -24,6 +24,7 @@ Base class for temporal property.
#include "qgstemporalproperty.h"
%End
public:

enum Flag
{
NoFlags,
@@ -37,10 +37,14 @@ class CORE_EXPORT QgsTemporalProperty : public QObject
Q_OBJECT

public:

/**
* Flags attached to the temporal property.
*/
enum Flag
{
NoFlags = 0,
FlagDontInvalidateCachedRendersWhenRangeChanges = 1 //!< Any cached rendering will not be invalidated when temporal range context is modified
FlagDontInvalidateCachedRendersWhenRangeChanges = 1 //!< Any cached rendering will not be invalidated when temporal range context is modified.
};
Q_DECLARE_FLAGS( Flags, Flag )

@@ -698,12 +698,12 @@ void QgsMapCanvas::rendererJobFinished()
{
mLastLayerRenderTime.insert( it.key()->id(), it.value() );
}
if ( mUsePreviewJobs && !mTemporalRefreshAfterJob )
if ( mUsePreviewJobs && !mRefreshAfterJob )
startPreviewJobs();
}
else
{
mTemporalRefreshAfterJob = false;
mRefreshAfterJob = false;
}

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

emit mapCanvasRefreshed();

if ( mTemporalRefreshAfterJob )
if ( mRefreshAfterJob )
{
mTemporalRefreshAfterJob = false;
mRefreshAfterJob = false;
clearTemporalCache();
refresh();
}
@@ -801,17 +801,12 @@ void QgsMapCanvas::setTemporalRange( const QgsDateTimeRange &dateTimeRange )

emit temporalRangeChanged();

// we need to discard any previously cached images which have temporal properties enabled, so that these will be updated when
// the canvas is redrawn
if ( !mJob )
{
// we need to discard any previously cached images which have temporal properties enabled, so that these will be updated when
// the canvas is redrawn
clearTemporalCache();
autoRefreshTriggered();
}
else
{
mTemporalRefreshAfterJob = true;
}

autoRefreshTriggered();
}

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

@@ -1063,8 +1063,8 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! Flag that allows squashing multiple refresh() calls into just one delayed rendering job
bool mRefreshScheduled = false;

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

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

0 comments on commit d0060fd

Please sign in to comment.
You can’t perform that action at this time.