[QGIS Commit] r8666 - in trunk/qgis: python/core src/app src/core
src/core/raster src/providers/postgres
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Jun 21 11:35:32 EDT 2008
Author: jef
Date: 2008-06-21 11:35:32 -0400 (Sat, 21 Jun 2008)
New Revision: 8666
Modified:
trunk/qgis/python/core/conversions.sip
trunk/qgis/python/core/qgsmaplayerregistry.sip
trunk/qgis/python/core/qgsrasterlayer.sip
trunk/qgis/src/app/qgsrasterlayerproperties.cpp
trunk/qgis/src/core/qgsmaplayerregistry.cpp
trunk/qgis/src/core/qgsmaplayerregistry.h
trunk/qgis/src/core/raster/qgsrasterlayer.cpp
trunk/qgis/src/core/raster/qgsrasterlayer.h
trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp
Log:
fix gcc 4.3 warnings, a gcc 4.3 compile error and a MSVC warning
Modified: trunk/qgis/python/core/conversions.sip
===================================================================
--- trunk/qgis/python/core/conversions.sip 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/python/core/conversions.sip 2008-06-21 15:35:32 UTC (rev 8666)
@@ -326,12 +326,18 @@
Py_DECREF(d);
if (kobj)
+ {
Py_DECREF(kobj);
+ }
if (tobj)
+ {
Py_DECREF(tobj);
+ }
else
+ {
delete t;
+ }
return NULL;
}
@@ -547,7 +553,9 @@
PyObject *lst = PyList_New(0);
PyDict_SetItem(d, t1obj, lst);
if (lst)
+ {
Py_DECREF(lst);
+ }
}
if (t1obj == NULL || t2obj == NULL ||
@@ -555,10 +563,14 @@
{
Py_DECREF(d);
if (t1obj)
+ {
Py_DECREF(t1obj);
+ }
if (t2obj)
+ {
Py_DECREF(t2obj);
+ }
return NULL;
}
Modified: trunk/qgis/python/core/qgsmaplayerregistry.sip
===================================================================
--- trunk/qgis/python/core/qgsmaplayerregistry.sip 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/python/core/qgsmaplayerregistry.sip 2008-06-21 15:35:32 UTC (rev 8666)
@@ -14,11 +14,10 @@
//! Returns the instance pointer, creating the object on the first call
static QgsMapLayerRegistry * instance();
-/*! Return the number of registered layers.
- *
- * */
- const int count();
+ //! Return the number of registered layers.
+ int count();
+
~QgsMapLayerRegistry();
//! Retrieve a pointer to a loaded plugin by id
Modified: trunk/qgis/python/core/qgsrasterlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsrasterlayer.sip 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/python/core/qgsrasterlayer.sip 2008-06-21 15:35:32 UTC (rev 8666)
@@ -114,10 +114,10 @@
// Accessors for image height and width
//
/** \brief Accessor that returns the width of the (unclipped) raster */
- const int getRasterXDim();
+ int getRasterXDim();
/** \brief Accessor that returns the height of the (unclipped) raster */
- const int getRasterYDim();
+ int getRasterYDim();
//
// Accessor and mutator for no data double
@@ -126,7 +126,7 @@
bool isNoDataValueValid();
/** \brief Accessor that returns the NO_DATA entry for this raster. */
- const double getNoDataValue(bool* isValid=0);
+ double getNoDataValue(bool* isValid=0);
/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden. */
void setNoDataValue(double theNoData);
@@ -152,11 +152,11 @@
void setStdDevsToPlot(double the);
/** \brief Get the number of bands in this layer */
- const unsigned int getBandCount();
+ unsigned int getBandCount();
/** \brief Get RasterBandStats for a band given its number (read only) */
const QgsRasterBandStats getRasterBandStats(int);
/** \brief Check whether a given band number has stats associated with it */
- const bool hasStats(int theBandNoInt);
+ bool hasStats(int theBandNoInt);
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
* Note this approach is not recommeneded because it is possible for two gdal raster
* bands to have the same name!
@@ -165,7 +165,7 @@
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
* If no matching band is found zero will be returned! */
- const int getRasterBandNumber (const QString & theBandNameQString);
+ int getRasterBandNumber (const QString & theBandNameQString);
/** \brief Get the name of a band given its number. */
const QString getRasterBandName(int theBandNoInt);
/** \brief Find out whether a given band exists. */
Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-06-21 15:35:32 UTC (rev 8666)
@@ -1560,7 +1560,7 @@
// as true so that we can generate pyramids for them.
//
QgsRasterLayer::RasterPyramidList myPyramidList = mRasterLayer->buildRasterPyramidList();
- for ( unsigned int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
+ for ( int myCounterInt = 0; myCounterInt < lbxPyramidResolutions->count(); myCounterInt++ )
{
QListWidgetItem *myItem = lbxPyramidResolutions->item( myCounterInt );
if ( myItem->isSelected() )
Modified: trunk/qgis/src/core/qgsmaplayerregistry.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayerregistry.cpp 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/src/core/qgsmaplayerregistry.cpp 2008-06-21 15:35:32 UTC (rev 8666)
@@ -53,7 +53,7 @@
}
// get the layer count (number of registered layers)
-const int QgsMapLayerRegistry::count()
+int QgsMapLayerRegistry::count()
{
return mMapLayers.size();
}
Modified: trunk/qgis/src/core/qgsmaplayerregistry.h
===================================================================
--- trunk/qgis/src/core/qgsmaplayerregistry.h 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/src/core/qgsmaplayerregistry.h 2008-06-21 15:35:32 UTC (rev 8666)
@@ -44,7 +44,7 @@
/*! Return the number of registered layers.
*
* */
- const int count();
+ int count();
~QgsMapLayerRegistry();
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-06-21 15:35:32 UTC (rev 8666)
@@ -1190,7 +1190,7 @@
}
else
{
- if ((myRasterViewPort->drawableAreaXDim) > 4000 && (myRasterViewPort->drawableAreaYDim > 4000))
+ if ((myRasterViewPort->drawableAreaXDim) > 4000 && (myRasterViewPort->drawableAreaYDim > 4000))
{
// We have scaled one raster pixel to more than 4000 screen pixels. What's the point of showing this layer?
// Instead, we just stop displaying the layer. Prevents allocating the entire world of memory for showing
@@ -2238,7 +2238,7 @@
//note this should be the rewritten name set up in the constructor,
//not the name retrieved directly from gdal!
//if no matching band is found zero will be returned!
-const int QgsRasterLayer::getRasterBandNumber(QString const & theBandNameQString)
+int QgsRasterLayer::getRasterBandNumber(QString const & theBandNameQString)
{
for (int myIterator = 0; myIterator < mRasterStatsList.size(); ++myIterator)
{
@@ -2280,7 +2280,7 @@
/** Check whether a given band number has stats associated with it */
-const bool QgsRasterLayer::hasStats(int theBandNo)
+bool QgsRasterLayer::hasStats(int theBandNo)
{
if (theBandNo <= mRasterStatsList.size())
{
@@ -2637,7 +2637,7 @@
//mutator for red band name (allows alternate mappings e.g. map blue as red colour)
-void QgsRasterLayer::setRedBandName(QString const & theBandNameQString)
+void QgsRasterLayer::setRedBandName(QString const & theBandNameQString)
{
QgsDebugMsg("setRedBandName : " + theBandNameQString);
//check if the band is unset
@@ -2674,7 +2674,7 @@
//mutator for green band name
-void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
+void QgsRasterLayer::setGreenBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET )
@@ -2708,7 +2708,7 @@
}
//mutator for blue band name
-void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
+void QgsRasterLayer::setBlueBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET)
@@ -2742,7 +2742,7 @@
}
//mutator for transparent band name
-void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
+void QgsRasterLayer::setTransparentBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET)
@@ -2776,7 +2776,7 @@
//mutator for gray band name
-void QgsRasterLayer::setGrayBandName(QString const & theBandNameQString)
+void QgsRasterLayer::setGrayBandName(QString const & theBandNameQString)
{
//check if the band is unset
if (theBandNameQString == TRSTRING_NOT_SET || theBandNameQString == QSTRING_NOT_SET )
@@ -3348,7 +3348,7 @@
// Useful for Provider mode
-void QgsRasterLayer::setSubLayerVisibility(QString const & name, bool vis)
+void QgsRasterLayer::setSubLayerVisibility(QString const & name, bool vis)
{
if (mDataProvider)
@@ -5110,7 +5110,7 @@
return mDataProvider;
}
-const unsigned int QgsRasterLayer::getBandCount()
+unsigned int QgsRasterLayer::getBandCount()
{
return mRasterStatsList.size();
}
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.h
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.h 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.h 2008-06-21 15:35:32 UTC (rev 8666)
@@ -284,10 +284,10 @@
// Accessors for image height and width
//
/** \brief Accessor that returns the width of the (unclipped) raster */
- const int getRasterXDim() {return mRasterXDim;}
+ int getRasterXDim() {return mRasterXDim;}
/** \brief Accessor that returns the height of the (unclipped) raster */
- const int getRasterYDim() {return mRasterYDim;}
+ int getRasterYDim() {return mRasterYDim;}
//
// Accessor and mutator for no data double
@@ -296,7 +296,7 @@
bool isNoDataValueValid() {return mValidNoDataValue;}
/** \brief Accessor that returns the NO_DATA entry for this raster. */
- const double getNoDataValue(bool* isValid=0) { if(isValid) { *isValid = mValidNoDataValue;} return mNoDataValue;}
+ double getNoDataValue(bool* isValid=0) { if(isValid) { *isValid = mValidNoDataValue;} return mNoDataValue;}
/** \brief Mutator that allows the NO_DATA entry for this raster to be overridden. */
void setNoDataValue(double theNoData);
@@ -349,11 +349,11 @@
mStandardDeviations = theStdDevsToPlot;
}
/** \brief Get the number of bands in this layer */
- const unsigned int getBandCount();
+ unsigned int getBandCount();
/** \brief Get RasterBandStats for a band given its number (read only) */
const QgsRasterBandStats getRasterBandStats(int);
/** \brief Check whether a given band number has stats associated with it */
- const bool hasStats(int theBandNoInt);
+ bool hasStats(int theBandNoInt);
/** \brief Overloaded method that also returns stats for a band, but uses the band colour name
* Note this approach is not recommeneded because it is possible for two gdal raster
* bands to have the same name!
@@ -362,7 +362,7 @@
/** \brief Get the number of a band given its name. Note this will be the rewritten name set
* up in the constructor, and will not necessarily be the same as the name retrieved directly from gdal!
* If no matching band is found zero will be returned! */
- const int getRasterBandNumber (const QString & theBandNameQString);
+ int getRasterBandNumber (const QString & theBandNameQString);
/** \brief Get the name of a band given its number. */
const QString getRasterBandName(int theBandNoInt);
/** \brief Find out whether a given band exists. */
Modified: trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp
===================================================================
--- trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp 2008-06-21 15:34:01 UTC (rev 8665)
+++ trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp 2008-06-21 15:35:32 UTC (rev 8666)
@@ -18,6 +18,8 @@
/* $Id$ */
#include <fstream>
+#include <cstdlib>
+
#include <QEvent>
#include <QApplication>
#include <QEvent>
More information about the QGIS-commit
mailing list