From 1eac22a1b9dad7f843916afa9b7c820aa1c23777 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 2 May 2012 16:32:26 +0200 Subject: Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtWidgets] This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ie8ac500f2f8ebe99b7525feaa7b39247e641a461 Reviewed-by: Olivier Goffart --- src/widgets/graphicsview/qgraph_p.h | 12 ++++++------ .../graphicsview/qgraphicsanchorlayout_p.cpp | 22 +++++++++++----------- src/widgets/graphicsview/qgraphicsanchorlayout_p.h | 10 +++++----- src/widgets/graphicsview/qgraphicswidget.cpp | 2 +- src/widgets/graphicsview/qgridlayoutengine.cpp | 6 +++--- src/widgets/graphicsview/qsimplex_p.cpp | 6 +++--- src/widgets/graphicsview/qsimplex_p.h | 10 +++++----- 7 files changed, 34 insertions(+), 34 deletions(-) (limited to 'src/widgets/graphicsview') diff --git a/src/widgets/graphicsview/qgraph_p.h b/src/widgets/graphicsview/qgraph_p.h index e41bf5a5da..766c35dd0d 100644 --- a/src/widgets/graphicsview/qgraph_p.h +++ b/src/widgets/graphicsview/qgraph_p.h @@ -150,7 +150,7 @@ public: // Creates a bidirectional edge #if defined(QT_DEBUG) && 0 qDebug("Graph::createEdge(): %s", - qPrintable(QString::fromAscii("%1-%2") + qPrintable(QString::fromLatin1("%1-%2") .arg(first->toString()).arg(second->toString()))); #endif if (edgeData(first, second)) { @@ -167,7 +167,7 @@ public: // Removes a bidirectional edge #if defined(QT_DEBUG) && 0 qDebug("Graph::removeEdge(): %s", - qPrintable(QString::fromAscii("%1-%2") + qPrintable(QString::fromLatin1("%1-%2") .arg(first->toString()).arg(second->toString()))); #endif EdgeData *data = edgeData(first, second); @@ -180,7 +180,7 @@ public: { #if defined(QT_DEBUG) && 0 qDebug("Graph::takeEdge(): %s", - qPrintable(QString::fromAscii("%1-%2") + qPrintable(QString::fromLatin1("%1-%2") .arg(first->toString()).arg(second->toString()))); #endif // Removes a bidirectional edge @@ -236,7 +236,7 @@ public: EdgeData *data = edgeData(v, v1); bool forward = data->from == v; if (forward) { - edges += QString::fromAscii("\"%1\"->\"%2\" [label=\"[%3,%4,%5,%6,%7]\" color=\"#000000\"] \n") + edges += QString::fromLatin1("\"%1\"->\"%2\" [label=\"[%3,%4,%5,%6,%7]\" color=\"#000000\"] \n") .arg(v->toString()) .arg(v1->toString()) .arg(data->minSize) @@ -247,9 +247,9 @@ public: ; } } - strVertices += QString::fromAscii("\"%1\" [label=\"%2\"]\n").arg(v->toString()).arg(v->toString()); + strVertices += QString::fromLatin1("\"%1\" [label=\"%2\"]\n").arg(v->toString()).arg(v->toString()); } - return QString::fromAscii("%1\n%2\n").arg(strVertices).arg(edges); + return QString::fromLatin1("%1\n%2\n").arg(strVertices).arg(edges); } #endif diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp index 3d20f0b07c..a935179a2a 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp @@ -611,10 +611,10 @@ QString GraphPath::toString() const { QString string(QLatin1String("Path: ")); foreach(AnchorData *edge, positives) - string += QString::fromAscii(" (+++) %1").arg(edge->toString()); + string += QString::fromLatin1(" (+++) %1").arg(edge->toString()); foreach(AnchorData *edge, negatives) - string += QString::fromAscii(" (---) %1").arg(edge->toString()); + string += QString::fromLatin1(" (---) %1").arg(edge->toString()); return string; } @@ -765,9 +765,9 @@ static AnchorData *createSequence(Graph *graph, #if defined(QT_DEBUG) && 0 QString strVertices; for (int i = 0; i < vertices.count(); ++i) { - strVertices += QString::fromAscii("%1 - ").arg(vertices.at(i)->toString()); + strVertices += QString::fromLatin1("%1 - ").arg(vertices.at(i)->toString()); } - QString strPath = QString::fromAscii("%1 - %2%3").arg(before->toString(), strVertices, after->toString()); + QString strPath = QString::fromLatin1("%1 - %2%3").arg(before->toString(), strVertices, after->toString()); qDebug("simplifying [%s] to [%s - %s]", qPrintable(strPath), qPrintable(before->toString()), qPrintable(after->toString())); #endif @@ -847,7 +847,7 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraph(Orientation orientation) static int count = 0; if (orientation == Horizontal) { count++; - dumpGraph(QString::fromAscii("%1-full").arg(count)); + dumpGraph(QString::fromLatin1("%1-full").arg(count)); } #endif @@ -872,8 +872,8 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraph(Orientation orientation) } #if defined(QT_DEBUG) && 0 - dumpGraph(QString::fromAscii("%1-simplified-%2").arg(count).arg( - QString::fromAscii(orientation == Horizontal ? "Horizontal" : "Vertical"))); + dumpGraph(QString::fromLatin1("%1-simplified-%2").arg(count).arg( + QString::fromLatin1(orientation == Horizontal ? "Horizontal" : "Vertical"))); #endif return true; @@ -903,7 +903,7 @@ bool QGraphicsAnchorLayoutPrivate::replaceVertex(Orientation orientation, Anchor AnchorVertex *otherV = replaceVertex_helper(ad, oldV, newV); #if defined(QT_DEBUG) - ad->name = QString::fromAscii("%1 --to--> %2").arg(ad->from->toString()).arg(ad->to->toString()); + ad->name = QString::fromLatin1("%1 --to--> %2").arg(ad->from->toString()).arg(ad->to->toString()); #endif bool newFeasible; @@ -1766,7 +1766,7 @@ void QGraphicsAnchorLayoutPrivate::addAnchor_helper(QGraphicsLayoutItem *firstIt data->from = v1; data->to = v2; #ifdef QT_DEBUG - data->name = QString::fromAscii("%1 --to--> %2").arg(v1->toString()).arg(v2->toString()); + data->name = QString::fromLatin1("%1 --to--> %2").arg(v1->toString()).arg(v2->toString()); #endif // ### bit to track internal anchors, since inside AnchorData methods // we don't have access to the 'q' pointer. @@ -2999,11 +2999,11 @@ bool QGraphicsAnchorLayoutPrivate::hasConflicts() const #ifdef QT_DEBUG void QGraphicsAnchorLayoutPrivate::dumpGraph(const QString &name) { - QFile file(QString::fromAscii("anchorlayout.%1.dot").arg(name)); + QFile file(QString::fromLatin1("anchorlayout.%1.dot").arg(name)); if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) qWarning("Could not write to %s", file.fileName().toLocal8Bit().constData()); - QString str = QString::fromAscii("digraph anchorlayout {\nnode [shape=\"rect\"]\n%1}"); + QString str = QString::fromLatin1("digraph anchorlayout {\nnode [shape=\"rect\"]\n%1}"); QString dotContents = graph[0].serializeToDot(); dotContents += graph[1].serializeToDot(); file.write(str.arg(dotContents).toLocal8Bit()); diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h index 328461a363..df1db84ee8 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h @@ -181,7 +181,7 @@ struct AnchorData : public QSimplexVariable { #ifdef QT_DEBUG inline QString AnchorData::toString() const { - return QString::fromAscii("Anchor(%1)").arg(name); + return QString::fromLatin1("Anchor(%1)").arg(name); } #endif @@ -193,7 +193,7 @@ struct SequentialAnchorData : public AnchorData type = AnchorData::Sequential; orientation = m_edges.at(0)->orientation; #ifdef QT_DEBUG - name = QString::fromAscii("%1 -- %2").arg(vertices.first()->toString(), vertices.last()->toString()); + name = QString::fromLatin1("%1 -- %2").arg(vertices.first()->toString(), vertices.last()->toString()); #endif } @@ -221,7 +221,7 @@ struct ParallelAnchorData : public AnchorData from = first->from; to = first->to; #ifdef QT_DEBUG - name = QString::fromAscii("%1 | %2").arg(first->toString(), second->toString()); + name = QString::fromLatin1("%1 | %2").arg(first->toString(), second->toString()); #endif } @@ -263,9 +263,9 @@ inline QString AnchorVertex::toString() const return QLatin1String("NULL"); } else if (m_type == Pair) { const AnchorVertexPair *vp = static_cast(this); - return QString::fromAscii("(%1, %2)").arg(vp->m_first->toString()).arg(vp->m_second->toString()); + return QString::fromLatin1("(%1, %2)").arg(vp->m_first->toString()).arg(vp->m_second->toString()); } else if (!m_item) { - return QString::fromAscii("NULL_%1").arg(quintptr(this)); + return QString::fromLatin1("NULL_%1").arg(quintptr(this)); } QString edge; switch (m_edge) { diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index 5ac2269ff1..1f45582442 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -2410,7 +2410,7 @@ void QGraphicsWidget::dumpFocusChain() qWarning("Found a focus chain that is not circular, (next == 0)"); break; } - qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromAscii("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0); + qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromLatin1("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0); if (visited.contains(next)) { qWarning("Already visited this node. However, I expected to dump until I found myself."); break; diff --git a/src/widgets/graphicsview/qgridlayoutengine.cpp b/src/widgets/graphicsview/qgridlayoutengine.cpp index b981ed651a..f45fe44b34 100644 --- a/src/widgets/graphicsview/qgridlayoutengine.cpp +++ b/src/widgets/graphicsview/qgridlayoutengine.cpp @@ -783,11 +783,11 @@ void QGridLayoutRowInfo::dump(int indent) const QString message; if (stretches.value(i).value() >= 0) - message += QString::fromAscii(" stretch %1").arg(stretches.value(i).value()); + message += QString::fromLatin1(" stretch %1").arg(stretches.value(i).value()); if (spacings.value(i).value() >= 0.0) - message += QString::fromAscii(" spacing %1").arg(spacings.value(i).value()); + message += QString::fromLatin1(" spacing %1").arg(spacings.value(i).value()); if (alignments.value(i) != 0) - message += QString::fromAscii(" alignment %1").arg(int(alignments.value(i)), 16); + message += QString::fromLatin1(" alignment %1").arg(int(alignments.value(i)), 16); if (!message.isEmpty() || boxes.value(i) != QGridLayoutBox()) { qDebug("%*s Row %d:%s", indent, "", i, qPrintable(message)); diff --git a/src/widgets/graphicsview/qsimplex_p.cpp b/src/widgets/graphicsview/qsimplex_p.cpp index f5816e2d3c..e6a3dee519 100644 --- a/src/widgets/graphicsview/qsimplex_p.cpp +++ b/src/widgets/graphicsview/qsimplex_p.cpp @@ -356,14 +356,14 @@ void QSimplex::dumpMatrix() QString str(QLatin1String(" ")); for (int j = 0; j < columns; ++j) - str += QString::fromAscii(" <%1 >").arg(j, 2); + str += QString::fromLatin1(" <%1 >").arg(j, 2); qDebug("%s", qPrintable(str)); for (int i = 0; i < rows; ++i) { - str = QString::fromAscii("Row %1:").arg(i, 2); + str = QString::fromLatin1("Row %1:").arg(i, 2); qreal *row = matrix + i * columns; for (int j = 0; j < columns; ++j) - str += QString::fromAscii("%1").arg(row[j], 7, 'f', 2); + str += QString::fromLatin1("%1").arg(row[j], 7, 'f', 2); qDebug("%s", qPrintable(str)); } qDebug("------------------------\n"); diff --git a/src/widgets/graphicsview/qsimplex_p.h b/src/widgets/graphicsview/qsimplex_p.h index 00ed0b9957..0208ce5537 100644 --- a/src/widgets/graphicsview/qsimplex_p.h +++ b/src/widgets/graphicsview/qsimplex_p.h @@ -123,22 +123,22 @@ struct QSimplexConstraint #ifdef QT_DEBUG QString toString() { QString result; - result += QString::fromAscii("-- QSimplexConstraint %1 --").arg(quintptr(this), 0, 16); + result += QString::fromLatin1("-- QSimplexConstraint %1 --").arg(quintptr(this), 0, 16); QHash::const_iterator iter; for (iter = variables.constBegin(); iter != variables.constEnd(); ++iter) { - result += QString::fromAscii(" %1 x %2").arg(iter.value()).arg(quintptr(iter.key()), 0, 16); + result += QString::fromLatin1(" %1 x %2").arg(iter.value()).arg(quintptr(iter.key()), 0, 16); } switch (ratio) { case LessOrEqual: - result += QString::fromAscii(" (less) <= %1").arg(constant); + result += QString::fromLatin1(" (less) <= %1").arg(constant); break; case MoreOrEqual: - result += QString::fromAscii(" (more) >= %1").arg(constant); + result += QString::fromLatin1(" (more) >= %1").arg(constant); break; default: - result += QString::fromAscii(" (eqal) == %1").arg(constant); + result += QString::fromLatin1(" (eqal) == %1").arg(constant); } return result; -- cgit v1.2.3