Skip to content

Commit

Permalink
minor update (indentation, debug output, plenks)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9189 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 27, 2008
1 parent afc5416 commit 874b29b
Show file tree
Hide file tree
Showing 46 changed files with 393 additions and 408 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsrasterdataprovider.sip
Expand Up @@ -19,7 +19,7 @@ public:
{
NoCapabilities = 0,
Identify = 1
// Capability2 = 1 << 1, , etc
// Capability2 = 1 << 1, etc
};


Expand Down
10 changes: 5 additions & 5 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -291,10 +291,10 @@ void QgsComposer::on_mActionZoomOut_activated( void )

void QgsComposer::on_mActionRefreshView_activated( void )
{
if(mComposition)
{
mComposition->update();
}
if ( mComposition )
{
mComposition->update();
}
}

void QgsComposer::on_mActionPrint_activated( void )
Expand Down Expand Up @@ -821,7 +821,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );

myQSettings.writeEntry( "/UI/lastSaveAsImageFormat" , myFilterMap[myFilterString] );
myQSettings.writeEntry( "/UI/lastSaveAsImageFormat", myFilterMap[myFilterString] );
myQSettings.writeEntry( "/UI/lastSaveAsImageFile", myOutputFileNameQString );

if ( myOutputFileNameQString == "" ) return;
Expand Down
45 changes: 19 additions & 26 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -155,9 +155,8 @@ void QgsLegend::removeLayer( QString layer_key )
}

QTreeWidgetItem* theItem = firstItem();
#ifdef QGISDEBUG
qWarning( "in QgsLegend::removeLayer" );
#endif
QgsDebugMsg( "called." )

while ( theItem )
{
QgsLegendItem *li = dynamic_cast<QgsLegendItem*>( theItem );
Expand Down Expand Up @@ -236,9 +235,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
QgsLegendItem::DRAG_ACTION action = dest->accept( origin );
if ( action == QgsLegendItem::REORDER )
{
#ifdef QGISDEBUG
qWarning( "mouseMoveEvent::REORDER" );
#endif
QgsDebugMsg( "mouseMoveEvent::REORDER" );

if ( !yCoordAboveCenter( dest, e->y() ) ) //over bottom of item
{
if ( origin->nextSibling() != dest )
Expand Down Expand Up @@ -266,9 +264,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
}
else if ( action == QgsLegendItem::INSERT )
{
#ifdef QGISDEBUG
qWarning( "mouseMoveEvent::INSERT" );
#endif
QgsDebugMsg( "mouseMoveEvent::INSERT" );

setCursor( QCursor( Qt::PointingHandCursor ) );
if ( origin->parent() != dest )
{
Expand All @@ -278,9 +275,8 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
}
else//no action
{
#ifdef QGISDEBUG
qWarning( "mouseMoveEvent::NO_ACTION" );
#endif
QgsDebugMsg( "mouseMoveEvent::NO_ACTION" );

if ( origin->type() == QgsLegendItem::LEGEND_LAYER_FILE && mItemBeingMovedOrigPos != getItemPos( mItemBeingMoved ) )
{
resetToInitialPosition( mItemBeingMoved );
Expand Down Expand Up @@ -1121,17 +1117,15 @@ void QgsLegend::resetToInitialPosition( QTreeWidgetItem* li )
QgsLegendItem* formerParent = dynamic_cast<QgsLegendItem*>( li->parent() ); //todo: make sure legend layers are updated
if ( mRestoreInformation == FIRST_ITEM )
{
#ifdef QGISDEBUG
qWarning( "FIRST_ITEM" );
#endif
QgsDebugMsg( "FIRST_ITEM" );

removeItem( li );
insertTopLevelItem( 0, li );
}
else if ( mRestoreInformation == FIRST_CHILD )
{
#ifdef QGISDEBUG
qWarning( "FIRST_CHILD" );
#endif
QgsDebugMsg( "FIRST_CHILD" );

removeItem( li );
if ( formerParent )
{
Expand All @@ -1142,9 +1136,8 @@ void QgsLegend::resetToInitialPosition( QTreeWidgetItem* li )
}
else if ( mRestoreInformation == YOUNGER_SIBLING )
{
#ifdef QGISDEBUG
qWarning( "YOUNGER_SIBLING" );
#endif
QgsDebugMsg( "YOUNGER_SIBLING" );

if ( formerParent )
{
formerParent->release(( QgsLegendItem* )li );
Expand Down Expand Up @@ -1439,10 +1432,10 @@ std::deque<QString> QgsLegend::layerIDs()
}

#ifdef QGISDEBUG
qWarning( "QgsLegend::layerIDs()" );
QgsDebugMsg( "QgsLegend::layerIDs()" );
for ( std::deque<QString>::iterator it = layers.begin(); it != layers.end(); ++it )
{
qWarning(( *it ).toUtf8() );
QgsDebugMsg( *it );
}
#endif

Expand Down Expand Up @@ -1596,15 +1589,15 @@ void QgsLegend::handleItemChange( QTreeWidgetItem* item, int row )
#ifdef QGISDEBUG
if ( item->checkState( 0 ) == Qt::Checked )
{
qWarning( "item checked" );
QgsDebugMsg( "item checked" );
}
else if ( item->checkState( 0 ) == Qt::Unchecked )
{
qWarning( "item unchecked" );
QgsDebugMsg( "item unchecked" );
}
else if ( item->checkState( 0 ) == Qt::PartiallyChecked )
{
qWarning( "item partially checked" );
QgsDebugMsg( "item partially checked" );
}
#endif
blockSignals( true );
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegendgroup.cpp
Expand Up @@ -25,7 +25,7 @@
#include <QCoreApplication>
#include <QIcon>

QgsLegendGroup::QgsLegendGroup( QTreeWidgetItem * theItem , QString theName )
QgsLegendGroup::QgsLegendGroup( QTreeWidgetItem * theItem, QString theName )
: QgsLegendItem( theItem, theName )
{
mType = LEGEND_GROUP;
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegendgroup.h
Expand Up @@ -33,7 +33,7 @@ This is a specialised version of QLegendItem that specifies that the items below
class QgsLegendGroup : public QgsLegendItem
{
public:
QgsLegendGroup( QTreeWidgetItem * , QString );
QgsLegendGroup( QTreeWidgetItem *, QString );
QgsLegendGroup( QTreeWidget*, QString );
QgsLegendGroup( QString name );
~QgsLegendGroup();
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegenditem.cpp
Expand Up @@ -23,7 +23,7 @@
#include "qgslogger.h"


QgsLegendItem::QgsLegendItem( QTreeWidgetItem * theItem , QString theName )
QgsLegendItem::QgsLegendItem( QTreeWidgetItem * theItem, QString theName )
: QTreeWidgetItem( theItem )
{
setText( 0, theName );
Expand Down
4 changes: 2 additions & 2 deletions src/app/legend/qgslegendlayer.h
Expand Up @@ -45,8 +45,8 @@ class QgsLegendLayer : public QgsLegendItem
Q_OBJECT

public:
QgsLegendLayer( QTreeWidgetItem * , QString );
QgsLegendLayer( QTreeWidget* , QString );
QgsLegendLayer( QTreeWidgetItem *, QString );
QgsLegendLayer( QTreeWidget*, QString );
QgsLegendLayer( QString name );
~QgsLegendLayer();
/**Sets an icon characterising the type of layer(s) it contains.
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegendpropertygroup.h
Expand Up @@ -30,7 +30,7 @@ container for layer properties (e.g. projection, scale dependent view)
class QgsLegendPropertyGroup : public QgsLegendItem
{
public:
QgsLegendPropertyGroup( QTreeWidgetItem * , QString );
QgsLegendPropertyGroup( QTreeWidgetItem *, QString );

~QgsLegendPropertyGroup();

Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegendpropertyitem.cpp
Expand Up @@ -22,7 +22,7 @@
#include <QIcon>

QgsLegendPropertyItem::QgsLegendPropertyItem( QTreeWidgetItem * theItem, QString theString )
: QgsLegendItem( theItem , theString )
: QgsLegendItem( theItem, theString )
{
mType = LEGEND_PROPERTY_ITEM;
QIcon myIcon( QgsApplication::pkgDataPath() + QString( "/images/icons/property_item.png" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -3439,7 +3439,7 @@ void QgisApp::saveMapAsImage()
myOutputFileNameQString += "." + myFilterMap[myFilterString];
}

myQSettings.setValue( "/UI/lastSaveAsImageFilter" , myFilterString );
myQSettings.setValue( "/UI/lastSaveAsImageFilter", myFilterString );
myQSettings.setValue( "/UI/lastSaveAsImageDir", myQFileDialog->directory().absolutePath() );

if ( myOutputFileNameQString != "" )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgslabeldialog.cpp
Expand Up @@ -320,7 +320,7 @@ void QgsLabelDialog::apply()
{
myTypeInt = QgsLabelAttributes::MapUnits;
}
myLabelAttributes->setSize( mFont.pointSize() , myTypeInt );
myLabelAttributes->setSize( mFont.pointSize(), myTypeInt );
myLabelAttributes->setBold( mFont.bold() );
myLabelAttributes->setItalic( mFont.italic() );
myLabelAttributes->setUnderline( mFont.underline() );
Expand All @@ -334,7 +334,7 @@ void QgsLabelDialog::apply()
{
myTypeInt = QgsLabelAttributes::MapUnits;
}
myLabelAttributes->setOffset( spinXOffset->value() , spinYOffset->value(), myTypeInt );
myLabelAttributes->setOffset( spinXOffset->value(), spinYOffset->value(), myTypeInt );
myLabelAttributes->setAngle( spinAngle->value() );

//the values here may seem a bit counterintuitive - basically everything
Expand Down
18 changes: 9 additions & 9 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -2123,9 +2123,9 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
{
myPainter.setPen( Qt::gray );
}
#ifdef QGISDEBUG
// QgsDebugMsg(QString("myPainter.fillRect(QRect(%1,%2,%3,%2) , myBrush );").arg(myX).arg(myY).arg(myBarWidth));
#endif

// QgsDebugMsg(QString("myPainter.fillRect(QRect(%1,%2,%3,%2), myBrush );").arg(myX).arg(myY).arg(myBarWidth));

myPainter.drawRect( myX + myYGutterWidth, myImageHeight - ( myY + myXGutterHeight ), myBarWidth, myY );
}
else //line graph
Expand Down Expand Up @@ -2209,10 +2209,10 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
for ( int i = 0;i < myXDivisions;++i )
{
QPolygon myPolygon;
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth , myImageHeight - myXGutterHeight );
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth , myImageHeight - ( myXGutterHeight - 5 ) );
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth , myImageHeight - myXGutterHeight );
myPolygon << QPoint((( i + 1 )*myXDivisions ) + myYGutterWidth , myImageHeight - myXGutterHeight );
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth, myImageHeight - myXGutterHeight );
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth, myImageHeight - ( myXGutterHeight - 5 ) );
myPolygon << QPoint(( i*myXDivisions ) + myYGutterWidth, myImageHeight - myXGutterHeight );
myPolygon << QPoint((( i + 1 )*myXDivisions ) + myYGutterWidth, myImageHeight - myXGutterHeight );
myPainter.drawPolyline( myPolygon );
}
//
Expand All @@ -2235,7 +2235,7 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
//now draw the axis labels onto the graph
myPainter.drawText( 1, 12, myYMaxLabel );
myPainter.drawText( 1, myImageHeight - myXGutterHeight, QString::number( static_cast < unsigned int >( myYAxisMin ) ) );
myPainter.drawText( myYGutterWidth, myImageHeight - 1 , myXMinLabel );
myPainter.drawText( myYGutterWidth, myImageHeight - 1, myXMinLabel );
myPainter.drawText( myImageWidth - myXGutterWidth, myImageHeight - 1, myXMaxLabel );

//
Expand Down Expand Up @@ -2604,7 +2604,7 @@ void QgsRasterLayerProperties::on_mClassifyButton_clicked()
for ( int i = 0; i < numberOfEntries; ++i )
{
QColor currentColor;
currentColor.setRgb( colorDiff*i , 0, 255 - colorDiff * i );
currentColor.setRgb( colorDiff*i, 0, 255 - colorDiff * i );
entryColors.push_back( currentColor );
}

Expand Down
29 changes: 10 additions & 19 deletions src/app/qgssinglesymboldialog.cpp
Expand Up @@ -37,18 +37,13 @@
QgsSingleSymbolDialog::QgsSingleSymbolDialog(): QDialog(), mVectorLayer( 0 )
{
setupUi( this );
#ifdef QGISDEBUG
qWarning( "constructor QgsSingleSymbolDialog called WITHOUT a layer" );
#endif
QgsDebugMsg( "entered." );
}

QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disabled ): QDialog(), mVectorLayer( layer )
{
setupUi( this );

#ifdef QGISDEBUG
qWarning( "constructor QgsSingleSymbolDialog called WITH a layer" );
#endif
QgsDebugMsg( "entered." );

//
//set point symbol list
Expand Down Expand Up @@ -110,7 +105,7 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
}
else
{
qWarning( "Warning, data provider is null in QgsSingleSymbolDialog::QgsSingleSymbolDialog(...)" );
QgsDebugMsg( "Warning, data provider is null" );
return;
}
//
Expand Down Expand Up @@ -173,8 +168,7 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
}
else
{
qWarning( "Warning, layer is a null pointer in "
"QgsSingleSymbolDialog::QgsSingleSymbolDialog(QgsVectorLayer)" );
QgsDebugMsg( "Warning, layer is a null pointer" );
}
}

Expand All @@ -183,8 +177,8 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab
connect( btnFillColor, SIGNAL( clicked() ), this, SLOT( selectFillColor() ) );
connect( outlinewidthspinbox, SIGNAL( valueChanged( double ) ), this, SLOT( resendSettingsChanged() ) );
connect( mLabelEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( resendSettingsChanged() ) );
connect( lstSymbols, SIGNAL( currentItemChanged( QListWidgetItem * , QListWidgetItem * ) ),
this, SLOT( symbolChanged( QListWidgetItem * , QListWidgetItem * ) ) );
connect( lstSymbols, SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ),
this, SLOT( symbolChanged( QListWidgetItem *, QListWidgetItem * ) ) );
connect( mPointSizeSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resendSettingsChanged() ) );
connect( mRotationClassificationComboBox, SIGNAL( currentIndexChanged( const QString & ) ),
this, SLOT( resendSettingsChanged() ) );
Expand All @@ -203,9 +197,7 @@ QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disab

QgsSingleSymbolDialog::~QgsSingleSymbolDialog()
{
#ifdef QGISDEBUG
qWarning( "destructor QgsSingleSymbolDialog" );
#endif
QgsDebugMsg( "entered." );
}

void QgsSingleSymbolDialog::selectOutlineColor()
Expand Down Expand Up @@ -508,9 +500,8 @@ void QgsSingleSymbolDialog::setFillColor( QColor& c )

void QgsSingleSymbolDialog::setFillStyle( Qt::BrushStyle fstyle )
{
#ifdef QGISDEBUG
qWarning(( "Setting fill style: " + QgsSymbologyUtils::brushStyle2QString( fstyle ) ).toLocal8Bit().data() );
#endif
QgsDebugMsg( QString( "Setting fill style: %1" ).arg( QgsSymbologyUtils::brushStyle2QString( fstyle ) ) );

QString myFillStyle = QgsSymbologyUtils::brushStyle2QString( fstyle );
for ( int i = 0; i < cboFillStyle->count(); ++i )
{
Expand Down Expand Up @@ -587,7 +578,7 @@ void QgsSingleSymbolDialog::fillStyleChanged( int theIndex )
//if the new style is texture we need to enable the texture
//selection button, otherwise disable it
QString myFillStyle =
cboFillStyle->itemData( theIndex , Qt::UserRole ).toString();
cboFillStyle->itemData( theIndex, Qt::UserRole ).toString();
if ( "TexturePattern" == myFillStyle )
{
toolSelectTexture->setEnabled( true );
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermap.h
Expand Up @@ -36,7 +36,7 @@ class QPainter;
* \brief Object representing map window.
*/
// NOTE: QgsComposerMapBase must be first, otherwise does not compile
class CORE_EXPORT QgsComposerMap : /*public QWidget , private Ui::QgsComposerMapBase,*/ public QObject, public QgsComposerItem
class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapBase,*/ public QObject, public QgsComposerItem
{
Q_OBJECT

Expand Down

0 comments on commit 874b29b

Please sign in to comment.