Skip to content

Commit

Permalink
fix some warnings and myriads of global QString objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 9, 2013
1 parent d00bc7a commit 7de5ad9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 26 deletions.
25 changes: 23 additions & 2 deletions src/core/qgis.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -45,11 +45,32 @@ const int QGis::QGIS_VERSION_INT = VERSION_INT;
const char* QGis::QGIS_RELEASE_NAME = RELEASE_NAME; const char* QGis::QGIS_RELEASE_NAME = RELEASE_NAME;


#if GDAL_VERSION_NUM >= 1800 #if GDAL_VERSION_NUM >= 1800
const QString GEOPROJ4 = "+proj=longlat +datum=WGS84 +no_defs"; const CORE_EXPORT QString GEOPROJ4 = "+proj=longlat +datum=WGS84 +no_defs";
#else #else
const QString GEOPROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"; const CORE_EXPORT QString GEOPROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
#endif #endif


const CORE_EXPORT QString GEOWKT =
"GEOGCS[\"WGS 84\", "
" DATUM[\"WGS_1984\", "
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
" AUTHORITY[\"EPSG\",7030]], "
" TOWGS84[0,0,0,0,0,0,0], "
" AUTHORITY[\"EPSG\",6326]], "
" PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
" UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
" AXIS[\"Lat\",NORTH], "
" AXIS[\"Long\",EAST], "
" AUTHORITY[\"EPSG\",4326]]";

const CORE_EXPORT QString PROJECT_SCALES =
"1:1000000,1:500000,1:250000,1:100000,1:50000,1:25000,"
"1:10000,1:5000,1:2500,1:1000,1:500";

const CORE_EXPORT QString GEO_EPSG_CRS_AUTHID = "EPSG:4326";

const CORE_EXPORT QString GEO_NONE = "NONE";

const double QGis::DEFAULT_IDENTIFY_RADIUS = 0.5; const double QGis::DEFAULT_IDENTIFY_RADIUS = 0.5;


// description strings for units // description strings for units
Expand Down
22 changes: 4 additions & 18 deletions src/core/qgis.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -296,22 +296,8 @@ void CORE_EXPORT QgsFree( void *ptr );
/** Wkt string that represents a geographic coord sys /** Wkt string that represents a geographic coord sys
* @note added in 1.8 to replace GEOWkt * @note added in 1.8 to replace GEOWkt
*/ */
const QString GEOWKT = extern CORE_EXPORT const QString GEOWKT;
"GEOGCS[\"WGS 84\", " extern CORE_EXPORT const QString PROJECT_SCALES;
" DATUM[\"WGS_1984\", "
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
" AUTHORITY[\"EPSG\",7030]], "
" TOWGS84[0,0,0,0,0,0,0], "
" AUTHORITY[\"EPSG\",6326]], "
" PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",8901]], "
" UNIT[\"DMSH\",0.0174532925199433,AUTHORITY[\"EPSG\",9108]], "
" AXIS[\"Lat\",NORTH], "
" AXIS[\"Long\",EAST], "
" AUTHORITY[\"EPSG\",4326]]";

const QString PROJECT_SCALES =
"1:1000000,1:500000,1:250000,1:100000,1:50000,1:25000,"
"1:10000,1:5000,1:2500,1:1000,1:500";


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


//! Constant that holds the string representation for "No ellips/No CRS" //! Constant that holds the string representation for "No ellips/No CRS"
// Added in version 2.0 // Added in version 2.0
const QString GEO_NONE = "NONE"; extern CORE_EXPORT const QString GEO_NONE;


// //
// Constants for point symbols // Constants for point symbols
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsgeometry.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ QgsGeometry* QgsGeometry::fromGML2( const QDomNode& geometryNode )
{ {
return 0; return 0;
} }
return 0;
} }


bool QgsGeometry::setFromGML2Point( const QDomElement& geometryElement ) bool QgsGeometry::setFromGML2Point( const QDomElement& geometryElement )
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassmodule.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
bool ok = false; bool ok = false;
QDomDocument gDoc( "task" ); QDomDocument gDoc( "task" );
QString err; QString err;
int line, column; int line = -1, column = -1;


if ( codec ) if ( codec )
{ {
Expand Down Expand Up @@ -3621,7 +3621,7 @@ void QgsGrassModuleField::updateFields()


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


for ( int i = 0; i < fields.size(); i++ ) for ( unsigned int i = 0; i < fields.size(); i++ )
{ {
if ( mType.contains( fields[i].typeName() ) ) if ( mType.contains( fields[i].typeName() ) )
{ {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/grass/qgsgrassmodule.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class QgsGrassModule: public QDialog, private Ui::QgsGrassModuleBase
Description(): direct( true ) {} Description(): direct( true ) {}
Description( QString lab, bool dir = false ): label( lab ), direct( dir ) { } Description( QString lab, bool dir = false ): label( lab ), direct( dir ) { }
Description( const Description & desc ) { label = desc.label; direct = desc.direct; } Description( const Description & desc ) { label = desc.label; direct = desc.direct; }
Description( Description & desc ) { label = desc.label; direct = desc.direct; }
}; };


//! Constructor //! Constructor
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresconn.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP
for ( int i = 0; i < 3; i++ ) for ( int i = 0; i < 3; i++ )
{ {
QString sql, tableName, schemaName, columnName, typeName, sridName, gtableName; QString sql, tableName, schemaName, columnName, typeName, sridName, gtableName;
QgsPostgresGeometryColumnType columnType; QgsPostgresGeometryColumnType columnType = sctGeometry;


if ( i == 0 ) if ( i == 0 )
{ {
Expand Down
1 change: 0 additions & 1 deletion src/providers/wms/qgswmsprovider.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3191,7 +3191,6 @@ bool QgsWmsProvider::calculateExtent()
QgsDebugMsg( "exiting with '" + mLayerExtent.toString() + "'." ); QgsDebugMsg( "exiting with '" + mLayerExtent.toString() + "'." );
return true; return true;
} }
return false; // should not be reached
} }




Expand Down

0 comments on commit 7de5ad9

Please sign in to comment.