Skip to content

Commit 656ca4a

Browse files
author
jef
committed
fix windows build, warnings, typos and roadgraph plugin indentation
git-svn-id: http://svn.osgeo.org/qgis/trunk@15071 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d29ac24 commit 656ca4a

40 files changed

+1037
-1031
lines changed

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ You can take care of both with the PyQwt source from:
15551555

15561556

15571557
Double-click the tarball to unpack it. The following assumes PyQwt v5.2.0 (comes with Qwt 5.2.1).
1558-
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is staically linked
1558+
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is statically linked
15591559
into PyQwt, and Qgis can't use it. So, we need to split the build.
15601560

15611561
First edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so

doc/osx.t2t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ http://pyqwt.sourceforge.net/
265265
```
266266

267267
Double-click the tarball to unpack it. The following assumes PyQwt v5.2.0 (comes with Qwt 5.2.1).
268-
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is staically linked
268+
Normal compilation does both Qwt and PyQwt at the same time, but Qwt is statically linked
269269
into PyQwt, and Qgis can't use it. So, we need to split the build.
270270

271271
First edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so

python/pyspatialite/src/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static pysqlite_StatementKind detect_statement_type(char* statement)
5656
dst = buf;
5757
*dst = 0;
5858
while (isalpha(*src) && dst - buf < sizeof(buf) - 2) {
59-
*dst++ = tolower(*src++);
59+
*dst++ = (char) tolower(*src++);
6060
}
6161

6262
*dst = 0;

scripts/chkspelling.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
RE=$(echo $(cut -d: -f1 scripts/spelling.dat | sed -e 's/^/\\</; s/$/\\>|/;') | sed -e 's/| /|/g; s/|$//;')
5-
EX="\.(svn-base|tmp|xpm|ts)|context_help|spelling\.dat"
5+
EX="\.(svn-base|tmp|xpm|ts)|context_help|spelling\.dat|Exception_to_GPL_for_Qt.txt|sqlite3.c"
66

77
egrep --color=always "$RE" -ir . | egrep -iv "$EX"
88
egrep --color=always "$RE" -i resources/context_help/*-en_US

src/astyle/ASBeautifier.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ string ASBeautifier::beautify(const string &originalLine)
15961596
/*
15971597
* Create a temporary snapshot of the current block's header-list in the
15981598
* uppermost inner stack in tempStacks, and clear the headerStack up to
1599-
* the begining of the block.
1599+
* the beginning of the block.
16001600
* Thus, the next future statement will think it comes one indent past
16011601
* the block's '{' unless it specifically checks for a companion-header
16021602
* (such as a previous 'if' for an 'else' header) within the tempStacks,
@@ -1758,7 +1758,7 @@ string ASBeautifier::beautify(const string &originalLine)
17581758
if (lineCommentNoBeautify || blockCommentNoBeautify || isInQuoteContinuation)
17591759
tabCount = spaceTabCount = 0;
17601760

1761-
// finally, insert indentations into begining of line
1761+
// finally, insert indentations into beginning of line
17621762

17631763
prevFinalLineSpaceTabCount = spaceTabCount;
17641764
prevFinalLineTabCount = tabCount;
@@ -1897,7 +1897,7 @@ const string *ASBeautifier::findHeader(const string &line, int i, const vector<c
18971897
if (line.compare(i, header->length(), header->c_str()) == 0)
18981898
{
18991899
// check that this is a header and not a part of a longer word
1900-
// (e.g. not at its begining, not at its middle...)
1900+
// (e.g. not at its beginning, not at its middle...)
19011901

19021902
int lineLength = line.length();
19031903
int headerEnd = i + header->length();

src/astyle/ASEnhancer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ bool ASEnhancer::findKeyword(const string &line, int i, const char *keyword) con
475475
if (line.compare(i, strlen(keyword), keyword) == 0)
476476
{
477477
// check that this is a header and not a part of a longer word
478-
// (e.g. not at its begining, not at its middle...)
478+
// (e.g. not at its beginning, not at its middle...)
479479

480480
int lineLength = line.length();
481481
int wordEnd = i + strlen(keyword);

src/astyle/ASFormatter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void ASFormatter::staticInit()
180180
*
181181
* init() should be called every time a ASFormatter object is to start
182182
* formatting a NEW source file.
183-
* init() recieves a pointer to a DYNAMICALLY CREATED ASSourceIterator object
183+
* init() receives a pointer to a DYNAMICALLY CREATED ASSourceIterator object
184184
* that will be used to iterate through the source code. This object will be
185185
* deleted during the ASFormatter's destruction, and thus should not be
186186
* deleted elsewhere.
@@ -307,7 +307,7 @@ string ASFormatter::nextLine()
307307
}
308308
else // stuff to do when reading a new character...
309309
{
310-
// make sure that a virgin '{' at the begining ofthe file will be treated as a block...
310+
// make sure that a virgin '{' at the beginning ofthe file will be treated as a block...
311311
if (isInVirginLine && currentChar == '{' && lineBeginsWith('{'))
312312
previousCommandChar = '{';
313313
isPreviousCharPostComment = isCharImmediatelyPostComment;
@@ -322,7 +322,7 @@ string ASFormatter::nextLine()
322322
{
323323
appendCurrentChar();
324324

325-
// explicitely break a line when a line comment's end is found.
325+
// explicitly break a line when a line comment's end is found.
326326
if (charNum + 1 == (int) currentLine.length())
327327
{
328328
isInLineBreak = true;
@@ -404,7 +404,7 @@ string ASFormatter::nextLine()
404404
formattedLineCommentNum = formattedLine.length();
405405
appendSequence(AS_OPEN_LINE_COMMENT);
406406
goForward(1);
407-
// explicitely break a line when a line comment's end is found.
407+
// explicitly break a line when a line comment's end is found.
408408
if (charNum + 1 == (int) currentLine.length())
409409
{
410410
isInLineBreak = true;
@@ -448,7 +448,7 @@ string ASFormatter::nextLine()
448448
previousCommandChar = previousNonWSChar = previousChar = '{';
449449

450450
// check if in preprocessor
451-
// ** isInPreprocessor will be automatically reset at the begining
451+
// ** isInPreprocessor will be automatically reset at the beginning
452452
// of a new line in getnextChar()
453453
if (isCStyle && currentChar == '#')
454454
{
@@ -1263,7 +1263,7 @@ bool ASFormatter::isBeforeLineEndComment(int startPos) const
12631263
* get the next character, increasing the current placement in the process.
12641264
* the new character is inserted into the variable currentChar.
12651265
*
1266-
* @return whether succeded to recieve the new character.
1266+
* @return whether succeded to receive the new character.
12671267
*/
12681268
bool ASFormatter::getNextChar()
12691269
{

src/core/qgspallabeling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class CORE_EXPORT QgsPalLayerSettings
9090
Hali, //horizontal alignment for data defined label position (Left, Center, Right)
9191
Vali, //vertical alignment for data defined label position (Bottom, Base, Half, Cap, Top)
9292
LabelDistance,
93-
Rotation //data defined rotation (only usefull in connection with data defined position)
93+
Rotation //data defined rotation (only useful in connection with data defined position)
9494
};
9595

9696
QString fieldName;

src/core/spatialite/headers/spatialite/gaiageo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ extern "C"
377377
char *Name; /* field name */
378378
unsigned char Type; /* field type */
379379
int Offset; /* buffer offset [this field begins at *buffer+offset* and extends for *length* bytes */
380-
unsigned char Length; /* field total lenght [in bytes] */
380+
unsigned char Length; /* field total length [in bytes] */
381381
unsigned char Decimals; /* decimal positions */
382382
gaiaValuePtr Value; /* the current multitype value for this attribute */
383383
struct gaiaDbfFieldStruct *Next; /* pointer to next element in linked list */

src/core/spatialite/headers/spatialite/sqlite3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4448,7 +4448,7 @@ SQLITE_API int sqlite3_release_memory(int);
44484448
** <li> Memory accounting is disabled using a combination of the
44494449
** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and
44504450
** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option.
4451-
** <li> An alternative page cache implementation is specifed using
4451+
** <li> An alternative page cache implementation is specified using
44524452
** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...).
44534453
** <li> The page cache allocates from its own memory pool supplied
44544454
** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than

src/core/spatialite/headers/spatialite/sqlite3ext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ struct sqlite3_api_routines {
424424

425425
/*
426426
** The following macros redefine the API routines so that they are
427-
** redirected throught the global sqlite3_api structure.
427+
** redirected through the global sqlite3_api structure.
428428
**
429429
** This header file is also used by the loadext.c source file
430430
** (part of the main SQLite library - not an extension) so that

src/core/spatialite/spatialite.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4556,7 +4556,7 @@ SQLITE_API int sqlite3_release_memory(int);
45564556
** <li> Memory accounting is disabled using a combination of the
45574557
** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and
45584558
** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option.
4559-
** <li> An alternative page cache implementation is specifed using
4559+
** <li> An alternative page cache implementation is specified using
45604560
** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...).
45614561
** <li> The page cache allocates from its own memory pool supplied
45624562
** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than
@@ -6717,7 +6717,7 @@ struct sqlite3_api_routines {
67176717

67186718
/*
67196719
** The following macros redefine the API routines so that they are
6720-
** redirected throught the global sqlite3_api structure.
6720+
** redirected through the global sqlite3_api structure.
67216721
**
67226722
** This header file is also used by the loadext.c source file
67236723
** (part of the main SQLite library - not an extension) so that
@@ -7533,7 +7533,7 @@ extern "C"
75337533
char *Name; /* field name */
75347534
unsigned char Type; /* field type */
75357535
int Offset; /* buffer offset [this field begins at *buffer+offset* and extends for *length* bytes */
7536-
unsigned char Length; /* field total lenght [in bytes] */
7536+
unsigned char Length; /* field total length [in bytes] */
75377537
unsigned char Decimals; /* decimal positions */
75387538
gaiaValuePtr Value; /* the current multitype value for this attribute */
75397539
struct gaiaDbfFieldStruct *Next; /* pointer to next element in linked list */

src/mapserver/CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@ ADD_EXECUTABLE(qgis_mapserv.fcgi
8282
)
8383

8484
INCLUDE_DIRECTORIES(
85-
${GDAL_INCLUDE_DIR}
86-
${FCGI_INCLUDE_DIR}
87-
${GEOS_INCLUDE_DIR}
88-
${PROJ_INCLUDE_DIR}
89-
${POSTGRES_INCLUDE_DIR}
90-
${CMAKE_CURRENT_BINARY_DIR}
91-
${QT_INCLUDE_DIR}
92-
${QGIS_INCLUDE_DIR}
93-
../core
94-
../core/raster
95-
../core/renderer
96-
../core/symbology
97-
../core/symbology-ng
98-
../core/composer
99-
../analysis/interpolation
100-
../plugins/diagram_overlay
101-
.
102-
)
85+
${GDAL_INCLUDE_DIR}
86+
${FCGI_INCLUDE_DIR}
87+
${GEOS_INCLUDE_DIR}
88+
${PROJ_INCLUDE_DIR}
89+
${POSTGRES_INCLUDE_DIR}
90+
${CMAKE_CURRENT_BINARY_DIR}
91+
${QT_INCLUDE_DIR}
92+
${QGIS_INCLUDE_DIR}
93+
../core
94+
../core/raster
95+
../core/renderer
96+
../core/symbology
97+
../core/symbology-ng
98+
../core/composer
99+
../analysis/interpolation
100+
../plugins/diagram_overlay
101+
.
102+
)
103103

104104
IF (WITH_INTERNAL_SPATIALITE)
105105
INCLUDE_DIRECTORIES(BEFORE ../core/spatialite/headers/spatialite)

src/mapserver/qgsprojectparser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ QList<QDomElement> QgsProjectParser::legendGroupElements() const
629629
{
630630
groupList.push_back( groupNodeList.at( i ).toElement() );
631631
}
632+
633+
return groupList;
632634
}
633635

634636
QMap< QString, QDomElement > QgsProjectParser::projectLayerElementsById() const

src/mapserver/qgsremoteowsbuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ QgsMapLayer* QgsRemoteOWSBuilder::createMapLayer( const QDomElement& elem, const
8888

8989
if ( serviceName == "WFS" )
9090
{
91-
//support for old format where type is explicitely given and not part of url
91+
//support for old format where type is explicitly given and not part of url
9292
QString tname = onlineResourceElement.attribute( "type" );
9393
if ( !tname.isEmpty() )
9494
{

src/plugins/roadgraph/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ SET (VRP_RCCS roadgraph.qrc)
2828

2929
INCLUDE_DIRECTORIES(
3030
${CMAKE_CURRENT_BINARY_DIR}
31+
${GEOS_INCLUDE_DIR}
3132
../../core
3233
../../gui
3334
..

src/plugins/roadgraph/exportdlg.cpp

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ RgExportDlg::RgExportDlg( QWidget* parent, Qt::WFlags fl )
3131
: QDialog( parent, fl )
3232
{
3333
// create base widgets;
34-
setWindowTitle( tr("Export feature") );
34+
setWindowTitle( tr( "Export feature" ) );
3535
QVBoxLayout *v = new QVBoxLayout( this );
36-
36+
3737
QHBoxLayout *h = new QHBoxLayout();
38-
QLabel *l = new QLabel( tr("Select destination layer:"), this);
39-
h->addWidget(l);
38+
QLabel *l = new QLabel( tr( "Select destination layer:" ), this );
39+
h->addWidget( l );
4040
mcbLayers = new QComboBox( this );
41-
h->addWidget(mcbLayers);
42-
v->addLayout(h);
41+
h->addWidget( mcbLayers );
42+
v->addLayout( h );
4343

44-
QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
45-
connect(bb, SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted()) );
46-
connect(bb, SIGNAL(rejected()), this, SLOT(on_buttonBox_rejected()) );
47-
v->addWidget(bb);
44+
QDialogButtonBox *bb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this );
45+
connect( bb, SIGNAL( accepted() ), this, SLOT( on_buttonBox_accepted() ) );
46+
connect( bb, SIGNAL( rejected() ), this, SLOT( on_buttonBox_rejected() ) );
47+
v->addWidget( bb );
4848

4949
//fill list of layers
50-
mcbLayers->insertItem( 0, tr("new temporary layer"), QVariant("-1") );
51-
50+
mcbLayers->insertItem( 0, tr( "new temporary layer" ), QVariant( "-1" ) );
51+
5252
QMap<QString, QgsMapLayer*> mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
5353
QMap<QString, QgsMapLayer*>::iterator layer_it = mapLayers.begin();
54-
54+
5555
for ( ; layer_it != mapLayers.end(); ++layer_it )
5656
{
5757
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer_it.value() );
@@ -72,33 +72,34 @@ QgsVectorLayer* RgExportDlg::mapLayer() const
7272
{
7373
QgsVectorLayer* myLayer = NULL;
7474
QString layerId = mcbLayers->itemData( mcbLayers->currentIndex() ).toString();
75-
76-
if ( layerId == QString("-1") )
75+
76+
if ( layerId == QString( "-1" ) )
7777
{
7878
// create a temporary layer
7979
myLayer = new QgsVectorLayer( "LineString", "shortest path", "memory" );
8080

8181
QgsVectorDataProvider *prov = myLayer->dataProvider();
82-
if ( prov == NULL)
83-
return NULL;
82+
if ( prov == NULL )
83+
return NULL;
8484

8585
QList<QgsField> attrList;
86-
attrList.append( QgsField("one", QVariant::Int) );
86+
attrList.append( QgsField( "one", QVariant::Int ) );
8787
prov->addAttributes( attrList );
88-
QgsMapLayerRegistry::instance()->addMapLayer( myLayer );
88+
QgsMapLayerRegistry::instance()->addMapLayer( myLayer );
8989

90-
}else
90+
}
91+
else
9192
{
9293
// retrun selected layer
9394
myLayer = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( layerId ) );
9495
}
95-
96+
9697
return myLayer;
9798
} // QgsVectorLayer* RgExportDlg::vectorLayer() const
9899

99100
void RgExportDlg::on_buttonBox_accepted()
100-
{
101-
accept();
101+
{
102+
accept();
102103
} // void RgExportDlg::on_buttonBox_accepted()
103104

104105
void RgExportDlg::on_buttonBox_rejected()

src/plugins/roadgraph/exportdlg.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* the Free Software Foundation; either version 2 of the License, or *
1212
* (at your option) any later version. *
1313
* *
14-
***************************************************************************/
14+
***************************************************************************/
1515
#ifndef ROADGRAPH_EXPORTDLG_H
1616
#define ROADGRAPH_EXPORTDLG_H
1717

@@ -35,20 +35,20 @@ class QgsVectorLayer;
3535
class RgExportDlg : public QDialog
3636
{
3737
Q_OBJECT
38-
public:
39-
RgExportDlg( QWidget* parent = 0, Qt::WFlags fl = 0 );
40-
~RgExportDlg();
41-
public:
42-
QgsVectorLayer* mapLayer() const;
43-
private:
44-
static const int context_id = 0;
38+
public:
39+
RgExportDlg( QWidget* parent = 0, Qt::WFlags fl = 0 );
40+
~RgExportDlg();
41+
public:
42+
QgsVectorLayer* mapLayer() const;
43+
private:
44+
static const int context_id = 0;
4545

46-
private slots:
47-
void on_buttonBox_accepted();
48-
void on_buttonBox_rejected();
49-
void on_buttonBox_helpRequested();
46+
private slots:
47+
void on_buttonBox_accepted();
48+
void on_buttonBox_rejected();
49+
void on_buttonBox_helpRequested();
5050

51-
private:
52-
QComboBox *mcbLayers;
51+
private:
52+
QComboBox *mcbLayers;
5353
};
5454
#endif

0 commit comments

Comments
 (0)