Skip to content

Commit

Permalink
fix lenny build
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14707 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 18, 2010
1 parent 9e9eec9 commit 2f572cf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion scripts/prepare-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -d .svn ]; then
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

Expand Down
52 changes: 31 additions & 21 deletions src/app/qgslabelpropertydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ QgsLabelPropertyDialog::~QgsLabelPropertyDialog()

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;
}
Expand All @@ -58,7 +58,7 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )

//get layerproperties. Problem: only for pallabeling...
QgsPalLabeling* lbl = dynamic_cast<QgsPalLabeling*>( mMapRenderer->labelingEngine() );
if( !lbl )
if ( !lbl )
{
return;
}
Expand All @@ -67,12 +67,12 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )

//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 ) );
Expand All @@ -82,6 +82,8 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
case QVariant::LongLong:
mLabelTextLineEdit->setValidator( new QIntValidator( this ) );
break;
default:
break;
}
}

Expand All @@ -94,17 +96,17 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
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 );
Expand Down Expand Up @@ -148,7 +150,7 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
mRotationSpinBox->setValue( attributeValues[propIt.value()].toDouble() );
break;

//font related properties
//font related properties
case QgsPalLayerSettings::Bold:
mLabelFont.setBold( attributeValues[propIt.value()].toBool() );
break;
Expand Down Expand Up @@ -247,8 +249,8 @@ void QgsLabelPropertyDialog::on_mRotationSpinBox_valueChanged( double d )
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() );
Expand All @@ -259,8 +261,12 @@ void QgsLabelPropertyDialog::on_mFontPushButton_clicked()

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() );
Expand All @@ -269,8 +275,12 @@ void QgsLabelPropertyDialog::on_mFontColorButton_clicked()

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() );
Expand All @@ -287,18 +297,18 @@ void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged( const QString
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 );
}
}

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 );
}
Expand Down

0 comments on commit 2f572cf

Please sign in to comment.