Whitespace cleanup: remove trailing whitespace

Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.

Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp

Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.

Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Axel Waggershauser 2013-03-15 00:42:15 +01:00 committed by The Qt Project
parent 72367a94a7
commit b11317a643
594 changed files with 3518 additions and 3541 deletions

View File

@ -143,4 +143,3 @@ void Images::finished()
}
#endif // QT_NO_CONCURRENT

View File

@ -61,7 +61,7 @@ QMAKE_CFLAGS_WARN_ON =
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = +O1
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB = +Z
QMAKE_CFLAGS_SHLI = +Z
QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_THREAD = -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -D_REENTRANT -mt
@ -74,7 +74,7 @@ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_STATIC_LB = $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = -D_POSIX_C_SOURCE=199506L -D_REENTRANT -mt

View File

@ -56,7 +56,7 @@ QMAKE_LINK_SHLIB = icpc
QMAKE_LFLAGS = -headerpad_max_install_names
QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB = -single_module -dynamiclib
QMAKE_LFLAGS_SHLIB = -ingle_module -dynamiclib
QMAKE_LFLAGS_INCREMENTAL = -undefined suppress -flat_namespace
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}

View File

@ -100,7 +100,6 @@ void tst_QtConcurrentFilter::filter()
QCOMPARE(vector, QVector<int>() << 2 << 4);
}
// function
{
QList<int> list;
@ -554,7 +553,6 @@ void tst_QtConcurrentFilter::filteredReduced()
int sum = QtConcurrent::filteredReduced<int>(vector, KeepEvenIntegers(), IntSumReduce());
QCOMPARE(sum, 6);
}
{
int sum = QtConcurrent::filteredReduced<int>(list.begin(),
list.end(),
@ -1411,7 +1409,6 @@ void tst_QtConcurrentFilter::resultAt()
QFuture<int> future = QtConcurrent::filtered(ints, filterfn);
future.waitForFinished();
for (int i = 0; i < future.resultCount(); ++i) {
QCOMPARE(future.resultAt(i), ints.at(i * 2 + 1));
}

View File

@ -268,7 +268,6 @@ void tst_QPicture::boundaryValues_data()
QTest::newRow("min x, max y") << INT_MIN << INT_MAX;
QTest::newRow("max x, min y") << INT_MAX << INT_MIN;
}
void tst_QPicture::boundaryValues()
@ -283,8 +282,6 @@ void tst_QPicture::boundaryValues()
painter.drawPoint(QPoint(x, y));
painter.end();
}

View File

@ -105,7 +105,6 @@ void tst_QSql::cleanup()
{
}
// this is a very basic test for drivers that cannot create/delete tables
// it can be used while developing new drivers,
// it's original purpose is to test ODBC Text datasources that are basically
@ -120,8 +119,7 @@ void tst_QSql::basicDriverTest()
tst_Databases dbs;
dbs.open();
foreach( const QString& dbName, dbs.dbNames )
{
foreach (const QString& dbName, dbs.dbNames) {
QSqlDatabase db = QSqlDatabase::database(dbName);
QVERIFY_SQL(db, isValid());

View File

@ -43,16 +43,20 @@
#include <QObject>
class GadgetWithNoEnums {
class GadgetWithNoEnums
{
Q_GADGET
public:
GadgetWithNoEnums() {}
virtual ~GadgetWithNoEnums() {}
};
class DerivedGadgetWithEnums : public GadgetWithNoEnums {
class DerivedGadgetWithEnums : public GadgetWithNoEnums
{
Q_GADGET
Q_ENUMS( FooEnum )
public:
enum FooEnum { FooValue };
DerivedGadgetWithEnums() {}

View File

@ -45,8 +45,10 @@
#include <QObject>
class InlineSlotsWithThrowDeclaration : public QObject {
class InlineSlotsWithThrowDeclaration : public QObject
{
Q_OBJECT
public slots:
void a() throw() { }
void b() const throw() { }

View File

@ -40,6 +40,7 @@
****************************************************************************/
#include <QApplication>
#include <stdio.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);

View File

@ -260,7 +260,6 @@ void AbstractItemView::rowsAboutToBeInserted(const QModelIndex &index, int start
// TODO implement
}
/*virtual*/
void AbstractItemView::rowsAboutToBeRemoved(const QModelIndex &index,int start, int end)
{
@ -396,8 +395,7 @@ void AbstractItemView::scrollContentsBy(qreal dx, qreal dy)
AbstractViewItem *item = m_container->itemAt(0);
if (item && item->size().height() > 1) {
itemH = item->size().height();
}
else if(item && item->preferredHeight() > 1) {
} else if (item && item->preferredHeight() > 1) {
itemH = item->preferredHeight();
}
@ -407,8 +405,7 @@ void AbstractItemView::scrollContentsBy(qreal dx, qreal dy)
if ((vpy+m_container->size().height()-dy > pos().y()+size().height()) &&
(qAbs(dy) < itemH) && (vpy-dy <= 0)) {
m_container->setPos(vpx, vpy-dy);
}
else {
} else {
qreal vPos = verticalScrollBar()->sliderPosition();
int startRow = m_model->index(vPos/itemH, 0).row();
int itemsInContainer = m_container->itemCount();

View File

@ -59,7 +59,6 @@ BackgroundItem::BackgroundItem(const QString &filename, QGraphicsWidget *parent)
BackgroundItem::~BackgroundItem()
{
}
void BackgroundItem::resizeEvent(QGraphicsSceneResizeEvent *event)

View File

@ -74,7 +74,6 @@ DummyDataGenerator::DummyDataGenerator() : m_isMale(false)
DummyDataGenerator::~DummyDataGenerator()
{
}
void DummyDataGenerator::Reset()
@ -131,8 +130,7 @@ QString DummyDataGenerator::randomIconItem()
QString DummyDataGenerator::randomStatusItem()
{
switch ( qrand()%3 )
{
switch (qrand()%3) {
case 0: return Theme::p()->pixmapPath() + "contact_status_online.svg";
case 1: return Theme::p()->pixmapPath() + "contact_status_offline.svg";
case 2: return Theme::p()->pixmapPath() + "contact_status_idle.svg";

View File

@ -81,12 +81,10 @@ void Label::resizeEvent(QGraphicsSceneResizeEvent *event)
QSizeF Label::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
{
switch (which)
{
switch (which) {
case Qt::MinimumSize:
// fall thru
case Qt::PreferredSize:
{
case Qt::PreferredSize: {
QFontMetricsF fm(m_textItem->font());
return QSizeF(fm.width(m_textItem->text()), fm.height());
}

View File

@ -64,11 +64,11 @@ struct ItemData
Q_DECLARE_METATYPE(ItemData);
ListItem::ListItem(QGraphicsWidget *parent)
: GvbWidget(parent),
m_txtlayout(new QGraphicsGridLayout()),
m_layout(new QGraphicsLinearLayout(Qt::Horizontal)),
m_liconlayout(new QGraphicsLinearLayout(Qt::Horizontal)),
m_riconlayout(new QGraphicsLinearLayout(Qt::Horizontal))
: GvbWidget(parent)
, m_txtlayout(new QGraphicsGridLayout())
, m_layout(new QGraphicsLinearLayout(Qt::Horizontal))
, m_liconlayout(new QGraphicsLinearLayout(Qt::Horizontal))
, m_riconlayout(new QGraphicsLinearLayout(Qt::Horizontal))
, m_fonts()
, m_borderPen(Qt::NoPen)
, m_backgroundBrush(QBrush())
@ -110,18 +110,15 @@ void ListItem::setIcon( IconItem *iconItem, const IconItemPos iconPos )
if (m_liconlayout->count() > 0 && m_liconlayout->itemAt(0)) {
delete m_liconlayout->itemAt(0);
m_liconlayout->addItem(iconItem);
}
else {
} else {
m_liconlayout->addItem(iconItem);
}
m_liconlayout->itemAt(0)->setMaximumSize(58, 58);
}
else if (iconPos == RightIcon) {
} else if (iconPos == RightIcon) {
if (m_riconlayout->count() > 0 && m_riconlayout->itemAt(0)) {
delete m_riconlayout->itemAt(0);
m_riconlayout->addItem(iconItem);
}
else {
} else {
m_riconlayout->addItem(iconItem);
}
m_riconlayout->itemAt(0)->setMaximumSize(22, 22);
@ -249,8 +246,7 @@ void ListItem::setText(const QString str, const TextPos position)
m_txtlayout->addItem(label, position, 0);
if (m_fonts.contains(position))
label->setFont(m_fonts[position]);
}
else {
} else {
Label *titem = static_cast<Label *>(item);
titem->setText(str);
}
@ -290,14 +286,12 @@ void ListItem::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option
QRectF r = rect();
r.adjust(penWidth, penWidth, -penWidth, -penWidth);
if (m_borderPen != Qt::NoPen)
{
if (m_borderPen != Qt::NoPen) {
painter->setPen(m_borderPen);
painter->drawRoundedRect(r, m_rounding.width(), m_rounding.height());
}
if (m_backgroundBrush != Qt::NoBrush)
{
if (m_backgroundBrush != Qt::NoBrush) {
painter->setPen(Qt::NoPen);
painter->setBrush(m_backgroundBrush);
painter->setOpacity(m_backgroundOpacity);

View File

@ -72,8 +72,10 @@ public:
void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
QRectF boundingRect() const;
void resizeEvent(QGraphicsSceneResizeEvent *event);
inline QPoint getStatusBarLocation() { return m_topBarStatusBarMiddlePoint +
m_topBarStatusBarMiddle.rect().bottomLeft(); }
inline QPoint getStatusBarLocation()
{
return m_topBarStatusBarMiddlePoint + m_topBarStatusBarMiddle.rect().bottomLeft();
}
public slots:
void themeChange();
@ -89,7 +91,6 @@ private:
const QSizeF &constraint = QSizeF()) const;
void setDefaultSizes();
private:
Q_DISABLE_COPY(TopBar)

View File

@ -86,7 +86,6 @@ void WebViewPrivate::adjustSize()
else
q->horizontalScrollBar()->setSliderSize(0.0);
if (h > q->viewport()->boundingRect().height())
q->verticalScrollBar()->setSliderSize(h);
else
@ -131,7 +130,6 @@ void WebViewPrivate::_q_motionEnded()
WebViewCache::WebViewCache(QGraphicsWebView *webView)
: m_webView(webView)
{
}
WebViewCache::~WebViewCache()

View File

@ -42,7 +42,6 @@
#include <QtWidgets>
#include "../shared/shared.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
@ -58,7 +57,6 @@ int main(int argc, char **argv)
scrollView.resize(600, 400);
scrollView.show();
return app.exec();
}

View File

@ -70,7 +70,6 @@ int main(int argc, char **argv)
tableWidget.resize(400, 600);
tableWidget.show();
return app.exec();
}

View File

@ -45,11 +45,12 @@
class MyWidget : public QWidget
{
public:
MyWidget() : QWidget() {
MyWidget() : QWidget()
{
setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_StaticContents); }
setAttribute(Qt::WA_StaticContents);
}
protected:
void paintEvent(QPaintEvent *e) { qDebug() << e->rect(); }
};

View File

@ -288,7 +288,6 @@ DFA NFA::toDFA() const
if (transition.key() == Epsilon && epsilonStates.contains(transition.value()))
epsilonStates.insert(i, epsilonStates.value(transition.value()));
}
} while (lastCount != epsilonStates.count());
for (int i = 0; i < states.count(); ++i) {
@ -313,7 +312,6 @@ DFA NFA::toDFA() const
*/
}
QSet<InputType> validInput;
foreach (const State &s, states)
for (TransitionMap::ConstIterator it = s.transitions.constBegin(),
@ -504,5 +502,3 @@ DFA DFA::minimize() const
return *this;
}