Navigation Menu

Skip to content

Commit

Permalink
fix windows build, warnings, typos and roadgraph plugin indentation
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15071 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 24, 2011
1 parent ff23fcb commit 8239b33
Show file tree
Hide file tree
Showing 40 changed files with 1,037 additions and 1,031 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -1555,7 +1555,7 @@ You can take care of both with the PyQwt source from:


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

First edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so
Expand Down
2 changes: 1 addition & 1 deletion doc/osx.t2t
Expand Up @@ -265,7 +265,7 @@ http://pyqwt.sourceforge.net/
```

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

First edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so
Expand Down
2 changes: 1 addition & 1 deletion python/pyspatialite/src/cursor.c
Expand Up @@ -56,7 +56,7 @@ static pysqlite_StatementKind detect_statement_type(char* statement)
dst = buf;
*dst = 0;
while (isalpha(*src) && dst - buf < sizeof(buf) - 2) {
*dst++ = tolower(*src++);
*dst++ = (char) tolower(*src++);
}

*dst = 0;
Expand Down
2 changes: 1 addition & 1 deletion scripts/chkspelling.sh
Expand Up @@ -2,7 +2,7 @@


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

egrep --color=always "$RE" -ir . | egrep -iv "$EX"
egrep --color=always "$RE" -i resources/context_help/*-en_US
6 changes: 3 additions & 3 deletions src/astyle/ASBeautifier.cpp
Expand Up @@ -1596,7 +1596,7 @@ string ASBeautifier::beautify(const string &originalLine)
/*
* Create a temporary snapshot of the current block's header-list in the
* uppermost inner stack in tempStacks, and clear the headerStack up to
* the begining of the block.
* the beginning of the block.
* Thus, the next future statement will think it comes one indent past
* the block's '{' unless it specifically checks for a companion-header
* (such as a previous 'if' for an 'else' header) within the tempStacks,
Expand Down Expand Up @@ -1758,7 +1758,7 @@ string ASBeautifier::beautify(const string &originalLine)
if (lineCommentNoBeautify || blockCommentNoBeautify || isInQuoteContinuation)
tabCount = spaceTabCount = 0;

// finally, insert indentations into begining of line
// finally, insert indentations into beginning of line

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

int lineLength = line.length();
int headerEnd = i + header->length();
Expand Down
2 changes: 1 addition & 1 deletion src/astyle/ASEnhancer.cpp
Expand Up @@ -475,7 +475,7 @@ bool ASEnhancer::findKeyword(const string &line, int i, const char *keyword) con
if (line.compare(i, strlen(keyword), keyword) == 0)
{
// check that this is a header and not a part of a longer word
// (e.g. not at its begining, not at its middle...)
// (e.g. not at its beginning, not at its middle...)

int lineLength = line.length();
int wordEnd = i + strlen(keyword);
Expand Down
12 changes: 6 additions & 6 deletions src/astyle/ASFormatter.cpp
Expand Up @@ -180,7 +180,7 @@ void ASFormatter::staticInit()
*
* init() should be called every time a ASFormatter object is to start
* formatting a NEW source file.
* init() recieves a pointer to a DYNAMICALLY CREATED ASSourceIterator object
* init() receives a pointer to a DYNAMICALLY CREATED ASSourceIterator object
* that will be used to iterate through the source code. This object will be
* deleted during the ASFormatter's destruction, and thus should not be
* deleted elsewhere.
Expand Down Expand Up @@ -307,7 +307,7 @@ string ASFormatter::nextLine()
}
else // stuff to do when reading a new character...
{
// make sure that a virgin '{' at the begining ofthe file will be treated as a block...
// make sure that a virgin '{' at the beginning ofthe file will be treated as a block...
if (isInVirginLine && currentChar == '{' && lineBeginsWith('{'))
previousCommandChar = '{';
isPreviousCharPostComment = isCharImmediatelyPostComment;
Expand All @@ -322,7 +322,7 @@ string ASFormatter::nextLine()
{
appendCurrentChar();

// explicitely break a line when a line comment's end is found.
// explicitly break a line when a line comment's end is found.
if (charNum + 1 == (int) currentLine.length())
{
isInLineBreak = true;
Expand Down Expand Up @@ -404,7 +404,7 @@ string ASFormatter::nextLine()
formattedLineCommentNum = formattedLine.length();
appendSequence(AS_OPEN_LINE_COMMENT);
goForward(1);
// explicitely break a line when a line comment's end is found.
// explicitly break a line when a line comment's end is found.
if (charNum + 1 == (int) currentLine.length())
{
isInLineBreak = true;
Expand Down Expand Up @@ -448,7 +448,7 @@ string ASFormatter::nextLine()
previousCommandChar = previousNonWSChar = previousChar = '{';

// check if in preprocessor
// ** isInPreprocessor will be automatically reset at the begining
// ** isInPreprocessor will be automatically reset at the beginning
// of a new line in getnextChar()
if (isCStyle && currentChar == '#')
{
Expand Down Expand Up @@ -1263,7 +1263,7 @@ bool ASFormatter::isBeforeLineEndComment(int startPos) const
* get the next character, increasing the current placement in the process.
* the new character is inserted into the variable currentChar.
*
* @return whether succeded to recieve the new character.
* @return whether succeded to receive the new character.
*/
bool ASFormatter::getNextChar()
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.h
Expand Up @@ -90,7 +90,7 @@ class CORE_EXPORT QgsPalLayerSettings
Hali, //horizontal alignment for data defined label position (Left, Center, Right)
Vali, //vertical alignment for data defined label position (Bottom, Base, Half, Cap, Top)
LabelDistance,
Rotation //data defined rotation (only usefull in connection with data defined position)
Rotation //data defined rotation (only useful in connection with data defined position)
};

QString fieldName;
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialite/headers/spatialite/gaiageo.h
Expand Up @@ -377,7 +377,7 @@ extern "C"
char *Name; /* field name */
unsigned char Type; /* field type */
int Offset; /* buffer offset [this field begins at *buffer+offset* and extends for *length* bytes */
unsigned char Length; /* field total lenght [in bytes] */
unsigned char Length; /* field total length [in bytes] */
unsigned char Decimals; /* decimal positions */
gaiaValuePtr Value; /* the current multitype value for this attribute */
struct gaiaDbfFieldStruct *Next; /* pointer to next element in linked list */
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialite/headers/spatialite/sqlite3.h
Expand Up @@ -4448,7 +4448,7 @@ SQLITE_API int sqlite3_release_memory(int);
** <li> Memory accounting is disabled using a combination of the
** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and
** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option.
** <li> An alternative page cache implementation is specifed using
** <li> An alternative page cache implementation is specified using
** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...).
** <li> The page cache allocates from its own memory pool supplied
** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialite/headers/spatialite/sqlite3ext.h
Expand Up @@ -424,7 +424,7 @@ struct sqlite3_api_routines {

/*
** The following macros redefine the API routines so that they are
** redirected throught the global sqlite3_api structure.
** redirected through the global sqlite3_api structure.
**
** This header file is also used by the loadext.c source file
** (part of the main SQLite library - not an extension) so that
Expand Down
6 changes: 3 additions & 3 deletions src/core/spatialite/spatialite.c
Expand Up @@ -4556,7 +4556,7 @@ SQLITE_API int sqlite3_release_memory(int);
** <li> Memory accounting is disabled using a combination of the
** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and
** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option.
** <li> An alternative page cache implementation is specifed using
** <li> An alternative page cache implementation is specified using
** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...).
** <li> The page cache allocates from its own memory pool supplied
** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than
Expand Down Expand Up @@ -6717,7 +6717,7 @@ struct sqlite3_api_routines {

/*
** The following macros redefine the API routines so that they are
** redirected throught the global sqlite3_api structure.
** redirected through the global sqlite3_api structure.
**
** This header file is also used by the loadext.c source file
** (part of the main SQLite library - not an extension) so that
Expand Down Expand Up @@ -7533,7 +7533,7 @@ extern "C"
char *Name; /* field name */
unsigned char Type; /* field type */
int Offset; /* buffer offset [this field begins at *buffer+offset* and extends for *length* bytes */
unsigned char Length; /* field total lenght [in bytes] */
unsigned char Length; /* field total length [in bytes] */
unsigned char Decimals; /* decimal positions */
gaiaValuePtr Value; /* the current multitype value for this attribute */
struct gaiaDbfFieldStruct *Next; /* pointer to next element in linked list */
Expand Down
36 changes: 18 additions & 18 deletions src/mapserver/CMakeLists.txt
Expand Up @@ -82,24 +82,24 @@ ADD_EXECUTABLE(qgis_mapserv.fcgi
)

INCLUDE_DIRECTORIES(
${GDAL_INCLUDE_DIR}
${FCGI_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDE_DIR}
${QGIS_INCLUDE_DIR}
../core
../core/raster
../core/renderer
../core/symbology
../core/symbology-ng
../core/composer
../analysis/interpolation
../plugins/diagram_overlay
.
)
${GDAL_INCLUDE_DIR}
${FCGI_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDE_DIR}
${QGIS_INCLUDE_DIR}
../core
../core/raster
../core/renderer
../core/symbology
../core/symbology-ng
../core/composer
../analysis/interpolation
../plugins/diagram_overlay
.
)

IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(BEFORE ../core/spatialite/headers/spatialite)
Expand Down
2 changes: 2 additions & 0 deletions src/mapserver/qgsprojectparser.cpp
Expand Up @@ -629,6 +629,8 @@ QList<QDomElement> QgsProjectParser::legendGroupElements() const
{
groupList.push_back( groupNodeList.at( i ).toElement() );
}

return groupList;
}

QMap< QString, QDomElement > QgsProjectParser::projectLayerElementsById() const
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsremoteowsbuilder.cpp
Expand Up @@ -88,7 +88,7 @@ QgsMapLayer* QgsRemoteOWSBuilder::createMapLayer( const QDomElement& elem, const

if ( serviceName == "WFS" )
{
//support for old format where type is explicitely given and not part of url
//support for old format where type is explicitly given and not part of url
QString tname = onlineResourceElement.attribute( "type" );
if ( !tname.isEmpty() )
{
Expand Down
1 change: 1 addition & 0 deletions src/plugins/roadgraph/CMakeLists.txt
Expand Up @@ -28,6 +28,7 @@ SET (VRP_RCCS roadgraph.qrc)

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${GEOS_INCLUDE_DIR}
../../core
../../gui
..
Expand Down
47 changes: 24 additions & 23 deletions src/plugins/roadgraph/exportdlg.cpp
Expand Up @@ -31,27 +31,27 @@ RgExportDlg::RgExportDlg( QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl )
{
// create base widgets;
setWindowTitle( tr("Export feature") );
setWindowTitle( tr( "Export feature" ) );
QVBoxLayout *v = new QVBoxLayout( this );

QHBoxLayout *h = new QHBoxLayout();
QLabel *l = new QLabel( tr("Select destination layer:"), this);
h->addWidget(l);
QLabel *l = new QLabel( tr( "Select destination layer:" ), this );
h->addWidget( l );
mcbLayers = new QComboBox( this );
h->addWidget(mcbLayers);
v->addLayout(h);
h->addWidget( mcbLayers );
v->addLayout( h );

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

//fill list of layers
mcbLayers->insertItem( 0, tr("new temporary layer"), QVariant("-1") );
mcbLayers->insertItem( 0, tr( "new temporary layer" ), QVariant( "-1" ) );

QMap<QString, QgsMapLayer*> mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
QMap<QString, QgsMapLayer*>::iterator layer_it = mapLayers.begin();

for ( ; layer_it != mapLayers.end(); ++layer_it )
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer_it.value() );
Expand All @@ -72,33 +72,34 @@ QgsVectorLayer* RgExportDlg::mapLayer() const
{
QgsVectorLayer* myLayer = NULL;
QString layerId = mcbLayers->itemData( mcbLayers->currentIndex() ).toString();
if ( layerId == QString("-1") )

if ( layerId == QString( "-1" ) )
{
// create a temporary layer
myLayer = new QgsVectorLayer( "LineString", "shortest path", "memory" );

QgsVectorDataProvider *prov = myLayer->dataProvider();
if ( prov == NULL)
return NULL;
if ( prov == NULL )
return NULL;

QList<QgsField> attrList;
attrList.append( QgsField("one", QVariant::Int) );
attrList.append( QgsField( "one", QVariant::Int ) );
prov->addAttributes( attrList );
QgsMapLayerRegistry::instance()->addMapLayer( myLayer );
QgsMapLayerRegistry::instance()->addMapLayer( myLayer );

}else
}
else
{
// retrun selected layer
myLayer = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( layerId ) );
}

return myLayer;
} // QgsVectorLayer* RgExportDlg::vectorLayer() const

void RgExportDlg::on_buttonBox_accepted()
{
accept();
{
accept();
} // void RgExportDlg::on_buttonBox_accepted()

void RgExportDlg::on_buttonBox_rejected()
Expand Down
28 changes: 14 additions & 14 deletions src/plugins/roadgraph/exportdlg.h
Expand Up @@ -11,7 +11,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
***************************************************************************/
#ifndef ROADGRAPH_EXPORTDLG_H
#define ROADGRAPH_EXPORTDLG_H

Expand All @@ -35,20 +35,20 @@ class QgsVectorLayer;
class RgExportDlg : public QDialog
{
Q_OBJECT
public:
RgExportDlg( QWidget* parent = 0, Qt::WFlags fl = 0 );
~RgExportDlg();
public:
QgsVectorLayer* mapLayer() const;
private:
static const int context_id = 0;
public:
RgExportDlg( QWidget* parent = 0, Qt::WFlags fl = 0 );
~RgExportDlg();
public:
QgsVectorLayer* mapLayer() const;
private:
static const int context_id = 0;

private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();

private:
QComboBox *mcbLayers;
private:
QComboBox *mcbLayers;
};
#endif

0 comments on commit 8239b33

Please sign in to comment.