Skip to content
Permalink
Browse files

fix some deprecation warnings

  • Loading branch information
jef-n committed Feb 23, 2014
1 parent 5d7179f commit 5134ef9aba775bc1e8ce0728a08d04575a304020
@@ -94,7 +94,7 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
ADD_DEFINITIONS( /wd4996 /wd4701 /wd4702 )
ELSE(MSVC)
# disable all warnings
ADD_DEFINITIONS( -w )
ADD_DEFINITIONS( -w -Wno-deprecated-declarations )
IF(NOT APPLE)
ADD_DEFINITIONS( -fpermissive )
ENDIF(NOT APPLE)
@@ -104,7 +104,7 @@ void QgsOSMDownloadDialog::onExtentCanvas()
{
QgsCoordinateReferenceSystem dst( GEOCRS_ID, QgsCoordinateReferenceSystem::InternalCrsId );

QgsCoordinateTransform ct( QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs(), dst );
QgsCoordinateTransform ct( QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs(), dst );
r = ct.transformBoundingBox( r );
if ( !r.isFinite() )
{
@@ -704,7 +704,7 @@ void QgsDiagramProperties::showSizeAttributeExpressionDialog()

QgsDistanceArea myDa;
myDa.setSourceCrs( mLayer->crs().srsid() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() );
myDa.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
dlg.setGeomCalculator( myDa );

@@ -734,7 +734,7 @@ void QgsDiagramProperties::showAddAttributeExpressionDialog()

QgsDistanceArea myDa;
myDa.setSourceCrs( mLayer->crs().srsid() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() );
myDa.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
dlg.setGeomCalculator( myDa );

@@ -45,7 +45,7 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl )

QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs().srsid() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() );
myDa.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
builder->setGeomCalculator( myDa );

@@ -311,7 +311,6 @@ ADD_BISON_FILES(QGIS_CORE_SRCS qgsexpressionparser.yy)
SET(QGIS_CORE_MOC_HDRS

qgsmaprenderercache.h
qgsmapsettings.h
qgsmaprendererjob.h

qgsapplication.h
@@ -387,6 +386,10 @@ ENDIF (QT_MOBILITY_LOCATION_FOUND)

QT4_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})

IF(UNIX)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)

# install headers
# install qgsconfig.h and plugin.h here so they can get into
# the OS X framework target
@@ -433,7 +433,21 @@ void QgsComposerMap::setCacheUpdated( bool u )

const QgsMapRenderer *QgsComposerMap::mapRenderer() const
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
return mComposition->mapRenderer();
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}

QStringList QgsComposerMap::layersToRender()
@@ -644,7 +644,23 @@ void QgsMapRenderer::setProjectionsEnabled( bool enabled )
mDistArea->setEllipsoidalMode( enabled );
updateFullExtent();
mLastExtent.setMinimal();

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
emit hasCrsTransformEnabled( enabled ); // deprecated
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif

emit hasCrsTransformEnabledChanged( enabled );
}
}
@@ -568,14 +568,13 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
continue;
}

bool split = false;
QgsRectangle r1 = mSettings.visibleExtent(), r2;
const QgsCoordinateTransform* ct = 0;

if ( mSettings.hasCrsTransformEnabled() )
{
ct = QgsCoordinateTransformCache::instance()->transform( ml->crs().authid(), mSettings.destinationCrs().authid() );
split = reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 );
reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 );
QgsDebugMsg( " extent 1: " + r1.toString() );
QgsDebugMsg( " extent 2: " + r2.toString() );
if ( !r1.isFinite() || !r2.isFinite() )
@@ -23,7 +23,7 @@
#include "qgssimplifymethod.h"


QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource(QgsVectorLayer *layer)
QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource( QgsVectorLayer *layer )
{
mProviderFeatureSource = layer->dataProvider()->featureSource();
mFields = layer->pendingFields();
@@ -34,10 +34,11 @@ QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource(QgsVectorLayer *layer)
mHasEditBuffer = layer->editBuffer();
if ( mHasEditBuffer )
{
/* TODO[MD]: after merge
#if 0
// TODO[MD]: after merge
if ( request.filterType() == QgsFeatureRequest::FilterFid )
{

// only copy relevant parts
if ( L->editBuffer()->addedFeatures().contains( request.filterFid() ) )
mAddedFeatures.insert( request.filterFid(), L->editBuffer()->addedFeatures()[ request.filterFid()] );
@@ -55,14 +56,17 @@ QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource(QgsVectorLayer *layer)
mChangedFeaturesRequest.setFilterFids( QgsFeatureIds() << request.filterFid() );
}
else
{*/
{
#endif
mAddedFeatures = QgsFeatureMap( layer->editBuffer()->addedFeatures() );
mChangedGeometries = QgsGeometryMap( layer->editBuffer()->changedGeometries() );
mDeletedFeatureIds = QgsFeatureIds( layer->editBuffer()->deletedFeatureIds() );
mChangedAttributeValues = QgsChangedAttributesMap( layer->editBuffer()->changedAttributeValues() );
mAddedAttributes = QList<QgsField>( layer->editBuffer()->addedAttributes() );
mDeletedAttributeIds = QgsAttributeList( layer->editBuffer()->deletedAttributeIds() );
//}
mDeletedAttributeIds = QgsAttributeList( layer->editBuffer()->deletedAttributeIds() );
#if 0
}
#endif
}
}

@@ -79,9 +83,9 @@ QgsFeatureIterator QgsVectorLayerFeatureSource::getFeatures( const QgsFeatureReq
}


QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(QgsVectorLayerFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
: QgsAbstractFeatureIteratorFromSource( source, ownSource, request )
, mEditGeometrySimplifier( 0 )
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator( QgsVectorLayerFeatureSource* source, bool ownSource, const QgsFeatureRequest& request )
: QgsAbstractFeatureIteratorFromSource( source, ownSource, request )
, mEditGeometrySimplifier( 0 )
{

// prepare joins: may add more attributes to fetch (in order to allow join)
@@ -516,7 +520,8 @@ bool QgsVectorLayerFeatureIterator::prepareSimplification( const QgsSimplifyMeth

bool QgsVectorLayerFeatureIterator::providerCanSimplify( QgsSimplifyMethod::MethodType methodType ) const
{
/* TODO[MD]: after merge
#if 0
// TODO[MD]: after merge
QgsVectorDataProvider* provider = L->dataProvider();

if ( provider && methodType != QgsSimplifyMethod::NoSimplification )
@@ -531,7 +536,8 @@ bool QgsVectorLayerFeatureIterator::providerCanSimplify( QgsSimplifyMethod::Meth
{
return ( capabilities & QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation );
}
}*/
}
#endif
return false;
}

@@ -42,7 +42,8 @@ class QgsVectorLayerRenderer : public QgsMapLayerRenderer
private:

/**Registers label and diagram layer
@param attributes attributes needed for labeling and diagrams will be added to the list
@param layer diagram layer
@param attributeNames attributes needed for labeling and diagrams will be added to the list
*/
void prepareLabeling( QgsVectorLayer* layer, QStringList& attributeNames );
void prepareDiagrams( QgsVectorLayer* layer, QStringList& attributeNames );
@@ -267,6 +267,10 @@ qgssublayersdialog.h

QT4_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS})

IF(UNIX)
SET_SOURCE_FILES_PROPERTIES(${QGIS_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)

# for installing headers

SET(QGIS_GUI_HDRS
@@ -1527,7 +1527,21 @@ bool QgsMapCanvas::isFrozen()

QPaintDevice &QgsMapCanvas::canvasPaintDevice()
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
return mMap->paintDevice();
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}

double QgsMapCanvas::mapUnitsPerPixel() const
@@ -526,7 +526,7 @@ double GlobePlugin::getSelectedElevation()
void GlobePlugin::syncExtent()
{
QgsMapCanvas* mapCanvas = mQGisIface->mapCanvas();
QgsMapRenderer* mapRenderer = mapCanvas->mapRenderer();
const QgsMapSettings &mapSettings = mapCanvas->mapSettings();
QgsRectangle extent = mapCanvas->extent();

osgEarth::Util::EarthManipulator* manip = dynamic_cast<osgEarth::Util::EarthManipulator*>( mOsgViewer->getCameraManipulator() );
@@ -535,8 +535,8 @@ void GlobePlugin::syncExtent()

QgsDistanceArea dist;

dist.setSourceCrs( mapRenderer->destinationCrs().srsid() );
dist.setEllipsoidalMode( mapRenderer->hasCrsTransformEnabled() );
dist.setSourceCrs( mapSettings.destinationCrs().srsid() );
dist.setEllipsoidalMode( mapSettings.hasCrsTransformEnabled() );
dist.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );

QgsPoint ll = QgsPoint( extent.xMinimum(), extent.yMinimum() );

0 comments on commit 5134ef9

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