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) StyleWidget::StyleWidget(QWidget *parent)
: QFrame(parent) : QFrame(parent)
{ {
m_ui.setupUi(this); m_ui.setupUi(this);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -186,10 +186,10 @@ TwoSidedGraphicsWidget::TwoSidedGraphicsWidget(QGraphicsScene *scene)
void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget) void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
{ {
if (index < 0 || index >= 2) if (index < 0 || index >= 2)
{ {
qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index); qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index);
return; return;
} }
GraphicsWidget *proxy = new GraphicsWidget; GraphicsWidget *proxy = new GraphicsWidget;
proxy->setWidget(widget); proxy->setWidget(widget);
@ -210,10 +210,10 @@ void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
QWidget *TwoSidedGraphicsWidget::widget(int index) QWidget *TwoSidedGraphicsWidget::widget(int index)
{ {
if (index < 0 || index >= 2) if (index < 0 || index >= 2)
{ {
qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index); qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
return 0; return 0;
} }
return m_proxyWidgets[index]->widget(); 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 rightShadow(sceneRect.right(), sceneRect.top() + 5, 5, sceneRect.height());
QRectF bottomShadow(sceneRect.left() + 5, sceneRect.bottom(), sceneRect.width(), 5); QRectF bottomShadow(sceneRect.left() + 5, sceneRect.bottom(), sceneRect.width(), 5);
if (rightShadow.intersects(rect) || rightShadow.contains(rect)) if (rightShadow.intersects(rect) || rightShadow.contains(rect))
painter->fillRect(rightShadow, Qt::darkGray); painter->fillRect(rightShadow, Qt::darkGray);
if (bottomShadow.intersects(rect) || bottomShadow.contains(rect)) if (bottomShadow.intersects(rect) || bottomShadow.contains(rect))
painter->fillRect(bottomShadow, Qt::darkGray); painter->fillRect(bottomShadow, Qt::darkGray);
// Fill // Fill
QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight()); 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 !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) { if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) {
QMessageBox::StandardButton answer; QMessageBox::StandardButton answer;
answer = QMessageBox::question(this, tr("Large Image Size"), answer = QMessageBox::question(this, tr("Large Image Size"),
tr("The printed image may be very large. Are you sure that " tr("The printed image may be very large. Are you sure that "
"you want to print it?"), "you want to print it?"),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if (answer == QMessageBox::No) if (answer == QMessageBox::No)
return; return;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -162,7 +162,7 @@ void MainWindow::createActions()
QString text = tr("%1...").arg(QString(codec->name())); QString text = tr("%1...").arg(QString(codec->name()));
QAction *action = new QAction(text, this); QAction *action = new QAction(text, this);
action->setData(codec->name()); action->setData(codec->name());
connect(action, SIGNAL(triggered()), this, SLOT(save())); connect(action, SIGNAL(triggered()), this, SLOT(save()));
saveAsActs.append(action); 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 //save value from editor to member m_gridData
m_gridData[index.row()][index.column()] = value.toString(); 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; QString result;
for(int row= 0; row < ROWS; row++) for (int row= 0; row < ROWS; row++)
{ {
for(int col= 0; col < COLS; col++) for(int col= 0; col < COLS; col++)
{ {
result += m_gridData[row][col] + " "; result += m_gridData[row][col] + " ";
} }
} }
emit editCompleted( result ); emit editCompleted( result );
} }

View File

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

View File

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

View File

@ -219,7 +219,7 @@ bool MainWindow::maybeSave()
tr("The image has been modified.\n" tr("The image has been modified.\n"
"Do you want to save your changes?"), "Do you want to save your changes?"),
QMessageBox::Save | QMessageBox::Discard QMessageBox::Save | QMessageBox::Discard
| QMessageBox::Cancel); | QMessageBox::Cancel);
if (ret == QMessageBox::Save) { if (ret == QMessageBox::Save) {
return saveFile("png"); return saveFile("png");
} else if (ret == QMessageBox::Cancel) { } 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)); meetingEdit->setDateRange(QDate(2004, 11, 1), QDate(2005, 11, 30));
meetingLabel->setText(tr("Meeting date (between %0 and %1):") meetingLabel->setText(tr("Meeting date (between %0 and %1):")
.arg(meetingEdit->minimumDate().toString(Qt::ISODate)) .arg(meetingEdit->minimumDate().toString(Qt::ISODate))
.arg(meetingEdit->maximumDate().toString(Qt::ISODate))); .arg(meetingEdit->maximumDate().toString(Qt::ISODate)));
} else { } else {
meetingEdit->setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0)); meetingEdit->setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0));
meetingLabel->setText(tr("Meeting time (between %0 and %1):") meetingLabel->setText(tr("Meeting time (between %0 and %1):")
.arg(meetingEdit->minimumTime().toString(Qt::ISODate)) .arg(meetingEdit->minimumTime().toString(Qt::ISODate))
.arg(meetingEdit->maximumTime().toString(Qt::ISODate))); .arg(meetingEdit->maximumTime().toString(Qt::ISODate)));
} }
} }
//! [13] //! [13]

View File

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

View File

@ -63,7 +63,7 @@ void WigglyWidget::paintEvent(QPaintEvent * /* event */)
//! [1] //! [2] //! [1] //! [2]
{ {
static const int sineTable[16] = { 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()); QFontMetrics metrics(font());
@ -94,7 +94,7 @@ void WigglyWidget::timerEvent(QTimerEvent *event)
++step; ++step;
update(); update();
} else { } else {
QWidget::timerEvent(event); QWidget::timerEvent(event);
} }
//! [6] //! [6]
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -85,7 +85,7 @@
#undef QT_SOCKLEN_T #undef QT_SOCKLEN_T
#define QT_SOCKLEN_T int #define QT_SOCKLEN_T int
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf #define QT_VSNPRINTF ::vsnprintf
#endif // QPLATFORMDEFS_H #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); } { return ::connect(s, addr, addrlen); }
// Only Solaris 7 and better support 64-bit // Only Solaris 7 and better support 64-bit
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf #define QT_VSNPRINTF ::vsnprintf
#ifdef connect #ifdef connect
#undef connect #undef connect

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1316,7 +1316,7 @@ UnixMakefileGenerator::writeLibtoolFile()
t << "# " << lname << " - a libtool library file\n"; t << "# " << lname << " - a libtool library file\n";
t << "# Generated by qmake/libtool (" QMAKE_VERSION_STR ") (Qt " t << "# Generated by qmake/libtool (" QMAKE_VERSION_STR ") (Qt "
<< QT_VERSION_STR << ") on: " << QDateTime::currentDateTime().toString(); << QT_VERSION_STR << ") on: " << QDateTime::currentDateTime().toString();
t << "\n"; t << "\n";
t << "# The name that we can dlopen(3).\n" t << "# The name that we can dlopen(3).\n"
<< "dlname='" << var(project->isActiveConfig("plugin") ? "TARGET" : "TARGET_x") << "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 if (!out.isEmpty()) // We assume if it never finds it that its correct
(*it) = out; (*it) = out;
} else if((*it).startsWith("-L")) { } else if ((*it).startsWith("-L")) {
dirs.append(QMakeLocalFileName((*it).mid(2).toQString())); dirs.append(QMakeLocalFileName((*it).mid(2).toQString()));
} }
@ -159,7 +159,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
t << path << endl; t << path << endl;
} }
t << ");\n"; t << ");\n";
t.flush(); t.flush();
file.close(); file.close();
} }
} }
@ -175,7 +175,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
t << "ADDMOD " << *it << endl; t << "ADDMOD " << *it << endl;
} }
t << "SAVE\n"; t << "SAVE\n";
t.flush(); t.flush();
file.close(); file.close();
} }
} }
@ -204,16 +204,16 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
if (!preCompHeaderOut.isEmpty()) { if (!preCompHeaderOut.isEmpty()) {
QString header = project->first("PRECOMPILED_HEADER").toQString(); QString header = project->first("PRECOMPILED_HEADER").toQString();
QString cHeader = preCompHeaderOut + Option::dir_sep + "c"; QString cHeader = preCompHeaderOut + Option::dir_sep + "c";
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " " t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << 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 << "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
<< endl << endl; << endl << endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++"; QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " " t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << 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 << "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
<< endl << endl; << endl << endl;
} }
@ -269,7 +269,7 @@ void MingwMakefileGenerator::init()
destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false); destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false);
project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET") project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET")
+ project->first("TARGET_VERSION_EXT") + ".a"); + 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()) { if (!project->values("DEF_FILE").isEmpty()) {
@ -287,21 +287,21 @@ void MingwMakefileGenerator::init()
&& project->isActiveConfig("precompile_header")) { && project->isActiveConfig("precompile_header")) {
QString preCompHeader = var("PRECOMPILED_DIR") QString preCompHeader = var("PRECOMPILED_DIR")
+ QFileInfo(project->first("PRECOMPILED_HEADER").toQString()).fileName(); + QFileInfo(project->first("PRECOMPILED_HEADER").toQString()).fileName();
preCompHeaderOut = preCompHeader + ".gch"; 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_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").clear();
project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader + project->values("QMAKE_RUN_CC").append("$(CC) -c -include " + preCompHeader +
" $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src"); " $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src");
project->values("QMAKE_RUN_CC_IMP").clear(); 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") + "$@ $<"); " $(CFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$@ $<");
project->values("QMAKE_RUN_CXX").clear(); 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"); " $(CXXFLAGS) $(INCPATH) " + var("QMAKE_CC_O_FLAG") + "$obj $src");
project->values("QMAKE_RUN_CXX_IMP").clear(); 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") + "$@ $<"); " $(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()) { if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
objectsLinkLine = "$(OBJECTS)"; objectsLinkLine = "$(OBJECTS)";
} else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { } else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) { if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME"); ar_script_file += "." + var("BUILD_NAME");
} }
// QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix. // QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
if (project->isActiveConfig("rvct_linker")) { if (project->isActiveConfig("rvct_linker")) {
createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS")); createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS"));
@ -371,9 +371,9 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
} }
} else { } else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) { if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME"); ld_script_file += "." + var("BUILD_NAME");
} }
if (project->isActiveConfig("rvct_linker")) { if (project->isActiveConfig("rvct_linker")) {
createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS")); createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
objectsLinkLine = QString::fromLatin1("--via ") + escapeFilePath(ld_script_file); objectsLinkLine = QString::fromLatin1("--via ") + escapeFilePath(ld_script_file);
@ -393,7 +393,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if(!project->isEmpty("QMAKE_PRE_LINK")) if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK"); t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { 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 << " " ; t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
} else { } else {
t << "\n\t" << objectsLinkLine << " " ; t << "\n\t" << objectsLinkLine << " " ;

View File

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

View File

@ -955,7 +955,7 @@ public:
VCConfiguration* Config; VCConfiguration* Config;
QList<VCFilterFile> Files; QList<VCFilterFile> Files;
customBuildCheck CustomBuild; customBuildCheck CustomBuild;
bool useCustomBuildTool; bool useCustomBuildTool;
VCCustomBuildTool CustomBuildTool; 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); 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) { for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
if(regx.exactMatch((*it))) { if(regx.exactMatch((*it))) {
if (!regx.cap(3).isEmpty()) { if (!regx.cap(3).isEmpty()) {
bool ok = true; bool ok = true;
int num = regx.cap(3).toInt(&ok); int num = regx.cap(3).toInt(&ok);
biggest = qMax(biggest, (!ok ? -1 : num)); biggest = qMax(biggest, (!ok ? -1 : num));
} }
} }
} }
} }
if(libInfoRead if(libInfoRead
@ -485,20 +485,20 @@ void Win32MakefileGenerator::processRcFileVar()
rcFile.close(); rcFile.close();
} }
if (writeRcFile) { if (writeRcFile) {
bool ok; bool ok;
ok = rcFile.open(QFile::WriteOnly); ok = rcFile.open(QFile::WriteOnly);
if (!ok) { if (!ok) {
// The file can't be opened... try creating the containing // The file can't be opened... try creating the containing
// directory first (needed for clean shadow builds) // directory first (needed for clean shadow builds)
QDir().mkpath(QFileInfo(rcFile).path()); QDir().mkpath(QFileInfo(rcFile).path());
ok = rcFile.open(QFile::WriteOnly); ok = rcFile.open(QFile::WriteOnly);
} }
if (!ok) { if (!ok) {
::fprintf(stderr, "Cannot open for writing: %s", rcFile.fileName().toLatin1().constData()); ::fprintf(stderr, "Cannot open for writing: %s", rcFile.fileName().toLatin1().constData());
::exit(1); ::exit(1);
} }
rcFile.write(rcString); rcFile.write(rcString);
rcFile.close(); rcFile.close();
} }
if (project->values("QMAKE_WRITE_DEFAULT_RC").isEmpty()) if (project->values("QMAKE_WRITE_DEFAULT_RC").isEmpty())
project->values("RC_FILE").insert(0, rcFile.fileName()); 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() = Option::fixPathToTargetOS(
project->values("RES_FILE").first().toQString(), false, false); 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"); project->values("CLEAN_FILES") += project->values("RES_FILE");
} }
} }

View File

@ -329,9 +329,9 @@ Option::init(int argc, char **argv)
globals->qmake_abslocation = argv0; globals->qmake_abslocation = argv0;
} else if (argv0.contains(QLatin1Char('/')) } else if (argv0.contains(QLatin1Char('/'))
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
|| argv0.contains(QLatin1Char('\\')) || argv0.contains(QLatin1Char('\\'))
#endif #endif
) { //relative PWD ) { //relative PWD
globals->qmake_abslocation = QDir::current().absoluteFilePath(argv0); globals->qmake_abslocation = QDir::current().absoluteFilePath(argv0);
} else { //in the PATH } else { //in the PATH
QByteArray pEnv = qgetenv("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()); qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData());
} else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) { } else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) {
qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData()); qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData());
} }
} }
void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue) void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -77,7 +77,7 @@ typedef int NativeFileHandle;
/* /*
* Copyright (c) 1987, 1993 * 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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * 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; } { return one.uc < other; }
static const NameprepCaseFoldingEntry NameprepCaseFolding[] = { static const NameprepCaseFoldingEntry NameprepCaseFolding[] = {
/* { 0x0041, { 0x0061, 0x0000, 0x0000, 0x0000 } }, /* { 0x0041, { 0x0061, 0x0000, 0x0000, 0x0000 } },
{ 0x0042, { 0x0062, 0x0000, 0x0000, 0x0000 } }, { 0x0042, { 0x0062, 0x0000, 0x0000, 0x0000 } },
{ 0x0043, { 0x0063, 0x0000, 0x0000, 0x0000 } }, { 0x0043, { 0x0063, 0x0000, 0x0000, 0x0000 } },
{ 0x0044, { 0x0064, 0x0000, 0x0000, 0x0000 } }, { 0x0044, { 0x0064, 0x0000, 0x0000, 0x0000 } },

View File

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

View File

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

View File

@ -105,13 +105,13 @@ public:
inline operator T() { return type; } inline operator T() { return type; }
inline QCFType operator =(const QCFType &helper) inline QCFType operator =(const QCFType &helper)
{ {
if (helper.type) if (helper.type)
CFRetain(helper.type); CFRetain(helper.type);
CFTypeRef type2 = type; CFTypeRef type2 = type;
type = helper.type; type = helper.type;
if (type2) if (type2)
CFRelease(type2); CFRelease(type2);
return *this; return *this;
} }
inline T *operator&() { return &type; } inline T *operator&() { return &type; }
template <typename X> X as() const { return reinterpret_cast<X>(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[]) static inline QStringList qCmdLineArgs(int argc, char *argv[])
{ {
QStringList args; QStringList args;
for (int i = 0; i != argc; ++i) for (int i = 0; i != argc; ++i)
args += QString::fromLocal8Bit(argv[i]); args += QString::fromLocal8Bit(argv[i]);
return args; return args;
} }

View File

@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
*/ */
QString QString
QSharedMemoryPrivate::makePlatformSafeKey(const QString &key, QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
const QString &prefix) const QString &prefix)
{ {
if (key.isEmpty()) if (key.isEmpty())
return QString(); return QString();
@ -350,7 +350,7 @@ bool QSharedMemory::create(int size, AccessMode mode)
if (size <= 0) { if (size <= 0) {
d->error = QSharedMemory::InvalidSize; d->error = QSharedMemory::InvalidSize;
d->errorString = 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; return false;
} }

View File

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

View File

@ -190,7 +190,7 @@ bool QLibraryPrivate::load_sys()
} }
#endif #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) { if (loadHints & QLibrary::LoadArchiveMemberHint) {
dlFlags |= RTLD_MEMBER; dlFlags |= RTLD_MEMBER;
} }

View File

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

View File

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

View File

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

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