expand tabs and related whitespace fixes in *.{cpp,h,qdoc}

the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Oswald Buddenhagen 2014-01-13 15:48:44 +01:00 committed by The Qt Project
parent 81157d2374
commit 882bf3475c
240 changed files with 5972 additions and 5972 deletions

View File

@ -49,7 +49,7 @@
StyleWidget::StyleWidget(QWidget *parent)
: QFrame(parent)
{
m_ui.setupUi(this);
m_ui.setupUi(this);
}

View File

@ -73,8 +73,8 @@ Dialog::Dialog(QWidget *parent)
ui.setupUi(this);
connect(ui.loadFromFileButton, SIGNAL(clicked()), SLOT(loadFromFile()));
connect(ui.loadFromSharedMemoryButton,
SIGNAL(clicked()),
SLOT(loadFromMemory()));
SIGNAL(clicked()),
SLOT(loadFromMemory()));
setWindowTitle(tr("SharedMemory Example"));
}
//! [0]
@ -155,7 +155,7 @@ void Dialog::loadFromMemory()
{
if (!sharedMemory.attach()) {
ui.label->setText(tr("Unable to attach to shared memory segment.\n" \
"Load an image first."));
"Load an image first."));
return;
}

View File

@ -99,9 +99,9 @@ void Dialog::start()
QMessageBox::StandardButton ret = QMessageBox::critical(this,
tr("Loopback"),
tr("Unable to start the test: %1.")
.arg(tcpServer.errorString()),
.arg(tcpServer.errorString()),
QMessageBox::Retry
| QMessageBox::Cancel);
| QMessageBox::Cancel);
if (ret == QMessageBox::Cancel)
return;
}

View File

@ -50,8 +50,8 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
if (!QSslSocket::supportsSsl()) {
QMessageBox::information(0, "Secure Socket Client",
"This system does not support OpenSSL.");
QMessageBox::information(0, "Secure Socket Client",
"This system does not support OpenSSL.");
return -1;
}

View File

@ -215,7 +215,7 @@ void PeerWireClient::sendPieceList(const QBitArray &bitField)
// Don't send the bitfield if it's all zeros.
if (bitField.count(true) == 0)
return;
return;
int bitFieldSize = bitField.size();
int size = (bitFieldSize + 7) / 8;

View File

@ -64,7 +64,7 @@ void TorrentServer::removeClient(TorrentClient *client)
void TorrentServer::incomingConnection(qintptr socketDescriptor)
{
PeerWireClient *client =
new PeerWireClient(ConnectionManager::instance()->clientId(), this);
new PeerWireClient(ConnectionManager::instance()->clientId(), this);
if (client->setSocketDescriptor(socketDescriptor)) {
if (ConnectionManager::instance()->canAddConnection() && !clients.isEmpty()) {

View File

@ -112,20 +112,20 @@ void GLWidget::initializeGL()
{
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
// draw cube background
// draw cube background
glPushMatrix();
glLoadIdentity();
glTranslatef(0.5f, 0.5f, -2.0f);
glDisable(GL_TEXTURE_2D);
glEnableClientState(GL_COLOR_ARRAY);
glVertexPointer(2, GL_INT, 0, faceArray);
glDrawArrays(GL_QUADS, 0, 4);
glVertexPointer(3, GL_INT, 0, cubeArray);
glDisableClientState(GL_COLOR_ARRAY);
glEnable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_2D);
glEnableClientState(GL_COLOR_ARRAY);
glVertexPointer(2, GL_INT, 0, faceArray);
glDrawArrays(GL_QUADS, 0, 4);
glVertexPointer(3, GL_INT, 0, cubeArray);
glDisableClientState(GL_COLOR_ARRAY);
glEnable(GL_TEXTURE_2D);
glPopMatrix();
// draw cube
// draw cube
glTranslatef(0.5f, 0.5f, 0.5f);
glRotatef(3.0f, 1.0f, 1.0f, 1.0f);
glTranslatef(-0.5f, -0.5f, -0.5f);
@ -205,12 +205,12 @@ void GLWidget::paintGL()
glTranslatef(-1.2f, -0.8f, 0.0f);
glScalef(0.2f, 0.2f, 0.2f);
for (int y = 0; y < 5; ++y) {
for (int x = 0; x < 5; ++x) {
glTranslatef(2.0f, 0, 0);
glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
glDrawArrays(GL_QUADS, 0, 4);
}
glTranslatef(-10.0f, 2.0f, 0);
for (int x = 0; x < 5; ++x) {
glTranslatef(2.0f, 0, 0);
glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
glDrawArrays(GL_QUADS, 0, 4);
}
glTranslatef(-10.0f, 2.0f, 0);
}
glVertexPointer(3, GL_INT, 0, cubeArray);

View File

@ -48,8 +48,8 @@ int main(int argc, char **argv)
QApplication a(argc, argv);
if (!QGLFormat::hasOpenGL() || !QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
QMessageBox::information(0, "OpenGL framebuffer objects 2",
"This system does not support OpenGL/framebuffer objects.");
QMessageBox::information(0, "OpenGL framebuffer objects 2",
"This system does not support OpenGL/framebuffer objects.");
return -1;
}

View File

@ -54,8 +54,8 @@ int main(int argc, char **argv)
widget.makeCurrent();
if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
QMessageBox::information(0, "OpenGL pbuffers",
"This system does not support OpenGL/pbuffers.");
QMessageBox::information(0, "OpenGL pbuffers",
"This system does not support OpenGL/pbuffers.");
return -1;
}

View File

@ -51,8 +51,8 @@ int main(int argc, char **argv)
widget.resize(640, 480);
widget.makeCurrent();
if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
QMessageBox::information(0, "OpenGL pbuffers 2",
"This system does not support OpenGL/pbuffers.");
QMessageBox::information(0, "OpenGL pbuffers 2",
"This system does not support OpenGL/pbuffers.");
return -1;
}
widget.show();

View File

@ -50,16 +50,16 @@ int main(int argc, char **argv)
f.setSampleBuffers(true);
QGLFormat::setDefaultFormat(f);
if (!QGLFormat::hasOpenGL()) {
QMessageBox::information(0, "OpenGL samplebuffers",
"This system does not support OpenGL.");
QMessageBox::information(0, "OpenGL samplebuffers",
"This system does not support OpenGL.");
return 0;
}
GLWidget widget(0);
if (!widget.format().sampleBuffers()) {
QMessageBox::information(0, "OpenGL samplebuffers",
"This system does not have sample buffer support.");
QMessageBox::information(0, "OpenGL samplebuffers",
"This system does not have sample buffer support.");
return 0;
}

View File

@ -186,7 +186,7 @@ bool MainWindow::maybeSave()
tr("The image has been modified.\n"
"Do you want to save your changes?"),
QMessageBox::Save | QMessageBox::Discard
| QMessageBox::Cancel);
| QMessageBox::Cancel);
if (ret == QMessageBox::Save) {
return saveFile("png");
} else if (ret == QMessageBox::Cancel) {

View File

@ -1,4 +1,4 @@
/****************************************************************************
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal

View File

@ -196,9 +196,9 @@ public:
{
GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::GLVertexBuffer", glGenBuffers && glBindBuffer && glBufferData, return)
glGenBuffers(1, &m_buffer);
glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
glBufferData(GL_ARRAY_BUFFER, (m_length = length) * sizeof(T), data, mode);
glGenBuffers(1, &m_buffer);
glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
glBufferData(GL_ARRAY_BUFFER, (m_length = length) * sizeof(T), data, mode);
}
~GLVertexBuffer()

View File

@ -45,54 +45,54 @@
bool GLExtensionFunctions::resolve(const QGLContext *context)
{
bool ok = true;
bool ok = true;
RESOLVE_GL_FUNC(GenFramebuffersEXT)
RESOLVE_GL_FUNC(GenRenderbuffersEXT)
RESOLVE_GL_FUNC(BindRenderbufferEXT)
RESOLVE_GL_FUNC(RenderbufferStorageEXT)
RESOLVE_GL_FUNC(DeleteFramebuffersEXT)
RESOLVE_GL_FUNC(DeleteRenderbuffersEXT)
RESOLVE_GL_FUNC(BindFramebufferEXT)
RESOLVE_GL_FUNC(FramebufferTexture2DEXT)
RESOLVE_GL_FUNC(FramebufferRenderbufferEXT)
RESOLVE_GL_FUNC(CheckFramebufferStatusEXT)
RESOLVE_GL_FUNC(GenFramebuffersEXT)
RESOLVE_GL_FUNC(GenRenderbuffersEXT)
RESOLVE_GL_FUNC(BindRenderbufferEXT)
RESOLVE_GL_FUNC(RenderbufferStorageEXT)
RESOLVE_GL_FUNC(DeleteFramebuffersEXT)
RESOLVE_GL_FUNC(DeleteRenderbuffersEXT)
RESOLVE_GL_FUNC(BindFramebufferEXT)
RESOLVE_GL_FUNC(FramebufferTexture2DEXT)
RESOLVE_GL_FUNC(FramebufferRenderbufferEXT)
RESOLVE_GL_FUNC(CheckFramebufferStatusEXT)
RESOLVE_GL_FUNC(ActiveTexture)
RESOLVE_GL_FUNC(TexImage3D)
RESOLVE_GL_FUNC(ActiveTexture)
RESOLVE_GL_FUNC(TexImage3D)
RESOLVE_GL_FUNC(GenBuffers)
RESOLVE_GL_FUNC(BindBuffer)
RESOLVE_GL_FUNC(BufferData)
RESOLVE_GL_FUNC(DeleteBuffers)
RESOLVE_GL_FUNC(MapBuffer)
RESOLVE_GL_FUNC(UnmapBuffer)
RESOLVE_GL_FUNC(GenBuffers)
RESOLVE_GL_FUNC(BindBuffer)
RESOLVE_GL_FUNC(BufferData)
RESOLVE_GL_FUNC(DeleteBuffers)
RESOLVE_GL_FUNC(MapBuffer)
RESOLVE_GL_FUNC(UnmapBuffer)
return ok;
return ok;
}
bool GLExtensionFunctions::fboSupported() {
return GenFramebuffersEXT
&& GenRenderbuffersEXT
&& BindRenderbufferEXT
&& RenderbufferStorageEXT
&& DeleteFramebuffersEXT
&& DeleteRenderbuffersEXT
&& BindFramebufferEXT
&& FramebufferTexture2DEXT
&& FramebufferRenderbufferEXT
&& CheckFramebufferStatusEXT;
&& GenRenderbuffersEXT
&& BindRenderbufferEXT
&& RenderbufferStorageEXT
&& DeleteFramebuffersEXT
&& DeleteRenderbuffersEXT
&& BindFramebufferEXT
&& FramebufferTexture2DEXT
&& FramebufferRenderbufferEXT
&& CheckFramebufferStatusEXT;
}
bool GLExtensionFunctions::openGL15Supported() {
return ActiveTexture
&& TexImage3D
&& TexImage3D
&& GenBuffers
&& BindBuffer
&& BufferData
&& DeleteBuffers
&& MapBuffer
&& UnmapBuffer;
&& BindBuffer
&& BufferData
&& DeleteBuffers
&& MapBuffer
&& UnmapBuffer;
}
#undef RESOLVE_GL_FUNC

View File

@ -145,37 +145,37 @@ typedef GLboolean (APIENTRY *_glUnmapBuffer) (GLenum);
struct GLExtensionFunctions
{
bool resolve(const QGLContext *context);
bool resolve(const QGLContext *context);
bool fboSupported();
bool openGL15Supported(); // the rest: multi-texture, 3D-texture, vertex buffer objects
_glGenFramebuffersEXT GenFramebuffersEXT;
_glGenRenderbuffersEXT GenRenderbuffersEXT;
_glBindRenderbufferEXT BindRenderbufferEXT;
_glRenderbufferStorageEXT RenderbufferStorageEXT;
_glDeleteFramebuffersEXT DeleteFramebuffersEXT;
_glDeleteRenderbuffersEXT DeleteRenderbuffersEXT;
_glBindFramebufferEXT BindFramebufferEXT;
_glFramebufferTexture2DEXT FramebufferTexture2DEXT;
_glFramebufferRenderbufferEXT FramebufferRenderbufferEXT;
_glCheckFramebufferStatusEXT CheckFramebufferStatusEXT;
_glGenFramebuffersEXT GenFramebuffersEXT;
_glGenRenderbuffersEXT GenRenderbuffersEXT;
_glBindRenderbufferEXT BindRenderbufferEXT;
_glRenderbufferStorageEXT RenderbufferStorageEXT;
_glDeleteFramebuffersEXT DeleteFramebuffersEXT;
_glDeleteRenderbuffersEXT DeleteRenderbuffersEXT;
_glBindFramebufferEXT BindFramebufferEXT;
_glFramebufferTexture2DEXT FramebufferTexture2DEXT;
_glFramebufferRenderbufferEXT FramebufferRenderbufferEXT;
_glCheckFramebufferStatusEXT CheckFramebufferStatusEXT;
_glActiveTexture ActiveTexture;
_glTexImage3D TexImage3D;
_glActiveTexture ActiveTexture;
_glTexImage3D TexImage3D;
_glGenBuffers GenBuffers;
_glBindBuffer BindBuffer;
_glBufferData BufferData;
_glDeleteBuffers DeleteBuffers;
_glMapBuffer MapBuffer;
_glUnmapBuffer UnmapBuffer;
_glGenBuffers GenBuffers;
_glBindBuffer BindBuffer;
_glBufferData BufferData;
_glDeleteBuffers DeleteBuffers;
_glMapBuffer MapBuffer;
_glUnmapBuffer UnmapBuffer;
};
inline GLExtensionFunctions &getGLExtensionFunctions()
{
static GLExtensionFunctions funcs;
return funcs;
static GLExtensionFunctions funcs;
return funcs;
}
#define glGenFramebuffersEXT getGLExtensionFunctions().GenFramebuffersEXT

View File

@ -186,10 +186,10 @@ TwoSidedGraphicsWidget::TwoSidedGraphicsWidget(QGraphicsScene *scene)
void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
{
if (index < 0 || index >= 2)
{
qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index);
return;
}
{
qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index);
return;
}
GraphicsWidget *proxy = new GraphicsWidget;
proxy->setWidget(widget);
@ -210,10 +210,10 @@ void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
QWidget *TwoSidedGraphicsWidget::widget(int index)
{
if (index < 0 || index >= 2)
{
qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
return 0;
}
{
qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
return 0;
}
return m_proxyWidgets[index]->widget();
}

View File

@ -193,9 +193,9 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect)
QRectF rightShadow(sceneRect.right(), sceneRect.top() + 5, 5, sceneRect.height());
QRectF bottomShadow(sceneRect.left() + 5, sceneRect.bottom(), sceneRect.width(), 5);
if (rightShadow.intersects(rect) || rightShadow.contains(rect))
painter->fillRect(rightShadow, Qt::darkGray);
painter->fillRect(rightShadow, Qt::darkGray);
if (bottomShadow.intersects(rect) || bottomShadow.contains(rect))
painter->fillRect(bottomShadow, Qt::darkGray);
painter->fillRect(bottomShadow, Qt::darkGray);
// Fill
QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight());

View File

@ -156,11 +156,11 @@ void MainWindow::printImage()
{
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) {
QMessageBox::StandardButton answer;
answer = QMessageBox::question(this, tr("Large Image Size"),
tr("The printed image may be very large. Are you sure that "
"you want to print it?"),
QMessageBox::Yes | QMessageBox::No);
QMessageBox::StandardButton answer;
answer = QMessageBox::question(this, tr("Large Image Size"),
tr("The printed image may be very large. Are you sure that "
"you want to print it?"),
QMessageBox::Yes | QMessageBox::No);
if (answer == QMessageBox::No)
return;
}

View File

@ -101,7 +101,7 @@ void Dialog::createHorizontalGroupBox()
for (int i = 0; i < NumButtons; ++i) {
buttons[i] = new QPushButton(tr("Button %1").arg(i + 1));
layout->addWidget(buttons[i]);
layout->addWidget(buttons[i]);
}
horizontalGroupBox->setLayout(layout);
}

View File

@ -69,13 +69,13 @@ public:
private:
struct ItemWrapper
{
ItemWrapper(QLayoutItem *i, Position p) {
item = i;
position = p;
}
ItemWrapper(QLayoutItem *i, Position p) {
item = i;
position = p;
}
QLayoutItem *item;
Position position;
QLayoutItem *item;
Position position;
};
enum SizeType { MinimumSize, SizeHint };

View File

@ -145,13 +145,13 @@ void MdiChild::documentWasModified()
bool MdiChild::maybeSave()
{
if (document()->isModified()) {
QMessageBox::StandardButton ret;
QMessageBox::StandardButton ret;
ret = QMessageBox::warning(this, tr("MDI"),
tr("'%1' has been modified.\n"
"Do you want to save your changes?")
.arg(userFriendlyCurrentFile()),
QMessageBox::Save | QMessageBox::Discard
| QMessageBox::Cancel);
| QMessageBox::Cancel);
if (ret == QMessageBox::Save)
return save();
else if (ret == QMessageBox::Cancel)

View File

@ -282,12 +282,12 @@ void MainWindow::writeSettings()
bool MainWindow::maybeSave()
{
if (textEdit->document()->isModified()) {
QMessageBox::StandardButton ret;
QMessageBox::StandardButton ret;
ret = QMessageBox::warning(this, tr("SDI"),
tr("The document has been modified.\n"
"Do you want to save your changes?"),
QMessageBox::Save | QMessageBox::Discard
| QMessageBox::Cancel);
| QMessageBox::Cancel);
if (ret == QMessageBox::Save)
return save();
else if (ret == QMessageBox::Cancel)

View File

@ -283,7 +283,7 @@ void TextEdit::setupTextActions()
tr("&Bold"), this);
actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B);
actionTextBold->setPriority(QAction::LowPriority);
QFont bold;
QFont bold;
bold.setBold(true);
actionTextBold->setFont(bold);
connect(actionTextBold, SIGNAL(triggered()), this, SLOT(textBold()));

View File

@ -162,7 +162,7 @@ void MainWindow::createActions()
QString text = tr("%1...").arg(QString(codec->name()));
QAction *action = new QAction(text, this);
action->setData(codec->name());
action->setData(codec->name());
connect(action, SIGNAL(triggered()), this, SLOT(save()));
saveAsActs.append(action);
}

View File

@ -77,14 +77,14 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
{
//save value from editor to member m_gridData
m_gridData[index.row()][index.column()] = value.toString();
//for presentation purposes only: build and emit a joined string
//for presentation purposes only: build and emit a joined string
QString result;
for(int row= 0; row < ROWS; row++)
{
for (int row= 0; row < ROWS; row++)
{
for(int col= 0; col < COLS; col++)
{
result += m_gridData[row][col] + " ";
}
{
result += m_gridData[row][col] + " ";
}
}
emit editCompleted( result );
}

View File

@ -69,7 +69,7 @@ Calculator::Calculator(QWidget *parent)
//! [4]
for (int i = 0; i < NumDigitButtons; ++i) {
digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked()));
digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked()));
}
Button *pointButton = createButton(tr("."), SLOT(pointClicked()));
@ -144,7 +144,7 @@ void Calculator::digitClicked()
if (waitingForOperand) {
display->clear();
waitingForOperand = false;
waitingForOperand = false;
}
display->setText(display->text() + QString::number(digitValue));
}
@ -169,8 +169,8 @@ void Calculator::unaryOperatorClicked()
result = pow(operand, 2.0);
} else if (clickedOperator == tr("1/x")) {
if (operand == 0.0) {
abortOperation();
return;
abortOperation();
return;
}
result = 1.0 / operand;
}
@ -192,7 +192,7 @@ void Calculator::additiveOperatorClicked()
//! [12] //! [13]
if (!calculate(operand, pendingMultiplicativeOperator)) {
abortOperation();
return;
return;
}
display->setText(QString::number(factorSoFar));
operand = factorSoFar;
@ -205,7 +205,7 @@ void Calculator::additiveOperatorClicked()
//! [14] //! [15]
if (!calculate(operand, pendingAdditiveOperator)) {
abortOperation();
return;
return;
}
display->setText(QString::number(sumSoFar));
} else {
@ -229,7 +229,7 @@ void Calculator::multiplicativeOperatorClicked()
if (!pendingMultiplicativeOperator.isEmpty()) {
if (!calculate(operand, pendingMultiplicativeOperator)) {
abortOperation();
return;
return;
}
display->setText(QString::number(factorSoFar));
} else {
@ -249,7 +249,7 @@ void Calculator::equalClicked()
if (!pendingMultiplicativeOperator.isEmpty()) {
if (!calculate(operand, pendingMultiplicativeOperator)) {
abortOperation();
return;
return;
}
operand = factorSoFar;
factorSoFar = 0.0;
@ -258,7 +258,7 @@ void Calculator::equalClicked()
if (!pendingAdditiveOperator.isEmpty()) {
if (!calculate(operand, pendingAdditiveOperator)) {
abortOperation();
return;
return;
}
pendingAdditiveOperator.clear();
} else {
@ -387,9 +387,9 @@ bool Calculator::calculate(double rightOperand, const QString &pendingOperator)
} else if (pendingOperator == tr("\303\227")) {
factorSoFar *= rightOperand;
} else if (pendingOperator == tr("\303\267")) {
if (rightOperand == 0.0)
return false;
factorSoFar /= rightOperand;
if (rightOperand == 0.0)
return false;
factorSoFar /= rightOperand;
}
return true;
}

View File

@ -182,7 +182,7 @@ void Window::echoChanged(int index)
echoLineEdit->setEchoMode(QLineEdit::Password);
break;
case 2:
echoLineEdit->setEchoMode(QLineEdit::PasswordEchoOnEdit);
echoLineEdit->setEchoMode(QLineEdit::PasswordEchoOnEdit);
break;
case 3:
echoLineEdit->setEchoMode(QLineEdit::NoEcho);
@ -221,7 +221,7 @@ void Window::alignmentChanged(int index)
alignmentLineEdit->setAlignment(Qt::AlignCenter);
break;
case 2:
alignmentLineEdit->setAlignment(Qt::AlignRight);
alignmentLineEdit->setAlignment(Qt::AlignRight);
}
}
//! [11]

View File

@ -219,7 +219,7 @@ bool MainWindow::maybeSave()
tr("The image has been modified.\n"
"Do you want to save your changes?"),
QMessageBox::Save | QMessageBox::Discard
| QMessageBox::Cancel);
| QMessageBox::Cancel);
if (ret == QMessageBox::Save) {
return saveFile("png");
} else if (ret == QMessageBox::Cancel) {

View File

@ -194,12 +194,12 @@ void Window::setFormatString(const QString &formatString)
meetingEdit->setDateRange(QDate(2004, 11, 1), QDate(2005, 11, 30));
meetingLabel->setText(tr("Meeting date (between %0 and %1):")
.arg(meetingEdit->minimumDate().toString(Qt::ISODate))
.arg(meetingEdit->maximumDate().toString(Qt::ISODate)));
.arg(meetingEdit->maximumDate().toString(Qt::ISODate)));
} else {
meetingEdit->setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0));
meetingLabel->setText(tr("Meeting time (between %0 and %1):")
.arg(meetingEdit->minimumTime().toString(Qt::ISODate))
.arg(meetingEdit->maximumTime().toString(Qt::ISODate)));
.arg(meetingEdit->maximumTime().toString(Qt::ISODate)));
}
}
//! [13]

View File

@ -109,9 +109,9 @@ void TetrixBoard::pause()
isPaused = !isPaused;
if (isPaused) {
timer.stop();
timer.stop();
} else {
timer.start(timeoutTime(), this);
timer.start(timeoutTime(), this);
}
update();
//! [5] //! [6]
@ -128,7 +128,7 @@ void TetrixBoard::paintEvent(QPaintEvent *event)
//! [7]
if (isPaused) {
painter.drawText(rect, Qt::AlignCenter, tr("Pause"));
painter.drawText(rect, Qt::AlignCenter, tr("Pause"));
return;
}
@ -138,7 +138,7 @@ void TetrixBoard::paintEvent(QPaintEvent *event)
for (int i = 0; i < BoardHeight; ++i) {
for (int j = 0; j < BoardWidth; ++j) {
TetrixShape shape = shapeAt(j, BoardHeight - i - 1);
if (shape != NoShape)
if (shape != NoShape)
drawSquare(painter, rect.left() + j * squareWidth(),
boardTop + i * squareHeight(), shape);
}
@ -165,7 +165,7 @@ void TetrixBoard::paintEvent(QPaintEvent *event)
void TetrixBoard::keyPressEvent(QKeyEvent *event)
{
if (!isStarted || isPaused || curPiece.shape() == NoShape) {
QFrame::keyPressEvent(event);
QFrame::keyPressEvent(event);
return;
}
//! [13]
@ -174,24 +174,24 @@ void TetrixBoard::keyPressEvent(QKeyEvent *event)
switch (event->key()) {
case Qt::Key_Left:
tryMove(curPiece, curX - 1, curY);
break;
break;
case Qt::Key_Right:
tryMove(curPiece, curX + 1, curY);
break;
break;
case Qt::Key_Down:
tryMove(curPiece.rotatedRight(), curX, curY);
break;
break;
case Qt::Key_Up:
tryMove(curPiece.rotatedLeft(), curX, curY);
break;
break;
case Qt::Key_Space:
dropDown();
break;
dropDown();
break;
case Qt::Key_D:
oneLineDown();
break;
oneLineDown();
break;
default:
QFrame::keyPressEvent(event);
QFrame::keyPressEvent(event);
}
//! [14]
}
@ -201,9 +201,9 @@ void TetrixBoard::timerEvent(QTimerEvent *event)
{
if (event->timerId() == timer.timerId()) {
if (isWaitingAfterLine) {
isWaitingAfterLine = false;
newPiece();
timer.start(timeoutTime(), this);
isWaitingAfterLine = false;
newPiece();
timer.start(timeoutTime(), this);
} else {
oneLineDown();
}
@ -243,7 +243,7 @@ void TetrixBoard::dropDown()
void TetrixBoard::oneLineDown()
{
if (!tryMove(curPiece, curX, curY - 1))
pieceDropped(0);
pieceDropped(0);
}
//! [21]
@ -290,24 +290,24 @@ void TetrixBoard::removeFullLines()
if (lineIsFull) {
//! [24] //! [25]
++numFullLines;
for (int k = i; k < BoardHeight - 1; ++k) {
++numFullLines;
for (int k = i; k < BoardHeight - 1; ++k) {
for (int j = 0; j < BoardWidth; ++j)
shapeAt(j, k) = shapeAt(j, k + 1);
}
}
//! [25] //! [26]
for (int j = 0; j < BoardWidth; ++j)
for (int j = 0; j < BoardWidth; ++j)
shapeAt(j, BoardHeight - 1) = NoShape;
}
}
//! [26] //! [27]
}
//! [27]
//! [28]
if (numFullLines > 0) {
numLinesRemoved += numFullLines;
score += 10 * numFullLines;
emit linesRemovedChanged(numLinesRemoved);
numLinesRemoved += numFullLines;
score += 10 * numFullLines;
emit linesRemovedChanged(numLinesRemoved);
emit scoreChanged(score);
timer.start(500, this);
@ -329,7 +329,7 @@ void TetrixBoard::newPiece()
curY = BoardHeight - 1 + curPiece.minY();
if (!tryMove(curPiece, curX, curY)) {
curPiece.setShape(NoShape);
curPiece.setShape(NoShape);
timer.stop();
isStarted = false;
}

View File

@ -63,7 +63,7 @@ void WigglyWidget::paintEvent(QPaintEvent * /* event */)
//! [1] //! [2]
{
static const int sineTable[16] = {
0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38
0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38
};
QFontMetrics metrics(font());
@ -94,7 +94,7 @@ void WigglyWidget::timerEvent(QTimerEvent *event)
++step;
update();
} else {
QWidget::timerEvent(event);
QWidget::timerEvent(event);
}
//! [6]
}

View File

@ -87,7 +87,7 @@
#define QT_SIGNAL_IGNORE (void (*)(int))1
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -63,48 +63,48 @@
#include <windows.h>
#ifdef QT_LARGEFILE_SUPPORT
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#else
#define QT_STATBUF struct stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct stat // non-ANSI defs
#define QT_STAT ::qt_wince_stat
#define QT_FSTAT ::qt_wince__fstat
#define QT_STATBUF struct stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct stat // non-ANSI defs
#define QT_STAT ::qt_wince_stat
#define QT_FSTAT ::qt_wince__fstat
#endif
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
# define QT_STAT_LNK _S_IFLNK
#endif
#define QT_FILENO ::qt_wince___fileno
#define QT_OPEN ::qt_wince_open
#define QT_CLOSE ::qt_wince__close
#define QT_FILENO ::qt_wince___fileno
#define QT_OPEN ::qt_wince_open
#define QT_CLOSE ::qt_wince__close
#ifdef QT_LARGEFILE_SUPPORT
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#else
#define QT_LSEEK ::qt_wince__lseek
#define QT_TSTAT ::_tstat
#define QT_LSEEK ::qt_wince__lseek
#define QT_TSTAT ::_tstat
#endif
#define QT_READ ::qt_wince__read
#define QT_WRITE ::qt_wince__write
#define QT_ACCESS ::qt_wince__access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::qt_wince__mkdir
#define QT_RMDIR ::qt_wince__rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#define QT_READ ::qt_wince__read
#define QT_WRITE ::qt_wince__write
#define QT_ACCESS ::qt_wince__access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::qt_wince__mkdir
#define QT_RMDIR ::qt_wince__rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#define QT_FOPEN ::fopen
#define QT_FSEEK ::fseek
@ -115,17 +115,17 @@
#define QT_FPOS_T fpos_t
#define QT_OFF_T long
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_ARGS int
#define QT_VSNPRINTF(buffer, count, format, arg) \
_vsnprintf(buffer, count, format, arg)
#define QT_SNPRINTF ::_snprintf
#define QT_SNPRINTF ::_snprintf
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
typedef int mode_t;

View File

@ -73,7 +73,7 @@
#include <sys/ioctl.h>
// Cygwin does not provide <sys/ipc.h> and <sys/shm.h> because it
// doesn't support SysV IPC or shared memory. See for example:
// http://afni.nimh.nih.gov/afni/afniboard/messages/1725.html
// http://afni.nimh.nih.gov/afni/afniboard/messages/1725.html
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/stat.h>
@ -88,8 +88,8 @@
#define QT_OPEN_LARGEFILE 0
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -79,7 +79,7 @@
#undef QT_OPEN_LARGEFILE
#define QT_OPEN_LARGEFILE 0
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -82,7 +82,7 @@
#define QT_OPEN_LARGEFILE 0
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -85,8 +85,8 @@
#include "../common/posix/qplatformdefs.h"
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -88,8 +88,8 @@
// Irix 6.5 and better
#if defined(_SGIAPI)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -88,8 +88,8 @@
// Irix 6.5 and better
#if defined(_SGIAPI)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -95,8 +95,8 @@
// Irix 6.5 and better
#if defined(_SGIAPI)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -87,14 +87,14 @@
#undef QT_SOCKLEN_T
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t
#define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -94,8 +94,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -93,8 +93,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -97,8 +97,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -94,8 +94,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -105,8 +105,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -94,8 +94,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -86,8 +86,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -84,8 +84,8 @@
// NetBSD 1.0 - 1.3.3 int
// NetBSD 1.4 - 1.5 socklen_t
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
// Older NetBSD versions may still use the a.out format instead of ELF.
#ifndef __ELF__

View File

@ -85,8 +85,8 @@
// OpenBSD 2.2 - 2.4 int
// OpenBSD 2.5 - 2.8 socklen_t
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
// 1003.1c-1995 says on page 38 (2.9.3, paragraph 3) that if _POSIX_THREADS
// is defined, then _POSIX_THREAD_SAFE_FUNCTIONS must also be defined.

View File

@ -81,7 +81,7 @@
#undef QT_SOCKLEN_T
#define QT_SOCKLEN_T size_t
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -85,7 +85,7 @@
#undef QT_SOCKLEN_T
#define QT_SOCKLEN_T int
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -87,8 +87,8 @@ static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T a
{ return ::connect(s, addr, addrlen); }
// Only Solaris 7 and better support 64-bit
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#ifdef connect
#undef connect

View File

@ -113,8 +113,8 @@ extern "C" int gethostname(char *, int);
#if defined(_XOPEN_UNIX)
// Solaris 2.6 and better
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#ifdef connect

View File

@ -100,7 +100,7 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr
#endif
// Only Solaris 7 and better support 64-bit
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -128,8 +128,8 @@ extern "C" int gethostname(char *, int);
#if defined(_XOPEN_UNIX)
// Solaris 2.6 and better
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -102,8 +102,8 @@ extern "C" int usleep(useconds_t);
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 400)
// Tru64 5.0 and better
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -102,8 +102,8 @@ extern "C" int usleep(useconds_t);
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 400)
// Tru64 5.0 and better
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -85,7 +85,7 @@
#define QT_OFF_T off_t
#define QT_SOCKLEN_T size_t
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -85,7 +85,7 @@
#define QT_OFF_T off_t
#define QT_SOCKLEN_T size_t
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H

View File

@ -110,37 +110,37 @@
#define QT_OFF_T long
#endif
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_SOCKET_CONNECT ::connect
#define QT_SOCKET_BIND ::bind
#define QT_FILENO fileno
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_SOCKET_CONNECT ::connect
#define QT_SOCKET_BIND ::bind
#define QT_FILENO fileno
#ifndef QT_CLOSE
#define QT_CLOSE ::close
#define QT_CLOSE ::close
#endif
#ifndef QT_READ
#define QT_READ ::read
#define QT_READ ::read
#endif
#ifndef QT_WRITE
#define QT_WRITE ::write
#define QT_WRITE ::write
#endif
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
#define QT_MMAP ::mmap
@ -166,8 +166,8 @@
#define QT_SOCKLEN_T socklen_t
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
// INTEGRITY doesn't enable the declaration in _POSIX_SOURCE mode,

View File

@ -93,8 +93,8 @@
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -84,8 +84,8 @@
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../../common/posix/qplatformdefs.h"
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
// QNX6 doesn't have getpagesize()
inline int getpagesize()

View File

@ -68,49 +68,49 @@
#define Q_FS_FAT
#ifdef QT_LARGEFILE_SUPPORT
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#else
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#endif
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
# define QT_STAT_LNK _S_IFLNK
#endif
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#ifdef QT_LARGEFILE_SUPPORT
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#else
#define QT_LSEEK ::_lseek
#define QT_TSTAT ::_tstat
#define QT_LSEEK ::_lseek
#define QT_TSTAT ::_tstat
#endif
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#if defined(O_TEXT)
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#endif
#include "../../common/c89/qplatformdefs.h"
@ -125,15 +125,15 @@
#define QT_OFF_T __int64
#endif
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_ARGS int
#define QT_VSNPRINTF ::_vsnprintf
#define QT_SNPRINTF ::_snprintf
#define QT_SNPRINTF ::_snprintf
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
typedef int mode_t;

View File

@ -79,57 +79,57 @@ typedef enum {
#endif
#ifdef QT_LARGEFILE_SUPPORT
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#else
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#endif
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
# define QT_STAT_LNK _S_IFLNK
#endif
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#ifdef QT_LARGEFILE_SUPPORT
#define QT_LSEEK ::_lseeki64
#define QT_LSEEK ::_lseeki64
#ifndef UNICODE
#define QT_TSTAT ::_stati64
#define QT_TSTAT ::_stati64
#else
#define QT_TSTAT ::_wstati64
#define QT_TSTAT ::_wstati64
#endif
#else
#define QT_LSEEK ::_lseek
#define QT_LSEEK ::_lseek
#ifndef UNICODE
#define QT_TSTAT ::_stat
#define QT_TSTAT ::_stat
#else
#define QT_TSTAT ::_wstat
#define QT_TSTAT ::_wstat
#endif
#endif
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#if defined(O_TEXT)
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#endif
#include "../common/c89/qplatformdefs.h"
@ -144,15 +144,15 @@ typedef enum {
#define QT_OFF_T off64_t
#endif
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_ARGS int
#define QT_VSNPRINTF ::_vsnprintf
#define QT_SNPRINTF ::_snprintf
#define QT_VSNPRINTF ::_vsnprintf
#define QT_SNPRINTF ::_snprintf
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
#endif // QPLATFORMDEFS_H

View File

@ -66,51 +66,51 @@
#include <stdlib.h>
#ifdef QT_LARGEFILE_SUPPORT
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#else
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#endif
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
# define QT_STAT_LNK _S_IFLNK
#else
# define QT_STAT_LNK 0120000
# define QT_STAT_LNK 0120000
#endif
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#ifdef QT_LARGEFILE_SUPPORT
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#else
#define QT_LSEEK ::_lseek
#define QT_TSTAT ::_tstat
#define QT_LSEEK ::_lseek
#define QT_TSTAT ::_tstat
#endif
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#if defined(O_TEXT)
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#endif
#include "../common/c89/qplatformdefs.h"
@ -125,17 +125,17 @@
#define QT_OFF_T __int64
#endif
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_ARGS int
#define QT_VSNPRINTF(buffer, count, format, arg) \
vsnprintf_s(buffer, count, count-1, format, arg)
#define QT_SNPRINTF ::_snprintf
#define QT_SNPRINTF ::_snprintf
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
typedef int mode_t;

View File

@ -1316,7 +1316,7 @@ UnixMakefileGenerator::writeLibtoolFile()
t << "# " << lname << " - a libtool library file\n";
t << "# Generated by qmake/libtool (" QMAKE_VERSION_STR ") (Qt "
<< QT_VERSION_STR << ") on: " << QDateTime::currentDateTime().toString();
t << "\n";
t << "\n";
t << "# The name that we can dlopen(3).\n"
<< "dlname='" << var(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x")

View File

@ -101,7 +101,7 @@ bool MingwMakefileGenerator::findLibraries()
}
if (!out.isEmpty()) // We assume if it never finds it that its correct
(*it) = out;
} else if((*it).startsWith("-L")) {
} else if ((*it).startsWith("-L")) {
dirs.append(QMakeLocalFileName((*it).mid(2).toQString()));
}
@ -159,7 +159,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
t << path << endl;
}
t << ");\n";
t.flush();
t.flush();
file.close();
}
}
@ -175,7 +175,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
t << "ADDMOD " << *it << endl;
}
t << "SAVE\n";
t.flush();
t.flush();
file.close();
}
}
@ -204,16 +204,16 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
if (!preCompHeaderOut.isEmpty()) {
QString header = project->first("PRECOMPILED_HEADER").toQString();
QString cHeader = preCompHeaderOut + Option::dir_sep + "c";
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
QString cHeader = preCompHeaderOut + Option::dir_sep + "c";
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
<< endl << endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
<< endl << endl;
}
@ -269,7 +269,7 @@ void MingwMakefileGenerator::init()
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET")
+ project->first("TARGET_VERSION_EXT") + ".a");
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB"));
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB"));
}
if (!project->values("DEF_FILE").isEmpty()) {
@ -287,21 +287,21 @@ void MingwMakefileGenerator::init()
&& project->isActiveConfig("precompile_header")) {
QString preCompHeader = var("PRECOMPILED_DIR")
+ QFileInfo(project->first("PRECOMPILED_HEADER").toQString()).fileName();
preCompHeaderOut = preCompHeader + ".gch";
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c");
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++");
preCompHeaderOut = preCompHeader + ".gch";
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c");
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++");
project->values("QMAKE_RUN_CC").clear();
project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
project->values("QMAKE_RUN_CC").clear();
project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
" $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src");
project->values("QMAKE_RUN_CC_IMP").clear();
project->values("QMAKE_RUN_CC_IMP").append("$(CC) -c -include " + preCompHeader +
project->values("QMAKE_RUN_CC_IMP").append("$(CC) -c -include " + preCompHeader +
" $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$@ $<");
project->values("QMAKE_RUN_CXX").clear();
project->values("QMAKE_RUN_CXX").append("$(CXX) -c -include " + preCompHeader +
project->values("QMAKE_RUN_CXX").append("$(CXX) -c -include " + preCompHeader +
" $(CXXFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src");
project->values("QMAKE_RUN_CXX_IMP").clear();
project->values("QMAKE_RUN_CXX_IMP").append("$(CXX) -c -include " + preCompHeader +
project->values("QMAKE_RUN_CXX_IMP").append("$(CXX) -c -include " + preCompHeader +
" $(CXXFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$@ $<");
}
@ -350,10 +350,10 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
objectsLinkLine = "$(OBJECTS)";
} else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME");
}
QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME");
}
// QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
if (project->isActiveConfig("rvct_linker")) {
createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS"));
@ -371,9 +371,9 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
}
} else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
if (project->isActiveConfig("rvct_linker")) {
createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
objectsLinkLine = QString::fromLatin1("--via ") + escapeFilePath(ld_script_file);
@ -393,7 +393,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
} else {
t << "\n\t" << objectsLinkLine << " " ;

View File

@ -1531,7 +1531,7 @@ bool VCLinkerTool::parseOption(const char* option)
AdditionalOptions.append(option);
}
break;
case 0x379ED25:
case 0x379ED25:
case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE}
switch (elfHash(option+9)) {
// Very limited documentation on all options but X86,
@ -1661,7 +1661,7 @@ bool VCLinkerTool::parseOption(const char* option)
else
AdditionalOptions += option;
break;
case 0x9B3C00D:
case 0x9B3C00D:
case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]]
{
// Split up in subsystem, and version number
@ -2247,7 +2247,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
CustomBuildTool.Description.clear();
CustomBuildTool.Outputs.clear();
CustomBuildTool.ToolPath.clear();
CustomBuildTool.ToolName = QLatin1String(_VCCustomBuildTool);
CustomBuildTool.ToolName = QLatin1String(_VCCustomBuildTool);
for (int x = 0; x < extraCompilers.count(); ++x) {
const QString &extraCompilerName = extraCompilers.at(x);
@ -2285,13 +2285,13 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
}
// Dependency for the output
if(!tmp_dep.isEmpty())
deps = tmp_dep;
if(!tmp_dep_cmd.isEmpty()) {
if (!tmp_dep.isEmpty())
deps = tmp_dep;
if (!tmp_dep_cmd.isEmpty()) {
// Execute dependency command, and add every line as a dep
char buff[256];
QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd,
Option::fixPathToLocalOS(inFile, true, false),
char buff[256];
QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd,
Option::fixPathToLocalOS(inFile, true, false),
out);
if(Project->canExecute(dep_cmd)) {
dep_cmd.prepend(QLatin1String("cd ")
@ -2318,7 +2318,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
}
}
for (int i = 0; i < deps.count(); ++i)
deps[i] = Option::fixPathToTargetOS(
deps[i] = Option::fixPathToTargetOS(
Project->replaceExtraCompilerVariables(deps.at(i), inFile, out),
false).trimmed();
// Command for file
@ -2347,18 +2347,18 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
out);
}
// Name for command
if(!tmp_cmd_name.isEmpty()) {
cmd_name = Project->replaceExtraCompilerVariables(tmp_cmd_name, inFile, out);
} else {
int space = cmd.indexOf(' ');
if(space != -1)
cmd_name = cmd.left(space);
else
cmd_name = cmd;
if((cmd_name[0] == '\'' || cmd_name[0] == '"') &&
cmd_name[0] == cmd_name[cmd_name.length()-1])
cmd_name = cmd_name.mid(1,cmd_name.length()-2);
}
if (!tmp_cmd_name.isEmpty()) {
cmd_name = Project->replaceExtraCompilerVariables(tmp_cmd_name, inFile, out);
} else {
int space = cmd.indexOf(' ');
if (space != -1)
cmd_name = cmd.left(space);
else
cmd_name = cmd;
if ((cmd_name[0] == '\'' || cmd_name[0] == '"') &&
cmd_name[0] == cmd_name[cmd_name.length()-1])
cmd_name = cmd_name.mid(1,cmd_name.length()-2);
}
// Fixify paths
for (int i = 0; i < deps.count(); ++i)

View File

@ -955,7 +955,7 @@ public:
VCConfiguration* Config;
QList<VCFilterFile> Files;
customBuildCheck CustomBuild;
customBuildCheck CustomBuild;
bool useCustomBuildTool;
VCCustomBuildTool CustomBuildTool;

View File

@ -89,12 +89,12 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
QRegExp regx(QString("((lib)?%1([0-9]*)).(%2|prl)$").arg(stem).arg(ext), Qt::CaseInsensitive);
for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
if(regx.exactMatch((*it))) {
if (!regx.cap(3).isEmpty()) {
bool ok = true;
int num = regx.cap(3).toInt(&ok);
biggest = qMax(biggest, (!ok ? -1 : num));
}
}
if (!regx.cap(3).isEmpty()) {
bool ok = true;
int num = regx.cap(3).toInt(&ok);
biggest = qMax(biggest, (!ok ? -1 : num));
}
}
}
}
if(libInfoRead
@ -485,20 +485,20 @@ void Win32MakefileGenerator::processRcFileVar()
rcFile.close();
}
if (writeRcFile) {
bool ok;
ok = rcFile.open(QFile::WriteOnly);
if (!ok) {
// The file can't be opened... try creating the containing
// directory first (needed for clean shadow builds)
QDir().mkpath(QFileInfo(rcFile).path());
ok = rcFile.open(QFile::WriteOnly);
}
if (!ok) {
::fprintf(stderr, "Cannot open for writing: %s", rcFile.fileName().toLatin1().constData());
::exit(1);
}
rcFile.write(rcString);
rcFile.close();
bool ok;
ok = rcFile.open(QFile::WriteOnly);
if (!ok) {
// The file can't be opened... try creating the containing
// directory first (needed for clean shadow builds)
QDir().mkpath(QFileInfo(rcFile).path());
ok = rcFile.open(QFile::WriteOnly);
}
if (!ok) {
::fprintf(stderr, "Cannot open for writing: %s", rcFile.fileName().toLatin1().constData());
::exit(1);
}
rcFile.write(rcString);
rcFile.close();
}
if (project->values("QMAKE_WRITE_DEFAULT_RC").isEmpty())
project->values("RC_FILE").insert(0, rcFile.fileName());
@ -530,7 +530,7 @@ void Win32MakefileGenerator::processRcFileVar()
}
project->values("RES_FILE").first() = Option::fixPathToTargetOS(
project->values("RES_FILE").first().toQString(), false, false);
project->values("POST_TARGETDEPS") += project->values("RES_FILE");
project->values("POST_TARGETDEPS") += project->values("RES_FILE");
project->values("CLEAN_FILES") += project->values("RES_FILE");
}
}

View File

@ -329,9 +329,9 @@ Option::init(int argc, char **argv)
globals->qmake_abslocation = argv0;
} else if (argv0.contains(QLatin1Char('/'))
#ifdef Q_OS_WIN
|| argv0.contains(QLatin1Char('\\'))
|| argv0.contains(QLatin1Char('\\'))
#endif
) { //relative PWD
) { //relative PWD
globals->qmake_abslocation = QDir::current().absoluteFilePath(argv0);
} else { //in the PATH
QByteArray pEnv = qgetenv("PATH");

View File

@ -121,7 +121,7 @@ void QPropertyAnimationPrivate::updateMetaProperty()
qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData());
} else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) {
qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData());
}
}
}
void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)

View File

@ -302,7 +302,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValu
x = &_q_value;
T *expectedValueCopy = expectedValue;
return (_InterlockedCompareExchange64_acq(p, quintptr(newValue), quintptr(expectedValueCopy))
== quintptr(expectedValue));
== quintptr(expectedValue));
}
template <typename T>
@ -315,7 +315,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValu
x = &_q_value;
T *expectedValueCopy = expectedValue;
return (_InterlockedCompareExchange64_rel(p, quintptr(newValue), quintptr(expectedValueCopy))
== quintptr(expectedValue));
== quintptr(expectedValue));
}
template <typename T>

View File

@ -48,7 +48,7 @@ Q_PROPERTY(type name
[DESIGNABLE bool]
[SCRIPTABLE bool]
[STORED bool]
[USER bool]
[USER bool]
[CONSTANT]
[FINAL])
//! [0]

View File

@ -274,9 +274,9 @@ list.insert(i, 12);
QVector<int> vect;
vect << 3 << 3 << 6 << 6 << 6 << 8;
QVector<int>::iterator begin6 =
qLowerBound(vect.begin(), vect.end(), 6);
qLowerBound(vect.begin(), vect.end(), 6);
QVector<int>::iterator end6 =
qUpperBound(begin6, vect.end(), 6);
qUpperBound(begin6, vect.end(), 6);
QVector<int>::iterator i = begin6;
while (i != end6) {
@ -305,9 +305,9 @@ list.insert(i, 12);
QVector<int> vect;
vect << 3 << 3 << 6 << 6 << 6 << 8;
QVector<int>::iterator begin6 =
qLowerBound(vect.begin(), vect.end(), 6);
qLowerBound(vect.begin(), vect.end(), 6);
QVector<int>::iterator end6 =
qUpperBound(vect.begin(), vect.end(), 6);
qUpperBound(vect.begin(), vect.end(), 6);
QVector<int>::iterator i = begin6;
while (i != end6) {
@ -323,7 +323,7 @@ QVector<int> vect;
vect << 3 << 3 << 6 << 6 << 6 << 8;
QVector<int>::iterator i =
qBinaryFind(vect.begin(), vect.end(), 6);
qBinaryFind(vect.begin(), vect.end(), 6);
// i == vect.begin() + 2 (or 3 or 4)
//! [22]

View File

@ -218,7 +218,7 @@ QMutableListIterator<int> i(list);
while (i.hasNext()) {
int val = i.next();
if (val < -32768 || val > 32767)
i.remove();
i.remove();
}
//! [19]
@ -228,7 +228,7 @@ QMutableLinkedListIterator<int> i(list);
while (i.hasNext()) {
int val = i.next();
if (val < -32768 || val > 32767)
i.remove();
i.remove();
}
//! [20]
@ -238,7 +238,7 @@ QMutableVectorIterator<int> i(vector);
while (i.hasNext()) {
int val = i.next();
if (val < -32768 || val > 32767)
i.remove();
i.remove();
}
//! [21]
@ -248,7 +248,7 @@ QMutableSetIterator<int> i(set);
while (i.hasNext()) {
int val = i.next();
if (val < -32768 || val > 32767)
i.remove();
i.remove();
}
//! [22]
@ -305,7 +305,7 @@ while (i.hasPrevious()) {
QMapIterator<int, QWidget *> i(map);
while (i.findNext(widget)) {
qDebug() << "Found widget " << widget << " under key "
<< i.key();
<< i.key();
}
//! [28]
@ -335,7 +335,7 @@ while (i.hasPrevious()) {
QHashIterator<int, QWidget *> i(hash);
while (i.findNext(widget)) {
qDebug() << "Found widget " << widget << " under key "
<< i.key();
<< i.key();
}
//! [31]
@ -365,7 +365,7 @@ while (i.hasPrevious()) {
QMutableMapIterator<int, QWidget *> i(map);
while (i.findNext(widget)) {
qDebug() << "Found widget " << widget << " under key "
<< i.key();
<< i.key();
}
//! [34]
@ -405,7 +405,7 @@ while (i.hasPrevious()) {
QMutableHashIterator<int, QWidget *> i(hash);
while (i.findNext(widget)) {
qDebug() << "Found widget " << widget << " under key "
<< i.key();
<< i.key();
}
//! [38]

View File

@ -523,10 +523,10 @@ class MyClass : public QObject
//! [45]
//! [46]
// Instead of comparing with 0.0
qFuzzyCompare(0.0,1.0e-200); // This will return false
// Compare adding 1 to both values will fix the problem
qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true
// Instead of comparing with 0.0
qFuzzyCompare(0.0,1.0e-200); // This will return false
// Compare adding 1 to both values will fix the problem
qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true
//! [46]
//! [47]

View File

@ -50,11 +50,11 @@ ButtonWidget::ButtonWidget(QStringList texts, QWidget *parent)
QGridLayout *gridLayout = new QGridLayout;
for (int i = 0; i < texts.size(); ++i) {
QPushButton *button = new QPushButton(texts[i]);
connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
QPushButton *button = new QPushButton(texts[i]);
connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
//! [0] //! [1]
signalMapper->setMapping(button, texts[i]);
gridLayout->addWidget(button, i / 3, i % 3);
signalMapper->setMapping(button, texts[i]);
gridLayout->addWidget(button, i / 3, i % 3);
}
connect(signalMapper, SIGNAL(mapped(QString)),

View File

@ -160,23 +160,23 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
#else
if (!QFile::exists(qtconfig) && QCoreApplication::instance()) {
#ifdef Q_OS_MAC
CFBundleRef bundleRef = CFBundleGetMainBundle();
CFBundleRef bundleRef = CFBundleGetMainBundle();
if (bundleRef) {
QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,
QCFString(QLatin1String("qt.conf")),
0,
0);
if (urlRef) {
QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
qtconfig = QDir::cleanPath(path);
}
}
if (qtconfig.isEmpty())
QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,
QCFString(QLatin1String("qt.conf")),
0,
0);
if (urlRef) {
QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
qtconfig = QDir::cleanPath(path);
}
}
if (qtconfig.isEmpty())
#endif
{
QDir pwd(QCoreApplication::applicationDirPath());
qtconfig = pwd.filePath(QLatin1String("qt.conf"));
}
}
}
#endif
if (QFile::exists(qtconfig))

View File

@ -129,9 +129,9 @@
# define __NR_inotify_rm_watch 271
# define __NR_inotify_init1 314
#elif defined (__avr32__)
# define __NR_inotify_init 240
# define __NR_inotify_add_watch 241
# define __NR_inotify_rm_watch 242
# define __NR_inotify_init 240
# define __NR_inotify_add_watch 241
# define __NR_inotify_rm_watch 242
// no inotify_init1 for AVR32
#elif defined (__mc68000__)
# define __NR_inotify_init 284

View File

@ -2388,14 +2388,14 @@ int QProcess::execute(const QString &program)
identifier of the started process.
*/
bool QProcess::startDetached(const QString &program,
const QStringList &arguments,
const QString &workingDirectory,
const QStringList &arguments,
const QString &workingDirectory,
qint64 *pid)
{
return QProcessPrivate::startDetached(program,
arguments,
workingDirectory,
pid);
arguments,
workingDirectory,
pid);
}
/*!
@ -2414,7 +2414,7 @@ bool QProcess::startDetached(const QString &program,
The started process will run as a regular standalone process.
*/
bool QProcess::startDetached(const QString &program,
const QStringList &arguments)
const QStringList &arguments)
{
return QProcessPrivate::startDetached(program, arguments);
}

View File

@ -1107,7 +1107,7 @@ bool QProcessPrivate::waitForStarted(int msecs)
#if defined (QPROCESS_DEBUG)
qDebug("QProcessPrivate::waitForStarted(%d) waiting for child to start (fd = %d)", msecs,
childStartedPipe[0]);
childStartedPipe[0]);
#endif
fd_set fds;
@ -1172,32 +1172,32 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
if (ret == 0) {
processError = QProcess::Timedout;
q->setErrorString(QProcess::tr("Process operation timed out"));
return false;
}
return false;
}
if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
if (!_q_startupNotification())
return false;
}
}
bool readyReadEmitted = false;
if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) {
bool canRead = _q_canReadStandardOutput();
if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) {
bool canRead = _q_canReadStandardOutput();
if (processChannel == QProcess::StandardOutput && canRead)
readyReadEmitted = true;
}
if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) {
bool canRead = _q_canReadStandardError();
}
if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) {
bool canRead = _q_canReadStandardError();
if (processChannel == QProcess::StandardError && canRead)
readyReadEmitted = true;
}
}
if (readyReadEmitted)
return true;
if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
_q_canWrite();
if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
_q_canWrite();
if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) {
if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) {
if (_q_processDied())
return false;
}
@ -1248,26 +1248,26 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
}
if (ret == 0) {
processError = QProcess::Timedout;
q->setErrorString(QProcess::tr("Process operation timed out"));
return false;
}
processError = QProcess::Timedout;
q->setErrorString(QProcess::tr("Process operation timed out"));
return false;
}
if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
if (!_q_startupNotification())
return false;
}
if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
if (!_q_startupNotification())
return false;
}
if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
return _q_canWrite();
if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
return _q_canWrite();
if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread))
_q_canReadStandardOutput();
if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread))
_q_canReadStandardOutput();
if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread))
_q_canReadStandardError();
if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread))
_q_canReadStandardError();
if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) {
if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) {
if (_q_processDied())
return false;
}
@ -1317,29 +1317,29 @@ bool QProcessPrivate::waitForFinished(int msecs)
if (ret < 0) {
break;
}
if (ret == 0) {
processError = QProcess::Timedout;
q->setErrorString(QProcess::tr("Process operation timed out"));
return false;
}
if (ret == 0) {
processError = QProcess::Timedout;
q->setErrorString(QProcess::tr("Process operation timed out"));
return false;
}
if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
if (!_q_startupNotification())
return false;
}
if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
_q_canWrite();
if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) {
if (!_q_startupNotification())
return false;
}
if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite))
_q_canWrite();
if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread))
_q_canReadStandardOutput();
if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread))
_q_canReadStandardOutput();
if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread))
_q_canReadStandardError();
if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread))
_q_canReadStandardError();
if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) {
if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) {
if (_q_processDied())
return true;
}
}
}
return false;
}

View File

@ -623,7 +623,7 @@ static BOOL QT_WIN_CALLBACK qt_terminateApp(HWND hwnd, LPARAM procId)
DWORD currentProcId = 0;
GetWindowThreadProcessId(hwnd, &currentProcId);
if (currentProcId == (DWORD)procId)
PostMessage(hwnd, WM_CLOSE, 0, 0);
PostMessage(hwnd, WM_CLOSE, 0, 0);
return TRUE;
}

View File

@ -1092,8 +1092,8 @@ QResource::unregisterResource(const QString &rccFilename, const QString &resourc
for(int i = 0; i < list->size(); ++i) {
QResourceRoot *res = list->at(i);
if(res->type() == QResourceRoot::Resource_File) {
QDynamicFileResourceRoot *root = reinterpret_cast<QDynamicFileResourceRoot*>(res);
if(root->mappingFile() == rccFilename && root->mappingRoot() == r) {
QDynamicFileResourceRoot *root = reinterpret_cast<QDynamicFileResourceRoot*>(res);
if (root->mappingFile() == rccFilename && root->mappingRoot() == r) {
resourceList()->removeAt(i);
if(!root->ref.deref()) {
delete root;
@ -1101,7 +1101,7 @@ QResource::unregisterResource(const QString &rccFilename, const QString &resourc
}
return false;
}
}
}
}
return false;
}
@ -1163,16 +1163,16 @@ QResource::unregisterResource(const uchar *rccData, const QString &resourceRoot)
for(int i = 0; i < list->size(); ++i) {
QResourceRoot *res = list->at(i);
if(res->type() == QResourceRoot::Resource_Buffer) {
QDynamicBufferResourceRoot *root = reinterpret_cast<QDynamicBufferResourceRoot*>(res);
if(root->mappingBuffer() == rccData && root->mappingRoot() == r) {
QDynamicBufferResourceRoot *root = reinterpret_cast<QDynamicBufferResourceRoot*>(res);
if (root->mappingBuffer() == rccData && root->mappingRoot() == r) {
resourceList()->removeAt(i);
if(!root->ref.deref()) {
delete root;
return true;
}
return false;
return false;
}
}
}
}
return false;
}
@ -1381,13 +1381,13 @@ QString QResourceFileEngine::fileName(FileName file) const
{
Q_D(const QResourceFileEngine);
if(file == BaseName) {
int slash = d->resource.fileName().lastIndexOf(QLatin1Char('/'));
if (slash == -1)
return d->resource.fileName();
return d->resource.fileName().mid(slash + 1);
int slash = d->resource.fileName().lastIndexOf(QLatin1Char('/'));
if (slash == -1)
return d->resource.fileName();
return d->resource.fileName().mid(slash + 1);
} else if(file == PathName || file == AbsolutePathName) {
const QString path = (file == AbsolutePathName) ? d->resource.absoluteFilePath() : d->resource.fileName();
const int slash = path.lastIndexOf(QLatin1Char('/'));
const int slash = path.lastIndexOf(QLatin1Char('/'));
if (slash == -1)
return QLatin1String(":");
else if (slash <= 1)

View File

@ -94,11 +94,11 @@ using namespace ABI::Windows::Storage;
#endif
#ifndef CSIDL_COMMON_APPDATA
#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
#endif
#ifndef CSIDL_APPDATA
#define CSIDL_APPDATA 0x001a // <username>\Application Data
#define CSIDL_APPDATA 0x001a // <username>\Application Data
#endif
#ifdef Q_AUTOTEST_EXPORT

View File

@ -117,7 +117,7 @@ public:
QSettings(Scope scope, const QString &organization,
const QString &application = QString(), QObject *parent = 0);
QSettings(Format format, Scope scope, const QString &organization,
const QString &application = QString(), QObject *parent = 0);
const QString &application = QString(), QObject *parent = 0);
QSettings(const QString &fileName, Format format, QObject *parent = 0);
explicit QSettings(QObject *parent = 0);
#else

View File

@ -77,7 +77,7 @@ typedef int NativeFileHandle;
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -73,7 +73,7 @@ inline bool operator<(const NameprepCaseFoldingEntry &one, uint other)
{ return one.uc < other; }
static const NameprepCaseFoldingEntry NameprepCaseFolding[] = {
/* { 0x0041, { 0x0061, 0x0000, 0x0000, 0x0000 } },
/* { 0x0041, { 0x0061, 0x0000, 0x0000, 0x0000 } },
{ 0x0042, { 0x0062, 0x0000, 0x0000, 0x0000 } },
{ 0x0043, { 0x0063, 0x0000, 0x0000, 0x0000 } },
{ 0x0044, { 0x0064, 0x0000, 0x0000, 0x0000 } },

View File

@ -114,7 +114,7 @@ void QWindowsPipeWriter::run()
if (quitNow) {
lock.unlock();
quitNow = false;
break;
break;
}
QByteArray copy = data;
@ -153,7 +153,7 @@ void QWindowsPipeWriter::run()
totalWritten += written;
#if defined QPIPEWRITER_DEBUG
qDebug("QWindowsPipeWriter::run() wrote %d %d/%d bytes",
written, int(totalWritten), int(maxlen));
written, int(totalWritten), int(maxlen));
#endif
lock.lock();
data.remove(0, written);

View File

@ -949,8 +949,8 @@ void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &sour
// update mapping
Mapping *cm = source_index_mapping.take(source_child_index);
Q_ASSERT(cm);
// we do not reinsert right away, because the new index might be identical with another, old index
moved_source_index_mappings.append(QPair<QModelIndex, Mapping*>(new_index, cm));
// we do not reinsert right away, because the new index might be identical with another, old index
moved_source_index_mappings.append(QPair<QModelIndex, Mapping*>(new_index, cm));
}
}
@ -1128,7 +1128,7 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
}
void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &source_top_left,
const QModelIndex &source_bottom_right)
const QModelIndex &source_bottom_right)
{
Q_Q(QSortFilterProxyModel);
if (!source_top_left.isValid() || !source_bottom_right.isValid())
@ -1200,8 +1200,8 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
source_parent, Qt::Vertical, false);
update_persistent_indexes(source_indexes);
emit q->layoutChanged(parents, QAbstractItemModel::VerticalSortHint);
// Make sure we also emit dataChanged for the rows
source_rows_change += source_rows_resort;
// Make sure we also emit dataChanged for the rows
source_rows_change += source_rows_resort;
}
if (!source_rows_change.isEmpty()) {

View File

@ -105,13 +105,13 @@ public:
inline operator T() { return type; }
inline QCFType operator =(const QCFType &helper)
{
if (helper.type)
CFRetain(helper.type);
CFTypeRef type2 = type;
type = helper.type;
if (type2)
CFRelease(type2);
return *this;
if (helper.type)
CFRetain(helper.type);
CFTypeRef type2 = type;
type = helper.type;
if (type2)
CFRelease(type2);
return *this;
}
inline T *operator&() { return &type; }
template <typename X> X as() const { return reinterpret_cast<X>(type); }

View File

@ -154,7 +154,7 @@ static inline QStringList qCmdLineArgs(int argc, char *argv[])
static inline QStringList qCmdLineArgs(int argc, char *argv[])
{
QStringList args;
for (int i = 0; i != argc; ++i)
for (int i = 0; i != argc; ++i)
args += QString::fromLocal8Bit(argv[i]);
return args;
}

View File

@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
*/
QString
QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
const QString &prefix)
const QString &prefix)
{
if (key.isEmpty())
return QString();
@ -350,7 +350,7 @@ bool QSharedMemory::create(int size, AccessMode mode)
if (size <= 0) {
d->error = QSharedMemory::InvalidSize;
d->errorString =
QSharedMemory::tr("%1: create size is less then 0").arg(function);
QSharedMemory::tr("%1: create size is less then 0").arg(function);
return false;
}

View File

@ -115,7 +115,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return false;
if (count > 0) {
if (0 == ReleaseSemaphore(semaphore, count, 0)) {
if (0 == ReleaseSemaphore(semaphore, count, 0)) {
setErrorString(QLatin1String("QSystemSemaphore::modifySemaphore"));
#if defined QSYSTEMSEMAPHORE_DEBUG
qDebug() << QLatin1String("QSystemSemaphore::modifySemaphore ReleaseSemaphore failed");

View File

@ -190,7 +190,7 @@ bool QLibraryPrivate::load_sys()
}
#endif
#if defined(Q_OS_AIX) // Not sure if any other platform actually support this thing.
#if defined(Q_OS_AIX) // Not sure if any other platform actually support this thing.
if (loadHints & QLibrary::LoadArchiveMemberHint) {
dlFlags |= RTLD_MEMBER;
}

View File

@ -665,62 +665,62 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root,
QSet<QAbstractState*> &statesToEnter,
QSet<QAbstractState*> &statesForDefaultEntry)
{
if (QHistoryState *h = toHistoryState(s)) {
QList<QAbstractState*> hconf = QHistoryStatePrivate::get(h)->configuration;
if (!hconf.isEmpty()) {
for (int k = 0; k < hconf.size(); ++k) {
QAbstractState *s0 = hconf.at(k);
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
qDebug() <<q_func() << ": restoring"
<< ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow")
<< "history from" << s << ':' << hconf;
#endif
} else {
QList<QAbstractState*> hlst;
if (QHistoryStatePrivate::get(h)->defaultState)
hlst.append(QHistoryStatePrivate::get(h)->defaultState);
if (QHistoryState *h = toHistoryState(s)) {
QList<QAbstractState*> hconf = QHistoryStatePrivate::get(h)->configuration;
if (!hconf.isEmpty()) {
for (int k = 0; k < hconf.size(); ++k) {
QAbstractState *s0 = hconf.at(k);
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": restoring"
<< ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow")
<< "history from" << s << ':' << hconf;
#endif
} else {
QList<QAbstractState*> hlst;
if (QHistoryStatePrivate::get(h)->defaultState)
hlst.append(QHistoryStatePrivate::get(h)->defaultState);
if (hlst.isEmpty()) {
setError(QStateMachine::NoDefaultStateInHistoryStateError, h);
} else {
for (int k = 0; k < hlst.size(); ++k) {
QAbstractState *s0 = hlst.at(k);
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": initial history targets for" << s << ':' << hlst;
#endif
}
}
} else {
if (s == rootState()) {
// Error has already been set by exitStates().
Q_ASSERT(error != QStateMachine::NoError);
if (hlst.isEmpty()) {
setError(QStateMachine::NoDefaultStateInHistoryStateError, h);
} else {
for (int k = 0; k < hlst.size(); ++k) {
QAbstractState *s0 = hlst.at(k);
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": initial history targets for" << s << ':' << hlst;
#endif
}
}
} else {
if (s == rootState()) {
// Error has already been set by exitStates().
Q_ASSERT(error != QStateMachine::NoError);
return;
}
statesToEnter.insert(s);
if (isParallel(s)) {
QState *grp = toStandardState(s);
QList<QAbstractState*> lst = QStatePrivate::get(grp)->childStates();
for (int i = 0; i < lst.size(); ++i) {
QAbstractState *child = lst.at(i);
addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry);
}
} else if (isCompound(s)) {
statesForDefaultEntry.insert(s);
QState *grp = toStandardState(s);
QAbstractState *initial = grp->initialState();
if (initial != 0) {
Q_ASSERT(initial->machine() == q_func());
addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry);
} else {
setError(QStateMachine::NoInitialStateError, grp);
return;
}
statesToEnter.insert(s);
if (isParallel(s)) {
QState *grp = toStandardState(s);
QList<QAbstractState*> lst = QStatePrivate::get(grp)->childStates();
for (int i = 0; i < lst.size(); ++i) {
QAbstractState *child = lst.at(i);
addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry);
}
} else if (isCompound(s)) {
statesForDefaultEntry.insert(s);
QState *grp = toStandardState(s);
QAbstractState *initial = grp->initialState();
if (initial != 0) {
Q_ASSERT(initial->machine() == q_func());
addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry);
} else {
setError(QStateMachine::NoInitialStateError, grp);
return;
}
}
}
}
}
}
void QStateMachinePrivate::addAncestorStatesToEnter(QAbstractState *s, QState *root,

View File

@ -84,9 +84,9 @@ public:
bool wait(QMutex *mutex, unsigned long time = ULONG_MAX)
{
Q_UNUSED(mutex);
Q_UNUSED(time);
return true;
Q_UNUSED(mutex);
Q_UNUSED(time);
return true;
}
void wakeOne() {}

View File

@ -746,8 +746,8 @@ QDataStream &operator>>(QDataStream &in, QBitArray &ba)
quint32 len;
in >> len;
if (len == 0) {
ba.clear();
return in;
ba.clear();
return in;
}
const quint32 Step = 8 * 1024 * 1024;

Some files were not shown because too many files have changed in this diff Show More