Skip to content

Commit 2f572cf

Browse files
author
jef
committedNov 18, 2010
fix lenny build
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14707 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+32
-22
lines changed

2 files changed

+32
-22
lines changed
 

‎scripts/prepare-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [ -d .svn ]; then
3636
REV=$(svn info | sed -ne "s/Revision: //p")
3737
svn diff >r$REV.diff
3838
elif [ -d .git ]; then
39-
REV=$(git svn info | sed -ne "s/Revision //p")
39+
REV=$(git svn info | sed -ne "s/Revision: //p")
4040
git diff >r$REV.diff
4141
fi
4242

‎src/app/qgslabelpropertydialog.cpp

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ QgsLabelPropertyDialog::~QgsLabelPropertyDialog()
3636

3737
void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
3838
{
39-
if( !mMapRenderer )
39+
if ( !mMapRenderer )
4040
{
4141
return;
4242
}
4343

4444
//get feature attributes
4545
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( layerId ) );
46-
if( !vlayer )
46+
if ( !vlayer )
4747
{
4848
return;
4949
}
5050

5151
QgsFeature f;
52-
if( !vlayer->featureAtId( featureId, f, false, true ) )
52+
if ( !vlayer->featureAtId( featureId, f, false, true ) )
5353
{
5454
return;
5555
}
@@ -58,7 +58,7 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
5858

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

6868
//get label field and fill line edit
6969
QString labelFieldName = vlayer->customProperty( "labeling/fieldName" ).toString();
70-
if( !labelFieldName.isEmpty() )
70+
if ( !labelFieldName.isEmpty() )
7171
{
7272
mCurrentLabelField = vlayer->fieldNameIndex( labelFieldName );
7373
mLabelTextLineEdit->setText( attributeValues[mCurrentLabelField].toString() );
7474
const QgsFieldMap& layerFields = vlayer->pendingFields();
75-
switch( layerFields[mCurrentLabelField].type() )
75+
switch ( layerFields[mCurrentLabelField].type() )
7676
{
7777
case QVariant::Double:
7878
mLabelTextLineEdit->setValidator( new QDoubleValidator( this ) );
@@ -82,6 +82,8 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
8282
case QVariant::LongLong:
8383
mLabelTextLineEdit->setValidator( new QIntValidator( this ) );
8484
break;
85+
default:
86+
break;
8587
}
8688
}
8789

@@ -94,17 +96,17 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
9496
mBufferColorButton->setColor( layerSettings.textColor );
9597
mLabelDistanceSpinBox->setValue( layerSettings.dist );
9698
mBufferSizeSpinBox->setValue( layerSettings.bufferSize );
97-
mHaliComboBox->setCurrentIndex( mHaliComboBox->findText("Left") );
98-
mValiComboBox->setCurrentIndex( mValiComboBox->findText("Bottom") );
99+
mHaliComboBox->setCurrentIndex( mHaliComboBox->findText( "Left" ) );
100+
mValiComboBox->setCurrentIndex( mValiComboBox->findText( "Bottom" ) );
99101

100102
disableGuiElements();
101103

102104
mDataDefinedProperties = layerSettings.dataDefinedProperties;
103105
QMap< QgsPalLayerSettings::DataDefinedProperties, int >::const_iterator propIt = mDataDefinedProperties.constBegin();
104106

105-
for(; propIt != mDataDefinedProperties.constEnd(); ++propIt )
107+
for ( ; propIt != mDataDefinedProperties.constEnd(); ++propIt )
106108
{
107-
switch( propIt.key() )
109+
switch ( propIt.key() )
108110
{
109111
case QgsPalLayerSettings::Size:
110112
mFontSizeSpinBox->setEnabled( true );
@@ -148,7 +150,7 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId )
148150
mRotationSpinBox->setValue( attributeValues[propIt.value()].toDouble() );
149151
break;
150152

151-
//font related properties
153+
//font related properties
152154
case QgsPalLayerSettings::Bold:
153155
mLabelFont.setBold( attributeValues[propIt.value()].toBool() );
154156
break;
@@ -247,8 +249,8 @@ void QgsLabelPropertyDialog::on_mRotationSpinBox_valueChanged( double d )
247249
void QgsLabelPropertyDialog::on_mFontPushButton_clicked()
248250
{
249251
bool ok;
250-
mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr("Label font") );
251-
if( ok )
252+
mLabelFont = QFontDialog::getFont( &ok, mLabelFont, 0, tr( "Label font" ) );
253+
if ( ok )
252254
{
253255
insertChangedValue( QgsPalLayerSettings::Size, mLabelFont.pointSizeF() );
254256
insertChangedValue( QgsPalLayerSettings::Bold, mLabelFont.bold() );
@@ -259,8 +261,12 @@ void QgsLabelPropertyDialog::on_mFontPushButton_clicked()
259261

260262
void QgsLabelPropertyDialog::on_mFontColorButton_clicked()
261263
{
262-
QColor c = QColorDialog::getColor ( mFontColorButton->color(), 0, tr("Font color"), QColorDialog::ShowAlphaChannel );
263-
if( c.isValid() )
264+
#if QT_VERSION >= 0x040500
265+
QColor c = QColorDialog::getColor( mFontColorButton->color(), 0, tr( "Font color" ), QColorDialog::ShowAlphaChannel );
266+
#else
267+
QColor c = QColorDialog::getColor( mFontColorButton->color() );
268+
#endif
269+
if ( c.isValid() )
264270
{
265271
mFontColorButton->setColor( c );
266272
insertChangedValue( QgsPalLayerSettings::Color, c.name() );
@@ -269,8 +275,12 @@ void QgsLabelPropertyDialog::on_mFontColorButton_clicked()
269275

270276
void QgsLabelPropertyDialog::on_mBufferColorButton_clicked()
271277
{
272-
QColor c = QColorDialog::getColor ( mBufferColorButton->color(), 0, tr("Buffer color"), QColorDialog::ShowAlphaChannel );
273-
if( c.isValid() )
278+
#if QT_VERSION >= 0x040500
279+
QColor c = QColorDialog::getColor( mBufferColorButton->color(), 0, tr( "Buffer color" ), QColorDialog::ShowAlphaChannel );
280+
#else
281+
QColor c = QColorDialog::getColor( mBufferColorButton->color() );
282+
#endif
283+
if ( c.isValid() )
274284
{
275285
mFontColorButton->setColor( c );
276286
insertChangedValue( QgsPalLayerSettings::BufferColor, c.name() );
@@ -287,18 +297,18 @@ void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged( const QString
287297
insertChangedValue( QgsPalLayerSettings::Vali, text );
288298
}
289299

290-
void QgsLabelPropertyDialog::on_mLabelTextLineEdit_textChanged ( const QString& text )
300+
void QgsLabelPropertyDialog::on_mLabelTextLineEdit_textChanged( const QString& text )
291301
{
292-
if( mCurrentLabelField != -1 )
302+
if ( mCurrentLabelField != -1 )
293303
{
294304
mChangedProperties.insert( mCurrentLabelField, text );
295305
}
296306
}
297307

298308
void QgsLabelPropertyDialog::insertChangedValue( QgsPalLayerSettings::DataDefinedProperties p, QVariant value )
299309
{
300-
QMap< QgsPalLayerSettings::DataDefinedProperties, int >::const_iterator ddIt = mDataDefinedProperties.find( p );
301-
if( ddIt != mDataDefinedProperties.constEnd() )
310+
QMap< QgsPalLayerSettings::DataDefinedProperties, int >::const_iterator ddIt = mDataDefinedProperties.find( p );
311+
if ( ddIt != mDataDefinedProperties.constEnd() )
302312
{
303313
mChangedProperties.insert( ddIt.value(), value );
304314
}

0 commit comments

Comments
 (0)
Please sign in to comment.