Skip to content
Permalink
Browse files

fix warnings

git-svn-id: http://svn.osgeo.org/qgis/trunk@11153 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jul 23, 2009
1 parent 0c59c74 commit bcde2dcfc3860288ec423bcde638a6d5c5ad9803
@@ -201,9 +201,9 @@ IF (PEDANTIC)
ENDIF (MSVC)
ENDIF (PEDANTIC)

IF (CMAKE_BUILD_TYPE MATCHES Debug)
IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
ADD_DEFINITIONS(-DQGISDEBUG=1)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)

#############################################################
# platform specific stuff
@@ -224,9 +224,6 @@ IF (WIN32)
# put all the build products into a single directory
# under build (doesnt affect install target) to make for
# easier debugging.
# SET(OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin)
# SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_DIR})
# SET(LIBRARY_OUTPUT_PATH ${OUTPUT_DIR})
#tell msvc compiler to use main instead of winmain as the
#application entry point
#SET(QT_USE_QTMAIN TRUE)
@@ -236,18 +233,14 @@ IF (WIN32)
# Turn off deprecation warnings
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
# Some file access stuff not defined in native win32
# environment
ADD_DEFINITIONS(-DF_OK=0)
ADD_DEFINITIONS(-DX_OK=1)
ADD_DEFINITIONS(-DW_OK=2)
ADD_DEFINITIONS(-DR_OK=4)

ADD_DEFINITIONS(-DQGISDEBUG=1)
IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
ADD_DEFINITIONS( /FR )
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/win_build/vcdeps/. DESTINATION .)
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/../vcdeps/. DESTINATION .)
ELSE(MSVC)
SET (DEFAULT_BIN_SUBDIR .)
SET (DEFAULT_BIN_SUBDIR .)
ENDIF(MSVC)
ELSE (WIN32)

@@ -65,14 +65,12 @@ void QgsAttributeTypeLoadDialog::setVectorLayer( QgsVectorLayer *layer )

void QgsAttributeTypeLoadDialog::previewButtonPushed()
{
createPreview( valueComboBox->currentIndex(), true);
createPreview( valueComboBox->currentIndex(), true );
}

void QgsAttributeTypeLoadDialog::fillLayerList()
{
layerComboBox->clear();
int i = 0;
QgsMapLayer* dataLayer;
QMap<QString, QgsMapLayer*>::iterator layer_it = QgsMapLayerRegistry::instance()->mapLayers().begin();
for ( ; layer_it != QgsMapLayerRegistry::instance()->mapLayers().end(); layer_it++ )
{
@@ -86,47 +84,47 @@ void QgsAttributeTypeLoadDialog::fillComboBoxes( int layerIndex )
keyComboBox->clear();
valueComboBox->clear();

if (layerIndex < 0)
if ( layerIndex < 0 )
{
return;
}

QgsMapLayer* dataLayer = QgsMapLayerRegistry::instance()->mapLayer( layerComboBox->currentText() );
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer *>( dataLayer );
if (vLayer == NULL)
if ( vLayer == NULL )
{
return;
return;
}
QMap<QString, int> fieldMap = vLayer->dataProvider()->fieldNameMap();
QMap<QString, int>::iterator it = fieldMap.begin();
for (; it != fieldMap.end(); it++)
for ( ; it != fieldMap.end(); it++ )
{
keyComboBox->addItem(it.key(), it.value());
valueComboBox->addItem(it.key(), it.value());
keyComboBox->addItem( it.key(), it.value() );
valueComboBox->addItem( it.key(), it.value() );
}

}

void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full)
void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full )
{
previewTableWidget->clearContents();

for (int i = previewTableWidget->rowCount() -1; i > 0; i--)
for ( int i = previewTableWidget->rowCount() - 1; i > 0; i-- )
{
previewTableWidget->removeRow(i);
previewTableWidget->removeRow( i );
}
if (layerComboBox->currentIndex() < 0 || fieldIndex < 0 )
if ( layerComboBox->currentIndex() < 0 || fieldIndex < 0 )
{
//when nothing is selected there is no reason for preview
return;
}
int idx = keyComboBox->itemData(keyComboBox->currentIndex()).toInt();
int idx2 = valueComboBox->itemData(valueComboBox->currentIndex()).toInt();
int idx = keyComboBox->itemData( keyComboBox->currentIndex() ).toInt();
int idx2 = valueComboBox->itemData( valueComboBox->currentIndex() ).toInt();
QgsMapLayer* dataLayer = QgsMapLayerRegistry::instance()->mapLayer( layerComboBox->currentText() );
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer *>( dataLayer );
if (vLayer == NULL)
if ( vLayer == NULL )
{
return;
return;
}

QgsVectorDataProvider* dataProvider = vLayer->dataProvider();
@@ -144,12 +142,12 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full)
QVariant val1 = f.attributeMap()[idx];
QVariant val2 = f.attributeMap()[idx2];
if ( val1.isValid() && !val1.isNull() && !val1.toString().isEmpty()
&& val2.isValid() && !val2.isNull() && !val2.toString().isEmpty() )
&& val2.isValid() && !val2.isNull() && !val2.toString().isEmpty() )
{
valueMap.insert(val1.toString(), val2.toString() );
valueMap.insert( val1.toString(), val2.toString() );
}
if (!full && valueMap.size() > 8)
break; //just first entries all on button
if ( !full && valueMap.size() > 8 )
break; //just first entries all on button
}
int row = 0;
for ( QMap<QString, QVariant>::iterator mit = valueMap.begin(); mit != valueMap.end(); mit++, row++ )
@@ -170,13 +168,13 @@ QMap<QString, QVariant> &QgsAttributeTypeLoadDialog::valueMap()
void QgsAttributeTypeLoadDialog::loadDataToValueMap()
{
mValueMap.clear();
int idx = keyComboBox->itemData(keyComboBox->currentIndex()).toInt();
int idx2 = valueComboBox->itemData(valueComboBox->currentIndex()).toInt();
int idx = keyComboBox->itemData( keyComboBox->currentIndex() ).toInt();
int idx2 = valueComboBox->itemData( valueComboBox->currentIndex() ).toInt();
QgsMapLayer* dataLayer = QgsMapLayerRegistry::instance()->mapLayer( layerComboBox->currentText() );
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer *>( dataLayer );
if (vLayer == NULL)
if ( vLayer == NULL )
{
return;
return;
}

QgsVectorDataProvider* dataProvider = vLayer->dataProvider();
@@ -193,7 +191,7 @@ void QgsAttributeTypeLoadDialog::loadDataToValueMap()
QVariant val = f.attributeMap()[idx];
if ( val.isValid() && !val.isNull() && !val.toString().isEmpty() )
{
mValueMap.insert(f.attributeMap()[idx2].toString(), val );
mValueMap.insert( f.attributeMap()[idx2].toString(), val );
}
}
dataProvider->enableGeometrylessFeatures( false );
@@ -52,7 +52,7 @@ void QgsSimplifyDialog::setRange( int minValue, int maxValue )
// let's have 20 page steps
horizontalSlider->setPageStep(( maxValue - minValue ) / 20 );

horizontalSlider->setMinimum( (minValue - 1 < 0 ? 0: minValue - 1 ) );// -1 for count with minimum tolerance end caused by double imprecision
horizontalSlider->setMinimum(( minValue - 1 < 0 ? 0 : minValue - 1 ) );// -1 for count with minimum tolerance end caused by double imprecision
horizontalSlider->setMaximum( maxValue );

}
@@ -146,7 +146,7 @@ int QgsMapToolSimplify::calculateDivider( double minimum, double maximum )

bool QgsMapToolSimplify::calculateSliderBoudaries()
{
double minTolerance, maxTolerance;
double minTolerance = -1, maxTolerance = -1;

double tol = 0.000001;
bool found = false;
@@ -372,7 +372,7 @@ bool QgsSimplifyFeature::simplifyPolygon( QgsFeature& polygonFeature, double to
QVector<QgsPoint> QgsSimplifyFeature::simplifyPoints( const QVector<QgsPoint>& pts, double tolerance )
{
//just safety precaution
if (tolerance < 0)
if ( tolerance < 0 )
return pts;
// Douglas-Peucker simplification algorithm

@@ -32,6 +32,10 @@
#include <io.h>
#ifdef _MSC_VER
#include <basetsd.h>
#define F_OK 0
#define X_OK 1
#define W_OK 2
#define R_OK 4
#endif//_MSC_VER
#define fsync(fd) _commit(fd)
#endif
@@ -198,7 +198,7 @@ QgsGrassModule::QgsGrassModule( QgsGrassTools *tools, QString moduleName, QgisIn
QString xName = qDocElem.attribute( "manual" );
if ( xName.isEmpty() )
{
xName = qDocElem.attribute( "module" );
xName = qDocElem.attribute( "module" );
}

// Binary modules on windows has .exe extension
@@ -1365,7 +1365,7 @@ void QgsGrassModule::finished( int exitCode, QProcess::ExitStatus exitStatus )
mSuccess = true;
mViewButton->setEnabled( true );
mOptions->thawOutput();
mCanvas->refresh();
mCanvas->refresh();
}
else
{
@@ -1898,7 +1898,6 @@ QString QgsGrassModuleOption::value()
}
else if ( mControlType == CheckBoxes )
{
int cnt = 0;
QStringList values;
for ( unsigned int i = 0; i < mCheckBoxes.size(); ++i )
{
@@ -1907,7 +1906,7 @@ QString QgsGrassModuleOption::value()
values.append( mValues[i] );
}
}
value = values.join(",");
value = values.join( "," );
}
return value;
}
@@ -3027,10 +3026,10 @@ QgsGrassModuleFile::QgsGrassModuleFile(
{
mType = Multiple;
}
if ( qdesc.attribute( "type" ).toLower() == "directory")

if ( qdesc.attribute( "type" ).toLower() == "directory" )
{
mType = Directory;
mType = Directory;
}

if ( !qdesc.attribute( "filters" ).isNull() )

0 comments on commit bcde2dc

Please sign in to comment.
You can’t perform that action at this time.