QtBase: combine adjacent qDebug()/qCritical() lines

For qDebug() and qWarning(), this is just an optimization.
For qCritical(), which can be fatal, the old code was just wrong.

Change-Id: I6d8ab1d7531d766cd41b49569dc0fd4420ecab8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2015-10-24 22:32:45 +02:00
parent 40a8302115
commit 678a4273a3
6 changed files with 34 additions and 38 deletions

View File

@ -568,9 +568,9 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file); // pre-1.3 mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file); // pre-1.3
} }
if (mimeFiles.isEmpty()) { if (mimeFiles.isEmpty()) {
qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist."; qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist.\n"
qWarning() << "Either it was just removed, or the directory doesn't have executable permission..."; "Either it was just removed, or the directory doesn't have executable permission..."
qWarning() << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory); << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);
return; return;
} }

View File

@ -164,8 +164,8 @@ void QFactoryLoader::update()
library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath()); library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath());
if (!library->isPlugin()) { if (!library->isPlugin()) {
if (qt_debug_component()) { if (qt_debug_component()) {
qDebug() << library->errorString; qDebug() << library->errorString << endl
qDebug() << " not a plugin"; << " not a plugin";
} }
library->release(); library->release();
continue; continue;

View File

@ -69,39 +69,39 @@ QWindowsSockInit2::~QWindowsSockInit2()
#ifdef BEARER_MANAGEMENT_DEBUG #ifdef BEARER_MANAGEMENT_DEBUG
static void printBlob(NLA_BLOB *blob) static void printBlob(NLA_BLOB *blob)
{ {
qDebug() << "==== BEGIN NLA_BLOB ===="; qDebug() << "==== BEGIN NLA_BLOB ====" << endl
qDebug() << "type:" << blob->header.type; << "type:" << blob->header.type << endl
qDebug() << "size:" << blob->header.dwSize; << "size:" << blob->header.dwSize << endl
qDebug() << "next offset:" << blob->header.nextOffset; << "next offset:" << blob->header.nextOffset;
switch (blob->header.type) { switch (blob->header.type) {
case NLA_RAW_DATA: case NLA_RAW_DATA:
qDebug() << "Raw Data"; qDebug() << "Raw Data" << endl
qDebug() << '\t' << blob->data.rawData; << '\t' << blob->data.rawData;
break; break;
case NLA_INTERFACE: case NLA_INTERFACE:
qDebug() << "Interface"; qDebug() << "Interface" << endl
qDebug() << "\ttype:" << blob->data.interfaceData.dwType; << "\ttype:" << blob->data.interfaceData.dwType << endl
qDebug() << "\tspeed:" << blob->data.interfaceData.dwSpeed; << "\tspeed:" << blob->data.interfaceData.dwSpeed << endl
qDebug() << "\tadapter:" << blob->data.interfaceData.adapterName; << "\tadapter:" << blob->data.interfaceData.adapterName;
break; break;
case NLA_802_1X_LOCATION: case NLA_802_1X_LOCATION:
qDebug() << "802.1x Location"; qDebug() << "802.1x Location" << endl
qDebug() << '\t' << blob->data.locationData.information; << '\t' << blob->data.locationData.information;
break; break;
case NLA_CONNECTIVITY: case NLA_CONNECTIVITY:
qDebug() << "Connectivity"; qDebug() << "Connectivity" << endl
qDebug() << "\ttype:" << blob->data.connectivity.type; << "\ttype:" << blob->data.connectivity.type << endl
qDebug() << "\tinternet:" << blob->data.connectivity.internet; << "\tinternet:" << blob->data.connectivity.internet;
break; break;
case NLA_ICS: case NLA_ICS:
qDebug() << "ICS"; qDebug() << "ICS" << endl
qDebug() << "\tspeed:" << blob->data.ICS.remote.speed; << "\tspeed:" << blob->data.ICS.remote.speed << endl
qDebug() << "\ttype:" << blob->data.ICS.remote.type; << "\ttype:" << blob->data.ICS.remote.type << endl
qDebug() << "\tstate:" << blob->data.ICS.remote.state; << "\tstate:" << blob->data.ICS.remote.state << endl
qDebug() << "\tmachine name:" << blob->data.ICS.remote.machineName; << "\tmachine name:" << blob->data.ICS.remote.machineName << endl
qDebug() << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName; << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
break; break;
default: default:
qDebug() << "UNKNOWN BLOB TYPE"; qDebug() << "UNKNOWN BLOB TYPE";

View File

@ -498,8 +498,8 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para
} }
if (!m_main) { if (!m_main) {
qCritical() << "dlsym failed:" << dlerror(); qCritical() << "dlsym failed:" << dlerror() << endl
qCritical() << "Could not find main method"; << "Could not find main method";
return false; return false;
} }

View File

@ -201,8 +201,7 @@ QDebug operator<<(QDebug str, const QSpanCollection::Span &span)
void QSpanCollection::updateInsertedRows(int start, int end) void QSpanCollection::updateInsertedRows(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end; qDebug() << start << end << endl << index;
qDebug() << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;
@ -250,8 +249,7 @@ void QSpanCollection::updateInsertedRows(int start, int end)
void QSpanCollection::updateInsertedColumns(int start, int end) void QSpanCollection::updateInsertedColumns(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end; qDebug() << start << end << endl << index;
qDebug() << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;
@ -332,8 +330,7 @@ bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int
void QSpanCollection::updateRemovedRows(int start, int end) void QSpanCollection::updateRemovedRows(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end; qDebug() << start << end << endl << index;
qDebug() << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;
@ -460,8 +457,7 @@ void QSpanCollection::updateRemovedRows(int start, int end)
void QSpanCollection::updateRemovedColumns(int start, int end) void QSpanCollection::updateRemovedColumns(int start, int end)
{ {
#ifdef DEBUG_SPAN_UPDATE #ifdef DEBUG_SPAN_UPDATE
qDebug() << start << end; qDebug() << start << end << endl << index;
qDebug() << index;
#endif #endif
if (spans.isEmpty()) if (spans.isEmpty())
return; return;

View File

@ -1870,8 +1870,8 @@ void QScrollerPrivate::setContentPositionHelperScrolling()
newPos.setY(nextSegmentPosition(ySegments, now, newPos.y())); newPos.setY(nextSegmentPosition(ySegments, now, newPos.y()));
// -- set the position and handle overshoot // -- set the position and handle overshoot
qScrollerDebug() << "QScroller::setContentPositionHelperScrolling()"; qScrollerDebug() << "QScroller::setContentPositionHelperScrolling()\n"
qScrollerDebug() << " --> overshoot:" << overshootPosition << "- new pos:" << newPos; " --> overshoot:" << overshootPosition << "- new pos:" << newPos;
QPointF newClampedPos = clampToRect(newPos, contentPosRange); QPointF newClampedPos = clampToRect(newPos, contentPosRange);