Skip to content

Commit ecafdfb

Browse files
author
timlinux
committed
Get rid of compiler warnings and dont link to qtsql lib
git-svn-id: http://svn.osgeo.org/qgis/trunk@7169 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a3d5f96 commit ecafdfb

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed

src/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ TARGET_LINK_LIBRARIES(qgis_core
147147
${QT_QTCORE_LIBRARY}
148148
${QT_QTGUI_LIBRARY}
149149
${QT_QTXML_LIBRARY}
150-
${QT_QTSQL_LIBRARY}
150+
#${QT_QTSQL_LIBRARY}
151151
${QT_QTSVG_LIBRARY}
152152
${QT_QTNETWORK_LIBRARY}
153153
${QT_QTMAIN_LIBRARY}

src/core/qgscoordinatetransform.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class CORE_EXPORT QgsCoordinateTransform: public QObject
180180
* Flag to indicate whether the coordinate systems have been initialised
181181
* @return true if initialised, otherwise false
182182
*/
183-
bool isInitialised() {return mInitialisedFlag;};
183+
bool isInitialised() const {return mInitialisedFlag;};
184184

185185
/*! See if the transform short circuits because src and dest are equivalent
186186
* @return bool True if it short circuits
@@ -263,6 +263,11 @@ inline std::ostream& operator << (std::ostream& os, const QgsCoordinateTransform
263263
{
264264
QString mySummary ("\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:");
265265
mySummary += "\n\tInitialised? : ";
266+
//prevent warnings
267+
if (r.isInitialised())
268+
{
269+
//do nothing this is a dummy
270+
}
266271
/*
267272
if (r.isInitialised())
268273
{

src/core/qgsdataprovider.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ class CORE_EXPORT QgsDataProvider : public QObject
115115
*/
116116
virtual void setSubsetString(QString subset)
117117
{
118+
//prevent unused var warnings
119+
if (subset.isEmpty())
120+
{
121+
return;
122+
}
118123
// NOP by default
119124
}
120125

@@ -172,6 +177,11 @@ class CORE_EXPORT QgsDataProvider : public QObject
172177
*/
173178
virtual void setLayerOrder(QStringList layers)
174179
{
180+
//prevent unused var warnings
181+
if (layers.count() < 1)
182+
{
183+
return;
184+
}
175185
// NOOP
176186
}
177187

@@ -181,6 +191,11 @@ class CORE_EXPORT QgsDataProvider : public QObject
181191
*/
182192
virtual void setSubLayerVisibility(QString name, bool vis)
183193
{
194+
//prevent unused var warnings
195+
if (name.isEmpty() || !vis)
196+
{
197+
return;
198+
}
184199
// NOOP
185200
}
186201

src/core/qgsrasterdataprovider.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider
9090
QString const & user,
9191
QString const & pass)
9292
{
93+
//this is mainly to prevent compiler warnings
94+
if (host.isEmpty() || port < 1 || user.isEmpty() || pass.isEmpty())
95+
{
96+
return FALSE;
97+
}
98+
9399
return FALSE;
94100
}
95101

src/core/raster/qgsrasterlayer.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,14 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
756756
static QDateTime lastModified ( QString const & name );
757757

758758
/**Copies the symbology settings from another layer. Returns true in case of success*/
759-
bool copySymbologySettings(const QgsMapLayer& other) {return false;} //todo
759+
bool copySymbologySettings(const QgsMapLayer& other) {
760+
//preventwarnings
761+
if (other.type() < 0)
762+
{
763+
return false;
764+
}
765+
return false;
766+
} //todo
760767

761768
bool isSymbologyCompatible(const QgsMapLayer& other) const {return false;} //todo
762769

src/core/renderer/qgsrenderer.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ class CORE_EXPORT QgsRenderer
4343
virtual ~QgsRenderer();
4444
/** Determines if a feature will be rendered or not
4545
@param f a pointer to the feature to determine if rendering will happen*/
46-
virtual bool willRenderFeature(QgsFeature *f) {return true;}
46+
virtual bool willRenderFeature(QgsFeature *f)
47+
{
48+
//prevent unused var warnings
49+
if (!f)
50+
{
51+
return true;
52+
}
53+
return true;
54+
}
4755
/**A vector layer passes features to a renderer object to change the brush and pen of the qpainter
4856
@param p the painter storing brush and pen
4957
@param f a pointer to the feature to be rendered

0 commit comments

Comments
 (0)