[QGIS Commit] r11345 - in trunk/qgis/src: app plugins/grass ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Aug 11 11:21:26 EDT 2009


Author: jef
Date: 2009-08-11 11:21:25 -0400 (Tue, 11 Aug 2009)
New Revision: 11345

Modified:
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
   trunk/qgis/src/ui/qgsoptionsbase.ui
Log:
fix warnings

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2009-08-11 14:26:43 UTC (rev 11344)
+++ trunk/qgis/src/app/qgisapp.cpp	2009-08-11 15:21:25 UTC (rev 11345)
@@ -4656,7 +4656,6 @@
 
 void QgisApp::removeLayer()
 {
-  QgsLegendLayerFile* currentLayerFile = mMapLegend->currentLayerFile();
   mMapLegend->legendLayerRemove();
   // notify the project we've made a change
   QgsProject::instance()->dirty( true );
@@ -5437,7 +5436,7 @@
   //pass any refresg signals off to canvases
   // Line below was commented out by wonder three years ago (r4949).
   // It is needed to refresh scale bar after changing display units.
-  connect (pp,SIGNAL(refresh()), mMapCanvas, SLOT(refresh()));
+  connect( pp, SIGNAL( refresh() ), mMapCanvas, SLOT( refresh() ) );
 
   QgsMapRenderer* myRender = mMapCanvas->mapRenderer();
   bool wasProjected = myRender->hasCrsTransformEnabled();

Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2009-08-11 14:26:43 UTC (rev 11344)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp	2009-08-11 15:21:25 UTC (rev 11345)
@@ -2004,11 +2004,7 @@
   adjustTitle();
 
   // Check if this parameter is required
-   if (gnode.toElement().attribute("required") == "yes") {
-      mRequired = true;
-  } else {
-      mRequired = false;
-  }
+  mRequired = gnode.toElement().attribute( "required" ) == "yes";
 
   QDomNode promptNode = gnode.namedItem( "gisprompt" );
   QDomElement promptElem = promptNode.toElement();
@@ -2221,11 +2217,12 @@
 
   // If not required, add an empty item to combobox and a padding item into
   // layer containers.
-  if (!mRequired){
-      mMaps.push_back(QString(""));
-      mVectorLayerNames.push_back(QString(""));
-      mMapLayers.push_back(NULL);
-      mLayerComboBox->addItem(tr("Select a layer"), QVariant());
+  if ( !mRequired )
+  {
+    mMaps.push_back( QString( "" ) );
+    mVectorLayerNames.push_back( QString( "" ) );
+    mMapLayers.push_back( NULL );
+    mLayerComboBox->addItem( tr( "Select a layer" ), QVariant() );
   }
 
   QgsMapCanvas *canvas = mModule->qgisIface()->mapCanvas();
@@ -2439,18 +2436,16 @@
 {
   QgsDebugMsg( "called." );
 
-  int limit = 0;
-  if (!mRequired)
+  unsigned int limit = 0;
+  if ( !mRequired )
     limit = 1;
 
   std::vector<QgsField> fields;
 
-  int c = mLayerComboBox->currentIndex();
-  if ( c < limit )
+  unsigned int current = mLayerComboBox->currentIndex();
+  if ( current < limit )
     return fields;
 
-  unsigned current = c;
-
   if ( current >= limit && current <  mVectorFields.size() )
   {
     fields = mVectorFields[current];
@@ -2463,16 +2458,14 @@
 {
   QgsDebugMsg( "called." );
 
-  int limit = 0;
-  if (!mRequired)
+  unsigned int limit = 0;
+  if ( !mRequired )
     limit = 1;
 
-  int c = mLayerComboBox->currentIndex();
-  if ( c < limit )
+  unsigned int current = mLayerComboBox->currentIndex();
+  if ( current < limit )
     return 0;
 
-  unsigned int current = c;
-
   if ( current >= limit && current <  mMapLayers.size() )
   {
     return mMapLayers[current];
@@ -2485,16 +2478,14 @@
 {
   QgsDebugMsg( "called." );
 
-  int limit = 0;
-  if (!mRequired)
+  unsigned int limit = 0;
+  if ( !mRequired )
     limit = 1;
-  
-  int c = mLayerComboBox->currentIndex();
-  if ( c < limit )
+
+  unsigned int current = mLayerComboBox->currentIndex();
+  if ( current < limit )
     return QString();
 
-  unsigned int current = c;
-
   if ( current >= limit && current <  mMaps.size() )
   {
     return mMaps[current];
@@ -2646,11 +2637,7 @@
   adjustTitle();
 
   // Check if this parameter is required
-  if (gnode.toElement().attribute("required") == "yes") {
-      mRequired = true;
-  } else {
-      mRequired = false;
-  }
+  mRequired = gnode.toElement().attribute( "required" ) == "yes";
 
   QDomNode promptNode = gnode.namedItem( "gisprompt" );
   QDomElement promptElem = promptNode.toElement();
@@ -2721,10 +2708,11 @@
 
   // If not required, add an empty item to combobox and a padding item into
   // layer containers.
-  if (!mRequired){
-      mUri.push_back(QString());
-      mOgrLayers.push_back(QString());
-      mLayerComboBox->addItem(tr("Select a layer"), QVariant());
+  if ( !mRequired )
+  {
+    mUri.push_back( QString() );
+    mOgrLayers.push_back( QString() );
+    mLayerComboBox->addItem( tr( "Select a layer" ), QVariant() );
   }
 
   QgsMapCanvas *canvas = mModule->qgisIface()->mapCanvas();

Modified: trunk/qgis/src/ui/qgsoptionsbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsoptionsbase.ui	2009-08-11 14:26:43 UTC (rev 11344)
+++ trunk/qgis/src/ui/qgsoptionsbase.ui	2009-08-11 15:21:25 UTC (rev 11345)
@@ -477,7 +477,7 @@
            </widget>
           </item>
           <item row="2" column="0">
-           <widget class="QLabel" name="textLabel1_8">
+           <widget class="QLabel" name="textLabel1_11">
             <property name="text">
              <string>Preferred measurements units</string>
             </property>



More information about the QGIS-commit mailing list