From 059bf03f30c0e27830d311ae9a664eb0376fcd1f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 9 Apr 2010 16:13:57 +0200 Subject: fix closing state in QLocalSocket on Windows When closing a QLocalSocket, which has unwritten data, the pipe writer was never deleted. Thus writing after a reconnect didn't work. Task-number: QTBUG-9681 Reviewed-by: ossi --- src/network/socket/qlocalsocket_win.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 3283bf2..5f46ecb 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include "qlocalsocket.h" #include "qlocalsocket_p.h" #include @@ -425,6 +424,15 @@ bool QLocalSocket::flush() void QLocalSocket::disconnectFromServer() { Q_D(QLocalSocket); + + // Are we still connected? + if (!isValid()) { + // If we have unwritten data, the pipeWriter is still present. + // It must be destroyed before close() to prevent an infinite loop. + delete d->pipeWriter; + d->pipeWriter = 0; + } + flush(); if (d->pipeWriter && d->pipeWriter->bytesToWrite() != 0) { d->state = QLocalSocket::ClosingState; -- cgit v0.12 From d3c1dea37f95ba2bb75a2a264e4d806c4c0c36f3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 12 Apr 2010 15:52:14 +0200 Subject: CSS: fixes border only affecting the first widget. Rules like "Foo { border: 2px solid; }" does not specify the border color. When the border color is not specified, it is assumed to be black. When reading the brush value from the cache, we should take that into account. Note that this logic cannot be moved into brushFromData() as it is different for the background. (when no color is specified, it is assumed to be transparent) Reviewed-by: jbache Task-number: QTBUG-9674 (part one) --- src/gui/text/qcssparser.cpp | 2 +- tests/auto/qcssparser/tst_qcssparser.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 938decd..b3d2526 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -895,7 +895,7 @@ void ValueExtractor::borderValue(const Declaration &decl, int *width, QCss::Bord BorderData data = qvariant_cast(decl.d->parsed); *width = lengthValueFromData(data.width, f); *style = data.style; - *color = brushFromData(data.color, pal); + *color = data.color.type != BrushData::Invalid ? brushFromData(data.color, pal) : QBrush(QColor()); return; } diff --git a/tests/auto/qcssparser/tst_qcssparser.cpp b/tests/auto/qcssparser/tst_qcssparser.cpp index ef102a0..966563c 100644 --- a/tests/auto/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/qcssparser/tst_qcssparser.cpp @@ -1381,6 +1381,13 @@ void tst_QCssParser::shorthandBackgroundProperty() QTEST(image, "expectedImage"); QTEST(int(repeat), "expectedRepeatValue"); QTEST(int(alignment), "expectedAlignment"); + + //QTBUG-9674 : a second evaluation should give the same results + QVERIFY(v.extractBackground(&brush, &image, &repeat, &alignment, &origin, &attachment, &ignoredOrigin)); + QVERIFY(expectedBrush.color() == brush.color()); + QTEST(image, "expectedImage"); + QTEST(int(repeat), "expectedRepeatValue"); + QTEST(int(alignment), "expectedAlignment"); } void tst_QCssParser::pseudoElement_data() @@ -1644,6 +1651,12 @@ void tst_QCssParser::extractBorder() QVERIFY(widths[QCss::TopEdge] == expectedTopWidth); QVERIFY(styles[QCss::TopEdge] == expectedTopStyle); QVERIFY(colors[QCss::TopEdge] == expectedTopColor); + + //QTBUG-9674 : a second evaluation should give the same results + QVERIFY(extractor.extractBorder(widths, colors, styles, radii)); + QVERIFY(widths[QCss::TopEdge] == expectedTopWidth); + QVERIFY(styles[QCss::TopEdge] == expectedTopStyle); + QVERIFY(colors[QCss::TopEdge] == expectedTopColor); } void tst_QCssParser::noTextDecoration() -- cgit v0.12