Skip to content
Permalink
Browse files

replace deprecation pragmas with macro (followup 5134ef9)

  • Loading branch information
jef-n committed Feb 27, 2014
1 parent 33a8b63 commit 3b1e192222c5861d04a7d2b028d94c12ee20f7c8
Showing with 23 additions and 43 deletions.
  1. +2 −14 src/core/composer/qgscomposermap.cpp
  2. +17 −0 src/core/qgis.h
  3. +2 −15 src/core/qgsmaprenderer.cpp
  4. +2 −14 src/gui/qgsmapcanvas.cpp
@@ -435,21 +435,9 @@ 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
Q_NOWARN_DEPRECATED_PUSH
return mComposition->mapRenderer();
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Q_NOWARN_DEPRECATED_POP
}

QStringList QgsComposerMap::layersToRender()
@@ -404,6 +404,23 @@ typedef QMap<QString, QString> QgsStringMap;
* KEEP IN SYNC WITH qgssize defined in SIP! */
typedef unsigned long long qgssize;

#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
#define Q_NOWARN_DEPRECATED_PUSH \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define Q_NOWARN_DEPRECATED_POP \
_Pragma("GCC diagnostic pop")
#elif defined(_MSC_VER)
#define Q_NOWARN_DEPRECATED_PUSH \
__pragma(warning(push)) \
__pragma(warning(disable:4996))
#define Q_NOWARN_DEPRECATED_POP \
__pragma(warning(pop))
#else
#define Q_NOWARN_DEPRECATED_PUSH
#define Q_NOWARN_DEPRECATED_POP
#endif

// FIXME: also in qgisinterface.h
#ifndef QGISEXTERN
#ifdef WIN32
@@ -30,7 +30,6 @@
#include "qgsproject.h"
#include "qgsvectorlayer.h"


#include <QDomDocument>
#include <QDomNode>
#include <QMutexLocker>
@@ -645,21 +644,9 @@ void QgsMapRenderer::setProjectionsEnabled( bool 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
Q_NOWARN_DEPRECATED_PUSH
emit hasCrsTransformEnabled( enabled ); // deprecated
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Q_NOWARN_DEPRECATED_POP

emit hasCrsTransformEnabledChanged( enabled );
}
@@ -1525,21 +1525,9 @@ 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
Q_NOWARN_DEPRECATED_PUSH
return mMap->paintDevice();
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Q_NOWARN_DEPRECATED_POP
}

double QgsMapCanvas::mapUnitsPerPixel() const

0 comments on commit 3b1e192

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