Skip to content

Commit 7de5ad9

Browse files
committedJan 9, 2013
fix some warnings and myriads of global QString objects
1 parent d00bc7a commit 7de5ad9

File tree

7 files changed

+30
-26
lines changed

7 files changed

+30
-26
lines changed
 

‎src/core/qgis.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,32 @@ const int QGis::QGIS_VERSION_INT = VERSION_INT;
4545
const char* QGis::QGIS_RELEASE_NAME = RELEASE_NAME;
4646

4747
#if GDAL_VERSION_NUM >= 1800
48-
const QString GEOPROJ4 = "+proj=longlat +datum=WGS84 +no_defs";
48+
const CORE_EXPORT QString GEOPROJ4 = "+proj=longlat +datum=WGS84 +no_defs";
4949
#else
50-
const QString GEOPROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
50+
const CORE_EXPORT QString GEOPROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
5151
#endif
5252

53+
const CORE_EXPORT QString GEOWKT =
54+
"GEOGCS[\"WGS 84\", "
55+
" DATUM[\"WGS_1984\", "
56+
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
57+
" AUTHORITY[\"EPSG\",7030]], "
58+
" TOWGS84[0,0,0,0,0,0,0], "
59+
" AUTHORITY[\"EPSG\",6326]], "
60+
" PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
61+
" UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
62+
" AXIS[\"Lat\",NORTH], "
63+
" AXIS[\"Long\",EAST], "
64+
" AUTHORITY[\"EPSG\",4326]]";
65+
66+
const CORE_EXPORT QString PROJECT_SCALES =
67+
"1:1000000,1:500000,1:250000,1:100000,1:50000,1:25000,"
68+
"1:10000,1:5000,1:2500,1:1000,1:500";
69+
70+
const CORE_EXPORT QString GEO_EPSG_CRS_AUTHID = "EPSG:4326";
71+
72+
const CORE_EXPORT QString GEO_NONE = "NONE";
73+
5374
const double QGis::DEFAULT_IDENTIFY_RADIUS = 0.5;
5475

5576
// description strings for units

‎src/core/qgis.h

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,8 @@ void CORE_EXPORT QgsFree( void *ptr );
296296
/** Wkt string that represents a geographic coord sys
297297
* @note added in 1.8 to replace GEOWkt
298298
*/
299-
const QString GEOWKT =
300-
"GEOGCS[\"WGS 84\", "
301-
" DATUM[\"WGS_1984\", "
302-
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
303-
" AUTHORITY[\"EPSG\",7030]], "
304-
" TOWGS84[0,0,0,0,0,0,0], "
305-
" AUTHORITY[\"EPSG\",6326]], "
306-
" PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
307-
" UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
308-
" AXIS[\"Lat\",NORTH], "
309-
" AXIS[\"Long\",EAST], "
310-
" AUTHORITY[\"EPSG\",4326]]";
311-
312-
const QString PROJECT_SCALES =
313-
"1:1000000,1:500000,1:250000,1:100000,1:50000,1:25000,"
314-
"1:10000,1:5000,1:2500,1:1000,1:500";
299+
extern CORE_EXPORT const QString GEOWKT;
300+
extern CORE_EXPORT const QString PROJECT_SCALES;
315301

316302
/** PROJ4 string that represents a geographic coord sys */
317303
extern CORE_EXPORT const QString GEOPROJ4;
@@ -322,7 +308,7 @@ const long GEOCRS_ID = 3452;
322308
/** Magic number for a geographic coord sys in EpsgCrsId ID format */
323309
const long GEO_EPSG_CRS_ID = 4326;
324310
/** Geographic coord sys from EPSG authority */
325-
const QString GEO_EPSG_CRS_AUTHID = "EPSG:4326";
311+
extern CORE_EXPORT const QString GEO_EPSG_CRS_AUTHID;
326312
/** The length of the string "+proj=" */
327313
const int PROJ_PREFIX_LEN = 6;
328314
/** The length of the string "+ellps=" */
@@ -335,7 +321,7 @@ const int USER_CRS_START_ID = 100000;
335321

336322
//! Constant that holds the string representation for "No ellips/No CRS"
337323
// Added in version 2.0
338-
const QString GEO_NONE = "NONE";
324+
extern CORE_EXPORT const QString GEO_NONE;
339325

340326
//
341327
// Constants for point symbols

‎src/core/qgsgeometry.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ QgsGeometry* QgsGeometry::fromGML2( const QDomNode& geometryNode )
582582
{
583583
return 0;
584584
}
585-
return 0;
586585
}
587586

588587
bool QgsGeometry::setFromGML2Point( const QDomElement& geometryElement )

‎src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
411411
bool ok = false;
412412
QDomDocument gDoc( "task" );
413413
QString err;
414-
int line, column;
414+
int line = -1, column = -1;
415415

416416
if ( codec )
417417
{
@@ -3621,7 +3621,7 @@ void QgsGrassModuleField::updateFields()
36213621

36223622
std::vector<QgsField> fields = mLayerInput->currentFields();
36233623

3624-
for ( int i = 0; i < fields.size(); i++ )
3624+
for ( unsigned int i = 0; i < fields.size(); i++ )
36253625
{
36263626
if ( mType.contains( fields[i].typeName() ) )
36273627
{

‎src/plugins/grass/qgsgrassmodule.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class QgsGrassModule: public QDialog, private Ui::QgsGrassModuleBase
5959
Description(): direct( true ) {}
6060
Description( QString lab, bool dir = false ): label( lab ), direct( dir ) { }
6161
Description( const Description & desc ) { label = desc.label; direct = desc.direct; }
62-
Description( Description & desc ) { label = desc.label; direct = desc.direct; }
6362
};
6463

6564
//! Constructor

‎src/providers/postgres/qgspostgresconn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP
309309
for ( int i = 0; i < 3; i++ )
310310
{
311311
QString sql, tableName, schemaName, columnName, typeName, sridName, gtableName;
312-
QgsPostgresGeometryColumnType columnType;
312+
QgsPostgresGeometryColumnType columnType = sctGeometry;
313313

314314
if ( i == 0 )
315315
{

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3191,7 +3191,6 @@ bool QgsWmsProvider::calculateExtent()
31913191
QgsDebugMsg( "exiting with '" + mLayerExtent.toString() + "'." );
31923192
return true;
31933193
}
3194-
return false; // should not be reached
31953194
}
31963195

31973196

0 commit comments

Comments
 (0)
Please sign in to comment.