[QGIS Commit] r11153 - in trunk/qgis: . src/app src/core/spatialindex/storagemanager src/plugins/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Jul 23 07:07:34 EDT 2009


Author: jef
Date: 2009-07-23 07:07:34 -0400 (Thu, 23 Jul 2009)
New Revision: 11153

Modified:
   trunk/qgis/CMakeLists.txt
   trunk/qgis/src/app/qgsattributetypeloaddialog.cpp
   trunk/qgis/src/app/qgsmaptoolsimplify.cpp
   trunk/qgis/src/core/spatialindex/storagemanager/DiskStorageManager.cc
   trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
Log:
fix warnings

Modified: trunk/qgis/CMakeLists.txt
===================================================================
--- trunk/qgis/CMakeLists.txt	2009-07-23 10:59:59 UTC (rev 11152)
+++ trunk/qgis/CMakeLists.txt	2009-07-23 11:07:34 UTC (rev 11153)
@@ -201,9 +201,9 @@
   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 @@
     # 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 @@
     # 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)
 

Modified: trunk/qgis/src/app/qgsattributetypeloaddialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributetypeloaddialog.cpp	2009-07-23 10:59:59 UTC (rev 11152)
+++ trunk/qgis/src/app/qgsattributetypeloaddialog.cpp	2009-07-23 11:07:34 UTC (rev 11153)
@@ -65,14 +65,12 @@
 
 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 @@
   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 @@
     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 @@
 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 @@
     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 );

Modified: trunk/qgis/src/app/qgsmaptoolsimplify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolsimplify.cpp	2009-07-23 10:59:59 UTC (rev 11152)
+++ trunk/qgis/src/app/qgsmaptoolsimplify.cpp	2009-07-23 11:07:34 UTC (rev 11153)
@@ -52,7 +52,7 @@
   // 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 @@
 
 bool QgsMapToolSimplify::calculateSliderBoudaries()
 {
-  double minTolerance, maxTolerance;
+  double minTolerance = -1, maxTolerance = -1;
 
   double tol = 0.000001;
   bool found = false;
@@ -372,7 +372,7 @@
 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
 

Modified: trunk/qgis/src/core/spatialindex/storagemanager/DiskStorageManager.cc
===================================================================
--- trunk/qgis/src/core/spatialindex/storagemanager/DiskStorageManager.cc	2009-07-23 10:59:59 UTC (rev 11152)
+++ trunk/qgis/src/core/spatialindex/storagemanager/DiskStorageManager.cc	2009-07-23 11:07:34 UTC (rev 11153)
@@ -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

Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2009-07-23 10:59:59 UTC (rev 11152)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2009-07-23 11:07:34 UTC (rev 11153)
@@ -198,7 +198,7 @@
   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 @@
       mSuccess = true;
       mViewButton->setEnabled( true );
       mOptions->thawOutput();
-      mCanvas->refresh(); 
+      mCanvas->refresh();
     }
     else
     {
@@ -1898,7 +1898,6 @@
   }
   else if ( mControlType == CheckBoxes )
   {
-    int cnt = 0;
     QStringList values;
     for ( unsigned int i = 0; i < mCheckBoxes.size(); ++i )
     {
@@ -1907,7 +1906,7 @@
         values.append( mValues[i] );
       }
     }
-    value = values.join(",");
+    value = values.join( "," );
   }
   return value;
 }
@@ -3027,10 +3026,10 @@
   {
     mType = Multiple;
   }
-  
-  if ( qdesc.attribute( "type" ).toLower() == "directory")
+
+  if ( qdesc.attribute( "type" ).toLower() == "directory" )
   {
-    mType = Directory; 
+    mType = Directory;
   }
 
   if ( !qdesc.attribute( "filters" ).isNull() )



More information about the QGIS-commit mailing list