Removing a few unneeded "? true : false"
Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
e5f528fb0e
commit
106487387d
@ -97,7 +97,7 @@ bool CeSdkHandler::parse()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_list.size() > 0 ? true : false;
|
return m_list.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CeSdkHandler::fixPaths(QString path) const
|
QString CeSdkHandler::fixPaths(QString path) const
|
||||||
|
@ -391,9 +391,9 @@ void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat)
|
|||||||
Q_ASSERT(reg->categories.contains(cat));
|
Q_ASSERT(reg->categories.contains(cat));
|
||||||
QtMsgType enableForLevel = reg->categories.value(cat);
|
QtMsgType enableForLevel = reg->categories.value(cat);
|
||||||
|
|
||||||
bool debug = (enableForLevel == QtDebugMsg) ? true : false;
|
bool debug = (enableForLevel == QtDebugMsg);
|
||||||
bool warning = (enableForLevel <= QtWarningMsg) ? true : false;
|
bool warning = (enableForLevel <= QtWarningMsg);
|
||||||
bool critical = (enableForLevel <= QtCriticalMsg) ? true : false;
|
bool critical = (enableForLevel <= QtCriticalMsg);
|
||||||
|
|
||||||
// hard-wired implementation of
|
// hard-wired implementation of
|
||||||
// qt.*.debug=false
|
// qt.*.debug=false
|
||||||
|
@ -1163,7 +1163,7 @@ bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const
|
|||||||
timeout.tv_sec = 0;
|
timeout.tv_sec = 0;
|
||||||
timeout.tv_usec = 5000;
|
timeout.tv_usec = 5000;
|
||||||
int available = ::select(1, &readS, 0, 0, &timeout);
|
int available = ::select(1, &readS, 0, 0, &timeout);
|
||||||
result = available > 0 ? true : false;
|
result = available > 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (QNATIVESOCKETENGINE_DEBUG)
|
#if defined (QNATIVESOCKETENGINE_DEBUG)
|
||||||
|
@ -163,7 +163,7 @@ static bool writeIconDirEntry(QIODevice *iodev, const ICONDIRENTRY &iconEntry)
|
|||||||
qToLittleEndian<quint16>(iconEntry.wBitCount, &tmp[6]);
|
qToLittleEndian<quint16>(iconEntry.wBitCount, &tmp[6]);
|
||||||
qToLittleEndian<quint32>(iconEntry.dwBytesInRes, &tmp[8]);
|
qToLittleEndian<quint32>(iconEntry.dwBytesInRes, &tmp[8]);
|
||||||
qToLittleEndian<quint32>(iconEntry.dwImageOffset, &tmp[12]);
|
qToLittleEndian<quint32>(iconEntry.dwImageOffset, &tmp[12]);
|
||||||
return (iodev->write((char*)tmp, ICONDIRENTRY_SIZE) == ICONDIRENTRY_SIZE) ? true : false;
|
return iodev->write((char*)tmp, ICONDIRENTRY_SIZE) == ICONDIRENTRY_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -190,7 +190,7 @@ static bool writeIconDir(QIODevice *iodev, const ICONDIR &iconDir)
|
|||||||
qToLittleEndian(iconDir.idReserved, tmp);
|
qToLittleEndian(iconDir.idReserved, tmp);
|
||||||
qToLittleEndian(iconDir.idType, &tmp[2]);
|
qToLittleEndian(iconDir.idType, &tmp[2]);
|
||||||
qToLittleEndian(iconDir.idCount, &tmp[4]);
|
qToLittleEndian(iconDir.idCount, &tmp[4]);
|
||||||
return (iodev->write((char*)tmp, 6) == 6) ? true : false;
|
return iodev->write((char*)tmp, 6) == 6;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ static bool writeBMPInfoHeader(QIODevice *iodev, const BMP_INFOHDR &header)
|
|||||||
qToLittleEndian<quint32>(header.biClrUsed, &tmp[32]);
|
qToLittleEndian<quint32>(header.biClrUsed, &tmp[32]);
|
||||||
qToLittleEndian<quint32>(header.biClrImportant, &tmp[36]);
|
qToLittleEndian<quint32>(header.biClrImportant, &tmp[36]);
|
||||||
|
|
||||||
return (iodev->write((char*)tmp, BMP_INFOHDR_SIZE) == BMP_INFOHDR_SIZE) ? true : false;
|
return iodev->write((char*)tmp, BMP_INFOHDR_SIZE) == BMP_INFOHDR_SIZE;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -881,7 +881,7 @@ bool QtIcoHandler::jumpToImage(int imageNumber)
|
|||||||
m_currentIconIndex = imageNumber;
|
m_currentIconIndex = imageNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (imageNumber < imageCount()) ? true : false;
|
return imageNumber < imageCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \reimp
|
/*! \reimp
|
||||||
|
@ -1679,7 +1679,7 @@ QSqlRecord QIBaseDriver::record(const QString& tablename) const
|
|||||||
f.setLength(q.value(2).toInt());
|
f.setLength(q.value(2).toInt());
|
||||||
f.setPrecision(0);
|
f.setPrecision(0);
|
||||||
}
|
}
|
||||||
f.setRequired(q.value(5).toInt() > 0 ? true : false);
|
f.setRequired(q.value(5).toInt() > 0);
|
||||||
f.setSqlType(type);
|
f.setSqlType(type);
|
||||||
|
|
||||||
rec.append(f);
|
rec.append(f);
|
||||||
|
@ -162,7 +162,7 @@ bool QTestElementAttribute::setPair(QTest::AttributeIndex index, const char *val
|
|||||||
attributeIndex = index;
|
attributeIndex = index;
|
||||||
attributeValue = qstrdup(value);
|
attributeValue = qstrdup(value);
|
||||||
|
|
||||||
return (attributeValue!=0) ? true:false;
|
return attributeValue != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -1101,7 +1101,7 @@ void Config::load(Location location, const QString& fileName)
|
|||||||
|
|
||||||
ConfigVarMultimap::Iterator i;
|
ConfigVarMultimap::Iterator i;
|
||||||
i = configVars_.insert(*key, ConfigVar(*key, rhsValues, QDir::currentPath(), keyLoc));
|
i = configVars_.insert(*key, ConfigVar(*key, rhsValues, QDir::currentPath(), keyLoc));
|
||||||
i.value().plus_ = (plus ? true : false);
|
i.value().plus_ = plus;
|
||||||
++key;
|
++key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1076,7 +1076,7 @@ bool CppCodeParser::skipTo(int target)
|
|||||||
{
|
{
|
||||||
while ((tok != Tok_Eoi) && (tok != target))
|
while ((tok != Tok_Eoi) && (tok != target))
|
||||||
readToken();
|
readToken();
|
||||||
return (tok == target ? true : false);
|
return tok == target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -3471,7 +3471,7 @@ void DomWidget::read(QXmlStreamReader &reader)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (name == QStringLiteral("native")) {
|
if (name == QStringLiteral("native")) {
|
||||||
setAttributeNative((attribute.value().toString() == QStringLiteral("true") ? true : false));
|
setAttributeNative(attribute.value().toString() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
|
reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
|
||||||
@ -4845,23 +4845,23 @@ void DomFont::read(QXmlStreamReader &reader)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("italic")) {
|
if (tag == QStringLiteral("italic")) {
|
||||||
setElementItalic((reader.readElementText() == QStringLiteral("true") ? true : false));
|
setElementItalic(reader.readElementText() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("bold")) {
|
if (tag == QStringLiteral("bold")) {
|
||||||
setElementBold((reader.readElementText() == QStringLiteral("true") ? true : false));
|
setElementBold(reader.readElementText() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("underline")) {
|
if (tag == QStringLiteral("underline")) {
|
||||||
setElementUnderline((reader.readElementText() == QStringLiteral("true") ? true : false));
|
setElementUnderline(reader.readElementText() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("strikeout")) {
|
if (tag == QStringLiteral("strikeout")) {
|
||||||
setElementStrikeOut((reader.readElementText() == QStringLiteral("true") ? true : false));
|
setElementStrikeOut(reader.readElementText() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("antialiasing")) {
|
if (tag == QStringLiteral("antialiasing")) {
|
||||||
setElementAntialiasing((reader.readElementText() == QStringLiteral("true") ? true : false));
|
setElementAntialiasing(reader.readElementText() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("stylestrategy")) {
|
if (tag == QStringLiteral("stylestrategy")) {
|
||||||
@ -4869,7 +4869,7 @@ void DomFont::read(QXmlStreamReader &reader)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tag == QStringLiteral("kerning")) {
|
if (tag == QStringLiteral("kerning")) {
|
||||||
setElementKerning((reader.readElementText() == QStringLiteral("true") ? true : false));
|
setElementKerning(reader.readElementText() == QStringLiteral("true"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
reader.raiseError(QStringLiteral("Unexpected element ") + tag);
|
reader.raiseError(QStringLiteral("Unexpected element ") + tag);
|
||||||
|
@ -198,7 +198,7 @@ int QAccessibleMenuItem::indexOfChild(const QAccessibleInterface * child) const
|
|||||||
|
|
||||||
bool QAccessibleMenuItem::isValid() const
|
bool QAccessibleMenuItem::isValid() const
|
||||||
{
|
{
|
||||||
return m_action && m_owner ? true : false;
|
return m_action && m_owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAccessibleInterface *QAccessibleMenuItem::parent() const
|
QAccessibleInterface *QAccessibleMenuItem::parent() const
|
||||||
|
@ -295,7 +295,7 @@ QSize QComboBoxPrivate::recomputeSizeHint(QSize &sh) const
|
|||||||
{
|
{
|
||||||
Q_Q(const QComboBox);
|
Q_Q(const QComboBox);
|
||||||
if (!sh.isValid()) {
|
if (!sh.isValid()) {
|
||||||
bool hasIcon = sizeAdjustPolicy == QComboBox::AdjustToMinimumContentsLengthWithIcon ? true : false;
|
bool hasIcon = sizeAdjustPolicy == QComboBox::AdjustToMinimumContentsLengthWithIcon;
|
||||||
int count = q->count();
|
int count = q->count();
|
||||||
QSize iconSize = q->iconSize();
|
QSize iconSize = q->iconSize();
|
||||||
const QFontMetrics &fm = q->fontMetrics();
|
const QFontMetrics &fm = q->fontMetrics();
|
||||||
|
@ -1466,7 +1466,7 @@ QMdiSubWindow *QMdiAreaPrivate::nextVisibleSubWindow(int increaseFactor, QMdiAre
|
|||||||
|
|
||||||
// Find the index for the current sub-window in the given activation order
|
// Find the index for the current sub-window in the given activation order
|
||||||
const int indexToCurrent = subWindows.indexOf(current);
|
const int indexToCurrent = subWindows.indexOf(current);
|
||||||
const bool increasing = increaseFactor > 0 ? true : false;
|
const bool increasing = increaseFactor > 0;
|
||||||
|
|
||||||
// and use that index + increseFactor as a candidate.
|
// and use that index + increseFactor as a candidate.
|
||||||
int index = -1;
|
int index = -1;
|
||||||
@ -2553,7 +2553,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
|
|||||||
if (!area)
|
if (!area)
|
||||||
return QAbstractScrollArea::eventFilter(object, event);
|
return QAbstractScrollArea::eventFilter(object, event);
|
||||||
|
|
||||||
const bool keyPress = (event->type() == QEvent::KeyPress) ? true : false;
|
const bool keyPress = (event->type() == QEvent::KeyPress);
|
||||||
|
|
||||||
// 1) Ctrl-Tab once -> activate the previously active window.
|
// 1) Ctrl-Tab once -> activate the previously active window.
|
||||||
// 2) Ctrl-Tab (Tab, Tab, ...) -> iterate through all windows (activateNextSubWindow()).
|
// 2) Ctrl-Tab (Tab, Tab, ...) -> iterate through all windows (activateNextSubWindow()).
|
||||||
|
@ -2188,7 +2188,7 @@ void QWidgetTextControlPrivate::editFocusEvent(QEvent *e)
|
|||||||
setBlinkingCursorEnabled(false);
|
setBlinkingCursorEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
hasEditFocus = e->type() == QEvent::EnterEditFocus ? true : false;
|
hasEditFocus = e->type() == QEvent::EnterEditFocus;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -166,8 +166,7 @@ void tst_Spdy::settingsAndNegotiation()
|
|||||||
QFETCH(QByteArray, expectedProtocol);
|
QFETCH(QByteArray, expectedProtocol);
|
||||||
|
|
||||||
#ifndef QT_NO_OPENSSL
|
#ifndef QT_NO_OPENSSL
|
||||||
bool expectedSpdyUsed = (expectedProtocol == QSslConfiguration::NextProtocolSpdy3_0)
|
bool expectedSpdyUsed = (expectedProtocol == QSslConfiguration::NextProtocolSpdy3_0);
|
||||||
? true : false;
|
|
||||||
QCOMPARE(reply->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool(), expectedSpdyUsed);
|
QCOMPARE(reply->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool(), expectedSpdyUsed);
|
||||||
#endif // QT_NO_OPENSSL
|
#endif // QT_NO_OPENSSL
|
||||||
|
|
||||||
|
@ -984,7 +984,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
|
|||||||
// in
|
// in
|
||||||
QTest::mouseMove(&view, QPoint(50, 50));
|
QTest::mouseMove(&view, QPoint(50, 50));
|
||||||
QSKIP("QTBUG-25294");
|
QSKIP("QTBUG-25294");
|
||||||
QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget ? true : false);
|
QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget);
|
||||||
// ### this attribute isn't supported
|
// ### this attribute isn't supported
|
||||||
QCOMPARE(widget->enterCount, hasWidget ? 1 : 0);
|
QCOMPARE(widget->enterCount, hasWidget ? 1 : 0);
|
||||||
QCOMPARE(widget->hoverEnter, (hasWidget && hoverEnabled) ? 1 : 0);
|
QCOMPARE(widget->hoverEnter, (hasWidget && hoverEnabled) ? 1 : 0);
|
||||||
@ -1366,7 +1366,7 @@ void tst_QGraphicsProxyWidget::sizeHint()
|
|||||||
void tst_QGraphicsProxyWidget::sizePolicy()
|
void tst_QGraphicsProxyWidget::sizePolicy()
|
||||||
{
|
{
|
||||||
for (int p = 0; p < 2; ++p) {
|
for (int p = 0; p < 2; ++p) {
|
||||||
bool hasWidget = (p == 0 ? true : false);
|
bool hasWidget = (p == 0);
|
||||||
SubQGraphicsProxyWidget proxy;
|
SubQGraphicsProxyWidget proxy;
|
||||||
QWidget *widget = new QWidget;
|
QWidget *widget = new QWidget;
|
||||||
QSizePolicy proxyPol(QSizePolicy::Maximum, QSizePolicy::Expanding);
|
QSizePolicy proxyPol(QSizePolicy::Maximum, QSizePolicy::Expanding);
|
||||||
|
@ -1080,7 +1080,7 @@ public:
|
|||||||
|
|
||||||
bool isEditingState(QListWidgetItem *item) {
|
bool isEditingState(QListWidgetItem *item) {
|
||||||
Q_UNUSED(item);
|
Q_UNUSED(item);
|
||||||
return (QListWidget::state() == QListWidget::EditingState ? true : false);
|
return QListWidget::state() == QListWidget::EditingState;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -381,8 +381,7 @@ void tst_qnetworkreply::spdy()
|
|||||||
|
|
||||||
QFETCH(QByteArray, expectedProtocol);
|
QFETCH(QByteArray, expectedProtocol);
|
||||||
|
|
||||||
bool expectedSpdyUsed = (expectedProtocol == QSslConfiguration::NextProtocolSpdy3_0)
|
bool expectedSpdyUsed = (expectedProtocol == QSslConfiguration::NextProtocolSpdy3_0);
|
||||||
? true : false;
|
|
||||||
QCOMPARE(reply->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool(), expectedSpdyUsed);
|
QCOMPARE(reply->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool(), expectedSpdyUsed);
|
||||||
|
|
||||||
QCOMPARE(metaDataChangedSpy.count(), 1);
|
QCOMPARE(metaDataChangedSpy.count(), 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user