Skip to content

Commit 4d537dd

Browse files
author
jef
committedJan 8, 2010
more fixes: optional QWT
git-svn-id: http://svn.osgeo.org/qgis/trunk@12705 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 864bbc1 commit 4d537dd

File tree

7 files changed

+55
-1147
lines changed

7 files changed

+55
-1147
lines changed
 

‎CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ IF (WIN32)
302302
ADD_DEFINITIONS("-DGUI_EXPORT=__declspec(dllimport)")
303303
ADD_DEFINITIONS("-DPYTHON_EXPORT=__declspec(dllimport)")
304304
ADD_DEFINITIONS("-DANALYSIS_EXPORT=__declspec(dllimport)")
305-
ADD_DEFINITIONS("-DQWT_DLL")
306305
ELSE (MSVC)
307306
ADD_DEFINITIONS("\"-DCORE_EXPORT=__declspec(dllimport)\"")
308307
ADD_DEFINITIONS("\"-DGUI_EXPORT=__declspec(dllimport)\"")

‎images/north_arrows/gpsarrow.svg~

Lines changed: 0 additions & 426 deletions
This file was deleted.

‎images/north_arrows/gpsarrow2.svg~

Lines changed: 0 additions & 693 deletions
This file was deleted.

‎src/app/CMakeLists.txt

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,7 @@ SET(QGIS_APP_SRCS
111111
attributetable/qgsattributetablefiltermodel.cpp
112112
attributetable/qgsattributetableidcolumnpair.cpp
113113
attributetable/qgsattributetabledelegate.cpp
114-
115-
gps/qgsgpsinformationwidget.cpp
116-
gps/qgsgpsmarker.cpp
117-
gps/qwtpolar/qwt_polar_canvas.cpp
118-
gps/qwtpolar/qwt_polar_curve.cpp
119-
gps/qwtpolar/qwt_polar_fitter.cpp
120-
gps/qwtpolar/qwt_polar_grid.cpp
121-
gps/qwtpolar/qwt_polar_itemdict.cpp
122-
gps/qwtpolar/qwt_polar_item.cpp
123-
gps/qwtpolar/qwt_polar_layout.cpp
124-
gps/qwtpolar/qwt_polar_magnifier.cpp
125-
gps/qwtpolar/qwt_polar_marker.cpp
126-
gps/qwtpolar/qwt_polar_panner.cpp
127-
gps/qwtpolar/qwt_polar_plot.cpp
128-
gps/qwtpolar/qwt_polar_point.cpp
129-
gps/qwtpolar/qwt_polar_spectrogram.cpp
130-
)
114+
)
131115

132116

133117
SET (QGIS_APP_MOC_HDRS
@@ -219,13 +203,40 @@ SET (QGIS_APP_MOC_HDRS
219203
attributetable/qgsattributetabledialog.h
220204
attributetable/qgsattributetabledelegate.h
221205

222-
gps/qgsgpsinformationwidget.h
223-
gps/qwtpolar/qwt_polar_canvas.h
224-
gps/qwtpolar/qwt_polar_magnifier.h
225-
gps/qwtpolar/qwt_polar_panner.h
226-
gps/qwtpolar/qwt_polar_plot.h
227206
)
228207

208+
IF( QWT_FOUND )
209+
ADD_DEFINITIONS(-DHAVE_QWT)
210+
211+
SET(QGIS_APP_SRCS
212+
${QGIS_APP_SRCS}
213+
gps/qgsgpsinformationwidget.cpp
214+
gps/qgsgpsmarker.cpp
215+
gps/qwtpolar/qwt_polar_canvas.cpp
216+
gps/qwtpolar/qwt_polar_curve.cpp
217+
gps/qwtpolar/qwt_polar_fitter.cpp
218+
gps/qwtpolar/qwt_polar_grid.cpp
219+
gps/qwtpolar/qwt_polar_itemdict.cpp
220+
gps/qwtpolar/qwt_polar_item.cpp
221+
gps/qwtpolar/qwt_polar_layout.cpp
222+
gps/qwtpolar/qwt_polar_magnifier.cpp
223+
gps/qwtpolar/qwt_polar_marker.cpp
224+
gps/qwtpolar/qwt_polar_panner.cpp
225+
gps/qwtpolar/qwt_polar_plot.cpp
226+
gps/qwtpolar/qwt_polar_point.cpp
227+
gps/qwtpolar/qwt_polar_spectrogram.cpp
228+
)
229+
230+
SET (QGIS_APP_MOC_HDRS
231+
${QGIS_APP_MOC_HDRS}
232+
gps/qgsgpsinformationwidget.h
233+
gps/qwtpolar/qwt_polar_canvas.h
234+
gps/qwtpolar/qwt_polar_magnifier.h
235+
gps/qwtpolar/qwt_polar_panner.h
236+
gps/qwtpolar/qwt_polar_plot.h
237+
)
238+
ENDIF( QWT_FOUND )
239+
229240
IF (POSTGRES_FOUND)
230241
IF(HAVE_PGCONFIG)
231242
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
@@ -260,10 +271,8 @@ QT4_WRAP_CPP(QGIS_APP_MOC_SRCS ${QGIS_APP_MOC_HDRS})
260271

261272

262273
IF (WIN32)
263-
264274
IF (MSVC)
265275
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)
266-
ADD_DEFINITIONS(-DQWT_DLL)
267276
ELSE(MSVC)
268277

269278
# Icon for windows MINGW
@@ -291,7 +300,6 @@ INCLUDE_DIRECTORIES(
291300
${CMAKE_CURRENT_BINARY_DIR}
292301
${CMAKE_CURRENT_BINARY_DIR}/../ui
293302
${QT_QTUITOOLS_INCLUDE_DIR}
294-
${QWT_INCLUDE_DIR}
295303
${PROJ_INCLUDE_DIR}
296304
${GEOS_INCLUDE_DIR}
297305
${GDAL_INCLUDE_DIR}
@@ -337,11 +345,18 @@ TARGET_LINK_LIBRARIES(qgis
337345
${QT_QTUITOOLS_LIBRARY}
338346
#should only be needed for win
339347
${QT_QTMAIN_LIBRARY}
340-
${QWT_LIBRARY}
341348
qgis_core
342349
qgis_gui
343350
)
344351

352+
IF( QWT_FOUND )
353+
IF( WIN32 )
354+
ADD_DEFINITIONS(-DQWT_DLL)
355+
ENDIF( WIN32 )
356+
INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR})
357+
TARGET_LINK_LIBRARIES(qgis ${QWT_LIBRARY})
358+
ENDIF( QWT_FOUND )
359+
345360
IF(NOT WITH_INTERNAL_SPATIALITE)
346361
TARGET_LINK_LIBRARIES(qgis ${SQLITE_LIBRARY})
347362
ENDIF(NOT WITH_INTERNAL_SPATIALITE)

‎src/app/qgisapp.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@
140140
#include "ogr/qgsopenvectorlayerdialog.h"
141141
#include "qgsattributetabledialog.h"
142142
#include "qgsvectorfilewriter.h"
143+
144+
#ifdef HAVE_QWT
143145
#include "qgsgpsinformationwidget.h"
146+
#endif
144147

145148
//
146149
// Gdal/Ogr includes
@@ -556,11 +559,14 @@ void QgisApp::readSettings()
556559

557560
// Add the recently accessed project file paths to the File menu
558561
mRecentProjectPaths = settings.value( "/UI/recentProjectsList" ).toStringList();
562+
563+
#if HAVE_QWT
559564
// Restore state of GPS Tracker
560565
if ( settings.value( "/gps/widgetEnabled", false ).toBool() )
561566
{
562567
showGpsTool();
563568
}
569+
#endif
564570
}
565571

566572

@@ -2124,6 +2130,8 @@ void QgisApp::restoreWindowState()
21242130
{
21252131
QgsDebugMsg( "restore of UI geometry failed" );
21262132
}
2133+
2134+
#ifdef HAVE_QWT
21272135
// Persist state of GPS Tracker
21282136
if ( mpGpsWidget )
21292137
{
@@ -2134,6 +2142,7 @@ void QgisApp::restoreWindowState()
21342142
{
21352143
settings.setValue( "/gps/widgetEnabled", false );
21362144
}
2145+
#endif
21372146
}
21382147
///////////// END OF GUI SETUP ROUTINES ///////////////
21392148

@@ -4399,6 +4408,7 @@ void QgisApp::removeAllLayers()
43994408
QgsProject::instance()->dirty( true );
44004409
} //remove all layers
44014410

4411+
#ifdef HAVE_QWT
44024412
void QgisApp::showGpsTool()
44034413
{
44044414
if ( !mpGpsWidget )
@@ -4420,6 +4430,7 @@ void QgisApp::showGpsTool()
44204430
mpGpsDock->toggleViewAction();
44214431
}
44224432
}
4433+
#endif
44234434

44244435
void QgisApp::zoomToLayerExtent()
44254436
{

‎src/app/qgisapp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,10 @@ class QgisApp : public QMainWindow
422422
void userCenter();
423423
//! Remove a layer from the map and legend
424424
void removeLayer();
425+
#ifdef HAVE_QWT
425426
//! Show GPS tool
426427
void showGpsTool();
428+
#endif
427429
//! zoom to extent of layer
428430
void zoomToLayerExtent();
429431
//! zoom to actual size of raster layer

‎src/core/gps/qgsnmeaconnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void QgsNMEAConnection::processStringBuffer()
8383
int endSentenceIndex = 0;
8484
int dollarIndex;
8585

86-
while ( endSentenceIndex = mStringBuffer.indexOf( "\r\n" ) && endSentenceIndex != -1 )
86+
while ( ( endSentenceIndex = mStringBuffer.indexOf( "\r\n" ) ) && endSentenceIndex != -1 )
8787
{
8888
endSentenceIndex = mStringBuffer.indexOf( "\r\n" );
8989

0 commit comments

Comments
 (0)
Please sign in to comment.