Skip to content
Permalink
Browse files

Fix deprecation warnings for core

  • Loading branch information
pblottiere authored and nyalldawson committed Jan 29, 2020
1 parent 810135c commit 9fb20f927bf5a16682565ddec3a26938be88beec
@@ -340,7 +340,7 @@ void QgsLabelingEngine::solve( QgsRenderContext &context )

mPal->registerCancellationCallback( &_palIsCanceled, reinterpret_cast< void * >( &context ) );

QTime t;
QElapsedTimer t;
t.start();

// do the labeling itself
@@ -400,7 +400,7 @@ void QgsLabelingEngine::solve( QgsRenderContext &context )

void QgsLabelingEngine::drawLabels( QgsRenderContext &context, const QString &layerId )
{
QTime t;
QElapsedTimer t;
t.start();

const QgsLabelingEngineSettings &settings = mMapSettings.labelingEngineSettings();
@@ -246,7 +246,7 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa
toExecute.insert( childIt->childId() );
}

QTime totalTime;
QElapsedTimer totalTime;
totalTime.start();

QgsProcessingMultiStepFeedback modelFeedback( toExecute.count(), feedback );
@@ -310,7 +310,7 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa
feedback->pushCommandInfo( QStringLiteral( "{ %1 }" ).arg( params.join( QStringLiteral( ", " ) ) ) );
}

QTime childTime;
QElapsedTimer childTime;
childTime.start();

bool ok = false;
@@ -19,6 +19,7 @@
#include <QtConcurrentMap>
#include <QtConcurrentRun>
#include <QDateTime>
#include <QElapsedTimer>
#include <QDir>
#include <QFileInfo>
#include <QMenu>
@@ -280,7 +281,7 @@ void QgsDataItem::populate( bool foreground )
QVector<QgsDataItem *> QgsDataItem::runCreateChildren( QgsDataItem *item )
{
QgsDebugMsgLevel( "path = " + item->path(), 2 );
QTime time;
QElapsedTimer time;
time.start();
QVector <QgsDataItem *> children = item->createChildren();
QgsDebugMsgLevel( QStringLiteral( "%1 children created in %2 ms" ).arg( children.size() ).arg( time.elapsed() ), 3 );
@@ -20,6 +20,7 @@
#include <QApplication>
#include <QtDebug>
#include <QFile>
#include <QElapsedTimer>
#include <QThread>

#ifndef CMAKE_SOURCE_DIR
@@ -30,7 +31,7 @@ int QgsLogger::sDebugLevel = -999; // undefined value
int QgsLogger::sPrefixLength = -1;
Q_GLOBAL_STATIC( QString, sFileFilter )
Q_GLOBAL_STATIC( QString, sLogFile )
Q_GLOBAL_STATIC( QTime, sTime )
Q_GLOBAL_STATIC( QElapsedTimer, sTime )

void QgsLogger::init()
{
@@ -87,7 +87,7 @@ void QgsMapRendererCustomPainterJob::start()
QgsDebugMsgLevel( QStringLiteral( "QPAINTER run!" ), 5 );

QgsDebugMsgLevel( QStringLiteral( "Preparing list of layer jobs for rendering" ), 5 );
QTime prepareTime;
QElapsedTimer prepareTime;
prepareTime.start();

preparePainter( mPainter, mSettings.backgroundColor() );
@@ -137,7 +137,7 @@ void QgsMapRendererCustomPainterJob::cancel()
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );
cancelWithoutBlocking();

QTime t;
QElapsedTimer t;
t.start();

mFutureWatcher.waitForFinished();
@@ -173,7 +173,7 @@ void QgsMapRendererCustomPainterJob::waitForFinished()

disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );

QTime t;
QElapsedTimer t;
t.start();

mFutureWatcher.waitForFinished();
@@ -283,7 +283,7 @@ void QgsMapRendererCustomPainterJob::doRender()
{
bool hasSecondPass = ! mSecondPassLayerJobs.isEmpty();
QgsDebugMsgLevel( QStringLiteral( "Starting to render layer stack." ), 5 );
QTime renderTime;
QElapsedTimer renderTime;
renderTime.start();

for ( LayerRenderJobs::iterator it = mLayerJobs.begin(); it != mLayerJobs.end(); ++it )
@@ -302,7 +302,7 @@ void QgsMapRendererCustomPainterJob::doRender()

if ( !job.cached )
{
QTime layerTime;
QElapsedTimer layerTime;
layerTime.start();

if ( job.img )
@@ -332,7 +332,7 @@ void QgsMapRendererCustomPainterJob::doRender()
{
if ( !mLabelJob.cached )
{
QTime labelTime;
QElapsedTimer labelTime;
labelTime.start();

if ( mLabelJob.img )
@@ -373,7 +373,7 @@ void QgsMapRendererCustomPainterJob::doRender()

if ( !job.cached )
{
QTime layerTime;
QElapsedTimer layerTime;
layerTime.start();

if ( job.img )
@@ -16,7 +16,7 @@
#include "qgsmaprendererjob.h"

#include <QPainter>
#include <QTime>
#include <QElapsedTimer>
#include <QTimer>
#include <QtConcurrentMap>

@@ -380,7 +380,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
}
}

QTime layerTime;
QElapsedTimer layerTime;
layerTime.start();
job.renderer = ml->createMapRenderer( job.context );
job.renderingTime = layerTime.elapsed(); // include job preparation time in layer rendering time
@@ -910,7 +910,7 @@ void QgsMapRendererJob::drawLabeling( QgsRenderContext &renderContext, QgsLabeli
{
QgsDebugMsgLevel( QStringLiteral( "Draw labeling start" ), 5 );

QTime t;
QElapsedTimer t;
t.start();

// Reset the composition mode before rendering the labels
@@ -313,7 +313,7 @@ class CORE_EXPORT QgsMapRendererJob : public QObject
protected:

QgsMapSettings mSettings;
QTime mRenderingStart;
QElapsedTimer mRenderingStart;
Errors mErrors;

QgsMapRendererCache *mCache = nullptr;
@@ -148,7 +148,7 @@ void QgsMapRendererParallelJob::waitForFinished()
{
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderLayersFinished );

QTime t;
QElapsedTimer t;
t.start();

mFutureWatcher.waitForFinished();
@@ -162,7 +162,7 @@ void QgsMapRendererParallelJob::waitForFinished()
{
disconnect( &mLabelingFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderingFinished );

QTime t;
QElapsedTimer t;
t.start();

mLabelingFutureWatcher.waitForFinished();
@@ -176,7 +176,7 @@ void QgsMapRendererParallelJob::waitForFinished()
{
disconnect( &mSecondPassFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderLayersSecondPassFinished );

QTime t;
QElapsedTimer t;
t.start();

mSecondPassFutureWatcher.waitForFinished();
@@ -345,7 +345,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob &job )
job.imageInitialized = true;
}

QTime t;
QElapsedTimer t;
t.start();
QgsDebugMsgLevel( QStringLiteral( "job %1 start (layer %2)" ).arg( reinterpret_cast< quint64 >( &job ), 0, 16 ).arg( job.layerId ), 2 );
try
@@ -379,7 +379,7 @@ void QgsMapRendererParallelJob::renderLabelsStatic( QgsMapRendererParallelJob *s

if ( !job.cached )
{
QTime labelTime;
QElapsedTimer labelTime;
labelTime.start();

QPainter painter;
@@ -42,7 +42,7 @@ void QgsMapRendererStagedRenderJob::start()
mErrors.clear();

QgsDebugMsgLevel( QStringLiteral( "Preparing list of layer jobs for rendering" ), 5 );
QTime prepareTime;
QElapsedTimer prepareTime;
prepareTime.start();

mLabelingEngineV2.reset();
@@ -687,7 +687,7 @@ bool QgsPointLocator::prepare( bool relaxed )

bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
{
QTime t;
QElapsedTimer t;
t.start();

QgsDebugMsg( QStringLiteral( "RebuildIndex start : %1" ).arg( mSource->id() ) );
@@ -22,7 +22,6 @@
#include <QColor>
#include <QPainter>
#include <QImage>
#include <QTime>
#include <QCryptographicHash>
#include <QByteArray>
#include <QDebug>
@@ -182,7 +181,7 @@ bool QgsRenderChecker::runTest( const QString &testName,
mMapSettings.setFlag( QgsMapSettings::Antialiasing );
mMapSettings.setOutputSize( QSize( myExpectedImage.width(), myExpectedImage.height() ) / mMapSettings.devicePixelRatio() );

QTime myTime;
QElapsedTimer myTime;
myTime.start();

QgsMapRendererSequentialJob job( mMapSettings );
@@ -16,6 +16,7 @@
#define QGSRUNTIMEPROFILER_H

#include <QTime>
#include <QElapsedTimer>
#include "qgis_sip.h"
#include <QPair>
#include <QStack>
@@ -80,7 +81,7 @@ class CORE_EXPORT QgsRuntimeProfiler
private:
QString mGroupPrefix;
QStack<QString> mGroupStack;
QTime mProfileTime;
QElapsedTimer mProfileTime;
QString mCurrentName;
QList<QPair<QString, double > > mProfileTimes;
};
@@ -377,7 +377,7 @@ void QgsSnappingUtils::prepareIndex( const QList<LayerAndAreaOfInterest> &layers
if ( !layersToIndex.isEmpty() )
{
// build indexes
QTime t;
QElapsedTimer t;
int i = 0;

if ( !relaxed )
@@ -484,7 +484,7 @@ bool QgsTracer::initGraph()

// TODO: use QgsPointLocator as a source for the linework

QTime t1, t2, t2a, t3;
QElapsedTimer t1, t2, t2a, t3;

t1.start();
int featuresCounted = 0;
@@ -745,7 +745,7 @@ QVector<QgsPointXY> QgsTracer::findShortestPath( const QgsPointXY &p1, const Qgs
return QVector<QgsPointXY>();
}

QTime t;
QElapsedTimer t;
t.start();
int v1 = pointInGraph( *mGraph, p1 );
int v2 = pointInGraph( *mGraph, p2 );
@@ -762,7 +762,7 @@ QVector<QgsPointXY> QgsTracer::findShortestPath( const QgsPointXY &p1, const Qgs
return QVector<QgsPointXY>();
}

QTime t2;
QElapsedTimer t2;
t2.start();
QgsPolylineXY points = shortestPath( *mGraph, v1, v2 );
int tPath = t2.elapsed();
@@ -100,7 +100,7 @@ void QgsVectorLayerCache::setFullCache( bool fullCache )

int i = 0;

QTime t;
QElapsedTimer t;
t.start();

QgsFeature f;
@@ -78,7 +78,6 @@ email : tim at linfiniti.com
#include <QPixmap>
#include <QRegExp>
#include <QSlider>
#include <QTime>

#define ERR(message) QGS_ERROR_MESSAGE(message,"Raster layer")

@@ -251,7 +250,7 @@ void QgsRasterLayer::draw( QPainter *theQPainter,
const QgsMapToPixel *qgsMapToPixel )
{
QgsDebugMsgLevel( QStringLiteral( " 3 arguments" ), 4 );
QTime time;
QElapsedTimer time;
time.start();
//
//
@@ -48,7 +48,7 @@ void QgsRasterLayerRendererFeedback::onNewData()
// TODO: update only the area that got new data

QgsDebugMsgLevel( QStringLiteral( "new raster preview! %1" ).arg( mLastPreview.msecsTo( QTime::currentTime() ) ), 3 );
QTime t;
QElapsedTimer t;
t.start();
QgsRasterBlockFeedback feedback;
feedback.setPreviewOnly( true );
@@ -240,7 +240,7 @@ bool QgsRasterLayerRenderer::render()

//R->draw( mPainter, mRasterViewPort, &mMapToPixel );

QTime time;
QElapsedTimer time;
time.start();
//
//

0 comments on commit 9fb20f9

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