Skip to content

Commit

Permalink
scripts/astyle-all.sh run
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 3, 2017
1 parent 24954f8 commit b9162dc
Show file tree
Hide file tree
Showing 145 changed files with 2,713 additions and 2,712 deletions.
12 changes: 6 additions & 6 deletions tests/bench/main.cpp
Expand Up @@ -63,7 +63,7 @@ typedef SInt32 SRefCon;

/** Print usage text
*/
void usage( std::string const & appName )
void usage( std::string const &appName )
{
std::cerr << "QGIS Benchmark - " << VERSION << " '" << RELEASE_NAME << "' ("
<< QGSVERSION << ")\n"
Expand Down Expand Up @@ -413,9 +413,9 @@ int main( int argc, char *argv[] )
QStringList gdalShares;
QString appResources( QDir::cleanPath( QgsApplication::pkgDataPath() ) );
gdalShares << QCoreApplication::applicationDirPath().append( "/share/gdal" )
<< appResources.append( "/share/gdal" )
<< appResources.append( "/gdal" );
Q_FOREACH ( const QString& gdalShare, gdalShares )
<< appResources.append( "/share/gdal" )
<< appResources.append( "/gdal" );
Q_FOREACH ( const QString &gdalShare, gdalShares )
{
if ( QFile::exists( gdalShare ) )
{
Expand Down Expand Up @@ -499,7 +499,7 @@ int main( int argc, char *argv[] )
{
QPainter::RenderHints hints;
QStringList list = myQuality.split( ',' );
Q_FOREACH ( const QString& q, list )
Q_FOREACH ( const QString &q, list )
{
if ( q == QLatin1String( "Antialiasing" ) ) hints |= QPainter::Antialiasing;
else if ( q == QLatin1String( "TextAntialiasing" ) ) hints |= QPainter::TextAntialiasing;
Expand All @@ -523,7 +523,7 @@ int main( int argc, char *argv[] )
QgsDebugMsg( QString( "Number of files in myFileList: %1" ).arg( sFileList.count() ) );
for ( QStringList::Iterator myIterator = sFileList.begin(); myIterator != sFileList.end(); ++myIterator )
{
QgsDebugMsg( QString( "Trying to load file : %1" ).arg(( *myIterator ) ) );
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
QString myLayerName = *myIterator;
// don't load anything with a .qgs extension - these are project files
if ( !myLayerName.contains( QLatin1String( ".qgs" ) ) )
Expand Down
36 changes: 18 additions & 18 deletions tests/bench/qgsbench.cpp
Expand Up @@ -75,7 +75,7 @@ struct rusage
*/


int getrusage( int who, struct rusage * rusage )
int getrusage( int who, struct rusage *rusage )
{
FILETIME starttime;
FILETIME exittime;
Expand Down Expand Up @@ -119,14 +119,14 @@ int getrusage( int who, struct rusage * rusage )
#endif

QgsBench::QgsBench( int width, int height, int iterations )
: QObject()
, mWidth( width )
, mHeight( height )
, mIterations( iterations )
, mSetExtent( false )
, mUserStart( 0.0 )
, mSysStart( 0.0 )
, mParallel( false )
: QObject()
, mWidth( width )
, mHeight( height )
, mIterations( iterations )
, mSetExtent( false )
, mUserStart( 0.0 )
, mSysStart( 0.0 )
, mParallel( false )
{

QgsDebugMsg( QString( "mIterations = %1" ).arg( mIterations ) );
Expand All @@ -139,7 +139,7 @@ QgsBench::~QgsBench()
{
}

bool QgsBench::openProject( const QString & fileName )
bool QgsBench::openProject( const QString &fileName )
{
if ( ! QgsProject::instance()->read( fileName ) )
{
Expand All @@ -163,7 +163,7 @@ void QgsBench::readProject( const QDomDocument &doc )
}
}

void QgsBench::setExtent( const QgsRectangle & extent )
void QgsBench::setExtent( const QgsRectangle &extent )
{
mExtent = extent;
mSetExtent = true;
Expand All @@ -174,7 +174,7 @@ void QgsBench::render()

QgsDebugMsg( "extent: " + mMapSettings.extent().toString() );

QMap<QString, QgsMapLayer*> layersMap = QgsProject::instance()->mapLayers();
QMap<QString, QgsMapLayer *> layersMap = QgsProject::instance()->mapLayers();

mMapSettings.setLayers( layersMap.values() );

Expand All @@ -198,7 +198,7 @@ void QgsBench::render()

for ( int i = 0; i < mIterations; i++ )
{
QgsMapRendererQImageJob* job = nullptr;
QgsMapRendererQImageJob *job = nullptr;
if ( mParallel )
job = new QgsMapRendererParallelJob( mMapSettings );
else
Expand Down Expand Up @@ -264,13 +264,13 @@ void QgsBench::render()
mLogMap.insert( QStringLiteral( "times" ), timesMap );
}

void QgsBench::saveSnapsot( const QString & fileName )
void QgsBench::saveSnapsot( const QString &fileName )
{
// If format is 0, QImage will attempt to guess the format by looking at fileName's suffix.
mImage.save( fileName );
}

void QgsBench::printLog( const QString& printTime )
void QgsBench::printLog( const QString &printTime )
{
std::cout << "iterations: " << mLogMap[QStringLiteral( "iterations" )].toString().toAscii().constData() << std::endl;

Expand All @@ -296,7 +296,7 @@ void QgsBench::printLog( const QString& printTime )
}
}

QString QgsBench::serialize( const QMap<QString, QVariant>& map, int level )
QString QgsBench::serialize( const QMap<QString, QVariant> &map, int level )
{
QStringList list;
QString space = QStringLiteral( " " ).repeated( level * 2 );
Expand All @@ -315,7 +315,7 @@ QString QgsBench::serialize( const QMap<QString, QVariant>& map, int level )
case QMetaType::QString:
list.append( space2 + '\"' + i.key() + "\": \"" + i.value().toString().replace( '\\', QLatin1String( "\\\\" ) ).replace( '\"', QLatin1String( "\\\"" ) ) + '\"' );
break;
//case QMetaType::QMap: QMap is not in QMetaType
//case QMetaType::QMap: QMap is not in QMetaType
default:
list.append( space2 + '\"' + i.key() + "\": " + serialize( i.value().toMap(), level + 1 ) );
break;
Expand All @@ -325,7 +325,7 @@ QString QgsBench::serialize( const QMap<QString, QVariant>& map, int level )
return space + "{\n" + list.join( QStringLiteral( ",\n" ) ) + '\n' + space + '}';
}

void QgsBench::saveLog( const QString & fileName )
void QgsBench::saveLog( const QString &fileName )
{
QFile file( fileName );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) )
Expand Down
16 changes: 8 additions & 8 deletions tests/bench/qgsbench.h
Expand Up @@ -44,19 +44,19 @@ class QgsBench : public QObject

void render();

void printLog( const QString& printTime );
void printLog( const QString &printTime );

bool openProject( const QString & fileName );
bool openProject( const QString &fileName );

void setExtent( const QgsRectangle & extent );
void setExtent( const QgsRectangle &extent );

void saveSnapsot( const QString & fileName );
void saveSnapsot( const QString &fileName );

void saveLog( const QString & fileName );
void saveLog( const QString &fileName );

QString serialize( const QMap<QString, QVariant>& map, int level = 0 );
QString serialize( const QMap<QString, QVariant> &map, int level = 0 );

void setRenderHints( const QPainter::RenderHints& hints ) { mRendererHints = hints; }
void setRenderHints( const QPainter::RenderHints &hints ) { mRendererHints = hints; }

void setParallel( bool enabled ) { mParallel = enabled; }

Expand Down Expand Up @@ -87,7 +87,7 @@ class QgsBench : public QObject
QTime mWallTime; // 'wall clock' time

// user, sys, total times
QVector<double*> mTimes;
QVector<double *> mTimes;

QImage mImage;

Expand Down
20 changes: 10 additions & 10 deletions tests/qt_modeltest/dynamictreemodel.cpp
Expand Up @@ -52,8 +52,8 @@


DynamicTreeModel::DynamicTreeModel( QObject *parent )
: QAbstractItemModel( parent )
, nextId( 1 )
: QAbstractItemModel( parent )
, nextId( 1 )
{
}

Expand Down Expand Up @@ -182,7 +182,7 @@ void DynamicTreeModel::clear()


ModelChangeCommand::ModelChangeCommand( DynamicTreeModel *model, QObject *parent )
: QObject( parent ), m_model( model ), m_numCols( 1 ), m_startRow( -1 ), m_endRow( -1 )
: QObject( parent ), m_model( model ), m_numCols( 1 ), m_startRow( -1 ), m_endRow( -1 )
{

}
Expand All @@ -201,7 +201,7 @@ QModelIndex ModelChangeCommand::findIndex( QList<int> rows )
}

ModelInsertCommand::ModelInsertCommand( DynamicTreeModel *model, QObject *parent )
: ModelChangeCommand( model, parent )
: ModelChangeCommand( model, parent )
{

}
Expand Down Expand Up @@ -233,8 +233,8 @@ void ModelInsertCommand::doCommand()


ModelMoveCommand::ModelMoveCommand( DynamicTreeModel *model, QObject *parent )
: ModelChangeCommand( model, parent )
, m_destRow( 0 )
: ModelChangeCommand( model, parent )
, m_destRow( 0 )
{

}
Expand Down Expand Up @@ -286,8 +286,8 @@ void ModelMoveCommand::emitPostSignal()
m_model->endMoveRows();
}

ModelResetCommand::ModelResetCommand( DynamicTreeModel* model, QObject* parent )
: ModelMoveCommand( model, parent )
ModelResetCommand::ModelResetCommand( DynamicTreeModel *model, QObject *parent )
: ModelMoveCommand( model, parent )
{

}
Expand All @@ -313,8 +313,8 @@ void ModelResetCommand::emitPostSignal()
m_model->reset();
}

ModelResetCommandFixed::ModelResetCommandFixed( DynamicTreeModel* model, QObject* parent )
: ModelMoveCommand( model, parent )
ModelResetCommandFixed::ModelResetCommandFixed( DynamicTreeModel *model, QObject *parent )
: ModelMoveCommand( model, parent )
{

}
Expand Down
8 changes: 4 additions & 4 deletions tests/qt_modeltest/dynamictreemodel.h
Expand Up @@ -119,15 +119,15 @@ class ModelChangeCommand : public QObject
virtual void doCommand() = 0;

protected:
DynamicTreeModel* m_model = nullptr;
DynamicTreeModel *m_model = nullptr;
QList<int> m_rowNumbers;
int m_numCols;
int m_startRow;
int m_endRow;

};

typedef QList<ModelChangeCommand*> ModelChangeCommandList;
typedef QList<ModelChangeCommand *> ModelChangeCommandList;

class ModelInsertCommand : public ModelChangeCommand
{
Expand Down Expand Up @@ -172,7 +172,7 @@ class ModelResetCommand : public ModelMoveCommand
{
Q_OBJECT
public:
ModelResetCommand( DynamicTreeModel* model, QObject* parent = 0 );
ModelResetCommand( DynamicTreeModel *model, QObject *parent = 0 );

virtual ~ModelResetCommand();

Expand All @@ -188,7 +188,7 @@ class ModelResetCommandFixed : public ModelMoveCommand
{
Q_OBJECT
public:
ModelResetCommandFixed( DynamicTreeModel* model, QObject* parent = 0 );
ModelResetCommandFixed( DynamicTreeModel *model, QObject *parent = 0 );

virtual ~ModelResetCommandFixed();

Expand Down
6 changes: 3 additions & 3 deletions tests/qt_modeltest/modeltest.cpp
Expand Up @@ -384,7 +384,7 @@ void ModelTest::checkChildren( const QModelIndex &parent, int currentDepth )
if ( model->parent( index ) != parent )
{
qDebug() << r << c << currentDepth << model->data( index ).toString()
<< model->data( parent ).toString();
<< model->data( parent ).toString();
qDebug() << index << parent << model->parent( index );
// And a view that you can even use to show the model.
// QTreeView view;
Expand Down Expand Up @@ -514,7 +514,7 @@ void ModelTest::rowsAboutToBeInserted( const QModelIndex &parent, int start, int
\sa rowsAboutToBeInserted()
*/
void ModelTest::rowsInserted( const QModelIndex & parent, int start, int end )
void ModelTest::rowsInserted( const QModelIndex &parent, int start, int end )
{
Changing c = insert.pop();
Q_ASSERT( c.parent == parent );
Expand Down Expand Up @@ -578,7 +578,7 @@ void ModelTest::rowsAboutToBeRemoved( const QModelIndex &parent, int start, int
\sa rowsAboutToBeRemoved()
*/
void ModelTest::rowsRemoved( const QModelIndex & parent, int start, int end )
void ModelTest::rowsRemoved( const QModelIndex &parent, int start, int end )
{
qDebug() << "rr" << parent << start << end;
Changing c = remove.pop();
Expand Down
4 changes: 2 additions & 2 deletions tests/qt_modeltest/modeltest.h
Expand Up @@ -75,9 +75,9 @@ class CORE_EXPORT ModelTest : public QObject
void layoutAboutToBeChanged();
void layoutChanged();
void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end );
void rowsInserted( const QModelIndex & parent, int start, int end );
void rowsInserted( const QModelIndex &parent, int start, int end );
void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end );
void rowsRemoved( const QModelIndex & parent, int start, int end );
void rowsRemoved( const QModelIndex &parent, int start, int end );

private:
void checkChildren( const QModelIndex &parent, int currentDepth = 0 );
Expand Down
2 changes: 1 addition & 1 deletion tests/qt_modeltest/tst_modeltest.cpp
Expand Up @@ -207,7 +207,7 @@ class ObservingObject : public QObject
Q_OBJECT
public:
ObservingObject( AccessibleProxyModel *proxy, QObject *parent = 0 )
: QObject( parent ),
: QObject( parent ),
m_proxy( proxy )
{
connect( m_proxy, SIGNAL( layoutAboutToBeChanged() ), SLOT( storePersistent() ) );
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsalignraster.cpp
Expand Up @@ -26,7 +26,7 @@



static QString _tempFile( const QString& name )
static QString _tempFile( const QString &name )
{
return QStringLiteral( "%1/aligntest-%2.tif" ).arg( QDir::tempPath(), name );
}
Expand Down

0 comments on commit b9162dc

Please sign in to comment.