Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix internal use of deprecated methods and fix related warnings
- Loading branch information
|
@@ -19,6 +19,11 @@ |
|
|
%{ |
|
|
#include "qgsrastercalcnode.h" |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
# pragma warnings( disable: 4065 ) // switch statement contains 'default' but no 'case' labels |
|
|
# pragma warnings( disable: 4701 ) // Potentially uninitialized local variable 'name' used |
|
|
#endif |
|
|
|
|
|
// don't redeclare malloc/free |
|
|
#define YYINCLUDED_STDLIB_H 1 |
|
|
|
|
|
|
@@ -349,11 +349,9 @@ ENDIF (WIN32) |
|
|
|
|
|
IF(PEDANTIC) |
|
|
# disable deprecation warnings |
|
|
IF(MSVC) |
|
|
SET_SOURCE_FILES_PROPERTIES(qgisappinterface.cpp PROPERTIES COMPILE_FLAGS /wd4996) |
|
|
ELSE(MSVC) |
|
|
IF(NOT MSVC) |
|
|
SET_SOURCE_FILES_PROPERTIES(qgisappinterface.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated) |
|
|
ENDIF(MSVC) |
|
|
ENDIF(NOT MSVC) |
|
|
ENDIF(PEDANTIC) |
|
|
|
|
|
INCLUDE_DIRECTORIES( |
|
|
|
@@ -28,9 +28,7 @@ class QwtPolarItemDict::PrivateData |
|
|
// for lists in Qt4. The implementation below |
|
|
// is slow, but there shouldn't be many plot items. |
|
|
|
|
|
#ifdef __GNUC__ |
|
|
#warning binary search missing |
|
|
#endif |
|
|
// TODO add binary search |
|
|
|
|
|
#if QT_VERSION < 0x040000 |
|
|
QValueListIterator<QwtPolarItem *> it; |
|
|
|
@@ -24,6 +24,11 @@ |
|
|
|
|
|
class QgisApp; |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
# pragma warning( push ) |
|
|
# pragma warning( disable: 4996 ) // declared deprecated |
|
|
#endif |
|
|
|
|
|
/** \class QgisAppInterface |
|
|
* \brief Interface class to provide access to private methods in QgisApp |
|
|
* for use by plugins. |
|
@@ -304,5 +309,8 @@ class QgisAppInterface : public QgisInterface |
|
|
QgsAppLegendInterface legendIface; |
|
|
}; |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
# pragma warning( pop ) |
|
|
#endif |
|
|
|
|
|
#endif //#define QGISAPPINTERFACE_H |
|
@@ -212,20 +212,6 @@ ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll) |
|
|
|
|
|
ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy) |
|
|
|
|
|
# Disable compiler warnings for lex generated sources |
|
|
SET_SOURCE_FILES_PROPERTIES( |
|
|
${CMAKE_BINARY_DIR}/src/core/flex_qgssearchstringlexer.cpp |
|
|
PROPERTIES COMPILE_FLAGS -w) |
|
|
|
|
|
IF (MSVC AND PEDANTIC) |
|
|
# disable warnings |
|
|
# 4065 switch with default and no case |
|
|
# 4702 unreachable code |
|
|
SET_SOURCE_FILES_PROPERTIES( |
|
|
${CMAKE_BINARY_DIR}/src/core/qgssearchstringparser.cpp |
|
|
PROPERTIES COMPILE_FLAGS "-wd4065 -wd4702") |
|
|
ENDIF (MSVC AND PEDANTIC) |
|
|
|
|
|
SET(QGIS_CORE_MOC_HDRS |
|
|
qgsapplication.h |
|
|
qgscontexthelp.h |
|
|
|
@@ -20,6 +20,7 @@ |
|
|
%option noyywrap |
|
|
%option case-insensitive |
|
|
%option never-interactive |
|
|
%option nounput |
|
|
|
|
|
// ensure that lexer will be 8-bit (and not just 7-bit) |
|
|
%option 8bit |
|
@@ -35,6 +36,8 @@ |
|
|
// which doesn't in MSVC compiler |
|
|
#define YY_NEVER_INTERACTIVE 1 |
|
|
|
|
|
#define YY_NO_UNPUT // unused |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
#define YY_NO_UNISTD_H |
|
|
#endif |
|
|
|
@@ -23,6 +23,11 @@ |
|
|
#include <cstdlib> |
|
|
#include "qgssearchtreenode.h" |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
# pragma warning( disable: 4065 ) // switch statement contains 'default' but no 'case' labels |
|
|
# pragma warning( disable: 4702 ) // unreachable code |
|
|
#endif |
|
|
|
|
|
// don't redeclare malloc/free |
|
|
#define YYINCLUDED_STDLIB_H 1 |
|
|
|
|
|
|
@@ -104,10 +104,6 @@ qgssearchquerybuilder.h |
|
|
|
|
|
QT4_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS}) |
|
|
|
|
|
IF(MSVC AND PEDANTIC) |
|
|
# disable deprecation warnings for qgisinterface (re-exporting deprecated methods) |
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx PROPERTIES COMPILE_FLAGS "-wd4996") |
|
|
ENDIF(MSVC AND PEDANTIC) |
|
|
|
|
|
INCLUDE_DIRECTORIES( |
|
|
${QT_QTUITOOLS_INCLUDE_DIR} |
|
@@ -139,11 +135,14 @@ IF (WIN32) |
|
|
ENDIF (MSVC) |
|
|
ENDIF (WIN32) |
|
|
|
|
|
IF(NOT MSVC) |
|
|
# disable deprecation warnings for qgisinterface (re-exporting deprecated methods) |
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx PROPERTIES COMPILE_FLAGS "-w") |
|
|
ENDIF(NOT MSVC) |
|
|
|
|
|
############################################################# |
|
|
# qgis_gui library |
|
|
|
|
|
|
|
|
ADD_LIBRARY(qgis_gui SHARED ${QGIS_GUI_SRCS} ${QGIS_GUI_MOC_SRCS}) |
|
|
|
|
|
SET_TARGET_PROPERTIES(qgis_gui PROPERTIES VERSION ${COMPLETE_VERSION} SOVERSION ${COMPLETE_VERSION}) |
|
|
|
@@ -40,6 +40,10 @@ class QgsFeature; |
|
|
|
|
|
#include <qgis.h> |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
# pragma warning( push ) |
|
|
# pragma warning( disable: 4996 ) // was declared deprecated |
|
|
#endif |
|
|
|
|
|
/** \ingroup gui |
|
|
* QgisInterface |
|
@@ -367,14 +371,15 @@ class GUI_EXPORT QgisInterface : public QObject |
|
|
|
|
|
}; |
|
|
|
|
|
#ifdef _MSC_VER |
|
|
# pragma warning( pop ) |
|
|
# pragma warning( disable: 4190 ) |
|
|
#endif |
|
|
|
|
|
// FIXME: also in core/qgis.h |
|
|
#ifndef QGISEXTERN |
|
|
#ifdef WIN32 |
|
|
# define QGISEXTERN extern "C" __declspec( dllexport ) |
|
|
# ifdef _MSC_VER |
|
|
// do not warn about C bindings returning QString |
|
|
# pragma warning(disable:4190) |
|
|
# endif |
|
|
#else |
|
|
# define QGISEXTERN extern "C" |
|
|
#endif |
|
|
|
@@ -217,19 +217,22 @@ int QgsSVGDiagramFactoryWidget::addDirectoryToPreview( const QString& path ) |
|
|
void QgsSVGDiagramFactoryWidget::addStandardDirectoriesToPreview() |
|
|
{ |
|
|
//list all directories in $prefix/share/qgis/svg |
|
|
QDir svgDirectory( QgsApplication::svgPath() ); |
|
|
if ( !svgDirectory.exists() || !svgDirectory.isReadable() ) |
|
|
foreach( QString path, QgsApplication::svgPaths() ) |
|
|
{ |
|
|
return; //error |
|
|
} |
|
|
QDir svgDirectory( path ); |
|
|
if ( !svgDirectory.exists() || !svgDirectory.isReadable() ) |
|
|
{ |
|
|
continue; //error |
|
|
} |
|
|
|
|
|
QFileInfoList directoryList = svgDirectory.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot ); |
|
|
QFileInfoList::const_iterator dirIt = directoryList.constBegin(); |
|
|
for ( ; dirIt != directoryList.constEnd(); ++dirIt ) |
|
|
{ |
|
|
if ( addDirectoryToPreview( dirIt->absoluteFilePath() ) == 0 ) |
|
|
QFileInfoList directoryList = svgDirectory.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot ); |
|
|
QFileInfoList::const_iterator dirIt = directoryList.constBegin(); |
|
|
for ( ; dirIt != directoryList.constEnd(); ++dirIt ) |
|
|
{ |
|
|
mSearchDirectoriesComboBox->addItem( dirIt->absoluteFilePath() ); |
|
|
if ( addDirectoryToPreview( dirIt->absoluteFilePath() ) == 0 ) |
|
|
{ |
|
|
mSearchDirectoriesComboBox->addItem( dirIt->absoluteFilePath() ); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
@@ -139,7 +139,7 @@ void OsmStyle::parse_rule_point( QString line ) |
|
|
QColor mSelectionColor( 255, 255, 0 ); |
|
|
|
|
|
QgsSymbol sym( QGis::Point ); |
|
|
sym.setNamedPointSymbol( QString( "svg:%1%2" ).arg( QgsApplication::svgPath() ).arg( name ) ); |
|
|
sym.setNamedPointSymbol( QString( "svg:%1" ).arg( name ) ); |
|
|
sym.setPointSize( size.toFloat() ); |
|
|
|
|
|
QImage img = sym.getPointSymbolAsImage( widthScale, selected, mSelectionColor ); |
|
|