Fix coding style for else statements

Change-Id: I1309db70e98d678e150388c76ce665e988fdf081
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Orgad Shaneh
2013-07-17 00:01:45 +03:00
committed by Orgad Shaneh
parent c67f7f6349
commit ad9e7ccab6
101 changed files with 331 additions and 470 deletions

View File

@@ -511,17 +511,17 @@ QString Context2D::textBaseline()
void Context2D::setTextBaseline(const QString &baseline)
{
if (baseline==QLatin1String("alphabetic"))
if (baseline==QLatin1String("alphabetic")) {
m_state.textBaseline = Context2D::Alphabetic;
else if (baseline == QLatin1String("hanging"))
} else if (baseline == QLatin1String("hanging")) {
m_state.textBaseline = Context2D::Hanging;
else if (baseline == QLatin1String("top"))
} else if (baseline == QLatin1String("top")) {
m_state.textBaseline = Context2D::Top;
else if (baseline == QLatin1String("bottom"))
} else if (baseline == QLatin1String("bottom")) {
m_state.textBaseline = Context2D::Bottom;
else if (baseline == QLatin1String("middle"))
} else if (baseline == QLatin1String("middle")) {
m_state.textBaseline = Context2D::Middle;
else {
} else {
m_state.textBaseline = Context2D::Alphabetic;
qWarning() << (QLatin1String("Context2D: invalid baseline:") + baseline);
}
@@ -550,17 +550,17 @@ QString Context2D::textAlign()
void Context2D::setTextAlign(const QString &baseline)
{
if (baseline==QLatin1String("start"))
if (baseline==QLatin1String("start")) {
m_state.textAlign = Context2D::Start;
else if (baseline == QLatin1String("end"))
} else if (baseline == QLatin1String("end")) {
m_state.textAlign = Context2D::End;
else if (baseline == QLatin1String("left"))
} else if (baseline == QLatin1String("left")) {
m_state.textAlign = Context2D::Left;
else if (baseline == QLatin1String("right"))
} else if (baseline == QLatin1String("right")) {
m_state.textAlign = Context2D::Right;
else if (baseline == QLatin1String("center"))
} else if (baseline == QLatin1String("center")) {
m_state.textAlign = Context2D::Center;
else {
} else {
m_state.textAlign= Context2D::Start;
qWarning("Context2D: invalid text align");
}
@@ -574,11 +574,11 @@ void Context2D::setFont(const QString &fontString)
// ### this is simplified and incomplete
QStringList tokens = fontString.split(QLatin1Char(QLatin1Char(' ')));
foreach (const QString &token, tokens) {
if (token == QLatin1String("italic"))
if (token == QLatin1String("italic")) {
font.setItalic(true);
else if (token == QLatin1String("bold"))
} else if (token == QLatin1String("bold")) {
font.setBold(true);
else if (token.endsWith(QLatin1String("px"))) {
} else if (token.endsWith(QLatin1String("px"))) {
QString number = token;
number.remove(QLatin1String("px"));
#ifdef Q_OS_MACX
@@ -589,8 +589,9 @@ void Context2D::setFont(const QString &fontString)
#else
font.setPointSizeF(number.trimmed().toFloat());
#endif
} else
} else {
font.setFamily(token);
}
}
m_state.font = font;
m_state.flags |= DirtyFont;

View File

@@ -310,9 +310,9 @@ void QmlProfilerDataModel::addRangedEvent(int type, int bindingType, qint64 star
setState(AcquiringData);
// generate details string
if (data.isEmpty())
if (data.isEmpty()) {
details = tr("Source code not available.");
else {
} else {
details = data.join(QLatin1String(" ")).replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified();
QRegExp rewrite(QLatin1String("\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)"));
bool match = rewrite.exactMatch(details);
@@ -613,18 +613,14 @@ qint64 QmlProfilerDataModel::firstTimeMark() const
{
if (d->startInstanceList.isEmpty())
return 0;
else {
return d->startInstanceList[0].startTime;
}
return d->startInstanceList[0].startTime;
}
qint64 QmlProfilerDataModel::lastTimeMark() const
{
if (d->endInstanceList.isEmpty())
return 0;
else {
return d->endInstanceList.last().endTime;
}
return d->endInstanceList.last().endTime;
}
////////////////////////////////////////////////////////////////////////////////////
@@ -1046,9 +1042,9 @@ void QmlProfilerDataModel::QmlProfilerDataModelPrivate::computeNestingDepth()
for (int i = 0; i < endInstanceList.count(); i++) {
int type = endInstanceList[i].description->eventType;
int nestingInType = startInstanceList[endInstanceList[i].startTimeIndex].nestingLevel;
if (!nestingDepth.contains(type))
if (!nestingDepth.contains(type)) {
nestingDepth[type] = nestingInType;
else {
} else {
int nd = nestingDepth[type];
nestingDepth[type] = nd > nestingInType ? nd : nestingInType;
}

View File

@@ -970,8 +970,7 @@ void QmlProfilerEventsParentsAndChildrenView::displayEvent(int eventId)
if (isChildren) {
QList <QV8EventSub *> childrenList = v8event->childrenHash.values();
rebuildTree((QObject *)&childrenList);
}
else {
} else {
QList <QV8EventSub *> parentList = v8event->parentHash.values();
rebuildTree((QObject *)&parentList);
}
@@ -982,8 +981,7 @@ void QmlProfilerEventsParentsAndChildrenView::displayEvent(int eventId)
if (isChildren) {
QList <QmlRangeEventRelative *> childrenList = qmlEvent->childrenHash.values();
rebuildTree((QObject *)&childrenList);
}
else {
} else {
QList <QmlRangeEventRelative *> parentList = qmlEvent->parentHash.values();
rebuildTree((QObject *)&parentList);
}