Skip to content

Commit 00efc2d

Browse files

22 files changed

+73
-90
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
587587
}
588588

589589
myOutputFileNameQString = myQFileDialog->selectedFiles().last();
590-
qWarning( myOutputFileNameQString.toLocal8Bit().data() );
590+
qWarning( "%s", myOutputFileNameQString.toLocal8Bit().constData() );
591591
QString myFilterString = myQFileDialog->selectedFilter();
592592
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
593593
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );

‎src/app/qgsabout.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ void QgsAbout::init()
5656

5757
QFile file( QgsApplication::authorsFilePath() );
5858
#ifdef QGISDEBUG
59-
printf(( "Reading authors file " + file.fileName() +
60-
".............................................\n" ).toLocal8Bit().constData() );
59+
printf( "Reading authors file %s.............................................\n",
60+
file.fileName().toLocal8Bit().constData() );
6161
#endif
6262
if ( file.open( QIODevice::ReadOnly ) )
6363
{
@@ -103,8 +103,8 @@ void QgsAbout::init()
103103
// read the SPONSORS file and populate the text widget
104104
QFile sponsorFile( QgsApplication::sponsorsFilePath() );
105105
#ifdef QGISDEBUG
106-
printf(( "Reading sponsors file " + sponsorFile.fileName() +
107-
".............................................\n" ).toLocal8Bit().constData() );
106+
printf( "Reading sponsors file %s.............................................\n",
107+
sponsorFile.fileName().toLocal8Bit().constData() );
108108
#endif
109109
if ( sponsorFile.open( QIODevice::ReadOnly ) )
110110
{

‎src/app/qgsdbsourceselect.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
442442
}
443443
else
444444
{
445-
qDebug( "Unable to get list of spatially enabled tables from the database" );
446-
qDebug( PQerrorMessage( pd ) );
445+
qDebug( "Unable to get list of spatially enabled tables from the database\n%s", PQerrorMessage( pd ) );
447446
}
448447
// BEGIN CHANGES ECOS
449448
if ( cmbConnections->count() > 0 )
@@ -510,7 +509,7 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
510509
QString schemaName = mTableModel.itemFromIndex( mProxyModel.mapToSource( schemaSibling ) )->text();
511510
QString tableName = mTableModel.itemFromIndex( mProxyModel.mapToSource( tableSibling ) )->text();
512511
QString tableString = "\"" + schemaName + "\".\"" + tableName + "\"";
513-
qWarning( tableString.toUtf8() );
512+
qWarning( "%s", tableString.toUtf8().constData() );
514513

515514
QString currentSql;
516515
QModelIndex sqlSibling = index.sibling( index.row(), 4 );

‎src/app/qgsgeomtypedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void QgsGeomTypeDialog::attributes( std::list<std::pair<QString, QString> >& at
9696
QTreeWidgetItem *item = *it;
9797
at.push_back( std::make_pair( item->text( 0 ), item->text( 1 ) ) );
9898
#ifdef QGISDEBUG
99-
qWarning(( "appending " + item->text( 0 ) + "//" + item->text( 1 ) ).toLocal8Bit().data() );
99+
qWarning( "appending %s//%s", item->text( 0 ).toLocal8Bit().constData(), item->text( 1 ).toLocal8Bit().constData() );
100100
#endif
101101
++it;
102102
}

‎src/core/composer/qgscomposition.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void QgsComposition::addItemToZList( QgsComposerItem* item )
232232
return;
233233
}
234234
mItemZList.push_back( item );
235-
qWarning( QString::number( mItemZList.size() ).toLocal8Bit().data() );
235+
qWarning( "%d", mItemZList.size() );
236236
item->setZValue( mItemZList.size() );
237237
}
238238

@@ -515,7 +515,7 @@ void QgsComposition::updateZValues()
515515
currentItem = *it;
516516
if ( currentItem )
517517
{
518-
qWarning( QString::number( counter ).toLocal8Bit().data() );
518+
qWarning( "%d", counter );
519519
currentItem->setZValue( counter );
520520
}
521521
++counter;
@@ -529,7 +529,7 @@ void QgsComposition::sortZList()
529529
QLinkedList<QgsComposerItem*>::iterator before_it = mItemZList.begin();
530530
for ( ; before_it != mItemZList.end(); ++before_it )
531531
{
532-
qWarning( QString::number(( *before_it )->zValue() ).toLocal8Bit().data() );
532+
qWarning( "%lf", ( *before_it )->zValue() );
533533
}
534534

535535
QMutableLinkedListIterator<QgsComposerItem*> it( mItemZList );
@@ -583,7 +583,7 @@ void QgsComposition::sortZList()
583583
QLinkedList<QgsComposerItem*>::iterator after_it = mItemZList.begin();
584584
for ( ; after_it != mItemZList.end(); ++after_it )
585585
{
586-
qWarning( QString::number(( *after_it )->zValue() ).toLocal8Bit().data() );
586+
qWarning( "%lf", ( *after_it )->zValue() );
587587
}
588588
}
589589

‎src/core/qgslogger.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ void QgsLogger::debug( const QString& msg, int debuglevel, const char* file, con
3535
{
3636
if ( file == NULL )
3737
{
38-
qDebug( msg.toLocal8Bit().data() );
38+
qDebug( "%s", msg.toLocal8Bit().constData() );
3939
}
4040
else if ( function == NULL )
4141
{
42-
qDebug( "%s: %s", file, msg.toLocal8Bit().data() );
42+
qDebug( "%s: %s", file, msg.toLocal8Bit().constData() );
4343
}
4444
else if ( line == -1 )
4545
{
46-
qDebug( "%s: (%s) %s", file, function, msg.toLocal8Bit().data() );
46+
qDebug( "%s: (%s) %s", file, function, msg.toLocal8Bit().constData() );
4747
}
4848
else
4949
{
5050
#ifndef _MSC_VER
51-
qDebug( "%s: %d: (%s) %s", file, line, function, msg.toLocal8Bit().data() );
51+
qDebug( "%s: %d: (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
5252
#else
53-
qDebug( "%s(%d) : (%s) %s", file, line, function, msg.toLocal8Bit().data() );
53+
qDebug( "%s(%d) : (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
5454
#endif
5555
}
5656
}
@@ -72,22 +72,22 @@ void QgsLogger::debug( const QString& var, int val, int debuglevel, const char*
7272
{
7373
if ( file == NULL )
7474
{
75-
qDebug( "%s: %d", var.toLocal8Bit().data(), val );
75+
qDebug( "%s: %d", var.toLocal8Bit().constData(), val );
7676
}
7777
else if ( function == NULL )
7878
{
79-
qDebug( "%s: %s: %d", file, var.toLocal8Bit().data(), val );
79+
qDebug( "%s: %s: %d", file, var.toLocal8Bit().constData(), val );
8080
}
8181
else if ( line == -1 )
8282
{
83-
qDebug( "%s: (%s): %s: %d", file, function, var.toLocal8Bit().data(), val );
83+
qDebug( "%s: (%s): %s: %d", file, function, var.toLocal8Bit().constData(), val );
8484
}
8585
else
8686
{
8787
#ifdef _MSC_VER
88-
qDebug( "%s(%d): (%s), %s: %d", file, line, function, var.toLocal8Bit().data(), val );
88+
qDebug( "%s(%d): (%s), %s: %d", file, line, function, var.toLocal8Bit().constData(), val );
8989
#else
90-
qDebug( "%s: %d: (%s), %s: %d", file, line, function, var.toLocal8Bit().data(), val );
90+
qDebug( "%s: %d: (%s), %s: %d", file, line, function, var.toLocal8Bit().constData(), val );
9191
#endif
9292
}
9393
}
@@ -109,40 +109,40 @@ void QgsLogger::debug( const QString& var, double val, int debuglevel, const cha
109109
{
110110
if ( file == NULL )
111111
{
112-
qDebug( "%s: %f", var.toLocal8Bit().data(), val );
112+
qDebug( "%s: %f", var.toLocal8Bit().constData(), val );
113113
}
114114
else if ( function == NULL )
115115
{
116-
qDebug( "%s: %s: %f", file, var.toLocal8Bit().data(), val );
116+
qDebug( "%s: %s: %f", file, var.toLocal8Bit().constData(), val );
117117
}
118118
else if ( line == -1 )
119119
{
120-
qDebug( "%s: (%s): %s: %f", file, function, var.toLocal8Bit().data(), val );
120+
qDebug( "%s: (%s): %s: %f", file, function, var.toLocal8Bit().constData(), val );
121121
}
122122
else
123123
{
124124
#ifdef _MSC_VER
125-
qDebug( "%s(%d): (%s), %s: %f", file, line, function, var.toLocal8Bit().data(), val );
125+
qDebug( "%s(%d): (%s), %s: %f", file, line, function, var.toLocal8Bit().constData(), val );
126126
#else
127-
qDebug( "%s: %d: (%s), %s: %f", file, line, function, var.toLocal8Bit().data(), val );
127+
qDebug( "%s: %d: (%s), %s: %f", file, line, function, var.toLocal8Bit().constData(), val );
128128
#endif
129129
}
130130
}
131131
}
132132

133133
void QgsLogger::warning( const QString& msg )
134134
{
135-
qWarning( msg.toLocal8Bit().data() );
135+
qWarning( "%s", msg.toLocal8Bit().constData() );
136136
}
137137

138138
void QgsLogger::critical( const QString& msg )
139139
{
140-
qCritical( msg.toLocal8Bit().data() );
140+
qCritical( "%s", msg.toLocal8Bit().constData() );
141141
}
142142

143143
void QgsLogger::fatal( const QString& msg )
144144
{
145-
qFatal( msg.toLocal8Bit().data() );
145+
qFatal( "%s", msg.toLocal8Bit().constData() );
146146
}
147147

148148
int QgsLogger::debugLevel()

‎src/core/qgsproject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ bool QgsProject::read()
769769
QString errorString = tr( "Project file read error: %1 at line %2 column %3" )
770770
.arg( errorMsg ).arg( line ).arg( column );
771771

772-
qDebug( errorString.toUtf8().constData() );
772+
qDebug( "%s", errorString.toUtf8().constData() );
773773

774774
imp_->file.close();
775775

‎src/core/symbology/qgssymbologyutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ Qt::BrushStyle QgsSymbologyUtils::qString2BrushStyle( QString brushString )
873873
}
874874
else //return a null string
875875
{
876-
qWarning( "Brush style \"" + brushString.toUtf8() + "\" not found in qString2BrushStyle" );
876+
qWarning( "Brush style \"%s\" not found in qString2BrushStyle", brushString.toUtf8().constData() );
877877
return Qt::NoBrush;
878878
}
879879
}

‎src/gui/qgsprojectionselector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,7 @@ void QgsProjectionSelector::on_pbnFind_clicked()
803803
myFileInfo.setFile( myDatabaseFileName );
804804
if ( !myFileInfo.exists( ) ) //its not critical if this happens
805805
{
806-
qDebug( myDatabaseFileName.toUtf8() );
807-
qDebug( "User db does not exist" );
806+
qDebug( "%s\nUser db does not exist", myDatabaseFileName.toUtf8().constData() );
808807
return ;
809808
}
810809
myResult = sqlite3_open( myDatabaseFileName.toUtf8().data(), &myDatabase );

‎src/gui/qgsquickprint.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ void QgsQuickPrint::setNorthArrow( QString theFileName )
8383
void QgsQuickPrint::setLogo1( QString theFileName )
8484
{
8585
mLogo1File = theFileName;
86-
qDebug( "Logo1 set to: " + mLogo1File.toLocal8Bit() );
86+
qDebug( "Logo1 set to: %s", mLogo1File.toLocal8Bit().constData() );
8787
}
8888
void QgsQuickPrint::setLogo2( QString theFileName )
8989
{
9090
mLogo2File = theFileName;
91-
qDebug( "Logo2 set to: " + mLogo2File.toLocal8Bit() );
91+
qDebug( "Logo2 set to: %s", mLogo2File.toLocal8Bit().constData() );
9292
}
9393
void QgsQuickPrint::setOutputPdf( QString theFileName )
9494
{
@@ -140,7 +140,7 @@ void QgsQuickPrint::printMap()
140140
int myPrintResolutionDpi = 300;
141141
myPrinter.setResolution( myPrintResolutionDpi );
142142
myPrinter.setOutputFormat( QPrinter::PdfFormat );
143-
qDebug( "Printing to page size" + pageSizeToString( mPageSize ).toLocal8Bit() );
143+
qDebug( "Printing to page size %s", pageSizeToString( mPageSize ).toLocal8Bit().constData() );
144144
myPrinter.setPageSize( mPageSize );
145145
myPrinter.setOutputFileName( mOutputFileName );
146146
myPrinter.setOrientation( QPrinter::Landscape );
@@ -588,8 +588,7 @@ void QgsQuickPrint::printMap()
588588
int myLogoXDim = ( myDrawableWidth / 100 ) * myLogoWidthPercent;
589589
int myLogoYDim = ( myDrawableHeight / 100 ) * myLogoHeightPercent;
590590
QPixmap myLogo1;
591-
qDebug( "Logo1:" );
592-
qDebug( mLogo1File.toLocal8Bit() );
591+
qDebug( "Logo1: %s", mLogo1File.toLocal8Bit().constData() );
593592
myLogo1.fill( Qt::white );
594593
myLogo1.load( mLogo1File );
595594
myLogo1 = myLogo1.scaled( myLogoXDim, myLogoYDim, Qt::KeepAspectRatio );
@@ -1042,9 +1041,7 @@ QStringList QgsQuickPrint::wordWrap( QString theString,
10421041
myList << myCumulativeLine.trimmed();
10431042
}
10441043

1045-
//qDebug("Wrapped legend entry:");
1046-
//qDebug(theString);
1047-
//qDebug(myList.join("\n").toLocal8Bit());
1044+
//qDebug("Wrapped legend entry: %s\n%s", theString, myList.join("\n").toLocal8Bit().constData() );
10481045
return myList;
10491046

10501047
}

‎src/plugins/quick_print/quickprintgui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void QuickPrintGui::on_buttonBox_accepted()
146146
myQuickPrint.setOutputPdf( myOutputFileName );
147147
QString myPageSizeString = cboPageSize->itemData( cboPageSize->currentIndex() ).toString();
148148
myQuickPrint.setPageSize( QgsQuickPrint::stringToPageSize( myPageSizeString ) );
149-
qDebug( "Page size : " + myPageSizeString.toLocal8Bit() );
149+
qDebug( "Page size : %s", myPageSizeString.toLocal8Bit().constData() );
150150
myQuickPrint.printMap();
151151
}
152152
else

‎src/plugins/wfs/qgswfssourceselect.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ int QgsWFSSourceSelect::getCapabilitiesGET( QString uri, std::list<QString>& typ
214214

215215
//print out result for a test
216216
QString resultString( result );
217-
qWarning( resultString.toUtf8() );
217+
qWarning( "%s", resultString.toUtf8().constData() );
218218

219219
return 0;
220220
}
@@ -269,7 +269,7 @@ void QgsWFSSourceSelect::connectToServer()
269269
QSettings settings;
270270
QString key = "/Qgis/connections-wfs/" + cmbConnections->currentText() + "/url";
271271
mUri = settings.value( key ).toString();
272-
qWarning( "url is: " + mUri.toUtf8() );
272+
qWarning( "url is: %s", mUri.toUtf8().constData() );
273273

274274
//make a GetCapabilities request
275275
std::list<QString> typenames;
@@ -349,7 +349,7 @@ void QgsWFSSourceSelect::addLayer()
349349
{
350350
uri.append( "?" );
351351
}
352-
qWarning( uri.toUtf8() + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName.toUtf8() );
352+
qWarning( "%sSERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=%s", uri.toUtf8().constData(), typeName.toUtf8().constData() );
353353

354354
//get CRS
355355
QString crsString;
@@ -385,7 +385,7 @@ void QgsWFSSourceSelect::changeCRSFilter()
385385
if ( currentTreeItem )
386386
{
387387
QString currentTypename = currentTreeItem->text( 1 );
388-
qWarning( "the current typename is: " + currentTypename.toUtf8() );
388+
qWarning( "the current typename is: %s", currentTypename.toUtf8().constData() );
389389

390390
std::map<QString, std::list<QString> >::const_iterator crsIterator = mAvailableCRS.find( currentTypename );
391391
if ( crsIterator != mAvailableCRS.end() )

‎src/providers/postgres/qgspostgresextentthread.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@ void QgsPostgresExtentThread::run()
9898
"ymax(extent(" + geometryColumn + ")) as ymax," "ymin(extent(" + geometryColumn + ")) as ymin" " from " + tableName;
9999
#endif
100100

101-
#ifdef QGISDEBUG
102-
qDebug( "+++++++++QgsPostgresExtentThread::run - Getting extents using schema.table: " + sql.toUtf8() );
103-
#endif
104-
101+
QgsDebugMsg( QString( "Getting extents using schema.table: %1" ).arg( sql ) );
105102

106103
QgsDebugMsg( "About to issue query." );
107104

‎src/providers/wfs/qgswfsdata.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ QgsWFSData::QgsWFSData(
5757
if ( it->startsWith( "TYPENAME", Qt::CaseInsensitive ) )
5858
{
5959
mTypeName = it->section( "=", 1, 1 );
60-
qWarning( "mTypeName is:" );
61-
qWarning( mTypeName.toLocal8Bit().data() );
60+
qWarning( "mTypeName is: %s", mTypeName.toLocal8Bit().constData() );
6261
}
6362
}
6463

‎src/providers/wfs/qgswfsprovider.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,8 @@ int QgsWFSProvider::getFeatureGET( const QString& uri, const QString& geometryAt
296296
return 1;
297297
}
298298

299-
qWarning( "feature count after request is:" );
300-
qWarning( QString::number( mFeatures.size() ).toLocal8Bit().data() );
301-
qWarning( "mExtent after request is:" );
302-
qWarning( mExtent.toString().toLocal8Bit().data() );
299+
qWarning( "feature count after request is: %d", mFeatures.size() );
300+
qWarning( "mExtent after request is: %s", mExtent.toString().toLocal8Bit().data() );
303301

304302
for ( QList<QgsFeature*>::iterator it = mFeatures.begin(); it != mFeatures.end(); ++it )
305303
{

‎tests/src/core/qgsrenderchecker.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,12 @@ bool QgsRenderChecker::compareImages( QString theTestName )
138138
// Put the same info to debug too
139139
//
140140

141-
qDebug( "Expected size: " + QString::number( myExpectedImage.width() ).toLocal8Bit() + "w x " +
142-
QString::number( myExpectedImage.width() ).toLocal8Bit() + "h" );
143-
qDebug( "Actual size: " + QString::number( myResultImage.width() ).toLocal8Bit() + "w x " +
144-
QString::number( myResultImage.width() ).toLocal8Bit() + "h" );
141+
qDebug( "Expected size: %dw x %dh", myExpectedImage.width(), myExpectedImage.height() );
142+
qDebug( "Actual size: %dw x %dh", myResultImage.width(), myResultImage.height() );
145143

146144
if ( mMatchTarget != myPixelCount )
147145
{
148-
qDebug( QString( "Test image and result image for %1 are different - FAILING!" ).arg( theTestName ).toLocal8Bit() );
146+
qDebug( "Test image and result image for %s are different - FAILING!", theTestName.toLocal8Bit().constData() );
149147
mReport += "<tr><td colspan=3>";
150148
mReport += "<font color=red>Expected image and result image for " + theTestName + " are different dimensions - FAILING!</font>";
151149
mReport += "</td></tr>";
@@ -180,9 +178,7 @@ bool QgsRenderChecker::compareImages( QString theTestName )
180178
//
181179
// Send match result to debug
182180
//
183-
qDebug( QString::number( mMismatchCount ).toLocal8Bit() + "/" +
184-
QString::number( mMatchTarget ).toLocal8Bit() +
185-
" pixels mismatched" );;
181+
qDebug( "%d/%d pixels mismatched", mMismatchCount, mMatchTarget );
186182

187183
//
188184
// Send match result to report

‎tests/src/core/regression1141.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ void Regression1141::diacriticalTest()
9999
mFields.insert( 0, myField );
100100
mCRS = QgsCoordinateReferenceSystem( GEOWkt );
101101

102-
qDebug( "Checking test dataset exists..." );
103-
qDebug( mFileName.toLocal8Bit() );
102+
qDebug( "Checking test dataset exists...\n%s", mFileName.toLocal8Bit().constData() );
104103

105104
if ( !QFile::exists( mFileName ) )
106105
{

‎tests/src/core/testqgsapplication.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Email : sherman at mrcc dot com
2424

2525
class TestQgsApplication: public QObject
2626
{
27-
Q_OBJECT;
27+
Q_OBJECT;
2828
private slots:
2929
void checkTheme();
3030
void initTestCase();
@@ -39,23 +39,23 @@ void TestQgsApplication::initTestCase()
3939
// Runs once before any tests are run
4040
//
4141
// init QGIS's paths - true means that all path will be inited from prefix
42-
QString qgisPath = QCoreApplication::applicationDirPath ();
43-
QgsApplication::setPrefixPath(INSTALL_PREFIX, true);
42+
QString qgisPath = QCoreApplication::applicationDirPath();
43+
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
4444
QgsApplication::showSettings();
4545
};
4646

4747
void TestQgsApplication::checkTheme()
4848
{
4949
QString myIconPath = QgsApplication::defaultThemePath();
5050
QPixmap myPixmap;
51-
myPixmap.load(myIconPath+"/mIconProjectionDisabled.png");
52-
qDebug("Checking if a theme icon exists:");
53-
qDebug(myIconPath.toLocal8Bit()+"/mIconProjectionDisabled.png");
54-
QVERIFY(!myPixmap.isNull());
51+
myPixmap.load( myIconPath + "/mIconProjectionDisabled.png" );
52+
qDebug( "Checking if a theme icon exists:" );
53+
qDebug( "%s/mIconProjectionDisabled.png", myIconPath.toLocal8Bit().constData() );
54+
QVERIFY( !myPixmap.isNull() );
5555

5656
};
5757

5858

59-
QTEST_MAIN(TestQgsApplication)
59+
QTEST_MAIN( TestQgsApplication )
6060
#include "moc_testqgsapplication.cxx"
6161

‎tests/src/core/testqgsgeometry.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void TestQgsGeometry::intersectionCheck1()
211211
QVERIFY( mpPolygonGeometryA->intersects( mpPolygonGeometryB ) );
212212
// should be a single polygon as A intersect B
213213
QgsGeometry * mypIntersectionGeometry = mpPolygonGeometryA->intersection( mpPolygonGeometryB );
214-
qDebug( "Geometry Type: " + wkbTypeAsString( mypIntersectionGeometry->wkbType() ).toLocal8Bit() );
214+
qDebug( "Geometry Type: %s", wkbTypeAsString( mypIntersectionGeometry->wkbType() ).toLocal8Bit().constData() );
215215
QVERIFY( mypIntersectionGeometry->wkbType() == QGis::WKBPolygon );
216216
QgsPolygon myPolygon = mypIntersectionGeometry->asPolygon();
217217
QVERIFY( myPolygon.size() > 0 ); //check that the union created a feature
@@ -228,7 +228,7 @@ void TestQgsGeometry::unionCheck1()
228228
{
229229
// should be a multipolygon with 2 parts as A does not intersect C
230230
QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->combine( mpPolygonGeometryC );
231-
qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
231+
qDebug( "Geometry Type: %s", wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit().constData() );
232232
QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBMultiPolygon );
233233
QgsMultiPolygon myMultiPolygon = mypUnionGeometry->asMultiPolygon();
234234
QVERIFY( myMultiPolygon.size() > 0 ); //check that the union did not fail
@@ -241,7 +241,7 @@ void TestQgsGeometry::unionCheck2()
241241
{
242242
// should be a single polygon as A intersect B
243243
QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->combine( mpPolygonGeometryB );
244-
qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
244+
qDebug( "Geometry Type: %s", wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit().constData() );
245245
QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBPolygon );
246246
QgsPolygon myPolygon = mypUnionGeometry->asPolygon();
247247
QVERIFY( myPolygon.size() > 0 ); //check that the union created a feature
@@ -254,7 +254,7 @@ void TestQgsGeometry::differenceCheck1()
254254
{
255255
// should be same as A since A does not intersect C so diff is 100% of A
256256
QgsGeometry * mypDifferenceGeometry = mpPolygonGeometryA->difference( mpPolygonGeometryC );
257-
qDebug( "Geometry Type: " + wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit() );
257+
qDebug( "Geometry Type: %s", wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit().constData() );
258258
QVERIFY( mypDifferenceGeometry->wkbType() == QGis::WKBPolygon );
259259
QgsPolygon myPolygon = mypDifferenceGeometry->asPolygon();
260260
QVERIFY( myPolygon.size() > 0 ); //check that the union did not fail
@@ -267,7 +267,7 @@ void TestQgsGeometry::differenceCheck2()
267267
{
268268
// should be a single polygon as (A - B) = subset of A
269269
QgsGeometry * mypDifferenceGeometry = mpPolygonGeometryA->difference( mpPolygonGeometryB );
270-
qDebug( "Geometry Type: " + wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit() );
270+
qDebug( "Geometry Type: %s", wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit().constData() );
271271
QVERIFY( mypDifferenceGeometry->wkbType() == QGis::WKBPolygon );
272272
QgsPolygon myPolygon = mypDifferenceGeometry->asPolygon();
273273
QVERIFY( myPolygon.size() > 0 ); //check that the union created a feature
@@ -279,7 +279,7 @@ void TestQgsGeometry::bufferCheck()
279279
{
280280
// should be a single polygon
281281
QgsGeometry * mypBufferGeometry = mpPolygonGeometryB->buffer( 10, 10 );
282-
qDebug( "Geometry Type: " + wkbTypeAsString( mypBufferGeometry->wkbType() ).toLocal8Bit() );
282+
qDebug( "Geometry Type: %s", wkbTypeAsString( mypBufferGeometry->wkbType() ).toLocal8Bit().constData() );
283283
QVERIFY( mypBufferGeometry->wkbType() == QGis::WKBPolygon );
284284
QgsPolygon myPolygon = mypBufferGeometry->asPolygon();
285285
QVERIFY( myPolygon.size() > 0 ); //check that the buffer created a feature
@@ -310,7 +310,7 @@ void TestQgsGeometry::dumpMultiPolygon( QgsMultiPolygon &theMultiPolygon )
310310
for ( int i = 0; i < theMultiPolygon.size(); i++ )
311311
{
312312
QgsPolygon myPolygon = theMultiPolygon.at( i );
313-
qDebug( "\tPolygon in multipolygon: " + QString::number( i ).toLocal8Bit() );
313+
qDebug( "\tPolygon in multipolygon: %d", i );
314314
dumpPolygon( myPolygon );
315315
}
316316
}
@@ -321,12 +321,12 @@ void TestQgsGeometry::dumpPolygon( QgsPolygon &thePolygon )
321321
for ( int j = 0; j < thePolygon.size(); j++ )
322322
{
323323
QgsPolyline myPolyline = thePolygon.at( j ); //rings of polygon
324-
qDebug( "\t\tRing in polygon: " + QString::number( j ).toLocal8Bit() );
324+
qDebug( "\t\tRing in polygon: %d", j );
325325

326326
for ( int k = 0; k < myPolyline.size(); k++ )
327327
{
328328
QgsPoint myPoint = myPolyline.at( k );
329-
qDebug( "\t\t\tPoint in ring " + QString::number( k ).toLocal8Bit() + " :" + myPoint.toString().toLocal8Bit() );
329+
qDebug( "\t\t\tPoint in ring %d : %s", k, myPoint.toString().toLocal8Bit().constData() );
330330
myPoints << QPointF( myPoint.x(), myPoint.y() );
331331
}
332332
}

‎tests/src/core/testqgsmaprenderer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ void TestQgsMapRenderer::initTestCase()
100100
//copy over the default qml for our generated layer
101101
QString myQmlFileName = myTestDataDir + "maprender_testdata.qml";
102102
QFile::copy( myQmlFileName, myTmpDir + "maprender_testdata.qml" );
103-
qDebug( "Checking test dataset exists..." );
104-
qDebug( myFileName.toLocal8Bit() );
103+
qDebug( "Checking test dataset exists...\n%s", myFileName.toLocal8Bit().constData() );
105104
if ( !QFile::exists( myFileName ) )
106105
{
107106
qDebug( "Creating test dataset: " );

‎tests/src/core/testqgsrasterlayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void TestQgsRasterLayer::buildExternalOverviews()
186186
"NEAREST",
187187
myInternalFlag
188188
);
189-
qDebug( myResult.toLocal8Bit() );
189+
qDebug( "%s", myResult.toLocal8Bit().constData() );
190190
//
191191
// Lets verify we have pyramids now...
192192
//
@@ -232,7 +232,7 @@ bool TestQgsRasterLayer::setQml( QString theType )
232232
if ( !myStyleFlag )
233233
{
234234
qDebug( " **** setQml -> mpLandsatRasterLayer is invalid" );
235-
qDebug( "Qml File :" + myFileName.toLocal8Bit() );
235+
qDebug( "Qml File :%s", myFileName.toLocal8Bit().constData() );
236236
}
237237
return myStyleFlag;
238238
}

‎tests/src/core/testqgsrenderers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ bool TestQgsRenderers::setQml( QString theType )
196196
QString error = mpPointsLayer->loadNamedStyle( myFileName, myStyleFlag );
197197
if ( !myStyleFlag )
198198
{
199-
qDebug( error.toLocal8Bit().data() );
199+
qDebug( "%s", error.toLocal8Bit().constData() );
200200
return false;
201201
}
202202
else

0 commit comments

Comments
 (0)
Please sign in to comment.