Skip to content
Permalink
Browse files

fix #1523

git-svn-id: http://svn.osgeo.org/qgis/trunk@10084 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Feb 1, 2009
1 parent 97086e6 commit bd9a6ca544dccace19456a10952e8fefcdae4f1c
@@ -587,7 +587,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
}

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] ) );
@@ -56,8 +56,8 @@ void QgsAbout::init()

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 @@ void QgsAbout::init()
// 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 ) )
{
@@ -442,8 +442,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
}
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 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
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 );
@@ -96,7 +96,7 @@ void QgsGeomTypeDialog::attributes( std::list<std::pair<QString, QString> >& at
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;
}
@@ -232,7 +232,7 @@ void QgsComposition::addItemToZList( QgsComposerItem* item )
return;
}
mItemZList.push_back( item );
qWarning( QString::number( mItemZList.size() ).toLocal8Bit().data() );
qWarning( "%d", mItemZList.size() );
item->setZValue( mItemZList.size() );
}

@@ -515,7 +515,7 @@ void QgsComposition::updateZValues()
currentItem = *it;
if ( currentItem )
{
qWarning( QString::number( counter ).toLocal8Bit().data() );
qWarning( "%d", counter );
currentItem->setZValue( counter );
}
++counter;
@@ -529,7 +529,7 @@ void QgsComposition::sortZList()
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 @@ void QgsComposition::sortZList()
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() );
}
}

@@ -35,22 +35,22 @@ void QgsLogger::debug( const QString& msg, int debuglevel, const char* file, con
{
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 @@ void QgsLogger::debug( const QString& var, int val, int debuglevel, const char*
{
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,40 +109,40 @@ void QgsLogger::debug( const QString& var, double val, int debuglevel, const cha
{
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
}
}
}

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()
@@ -769,7 +769,7 @@ bool QgsProject::read()
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();

@@ -873,7 +873,7 @@ Qt::BrushStyle QgsSymbologyUtils::qString2BrushStyle( QString brushString )
}
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;
}
}
@@ -803,8 +803,7 @@ void QgsProjectionSelector::on_pbnFind_clicked()
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 );
@@ -83,12 +83,12 @@ void QgsQuickPrint::setNorthArrow( QString theFileName )
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 @@ void QgsQuickPrint::printMap()
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 @@ void QgsQuickPrint::printMap()
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 @@ QStringList QgsQuickPrint::wordWrap( QString theString,
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;

}
@@ -146,7 +146,7 @@ void QuickPrintGui::on_buttonBox_accepted()
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
@@ -214,7 +214,7 @@ int QgsWFSSourceSelect::getCapabilitiesGET( QString uri, std::list<QString>& typ

//print out result for a test
QString resultString( result );
qWarning( resultString.toUtf8() );
qWarning( "%s", resultString.toUtf8().constData() );

return 0;
}
@@ -269,7 +269,7 @@ void QgsWFSSourceSelect::connectToServer()
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 @@ void QgsWFSSourceSelect::addLayer()
{
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 @@ void QgsWFSSourceSelect::changeCRSFilter()
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() )
@@ -98,10 +98,7 @@ void QgsPostgresExtentThread::run()
"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." );

@@ -57,8 +57,7 @@ QgsWFSData::QgsWFSData(
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() );
}
}

@@ -296,10 +296,8 @@ int QgsWFSProvider::getFeatureGET( const QString& uri, const QString& geometryAt
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 )
{
@@ -138,14 +138,12 @@ bool QgsRenderChecker::compareImages( QString theTestName )
// 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 @@ bool QgsRenderChecker::compareImages( QString theTestName )
//
// 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
@@ -99,8 +99,7 @@ void Regression1141::diacriticalTest()
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 ) )
{

0 comments on commit bd9a6ca

Please sign in to comment.
You can’t perform that action at this time.