Skip to content

Commit c77ca6d

Browse files
author
jef
committedJul 23, 2009

File tree

5 files changed

+44
-50
lines changed

5 files changed

+44
-50
lines changed
 

‎CMakeLists.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ IF (PEDANTIC)
201201
ENDIF (MSVC)
202202
ENDIF (PEDANTIC)
203203

204-
IF (CMAKE_BUILD_TYPE MATCHES Debug)
204+
IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
205205
ADD_DEFINITIONS(-DQGISDEBUG=1)
206-
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
206+
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
207207

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

246-
ADD_DEFINITIONS(-DQGISDEBUG=1)
237+
IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
238+
ADD_DEFINITIONS( /FR )
239+
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
247240

248-
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/win_build/vcdeps/. DESTINATION .)
241+
INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/../vcdeps/. DESTINATION .)
249242
ELSE(MSVC)
250-
SET (DEFAULT_BIN_SUBDIR .)
243+
SET (DEFAULT_BIN_SUBDIR .)
251244
ENDIF(MSVC)
252245
ELSE (WIN32)
253246

‎src/app/qgsattributetypeloaddialog.cpp

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,12 @@ void QgsAttributeTypeLoadDialog::setVectorLayer( QgsVectorLayer *layer )
6565

6666
void QgsAttributeTypeLoadDialog::previewButtonPushed()
6767
{
68-
createPreview( valueComboBox->currentIndex(), true);
68+
createPreview( valueComboBox->currentIndex(), true );
6969
}
7070

7171
void QgsAttributeTypeLoadDialog::fillLayerList()
7272
{
7373
layerComboBox->clear();
74-
int i = 0;
75-
QgsMapLayer* dataLayer;
7674
QMap<QString, QgsMapLayer*>::iterator layer_it = QgsMapLayerRegistry::instance()->mapLayers().begin();
7775
for ( ; layer_it != QgsMapLayerRegistry::instance()->mapLayers().end(); layer_it++ )
7876
{
@@ -86,47 +84,47 @@ void QgsAttributeTypeLoadDialog::fillComboBoxes( int layerIndex )
8684
keyComboBox->clear();
8785
valueComboBox->clear();
8886

89-
if (layerIndex < 0)
87+
if ( layerIndex < 0 )
9088
{
9189
return;
9290
}
9391

9492
QgsMapLayer* dataLayer = QgsMapLayerRegistry::instance()->mapLayer( layerComboBox->currentText() );
9593
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer *>( dataLayer );
96-
if (vLayer == NULL)
94+
if ( vLayer == NULL )
9795
{
98-
return;
96+
return;
9997
}
10098
QMap<QString, int> fieldMap = vLayer->dataProvider()->fieldNameMap();
10199
QMap<QString, int>::iterator it = fieldMap.begin();
102-
for (; it != fieldMap.end(); it++)
100+
for ( ; it != fieldMap.end(); it++ )
103101
{
104-
keyComboBox->addItem(it.key(), it.value());
105-
valueComboBox->addItem(it.key(), it.value());
102+
keyComboBox->addItem( it.key(), it.value() );
103+
valueComboBox->addItem( it.key(), it.value() );
106104
}
107105

108106
}
109107

110-
void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full)
108+
void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full )
111109
{
112110
previewTableWidget->clearContents();
113111

114-
for (int i = previewTableWidget->rowCount() -1; i > 0; i--)
112+
for ( int i = previewTableWidget->rowCount() - 1; i > 0; i-- )
115113
{
116-
previewTableWidget->removeRow(i);
114+
previewTableWidget->removeRow( i );
117115
}
118-
if (layerComboBox->currentIndex() < 0 || fieldIndex < 0 )
116+
if ( layerComboBox->currentIndex() < 0 || fieldIndex < 0 )
119117
{
120118
//when nothing is selected there is no reason for preview
121119
return;
122120
}
123-
int idx = keyComboBox->itemData(keyComboBox->currentIndex()).toInt();
124-
int idx2 = valueComboBox->itemData(valueComboBox->currentIndex()).toInt();
121+
int idx = keyComboBox->itemData( keyComboBox->currentIndex() ).toInt();
122+
int idx2 = valueComboBox->itemData( valueComboBox->currentIndex() ).toInt();
125123
QgsMapLayer* dataLayer = QgsMapLayerRegistry::instance()->mapLayer( layerComboBox->currentText() );
126124
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer *>( dataLayer );
127-
if (vLayer == NULL)
125+
if ( vLayer == NULL )
128126
{
129-
return;
127+
return;
130128
}
131129

132130
QgsVectorDataProvider* dataProvider = vLayer->dataProvider();
@@ -144,12 +142,12 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full)
144142
QVariant val1 = f.attributeMap()[idx];
145143
QVariant val2 = f.attributeMap()[idx2];
146144
if ( val1.isValid() && !val1.isNull() && !val1.toString().isEmpty()
147-
&& val2.isValid() && !val2.isNull() && !val2.toString().isEmpty() )
145+
&& val2.isValid() && !val2.isNull() && !val2.toString().isEmpty() )
148146
{
149-
valueMap.insert(val1.toString(), val2.toString() );
147+
valueMap.insert( val1.toString(), val2.toString() );
150148
}
151-
if (!full && valueMap.size() > 8)
152-
break; //just first entries all on button
149+
if ( !full && valueMap.size() > 8 )
150+
break; //just first entries all on button
153151
}
154152
int row = 0;
155153
for ( QMap<QString, QVariant>::iterator mit = valueMap.begin(); mit != valueMap.end(); mit++, row++ )
@@ -170,13 +168,13 @@ QMap<QString, QVariant> &QgsAttributeTypeLoadDialog::valueMap()
170168
void QgsAttributeTypeLoadDialog::loadDataToValueMap()
171169
{
172170
mValueMap.clear();
173-
int idx = keyComboBox->itemData(keyComboBox->currentIndex()).toInt();
174-
int idx2 = valueComboBox->itemData(valueComboBox->currentIndex()).toInt();
171+
int idx = keyComboBox->itemData( keyComboBox->currentIndex() ).toInt();
172+
int idx2 = valueComboBox->itemData( valueComboBox->currentIndex() ).toInt();
175173
QgsMapLayer* dataLayer = QgsMapLayerRegistry::instance()->mapLayer( layerComboBox->currentText() );
176174
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer *>( dataLayer );
177-
if (vLayer == NULL)
175+
if ( vLayer == NULL )
178176
{
179-
return;
177+
return;
180178
}
181179

182180
QgsVectorDataProvider* dataProvider = vLayer->dataProvider();
@@ -193,7 +191,7 @@ void QgsAttributeTypeLoadDialog::loadDataToValueMap()
193191
QVariant val = f.attributeMap()[idx];
194192
if ( val.isValid() && !val.isNull() && !val.toString().isEmpty() )
195193
{
196-
mValueMap.insert(f.attributeMap()[idx2].toString(), val );
194+
mValueMap.insert( f.attributeMap()[idx2].toString(), val );
197195
}
198196
}
199197
dataProvider->enableGeometrylessFeatures( false );

‎src/app/qgsmaptoolsimplify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void QgsSimplifyDialog::setRange( int minValue, int maxValue )
5252
// let's have 20 page steps
5353
horizontalSlider->setPageStep(( maxValue - minValue ) / 20 );
5454

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

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

147147
bool QgsMapToolSimplify::calculateSliderBoudaries()
148148
{
149-
double minTolerance, maxTolerance;
149+
double minTolerance = -1, maxTolerance = -1;
150150

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

‎src/core/spatialindex/storagemanager/DiskStorageManager.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include <io.h>
3333
#ifdef _MSC_VER
3434
#include <basetsd.h>
35+
#define F_OK 0
36+
#define X_OK 1
37+
#define W_OK 2
38+
#define R_OK 4
3539
#endif//_MSC_VER
3640
#define fsync(fd) _commit(fd)
3741
#endif

‎src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ QgsGrassModule::QgsGrassModule( QgsGrassTools *tools, QString moduleName, QgisIn
198198
QString xName = qDocElem.attribute( "manual" );
199199
if ( xName.isEmpty() )
200200
{
201-
xName = qDocElem.attribute( "module" );
201+
xName = qDocElem.attribute( "module" );
202202
}
203203

204204
// Binary modules on windows has .exe extension
@@ -1365,7 +1365,7 @@ void QgsGrassModule::finished( int exitCode, QProcess::ExitStatus exitStatus )
13651365
mSuccess = true;
13661366
mViewButton->setEnabled( true );
13671367
mOptions->thawOutput();
1368-
mCanvas->refresh();
1368+
mCanvas->refresh();
13691369
}
13701370
else
13711371
{
@@ -1898,7 +1898,6 @@ QString QgsGrassModuleOption::value()
18981898
}
18991899
else if ( mControlType == CheckBoxes )
19001900
{
1901-
int cnt = 0;
19021901
QStringList values;
19031902
for ( unsigned int i = 0; i < mCheckBoxes.size(); ++i )
19041903
{
@@ -1907,7 +1906,7 @@ QString QgsGrassModuleOption::value()
19071906
values.append( mValues[i] );
19081907
}
19091908
}
1910-
value = values.join(",");
1909+
value = values.join( "," );
19111910
}
19121911
return value;
19131912
}
@@ -3027,10 +3026,10 @@ QgsGrassModuleFile::QgsGrassModuleFile(
30273026
{
30283027
mType = Multiple;
30293028
}
3030-
3031-
if ( qdesc.attribute( "type" ).toLower() == "directory")
3029+
3030+
if ( qdesc.attribute( "type" ).toLower() == "directory" )
30323031
{
3033-
mType = Directory;
3032+
mType = Directory;
30343033
}
30353034

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

0 commit comments

Comments
 (0)
Please sign in to comment.