Skip to content

Commit

Permalink
Code foramtting cleanups only
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Dec 30, 2013
1 parent ba229e5 commit a152312
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
28 changes: 14 additions & 14 deletions src/app/nodetool/qgsmaptoolnodetool.cpp
Expand Up @@ -723,7 +723,7 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
if ( mSelectedFeature && ( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1) return;
if ( firstSelectedIndex == -1 ) return;

mSelectedFeature->deleteSelectedVertexes();
safeSelectVertex( firstSelectedIndex );
Expand All @@ -733,15 +733,15 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
e->ignore();
}
else
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Greater ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1) return;
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Greater ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1 ) return;

mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex + ( (e->key() == Qt::Key_Less) ? -1 : +1 ) );
mCanvas->refresh();
}
mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex + (( e->key() == Qt::Key_Less ) ? -1 : + 1 ) );
mCanvas->refresh();
}
}

void QgsMapToolNodeTool::keyReleaseEvent( QKeyEvent* e )
Expand Down Expand Up @@ -790,13 +790,13 @@ int QgsMapToolNodeTool::safeSelectVertex( int vertexNr )
{
if ( mSelectedFeature )
{
QList<QgsVertexEntry*> &vertexMap = mSelectedFeature->vertexMap();
QList<QgsVertexEntry*> &vertexMap = mSelectedFeature->vertexMap();

if ( vertexNr >= vertexMap.size() ) vertexNr -= vertexMap.size();
if ( vertexNr < 0 ) vertexNr = vertexMap.size() - 1 + vertexNr;
if ( vertexNr >= vertexMap.size() ) vertexNr -= vertexMap.size();
if ( vertexNr < 0 ) vertexNr = vertexMap.size() - 1 + vertexNr;

mSelectedFeature->selectVertex( vertexNr );
return vertexNr;
mSelectedFeature->selectVertex( vertexNr );
return vertexNr;
}
return -1;
}
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -1904,7 +1904,7 @@ void QgisApp::setupConnections()
mMapCanvas, SLOT( setRenderFlag( bool ) ) );

// connect MapCanvas keyPress event so we can check if selected feature collection must be deleted
connect( mMapCanvas, SIGNAL( keyPressed( QKeyEvent * ) ),
connect( mMapCanvas, SIGNAL( keyPressed( QKeyEvent * ) ),
this, SLOT( mapCanvas_keyPressed( QKeyEvent * ) ) );

// connect renderer
Expand Down Expand Up @@ -9097,7 +9097,7 @@ void QgisApp::keyPressEvent( QKeyEvent * e )
void QgisApp::mapCanvas_keyPressed( QKeyEvent *e )
{
// Delete selected features when it is possible and KeyEvent was not managed by current MapTool
if ( ( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) && e->isAccepted() )
if (( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) && e->isAccepted() )
{
deleteSelected();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Expand Up @@ -226,7 +226,7 @@ void QgsAttributeTableDialog::keyPressEvent( QKeyEvent* event )
{
QDialog::keyPressEvent( event );

if ( ( event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) && mDeleteSelectedButton->isEnabled() )
if (( event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) && mDeleteSelectedButton->isEnabled() )
{
QgisApp::instance()->deleteSelected( mLayer, this );
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/composer/qgscomposermousehandles.h
Expand Up @@ -97,7 +97,7 @@ class CORE_EXPORT QgsComposerMouseHandles: public QObject, public QGraphicsRectI

/**Redraws handles when selected item rotation changes*/
void selectedItemRotationChanged();

private:

QgsComposition* mComposition; //reference to composition
Expand Down Expand Up @@ -131,8 +131,8 @@ class CORE_EXPORT QgsComposerMouseHandles: public QObject, public QGraphicsRectI

/**Returns the mouse handle bounds of current selection*/
QRectF selectionBounds() const;
/**Returns true if all selected items have same rotation, and if so, updates passed rotation variable*/

/**Returns true if all selected items have same rotation, and if so, updates passed rotation variable*/
bool selectionRotation( double & rotation ) const;

/**Redraws or hides the handles based on the current selection*/
Expand Down
4 changes: 2 additions & 2 deletions src/core/composer/qgscomposition.h
Expand Up @@ -413,11 +413,11 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;

QgsAtlasComposition& atlasComposition() { return mAtlasComposition; };

/**Resizes a QRectF relative to the change from boundsBefore to boundsAfter*/
static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
/**Returns a scaled position given a before and after range*/
static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );

public slots:
/**Casts object to the proper subclass type and calls corresponding itemAdded signal*/
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsrelationmanagerdialog.cpp
Expand Up @@ -119,7 +119,7 @@ void QgsRelationManagerDialog::on_mBtnAddRelation_clicked()
void QgsRelationManagerDialog::on_mBtnRemoveRelation_clicked()
{
if ( mRelationsTable->currentIndex().isValid() )
mRelationsTable->removeRow( mRelationsTable->currentItem()->row() );
mRelationsTable->removeRow( mRelationsTable->currentItem()->row() );
}

QList< QgsRelation > QgsRelationManagerDialog::relations()
Expand Down
6 changes: 3 additions & 3 deletions tests/src/core/testqgscomposereffects.cpp
Expand Up @@ -69,15 +69,15 @@ void TestQgsComposerEffects::initTestCase()
void TestQgsComposerEffects::cleanupTestCase()
{
delete mComposition;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
}
}

void TestQgsComposerEffects::init()
Expand All @@ -95,7 +95,7 @@ void TestQgsComposerEffects::blend_modes()
mComposerRect2->setBlendMode( QPainter::CompositionMode_Multiply );

QgsCompositionChecker checker( "composereffects_blend", mComposition );
QVERIFY( checker.testComposition( mReport) );
QVERIFY( checker.testComposition( mReport ) );
// reset blending
mComposerRect2->setBlendMode( QPainter::CompositionMode_SourceOver );
}
Expand Down
10 changes: 5 additions & 5 deletions tests/src/core/testqgscomposershapes.cpp
Expand Up @@ -40,7 +40,7 @@ class TestQgsComposerShapes: public QObject
private:
QgsComposition* mComposition;
QgsComposerShape* mComposerShape;
QString mReport;
QString mReport;
};

void TestQgsComposerShapes::initTestCase()
Expand All @@ -54,22 +54,22 @@ void TestQgsComposerShapes::initTestCase()
mComposerShape = new QgsComposerShape( 20, 20, 150, 100, mComposition );
mComposerShape->setBackgroundColor( QColor::fromRgb( 255, 150, 0 ) );
mComposition->addComposerShape( mComposerShape );
mReport = "<h1>Composer Shape Tests</h1>\n";

mReport = "<h1>Composer Shape Tests</h1>\n";
}

void TestQgsComposerShapes::cleanupTestCase()
{
delete mComposition;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
}
}

void TestQgsComposerShapes::init()
Expand Down

0 comments on commit a152312

Please sign in to comment.