[QGIS Commit] r10084 - in trunk/qgis: src/app src/app/composer src/core src/core/composer src/core/symbology src/gui src/plugins/quick_print src/plugins/wfs src/providers/postgres src/providers/wfs tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Feb 1 11:59:03 EST 2009


Author: jef
Date: 2009-02-01 11:59:03 -0500 (Sun, 01 Feb 2009)
New Revision: 10084

Modified:
   trunk/qgis/src/app/composer/qgscomposer.cpp
   trunk/qgis/src/app/qgsabout.cpp
   trunk/qgis/src/app/qgsdbsourceselect.cpp
   trunk/qgis/src/app/qgsgeomtypedialog.cpp
   trunk/qgis/src/core/composer/qgscomposition.cpp
   trunk/qgis/src/core/qgslogger.cpp
   trunk/qgis/src/core/qgsproject.cpp
   trunk/qgis/src/core/symbology/qgssymbologyutils.cpp
   trunk/qgis/src/gui/qgsprojectionselector.cpp
   trunk/qgis/src/gui/qgsquickprint.cpp
   trunk/qgis/src/plugins/quick_print/quickprintgui.cpp
   trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp
   trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp
   trunk/qgis/src/providers/wfs/qgswfsdata.cpp
   trunk/qgis/src/providers/wfs/qgswfsprovider.cpp
   trunk/qgis/tests/src/core/qgsrenderchecker.cpp
   trunk/qgis/tests/src/core/regression1141.cpp
   trunk/qgis/tests/src/core/testqgsapplication.cpp
   trunk/qgis/tests/src/core/testqgsgeometry.cpp
   trunk/qgis/tests/src/core/testqgsmaprenderer.cpp
   trunk/qgis/tests/src/core/testqgsrasterlayer.cpp
   trunk/qgis/tests/src/core/testqgsrenderers.cpp
Log:
fix #1523

Modified: trunk/qgis/src/app/composer/qgscomposer.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposer.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/app/composer/qgscomposer.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -587,7 +587,7 @@
   }
 
   myOutputFileNameQString = myQFileDialog->selectedFiles().last();
-  qWarning( myOutputFileNameQString.toLocal8Bit().data() );
+  qWarning( "%s", myOutputFileNameQString.toLocal8Bit().constData() );
   QString myFilterString = myQFileDialog->selectedFilter();
   QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
   QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );

Modified: trunk/qgis/src/app/qgsabout.cpp
===================================================================
--- trunk/qgis/src/app/qgsabout.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/app/qgsabout.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -56,8 +56,8 @@
 
   QFile file( QgsApplication::authorsFilePath() );
 #ifdef QGISDEBUG
-  printf(( "Reading authors file " + file.fileName() +
-           ".............................................\n" ).toLocal8Bit().constData() );
+  printf( "Reading authors file %s.............................................\n",
+          file.fileName().toLocal8Bit().constData() );
 #endif
   if ( file.open( QIODevice::ReadOnly ) )
   {
@@ -103,8 +103,8 @@
   // read the SPONSORS file and populate the text widget
   QFile sponsorFile( QgsApplication::sponsorsFilePath() );
 #ifdef QGISDEBUG
-  printf(( "Reading sponsors file " + sponsorFile.fileName() +
-           ".............................................\n" ).toLocal8Bit().constData() );
+  printf( "Reading sponsors file %s.............................................\n",
+          sponsorFile.fileName().toLocal8Bit().constData() );
 #endif
   if ( sponsorFile.open( QIODevice::ReadOnly ) )
   {

Modified: trunk/qgis/src/app/qgsdbsourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsdbsourceselect.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/app/qgsdbsourceselect.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -442,8 +442,7 @@
     }
     else
     {
-      qDebug( "Unable to get list of spatially enabled tables from the database" );
-      qDebug( PQerrorMessage( pd ) );
+      qDebug( "Unable to get list of spatially enabled tables from the database\n%s", PQerrorMessage( pd ) );
     }
     // BEGIN CHANGES ECOS
     if ( cmbConnections->count() > 0 )
@@ -510,7 +509,7 @@
   QString schemaName = mTableModel.itemFromIndex( mProxyModel.mapToSource( schemaSibling ) )->text();
   QString tableName = mTableModel.itemFromIndex( mProxyModel.mapToSource( tableSibling ) )->text();
   QString tableString = "\"" + schemaName + "\".\"" + tableName + "\"";
-  qWarning( tableString.toUtf8() );
+  qWarning( "%s", tableString.toUtf8().constData() );
 
   QString currentSql;
   QModelIndex sqlSibling = index.sibling( index.row(), 4 );

Modified: trunk/qgis/src/app/qgsgeomtypedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsgeomtypedialog.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/app/qgsgeomtypedialog.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -96,7 +96,7 @@
     QTreeWidgetItem *item = *it;
     at.push_back( std::make_pair( item->text( 0 ), item->text( 1 ) ) );
 #ifdef QGISDEBUG
-    qWarning(( "appending " + item->text( 0 ) + "//" + item->text( 1 ) ).toLocal8Bit().data() );
+    qWarning( "appending %s//%s", item->text( 0 ).toLocal8Bit().constData(), item->text( 1 ).toLocal8Bit().constData() );
 #endif
     ++it;
   }

Modified: trunk/qgis/src/core/composer/qgscomposition.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposition.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/core/composer/qgscomposition.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -232,7 +232,7 @@
     return;
   }
   mItemZList.push_back( item );
-  qWarning( QString::number( mItemZList.size() ).toLocal8Bit().data() );
+  qWarning( "%d", mItemZList.size() );
   item->setZValue( mItemZList.size() );
 }
 
@@ -515,7 +515,7 @@
     currentItem = *it;
     if ( currentItem )
     {
-      qWarning( QString::number( counter ).toLocal8Bit().data() );
+      qWarning( "%d", counter );
       currentItem->setZValue( counter );
     }
     ++counter;
@@ -529,7 +529,7 @@
   QLinkedList<QgsComposerItem*>::iterator before_it = mItemZList.begin();
   for ( ; before_it != mItemZList.end(); ++before_it )
   {
-    qWarning( QString::number(( *before_it )->zValue() ).toLocal8Bit().data() );
+    qWarning( "%lf", ( *before_it )->zValue() );
   }
 
   QMutableLinkedListIterator<QgsComposerItem*> it( mItemZList );
@@ -583,7 +583,7 @@
   QLinkedList<QgsComposerItem*>::iterator after_it = mItemZList.begin();
   for ( ; after_it != mItemZList.end(); ++after_it )
   {
-    qWarning( QString::number(( *after_it )->zValue() ).toLocal8Bit().data() );
+    qWarning( "%lf", ( *after_it )->zValue() );
   }
 }
 

Modified: trunk/qgis/src/core/qgslogger.cpp
===================================================================
--- trunk/qgis/src/core/qgslogger.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/core/qgslogger.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -35,22 +35,22 @@
   {
     if ( file == NULL )
     {
-      qDebug( msg.toLocal8Bit().data() );
+      qDebug( "%s", msg.toLocal8Bit().constData() );
     }
     else if ( function == NULL )
     {
-      qDebug( "%s: %s", file, msg.toLocal8Bit().data() );
+      qDebug( "%s: %s", file, msg.toLocal8Bit().constData() );
     }
     else if ( line == -1 )
     {
-      qDebug( "%s: (%s) %s", file, function, msg.toLocal8Bit().data() );
+      qDebug( "%s: (%s) %s", file, function, msg.toLocal8Bit().constData() );
     }
     else
     {
 #ifndef _MSC_VER
-      qDebug( "%s: %d: (%s) %s", file, line, function, msg.toLocal8Bit().data() );
+      qDebug( "%s: %d: (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
 #else
-      qDebug( "%s(%d) : (%s) %s", file, line, function, msg.toLocal8Bit().data() );
+      qDebug( "%s(%d) : (%s) %s", file, line, function, msg.toLocal8Bit().constData() );
 #endif
     }
   }
@@ -72,22 +72,22 @@
   {
     if ( file == NULL )
     {
-      qDebug( "%s: %d", var.toLocal8Bit().data(), val );
+      qDebug( "%s: %d", var.toLocal8Bit().constData(), val );
     }
     else if ( function == NULL )
     {
-      qDebug( "%s: %s: %d", file, var.toLocal8Bit().data(), val );
+      qDebug( "%s: %s: %d", file, var.toLocal8Bit().constData(), val );
     }
     else if ( line == -1 )
     {
-      qDebug( "%s: (%s): %s: %d", file, function, var.toLocal8Bit().data(), val );
+      qDebug( "%s: (%s): %s: %d", file, function, var.toLocal8Bit().constData(), val );
     }
     else
     {
 #ifdef _MSC_VER
-      qDebug( "%s(%d): (%s), %s: %d", file, line, function, var.toLocal8Bit().data(), val );
+      qDebug( "%s(%d): (%s), %s: %d", file, line, function, var.toLocal8Bit().constData(), val );
 #else
-      qDebug( "%s: %d: (%s), %s: %d", file, line, function, var.toLocal8Bit().data(), val );
+      qDebug( "%s: %d: (%s), %s: %d", file, line, function, var.toLocal8Bit().constData(), val );
 #endif
     }
   }
@@ -109,22 +109,22 @@
   {
     if ( file == NULL )
     {
-      qDebug( "%s: %f", var.toLocal8Bit().data(), val );
+      qDebug( "%s: %f", var.toLocal8Bit().constData(), val );
     }
     else if ( function == NULL )
     {
-      qDebug( "%s: %s: %f", file, var.toLocal8Bit().data(), val );
+      qDebug( "%s: %s: %f", file, var.toLocal8Bit().constData(), val );
     }
     else if ( line == -1 )
     {
-      qDebug( "%s: (%s): %s: %f", file, function, var.toLocal8Bit().data(), val );
+      qDebug( "%s: (%s): %s: %f", file, function, var.toLocal8Bit().constData(), val );
     }
     else
     {
 #ifdef _MSC_VER
-      qDebug( "%s(%d): (%s), %s: %f", file, line, function, var.toLocal8Bit().data(), val );
+      qDebug( "%s(%d): (%s), %s: %f", file, line, function, var.toLocal8Bit().constData(), val );
 #else
-      qDebug( "%s: %d: (%s), %s: %f", file, line, function, var.toLocal8Bit().data(), val );
+      qDebug( "%s: %d: (%s), %s: %f", file, line, function, var.toLocal8Bit().constData(), val );
 #endif
     }
   }
@@ -132,17 +132,17 @@
 
 void QgsLogger::warning( const QString& msg )
 {
-  qWarning( msg.toLocal8Bit().data() );
+  qWarning( "%s", msg.toLocal8Bit().constData() );
 }
 
 void QgsLogger::critical( const QString& msg )
 {
-  qCritical( msg.toLocal8Bit().data() );
+  qCritical( "%s", msg.toLocal8Bit().constData() );
 }
 
 void QgsLogger::fatal( const QString& msg )
 {
-  qFatal( msg.toLocal8Bit().data() );
+  qFatal( "%s", msg.toLocal8Bit().constData() );
 }
 
 int QgsLogger::debugLevel()

Modified: trunk/qgis/src/core/qgsproject.cpp
===================================================================
--- trunk/qgis/src/core/qgsproject.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/core/qgsproject.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -769,7 +769,7 @@
     QString errorString = tr( "Project file read error: %1 at line %2 column %3" )
                           .arg( errorMsg ).arg( line ).arg( column );
 
-    qDebug( errorString.toUtf8().constData() );
+    qDebug( "%s", errorString.toUtf8().constData() );
 
     imp_->file.close();
 

Modified: trunk/qgis/src/core/symbology/qgssymbologyutils.cpp
===================================================================
--- trunk/qgis/src/core/symbology/qgssymbologyutils.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/core/symbology/qgssymbologyutils.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -873,7 +873,7 @@
   }
   else                        //return a null string
   {
-    qWarning( "Brush style \"" + brushString.toUtf8() + "\" not found in qString2BrushStyle" );
+    qWarning( "Brush style \"%s\" not found in qString2BrushStyle", brushString.toUtf8().constData() );
     return Qt::NoBrush;
   }
 }

Modified: trunk/qgis/src/gui/qgsprojectionselector.cpp
===================================================================
--- trunk/qgis/src/gui/qgsprojectionselector.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/gui/qgsprojectionselector.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -803,8 +803,7 @@
   myFileInfo.setFile( myDatabaseFileName );
   if ( !myFileInfo.exists( ) ) //its not critical if this happens
   {
-    qDebug( myDatabaseFileName.toUtf8() );
-    qDebug( "User db does not exist" );
+    qDebug( "%s\nUser db does not exist", myDatabaseFileName.toUtf8().constData() );
     return ;
   }
   myResult = sqlite3_open( myDatabaseFileName.toUtf8().data(), &myDatabase );

Modified: trunk/qgis/src/gui/qgsquickprint.cpp
===================================================================
--- trunk/qgis/src/gui/qgsquickprint.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/gui/qgsquickprint.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -83,12 +83,12 @@
 void QgsQuickPrint::setLogo1( QString theFileName )
 {
   mLogo1File = theFileName;
-  qDebug( "Logo1 set to: " + mLogo1File.toLocal8Bit() );
+  qDebug( "Logo1 set to: %s", mLogo1File.toLocal8Bit().constData() );
 }
 void QgsQuickPrint::setLogo2( QString theFileName )
 {
   mLogo2File = theFileName;
-  qDebug( "Logo2 set to: " + mLogo2File.toLocal8Bit() );
+  qDebug( "Logo2 set to: %s", mLogo2File.toLocal8Bit().constData() );
 }
 void QgsQuickPrint::setOutputPdf( QString theFileName )
 {
@@ -140,7 +140,7 @@
   int myPrintResolutionDpi = 300;
   myPrinter.setResolution( myPrintResolutionDpi );
   myPrinter.setOutputFormat( QPrinter::PdfFormat );
-  qDebug( "Printing to page size"  +  pageSizeToString( mPageSize ).toLocal8Bit() );
+  qDebug( "Printing to page size %s", pageSizeToString( mPageSize ).toLocal8Bit().constData() );
   myPrinter.setPageSize( mPageSize );
   myPrinter.setOutputFileName( mOutputFileName );
   myPrinter.setOrientation( QPrinter::Landscape );
@@ -588,8 +588,7 @@
   int myLogoXDim = ( myDrawableWidth / 100 ) * myLogoWidthPercent;
   int myLogoYDim = ( myDrawableHeight / 100 ) * myLogoHeightPercent;
   QPixmap myLogo1;
-  qDebug( "Logo1:" );
-  qDebug( mLogo1File.toLocal8Bit() );
+  qDebug( "Logo1: %s", mLogo1File.toLocal8Bit().constData() );
   myLogo1.fill( Qt::white );
   myLogo1.load( mLogo1File );
   myLogo1 = myLogo1.scaled( myLogoXDim, myLogoYDim, Qt::KeepAspectRatio );
@@ -1042,9 +1041,7 @@
     myList << myCumulativeLine.trimmed();
   }
 
-  //qDebug("Wrapped legend entry:");
-  //qDebug(theString);
-  //qDebug(myList.join("\n").toLocal8Bit());
+  //qDebug("Wrapped legend entry: %s\n%s", theString, myList.join("\n").toLocal8Bit().constData() );
   return myList;
 
 }

Modified: trunk/qgis/src/plugins/quick_print/quickprintgui.cpp
===================================================================
--- trunk/qgis/src/plugins/quick_print/quickprintgui.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/plugins/quick_print/quickprintgui.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -146,7 +146,7 @@
       myQuickPrint.setOutputPdf( myOutputFileName );
       QString myPageSizeString = cboPageSize->itemData( cboPageSize->currentIndex() ).toString();
       myQuickPrint.setPageSize( QgsQuickPrint::stringToPageSize( myPageSizeString ) );
-      qDebug( "Page size : " + myPageSizeString.toLocal8Bit() );
+      qDebug( "Page size : %s", myPageSizeString.toLocal8Bit().constData() );
       myQuickPrint.printMap();
     }
     else

Modified: trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp
===================================================================
--- trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -214,7 +214,7 @@
 
   //print out result for a test
   QString resultString( result );
-  qWarning( resultString.toUtf8() );
+  qWarning( "%s", resultString.toUtf8().constData() );
 
   return 0;
 }
@@ -269,7 +269,7 @@
   QSettings settings;
   QString key = "/Qgis/connections-wfs/" + cmbConnections->currentText() + "/url";
   mUri = settings.value( key ).toString();
-  qWarning( "url is: " + mUri.toUtf8() );
+  qWarning( "url is: %s", mUri.toUtf8().constData() );
 
   //make a GetCapabilities request
   std::list<QString> typenames;
@@ -349,7 +349,7 @@
   {
     uri.append( "?" );
   }
-  qWarning( uri.toUtf8() + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName.toUtf8() );
+  qWarning( "%sSERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=%s", uri.toUtf8().constData(), typeName.toUtf8().constData() );
 
   //get CRS
   QString crsString;
@@ -385,7 +385,7 @@
   if ( currentTreeItem )
   {
     QString currentTypename = currentTreeItem->text( 1 );
-    qWarning( "the current typename is: " + currentTypename.toUtf8() );
+    qWarning( "the current typename is: %s", currentTypename.toUtf8().constData() );
 
     std::map<QString, std::list<QString> >::const_iterator crsIterator = mAvailableCRS.find( currentTypename );
     if ( crsIterator != mAvailableCRS.end() )

Modified: trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp
===================================================================
--- trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/providers/postgres/qgspostgresextentthread.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -98,11 +98,8 @@
         "ymax(extent(" + geometryColumn + ")) as ymax," "ymin(extent(" + geometryColumn + ")) as ymin" " from " + tableName;
 #endif
 
-#ifdef QGISDEBUG
-  qDebug( "+++++++++QgsPostgresExtentThread::run -  Getting extents using schema.table: " + sql.toUtf8() );
-#endif
+  QgsDebugMsg( QString( "Getting extents using schema.table: %1" ).arg( sql ) );
 
-
   QgsDebugMsg( "About to issue query." );
 
   PGresult *result = PQexec( connection, sql.toUtf8() );

Modified: trunk/qgis/src/providers/wfs/qgswfsdata.cpp
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsdata.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/providers/wfs/qgswfsdata.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -57,8 +57,7 @@
     if ( it->startsWith( "TYPENAME", Qt::CaseInsensitive ) )
     {
       mTypeName = it->section( "=", 1, 1 );
-      qWarning( "mTypeName is:" );
-      qWarning( mTypeName.toLocal8Bit().data() );
+      qWarning( "mTypeName is: %s", mTypeName.toLocal8Bit().constData() );
     }
   }
 

Modified: trunk/qgis/src/providers/wfs/qgswfsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsprovider.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/src/providers/wfs/qgswfsprovider.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -296,10 +296,8 @@
     return 1;
   }
 
-  qWarning( "feature count after request is:" );
-  qWarning( QString::number( mFeatures.size() ).toLocal8Bit().data() );
-  qWarning( "mExtent after request is:" );
-  qWarning( mExtent.toString().toLocal8Bit().data() );
+  qWarning( "feature count after request is: %d", mFeatures.size() );
+  qWarning( "mExtent after request is: %s",  mExtent.toString().toLocal8Bit().data() );
 
   for ( QList<QgsFeature*>::iterator it = mFeatures.begin(); it != mFeatures.end(); ++it )
   {

Modified: trunk/qgis/tests/src/core/qgsrenderchecker.cpp
===================================================================
--- trunk/qgis/tests/src/core/qgsrenderchecker.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/qgsrenderchecker.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -138,14 +138,12 @@
   // Put the same info to debug too
   //
 
-  qDebug( "Expected size: " + QString::number( myExpectedImage.width() ).toLocal8Bit() + "w x " +
-          QString::number( myExpectedImage.width() ).toLocal8Bit() + "h" );
-  qDebug( "Actual   size: " + QString::number( myResultImage.width() ).toLocal8Bit() + "w x " +
-          QString::number( myResultImage.width() ).toLocal8Bit() + "h" );
+  qDebug( "Expected size: %dw x %dh", myExpectedImage.width(), myExpectedImage.height() );
+  qDebug( "Actual   size: %dw x %dh", myResultImage.width(), myResultImage.height() );
 
   if ( mMatchTarget != myPixelCount )
   {
-    qDebug( QString( "Test image and result image for %1 are different - FAILING!" ).arg( theTestName ).toLocal8Bit() );
+    qDebug( "Test image and result image for %s are different - FAILING!", theTestName.toLocal8Bit().constData() );
     mReport += "<tr><td colspan=3>";
     mReport += "<font color=red>Expected image and result image for " + theTestName + " are different dimensions - FAILING!</font>";
     mReport += "</td></tr>";
@@ -180,9 +178,7 @@
   //
   // Send match result to debug
   //
-  qDebug( QString::number( mMismatchCount ).toLocal8Bit() + "/" +
-          QString::number( mMatchTarget ).toLocal8Bit() +
-          " pixels mismatched" );;
+  qDebug( "%d/%d pixels mismatched", mMismatchCount, mMatchTarget );
 
   //
   // Send match result to report

Modified: trunk/qgis/tests/src/core/regression1141.cpp
===================================================================
--- trunk/qgis/tests/src/core/regression1141.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/regression1141.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -99,8 +99,7 @@
   mFields.insert( 0, myField );
   mCRS = QgsCoordinateReferenceSystem( GEOWkt );
 
-  qDebug( "Checking test dataset exists..." );
-  qDebug( mFileName.toLocal8Bit() );
+  qDebug( "Checking test dataset exists...\n%s", mFileName.toLocal8Bit().constData() );
 
   if ( !QFile::exists( mFileName ) )
   {

Modified: trunk/qgis/tests/src/core/testqgsapplication.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsapplication.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/testqgsapplication.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -24,7 +24,7 @@
 
 class TestQgsApplication: public QObject
 {
-  Q_OBJECT;
+    Q_OBJECT;
   private slots:
     void checkTheme();
     void initTestCase();
@@ -39,8 +39,8 @@
   // Runs once before any tests are run
   //
   // init QGIS's paths - true means that all path will be inited from prefix
-  QString qgisPath = QCoreApplication::applicationDirPath ();
-  QgsApplication::setPrefixPath(INSTALL_PREFIX, true);
+  QString qgisPath = QCoreApplication::applicationDirPath();
+  QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
   QgsApplication::showSettings();
 };
 
@@ -48,14 +48,14 @@
 {
   QString myIconPath = QgsApplication::defaultThemePath();
   QPixmap myPixmap;
-  myPixmap.load(myIconPath+"/mIconProjectionDisabled.png");
-  qDebug("Checking if a theme icon exists:");
-  qDebug(myIconPath.toLocal8Bit()+"/mIconProjectionDisabled.png");
-  QVERIFY(!myPixmap.isNull());
+  myPixmap.load( myIconPath + "/mIconProjectionDisabled.png" );
+  qDebug( "Checking if a theme icon exists:" );
+  qDebug( "%s/mIconProjectionDisabled.png", myIconPath.toLocal8Bit().constData() );
+  QVERIFY( !myPixmap.isNull() );
 
 };
 
 
-QTEST_MAIN(TestQgsApplication)
+QTEST_MAIN( TestQgsApplication )
 #include "moc_testqgsapplication.cxx"
 

Modified: trunk/qgis/tests/src/core/testqgsgeometry.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsgeometry.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/testqgsgeometry.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -211,7 +211,7 @@
   QVERIFY( mpPolygonGeometryA->intersects( mpPolygonGeometryB ) );
   // should be a single polygon as A intersect B
   QgsGeometry * mypIntersectionGeometry  =  mpPolygonGeometryA->intersection( mpPolygonGeometryB );
-  qDebug( "Geometry Type: " + wkbTypeAsString( mypIntersectionGeometry->wkbType() ).toLocal8Bit() );
+  qDebug( "Geometry Type: %s", wkbTypeAsString( mypIntersectionGeometry->wkbType() ).toLocal8Bit().constData() );
   QVERIFY( mypIntersectionGeometry->wkbType() == QGis::WKBPolygon );
   QgsPolygon myPolygon = mypIntersectionGeometry->asPolygon();
   QVERIFY( myPolygon.size() > 0 ); //check that the union created a feature
@@ -228,7 +228,7 @@
 {
   // should be a multipolygon with 2 parts as A does not intersect C
   QgsGeometry * mypUnionGeometry  =  mpPolygonGeometryA->combine( mpPolygonGeometryC );
-  qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
+  qDebug( "Geometry Type: %s", wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit().constData() );
   QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBMultiPolygon );
   QgsMultiPolygon myMultiPolygon = mypUnionGeometry->asMultiPolygon();
   QVERIFY( myMultiPolygon.size() > 0 ); //check that the union did not fail
@@ -241,7 +241,7 @@
 {
   // should be a single polygon as A intersect B
   QgsGeometry * mypUnionGeometry  =  mpPolygonGeometryA->combine( mpPolygonGeometryB );
-  qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
+  qDebug( "Geometry Type: %s", wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit().constData() );
   QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBPolygon );
   QgsPolygon myPolygon = mypUnionGeometry->asPolygon();
   QVERIFY( myPolygon.size() > 0 ); //check that the union created a feature
@@ -254,7 +254,7 @@
 {
   // should be same as A since A does not intersect C so diff is 100% of A
   QgsGeometry * mypDifferenceGeometry  =  mpPolygonGeometryA->difference( mpPolygonGeometryC );
-  qDebug( "Geometry Type: " + wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit() );
+  qDebug( "Geometry Type: %s", wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit().constData() );
   QVERIFY( mypDifferenceGeometry->wkbType() == QGis::WKBPolygon );
   QgsPolygon myPolygon = mypDifferenceGeometry->asPolygon();
   QVERIFY( myPolygon.size() > 0 ); //check that the union did not fail
@@ -267,7 +267,7 @@
 {
   // should be a single polygon as (A - B) = subset of A
   QgsGeometry * mypDifferenceGeometry  =  mpPolygonGeometryA->difference( mpPolygonGeometryB );
-  qDebug( "Geometry Type: " + wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit() );
+  qDebug( "Geometry Type: %s", wkbTypeAsString( mypDifferenceGeometry->wkbType() ).toLocal8Bit().constData() );
   QVERIFY( mypDifferenceGeometry->wkbType() == QGis::WKBPolygon );
   QgsPolygon myPolygon = mypDifferenceGeometry->asPolygon();
   QVERIFY( myPolygon.size() > 0 ); //check that the union created a feature
@@ -279,7 +279,7 @@
 {
   // should be a single polygon
   QgsGeometry * mypBufferGeometry  =  mpPolygonGeometryB->buffer( 10, 10 );
-  qDebug( "Geometry Type: " + wkbTypeAsString( mypBufferGeometry->wkbType() ).toLocal8Bit() );
+  qDebug( "Geometry Type: %s", wkbTypeAsString( mypBufferGeometry->wkbType() ).toLocal8Bit().constData() );
   QVERIFY( mypBufferGeometry->wkbType() == QGis::WKBPolygon );
   QgsPolygon myPolygon = mypBufferGeometry->asPolygon();
   QVERIFY( myPolygon.size() > 0 ); //check that the buffer created a feature
@@ -310,7 +310,7 @@
   for ( int i = 0; i < theMultiPolygon.size(); i++ )
   {
     QgsPolygon myPolygon = theMultiPolygon.at( i );
-    qDebug( "\tPolygon in multipolygon: " + QString::number( i ).toLocal8Bit() );
+    qDebug( "\tPolygon in multipolygon: %d", i );
     dumpPolygon( myPolygon );
   }
 }
@@ -321,12 +321,12 @@
   for ( int j = 0; j < thePolygon.size(); j++ )
   {
     QgsPolyline myPolyline = thePolygon.at( j ); //rings of polygon
-    qDebug( "\t\tRing  in polygon: " + QString::number( j ).toLocal8Bit() );
+    qDebug( "\t\tRing in polygon: %d", j );
 
     for ( int k = 0; k < myPolyline.size(); k++ )
     {
       QgsPoint myPoint = myPolyline.at( k );
-      qDebug( "\t\t\tPoint in ring " + QString::number( k ).toLocal8Bit() + " :" + myPoint.toString().toLocal8Bit() );
+      qDebug( "\t\t\tPoint in ring %d : %s", k, myPoint.toString().toLocal8Bit().constData() );
       myPoints << QPointF( myPoint.x(), myPoint.y() );
     }
   }

Modified: trunk/qgis/tests/src/core/testqgsmaprenderer.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsmaprenderer.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/testqgsmaprenderer.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -100,8 +100,7 @@
   //copy over the default qml for our generated layer
   QString myQmlFileName = myTestDataDir +  "maprender_testdata.qml";
   QFile::copy( myQmlFileName, myTmpDir + "maprender_testdata.qml" );
-  qDebug( "Checking test dataset exists..." );
-  qDebug( myFileName.toLocal8Bit() );
+  qDebug( "Checking test dataset exists...\n%s", myFileName.toLocal8Bit().constData() );
   if ( !QFile::exists( myFileName ) )
   {
     qDebug( "Creating test dataset: " );

Modified: trunk/qgis/tests/src/core/testqgsrasterlayer.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsrasterlayer.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/testqgsrasterlayer.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -186,7 +186,7 @@
                        "NEAREST",
                        myInternalFlag
                      );
-  qDebug( myResult.toLocal8Bit() );
+  qDebug( "%s", myResult.toLocal8Bit().constData() );
   //
   // Lets verify we have pyramids now...
   //
@@ -232,7 +232,7 @@
   if ( !myStyleFlag )
   {
     qDebug( " **** setQml -> mpLandsatRasterLayer is invalid" );
-    qDebug( "Qml File :" +  myFileName.toLocal8Bit() );
+    qDebug( "Qml File :%s", myFileName.toLocal8Bit().constData() );
   }
   return myStyleFlag;
 }

Modified: trunk/qgis/tests/src/core/testqgsrenderers.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsrenderers.cpp	2009-02-01 16:54:30 UTC (rev 10083)
+++ trunk/qgis/tests/src/core/testqgsrenderers.cpp	2009-02-01 16:59:03 UTC (rev 10084)
@@ -196,7 +196,7 @@
   QString error = mpPointsLayer->loadNamedStyle( myFileName, myStyleFlag );
   if ( !myStyleFlag )
   {
-    qDebug( error.toLocal8Bit().data() );
+    qDebug( "%s", error.toLocal8Bit().constData() );
     return false;
   }
   else



More information about the QGIS-commit mailing list