Skip to content

Commit 2846857

Browse files
committedMar 4, 2014
remove more msvc deprecation pragmas
1 parent 100f972 commit 2846857

File tree

6 files changed

+23
-26
lines changed

6 files changed

+23
-26
lines changed
 

‎src/app/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,18 @@ if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
498498
SET_TARGET_PROPERTIES(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
499499
ENDIF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
500500

501+
# disable deprecation warnings for classes re-exporting deprecated methods
502+
IF(MSVC)
503+
SET_SOURCE_FILES_PROPERTIES(
504+
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
505+
PROPERTIES COMPILE_FLAGS "-wd4996")
506+
ELSE(MSVC)
507+
SET_SOURCE_FILES_PROPERTIES(
508+
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
509+
PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations")
510+
ENDIF(MSVC)
511+
512+
501513
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
502514
${QWT_LIBRARY}
503515
${QT_QTSQL_LIBRARY}

‎src/app/qgisappinterface.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424

2525
class QgisApp;
2626

27-
#ifdef _MSC_VER
28-
# pragma warning( push )
29-
# pragma warning( disable: 4996 ) // declared deprecated
30-
#endif
3127

3228
/** \class QgisAppInterface
3329
* \brief Interface class to provide access to private methods in QgisApp
@@ -157,6 +153,9 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
157153
* @param useQgisDocDirectory If true, the URL will be formed by concatenating
158154
* url to the QGIS documentation directory path (<prefix>/share/doc)
159155
*/
156+
#ifndef Q_MOC_RUN
157+
Q_DECL_DEPRECATED
158+
#endif
160159
void openURL( QString url, bool useQgisDocDirectory = true );
161160

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

507-
#ifdef _MSC_VER
508-
# pragma warning( pop )
509-
#endif
510-
511506
#endif //#define QGISAPPINTERFACE_H

‎src/core/gps/config.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545
# define NMEA_UNI
4646
#endif
4747

48-
#if defined(NMEA_WIN) && (_MSC_VER >= 1400)
49-
# pragma warning(disable: 4996) /* declared deprecated */
50-
#endif
51-
5248
#if defined(_MSC_VER)
5349
# define NMEA_POSIX(x) _##x
5450
# define NMEA_INLINE __inline

‎src/gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ ELSE(MSVC)
432432
${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx
433433
${CMAKE_BINARY_DIR}/src/gui/moc_qgsgenericprojectionselector.cxx
434434
${CMAKE_BINARY_DIR}/src/gui/moc_qgsprojectionselector.cxx
435-
PROPERTIES COMPILE_FLAGS "-w")
435+
PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations")
436436
ENDIF(MSVC)
437437

438438
#############################################################

‎src/gui/qgisinterface.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ class QgsVectorLayerTools;
4343

4444
#include <qgis.h>
4545

46-
#ifdef _MSC_VER
47-
# pragma warning( push )
48-
# pragma warning( disable: 4996 ) // was declared deprecated
49-
#endif
5046

5147
/** \ingroup gui
5248
* QgisInterface
@@ -531,6 +527,9 @@ class GUI_EXPORT QgisInterface : public QObject
531527
virtual QAction *actionCancelAllEdits() = 0;
532528
virtual QAction *actionLayerSaveAs() = 0;
533529
/** @note deprecated in 2.4 - returns null pointer */
530+
#ifndef Q_MOC_RUN
531+
Q_DECL_DEPRECATED
532+
#endif
534533
virtual QAction *actionLayerSelectionSaveAs() = 0;
535534
virtual QAction *actionRemoveLayer() = 0;
536535
/** @note added in 1.9 */
@@ -625,11 +624,6 @@ class GUI_EXPORT QgisInterface : public QObject
625624
void newProjectCreated();
626625
};
627626

628-
#ifdef _MSC_VER
629-
# pragma warning( pop )
630-
# pragma warning( disable: 4190 )
631-
#endif
632-
633627
// FIXME: also in core/qgis.h
634628
#ifndef QGISEXTERN
635629
#ifdef WIN32

‎src/plugins/grass/qgsgrasstools.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void QgsGrassTools::runModule( QString name, bool direct )
202202
if ( name.length() == 0 )
203203
return; // Section
204204

205-
#ifdef HAVE_OPENPTY
205+
#if defined(HAVE_OPENPTY) && !defined(Q_OS_WIN)
206206
QgsGrassShell* sh = 0;
207207
#endif
208208

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

230-
#endif // ! WIN32
230+
#endif // ! Q_OS_WIN
231231
}
232232
else
233233
{
@@ -471,7 +471,7 @@ QgsGrassTools::~QgsGrassTools()
471471

472472
QString QgsGrassTools::appDir( void )
473473
{
474-
#if defined(WIN32)
474+
#if defined(Q_OS_WIN)
475475
return QgsGrass::shortPath( QgsApplication::applicationDirPath() );
476476
#else
477477
return QgsApplication::applicationDirPath();

0 commit comments

Comments
 (0)
Please sign in to comment.