Skip to content

Commit

Permalink
remove more msvc deprecation pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 4, 2014
1 parent 100f972 commit 2846857
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
12 changes: 12 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -498,6 +498,18 @@ if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET_TARGET_PROPERTIES(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
ENDIF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)

# disable deprecation warnings for classes re-exporting deprecated methods
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-wd4996")
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations")
ENDIF(MSVC)


TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
${QWT_LIBRARY}
${QT_QTSQL_LIBRARY}
Expand Down
11 changes: 3 additions & 8 deletions src/app/qgisappinterface.h
Expand Up @@ -24,10 +24,6 @@

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
Expand Down Expand Up @@ -157,6 +153,9 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
* @param useQgisDocDirectory If true, the URL will be formed by concatenating
* url to the QGIS documentation directory path (<prefix>/share/doc)
*/
#ifndef Q_MOC_RUN
Q_DECL_DEPRECATED
#endif
void openURL( QString url, bool useQgisDocDirectory = true );

/** Return a pointer to the map canvas used by qgisapp */
Expand Down Expand Up @@ -504,8 +503,4 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
QgsAppPluginManagerInterface pluginManagerIface;
};

#ifdef _MSC_VER
# pragma warning( pop )
#endif

#endif //#define QGISAPPINTERFACE_H
4 changes: 0 additions & 4 deletions src/core/gps/config.h
Expand Up @@ -45,10 +45,6 @@
# define NMEA_UNI
#endif

#if defined(NMEA_WIN) && (_MSC_VER >= 1400)
# pragma warning(disable: 4996) /* declared deprecated */
#endif

#if defined(_MSC_VER)
# define NMEA_POSIX(x) _##x
# define NMEA_INLINE __inline
Expand Down
2 changes: 1 addition & 1 deletion src/gui/CMakeLists.txt
Expand Up @@ -432,7 +432,7 @@ ELSE(MSVC)
${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx
${CMAKE_BINARY_DIR}/src/gui/moc_qgsgenericprojectionselector.cxx
${CMAKE_BINARY_DIR}/src/gui/moc_qgsprojectionselector.cxx
PROPERTIES COMPILE_FLAGS "-w")
PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations")
ENDIF(MSVC)

#############################################################
Expand Down
12 changes: 3 additions & 9 deletions src/gui/qgisinterface.h
Expand Up @@ -43,10 +43,6 @@ class QgsVectorLayerTools;

#include <qgis.h>

#ifdef _MSC_VER
# pragma warning( push )
# pragma warning( disable: 4996 ) // was declared deprecated
#endif

/** \ingroup gui
* QgisInterface
Expand Down Expand Up @@ -531,6 +527,9 @@ class GUI_EXPORT QgisInterface : public QObject
virtual QAction *actionCancelAllEdits() = 0;
virtual QAction *actionLayerSaveAs() = 0;
/** @note deprecated in 2.4 - returns null pointer */
#ifndef Q_MOC_RUN
Q_DECL_DEPRECATED
#endif
virtual QAction *actionLayerSelectionSaveAs() = 0;
virtual QAction *actionRemoveLayer() = 0;
/** @note added in 1.9 */
Expand Down Expand Up @@ -625,11 +624,6 @@ class GUI_EXPORT QgisInterface : public QObject
void newProjectCreated();
};

#ifdef _MSC_VER
# pragma warning( pop )
# pragma warning( disable: 4190 )
#endif

// FIXME: also in core/qgis.h
#ifndef QGISEXTERN
#ifdef WIN32
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrasstools.cpp
Expand Up @@ -202,7 +202,7 @@ void QgsGrassTools::runModule( QString name, bool direct )
if ( name.length() == 0 )
return; // Section

#ifdef HAVE_OPENPTY
#if defined(HAVE_OPENPTY) && !defined(Q_OS_WIN)
QgsGrassShell* sh = 0;
#endif

Expand All @@ -211,7 +211,7 @@ void QgsGrassTools::runModule( QString name, bool direct )
QWidget *m;
if ( name == "shell" )
{
#ifdef WIN32
#ifdef Q_OS_WIN
QgsGrass::putEnv( "GRASS_HTML_BROWSER", QgsApplication::libexecPath() + "grass/bin/qgis.g.browser" );
if ( !QProcess::startDetached( getenv( "COMSPEC" ) ) )
{
Expand All @@ -227,7 +227,7 @@ void QgsGrassTools::runModule( QString name, bool direct )
QMessageBox::warning( 0, tr( "Warning" ), tr( "GRASS Shell is not compiled." ) );
#endif // HAVE_OPENPTY

#endif // ! WIN32
#endif // ! Q_OS_WIN
}
else
{
Expand Down Expand Up @@ -471,7 +471,7 @@ QgsGrassTools::~QgsGrassTools()

QString QgsGrassTools::appDir( void )
{
#if defined(WIN32)
#if defined(Q_OS_WIN)
return QgsGrass::shortPath( QgsApplication::applicationDirPath() );
#else
return QgsApplication::applicationDirPath();
Expand Down

0 comments on commit 2846857

Please sign in to comment.