[QGIS Commit] r14707 - in trunk/qgis: scripts src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Nov 17 19:24:13 EST 2010


Author: jef
Date: 2010-11-17 16:24:13 -0800 (Wed, 17 Nov 2010)
New Revision: 14707

Modified:
   trunk/qgis/scripts/prepare-commit.sh
   trunk/qgis/src/app/qgslabelpropertydialog.cpp
Log:
fix lenny build

Modified: trunk/qgis/scripts/prepare-commit.sh
===================================================================
--- trunk/qgis/scripts/prepare-commit.sh	2010-11-17 22:12:51 UTC (rev 14706)
+++ trunk/qgis/scripts/prepare-commit.sh	2010-11-18 00:24:13 UTC (rev 14707)
@@ -36,7 +36,7 @@
 	REV=$(svn info | sed -ne "s/Revision: //p")
 	svn diff >r$REV.diff
 elif [ -d .git ]; then
-	REV=$(git svn info | sed -ne "s/Revision //p")
+	REV=$(git svn info | sed -ne "s/Revision: //p")
 	git diff >r$REV.diff
 fi
 

Modified: trunk/qgis/src/app/qgslabelpropertydialog.cpp
===================================================================
--- trunk/qgis/src/app/qgslabelpropertydialog.cpp	2010-11-17 22:12:51 UTC (rev 14706)
+++ trunk/qgis/src/app/qgslabelpropertydialog.cpp	2010-11-18 00:24:13 UTC (rev 14707)
@@ -36,20 +36,20 @@
 
 void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
 {
-  if( !mMapRenderer )
+  if ( !mMapRenderer )
   {
     return;
   }
 
   //get feature attributes
   QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( layerId ) );
-  if( !vlayer )
+  if ( !vlayer )
   {
     return;
   }
 
   QgsFeature f;
-  if( !vlayer->featureAtId( featureId, f, false, true ) )
+  if ( !vlayer->featureAtId( featureId, f, false, true ) )
   {
     return;
   }
@@ -58,7 +58,7 @@
 
   //get layerproperties. Problem: only for pallabeling...
   QgsPalLabeling* lbl = dynamic_cast<QgsPalLabeling*>( mMapRenderer->labelingEngine() );
-  if( !lbl )
+  if ( !lbl )
   {
     return;
   }
@@ -67,12 +67,12 @@
 
   //get label field and fill line edit
   QString labelFieldName = vlayer->customProperty( "labeling/fieldName" ).toString();
-  if( !labelFieldName.isEmpty() )
+  if ( !labelFieldName.isEmpty() )
   {
     mCurrentLabelField = vlayer->fieldNameIndex( labelFieldName );
     mLabelTextLineEdit->setText( attributeValues[mCurrentLabelField].toString() );
     const QgsFieldMap& layerFields = vlayer->pendingFields();
-    switch( layerFields[mCurrentLabelField].type() )
+    switch ( layerFields[mCurrentLabelField].type() )
     {
       case QVariant::Double:
         mLabelTextLineEdit->setValidator( new QDoubleValidator( this ) );
@@ -82,6 +82,8 @@
       case QVariant::LongLong:
         mLabelTextLineEdit->setValidator( new QIntValidator( this ) );
         break;
+      default:
+        break;
     }
   }
 
@@ -94,17 +96,17 @@
   mBufferColorButton->setColor( layerSettings.textColor );
   mLabelDistanceSpinBox->setValue( layerSettings.dist );
   mBufferSizeSpinBox->setValue( layerSettings.bufferSize );
-  mHaliComboBox->setCurrentIndex( mHaliComboBox->findText("Left") );
-  mValiComboBox->setCurrentIndex( mValiComboBox->findText("Bottom") );
+  mHaliComboBox->setCurrentIndex( mHaliComboBox->findText( "Left" ) );
+  mValiComboBox->setCurrentIndex( mValiComboBox->findText( "Bottom" ) );
 
   disableGuiElements();
 
   mDataDefinedProperties = layerSettings.dataDefinedProperties;
   QMap< QgsPalLayerSettings::DataDefinedProperties, int >::const_iterator propIt = mDataDefinedProperties.constBegin();
 
-  for(; propIt != mDataDefinedProperties.constEnd(); ++propIt )
+  for ( ; propIt != mDataDefinedProperties.constEnd(); ++propIt )
   {
-    switch( propIt.key() )
+    switch ( propIt.key() )
     {
       case QgsPalLayerSettings::Size:
         mFontSizeSpinBox->setEnabled( true );
@@ -148,7 +150,7 @@
         mRotationSpinBox->setValue( attributeValues[propIt.value()].toDouble() );
         break;
 
-      //font related properties
+        //font related properties
       case QgsPalLayerSettings::Bold:
         mLabelFont.setBold( attributeValues[propIt.value()].toBool() );
         break;
@@ -247,8 +249,8 @@
 void QgsLabelPropertyDialog::on_mFontPushButton_clicked()
 {
   bool ok;
-  mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr("Label font") );
-  if( ok )
+  mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ) );
+  if ( ok )
   {
     insertChangedValue( QgsPalLayerSettings::Size, mLabelFont.pointSizeF() );
     insertChangedValue( QgsPalLayerSettings::Bold, mLabelFont.bold() );
@@ -259,8 +261,12 @@
 
 void QgsLabelPropertyDialog::on_mFontColorButton_clicked()
 {
-  QColor c = QColorDialog::getColor ( mFontColorButton->color(), 0, tr("Font color"), QColorDialog::ShowAlphaChannel );
-  if( c.isValid() )
+#if QT_VERSION >= 0x040500
+  QColor c = QColorDialog::getColor( mFontColorButton->color(), 0, tr( "Font color" ), QColorDialog::ShowAlphaChannel );
+#else
+  QColor c = QColorDialog::getColor( mFontColorButton->color() );
+#endif
+  if ( c.isValid() )
   {
     mFontColorButton->setColor( c );
     insertChangedValue( QgsPalLayerSettings::Color, c.name() );
@@ -269,8 +275,12 @@
 
 void QgsLabelPropertyDialog::on_mBufferColorButton_clicked()
 {
-  QColor c = QColorDialog::getColor ( mBufferColorButton->color(), 0, tr("Buffer color"), QColorDialog::ShowAlphaChannel );
-  if( c.isValid() )
+#if QT_VERSION >= 0x040500
+  QColor c = QColorDialog::getColor( mBufferColorButton->color(), 0, tr( "Buffer color" ), QColorDialog::ShowAlphaChannel );
+#else
+  QColor c = QColorDialog::getColor( mBufferColorButton->color() );
+#endif
+  if ( c.isValid() )
   {
     mFontColorButton->setColor( c );
     insertChangedValue( QgsPalLayerSettings::BufferColor, c.name() );
@@ -287,9 +297,9 @@
   insertChangedValue( QgsPalLayerSettings::Vali, text );
 }
 
-void QgsLabelPropertyDialog::on_mLabelTextLineEdit_textChanged ( const QString& text )
+void QgsLabelPropertyDialog::on_mLabelTextLineEdit_textChanged( const QString& text )
 {
-  if( mCurrentLabelField != -1 )
+  if ( mCurrentLabelField != -1 )
   {
     mChangedProperties.insert( mCurrentLabelField, text );
   }
@@ -297,8 +307,8 @@
 
 void QgsLabelPropertyDialog::insertChangedValue( QgsPalLayerSettings::DataDefinedProperties p, QVariant value )
 {
-   QMap< QgsPalLayerSettings::DataDefinedProperties, int >::const_iterator ddIt = mDataDefinedProperties.find( p );
-   if( ddIt != mDataDefinedProperties.constEnd() )
+  QMap< QgsPalLayerSettings::DataDefinedProperties, int >::const_iterator ddIt = mDataDefinedProperties.find( p );
+  if ( ddIt != mDataDefinedProperties.constEnd() )
   {
     mChangedProperties.insert( ddIt.value(), value );
   }



More information about the QGIS-commit mailing list