summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-28 20:16:34 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-28 20:16:34 (GMT)
commit917e4e3284a568eecfca26365cc0a545d0f4eb70 (patch)
tree247bbe996467199c011a348658d62844206336e0 /src
parent0599478b270ae277121a55c6040acc15edd4d6eb (diff)
parent8d84ef130ca8dc3d6a7c0b6e7408ad2db6874e75 (diff)
downloadQt-917e4e3284a568eecfca26365cc0a545d0f4eb70.zip
Qt-917e4e3284a568eecfca26365cc0a545d0f4eb70.tar.gz
Qt-917e4e3284a568eecfca26365cc0a545d0f4eb70.tar.bz2
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (73 commits) Apply Rhys's fix to qpaintengine_vg.cpp to make it compile Attempt again at fixing the OpenVG paint engine build Revert "Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp" Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp Fixing the wrong QUrl usage When on Symbian use smaller files. correctly position glyphs for complex languages Removed inneccessary QGlyphLayout::offsets initialization. Fix mirrored characters for RTL text in Symbian QNAM: Add a code comment related to the cache tst_QSystemSemaphore::processes fixed for WinCE tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE tst_qsharedmemory: create multiple instances of lackey.exe on WinCE tst_qsharedmemory: fix deployment of lackey.exe for WinCE fix compilation of tst_sharedmemory on Windows CE QtScript: regression with instanceof operator for QMetaObject wrappers examples/widgets/stylesheet fix mainwindow.ui QStyleSheetStyle: fix memory leak on base style change QNAM HTTP: Fixed a bug when getting empty files with pipelining Fix window transparency on Symbian. ...
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qiodevice.cpp13
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h7
-rw-r--r--src/gui/graphicsview/qgraphicsview_p.h8
-rw-r--r--src/gui/kernel/qapplication_s60.cpp9
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp2
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm11
-rw-r--r--src/gui/kernel/qt_s60_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp82
-rw-r--r--src/gui/painting/qprintengine_win.cpp7
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp12
-rw-r--r--src/gui/styles/qs60style.cpp12
-rw-r--r--src/gui/styles/qs60style_s60.cpp8
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp9
-rw-r--r--src/gui/styles/qstylesheetstyle_p.h1
-rw-r--r--src/gui/text/qfontengine_s60.cpp8
-rw-r--r--src/gui/widgets/qmenu.cpp4
-rw-r--r--src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp3
-rw-r--r--src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp7
-rw-r--r--src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp3
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp6
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp5
-rw-r--r--src/openvg/qpaintengine_vg.cpp56
-rw-r--r--src/openvg/qpaintengine_vg_p.h4
-rw-r--r--src/script/bridge/qscriptqobject_p.h2
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp1
-rw-r--r--src/testlib/qtestlogger.cpp29
-rw-r--r--src/testlib/qtestlogger_p.h1
-rw-r--r--src/testlib/qtestxmlstreamer.cpp58
-rw-r--r--src/xmlpatterns/xmlpatterns.pro15
30 files changed, 265 insertions, 123 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index f2cef4e1..bb11d6b 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -755,7 +755,6 @@ qint64 QIODevice::bytesToWrite() const
qint64 QIODevice::read(char *data, qint64 maxSize)
{
Q_D(QIODevice);
- CHECK_READABLE(read, qint64(-1));
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::read(%p, %d), d->pos = %d, d->buffer.size() = %d\n",
@@ -786,13 +785,13 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
do {
// Try reading from the buffer.
int lastReadChunkSize = d->buffer.read(data, maxSize);
- *d->pPos += lastReadChunkSize;
- readSoFar += lastReadChunkSize;
- // fast exit when satisfied by buffer
- if (lastReadChunkSize == maxSize && !(d->openMode & Text))
- return readSoFar;
-
if (lastReadChunkSize > 0) {
+ *d->pPos += lastReadChunkSize;
+ readSoFar += lastReadChunkSize;
+ // fast exit when satisfied by buffer
+ if (lastReadChunkSize == maxSize && !(d->openMode & Text))
+ return readSoFar;
+
data += lastReadChunkSize;
maxSize -= lastReadChunkSize;
#if defined QIODEVICE_DEBUG
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 6b22607..569a329 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -845,6 +845,13 @@ inline bool QGraphicsItemPrivate::insertionOrder(QGraphicsItem *a, QGraphicsItem
inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
{
QGraphicsItemPrivate *parentp = this;
+#ifndef QT_NO_GRAPHICSEFFECT
+ if (updateBoundingRect && parentp->graphicsEffect && !parentp->inSetPosHelper) {
+ parentp->notifyInvalidated = 1;
+ static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
+ ->source->d_func())->invalidateCache();
+ }
+#endif
while (parentp->parent) {
parentp = parentp->parent->d_ptr.data();
parentp->dirtyChildren = 1;
diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h
index 729837a..80e3ec1 100644
--- a/src/gui/graphicsview/qgraphicsview_p.h
+++ b/src/gui/graphicsview/qgraphicsview_p.h
@@ -183,8 +183,12 @@ public:
else
QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
#else
- QCoreApplication::processEvents(QEventLoop::AllEvents | QEventLoop::ExcludeSocketNotifiers
- | QEventLoop::ExcludeUserInputEvents);
+ // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa)
+ // is called, which means there's a pending update request. We want to dispatch it
+ // now because otherwise graphics view updates would require two
+ // round-trips in the event loop before the item is painted.
+ extern void qt_mac_dispatchPendingUpdateRequests(QWidget *);
+ qt_mac_dispatchPendingUpdateRequests(viewport->window());
#endif
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index c735d1f..c9a79eb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -73,6 +73,7 @@
# endif
# include <private/qs60mainapplication_p.h>
# include <centralrepository.h>
+# include "qs60mainappui.h"
#endif
#include "private/qstylesheetstyle_p.h"
@@ -539,6 +540,14 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
sendMouseEvent(receiver, type, globalPos, button, modifiers);
}
+#ifdef Q_WS_S60
+void QSymbianControl::HandleStatusPaneSizeChange()
+{
+ QS60MainAppUi *s60AppUi = static_cast<QS60MainAppUi *>(S60->appUi());
+ s60AppUi->HandleStatusPaneSizeChange();
+}
+#endif
+
void QSymbianControl::sendMouseEvent(
QWidget *receiver,
QEvent::Type type,
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index e4990b1..6325d95 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -79,6 +79,8 @@ bool QSoftKeyManagerPrivateS60::skipCbaUpdate()
// Note: Cannot use IsDisplayingMenuOrDialog since CBA update can be triggered before
// menu/dialog CBA is actually displayed i.e. it is being costructed.
CEikButtonGroupContainer *appUiCba = S60->buttonGroupContainer();
+ if (!appUiCba)
+ return true;
// CEikButtonGroupContainer::Current returns 0 if CBA is not visible at all
CEikButtonGroupContainer *currentCba = CEikButtonGroupContainer::Current();
// Check if softkey need to be update even they are not visible
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 024c1fc..8cef03c 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -1299,6 +1299,17 @@ CGContextRef qt_mac_graphicsContextFor(QWidget *widget)
return context;
}
+void qt_mac_dispatchPendingUpdateRequests(QWidget *widget)
+{
+ if (!widget)
+ return;
+#ifndef QT_MAC_USE_COCOA
+ HIViewRender(qt_mac_nativeview_for(widget));
+#else
+ [qt_mac_nativeview_for(widget) displayIfNeeded];
+#endif
+}
+
CGFloat qt_mac_get_scalefactor()
{
#ifndef QT_MAC_USE_COCOA
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index a714221..58da302 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -155,7 +155,7 @@ class QLongTapTimer;
class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver
#ifdef Q_WS_S60
-, public MAknFadedComponent
+, public MAknFadedComponent, public MEikStatusPaneObserver
#endif
{
public:
@@ -183,6 +183,7 @@ public:
#ifdef Q_WS_S60
void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
+ void HandleStatusPaneSizeChange();
protected: // from MAknFadedComponent
TInt CountFadedComponents() {return 1;}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index bfa7050..c30814b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -387,16 +387,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
| EPointerFilterMove | EPointerFilterDrag, 0);
drawableWindow->EnableVisibilityChangeEvents();
- if (!isOpaque) {
- RWindow *const window = static_cast<RWindow *>(drawableWindow);
-#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
- window->SetSurfaceTransparency(true);
-#else
- const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
- if (window->SetTransparencyAlphaChannel() == KErrNone)
- window->SetBackgroundColor(TRgb(255, 255, 255, 0));
-#endif
- }
+ s60UpdateIsOpaque();
}
q->setAttribute(Qt::WA_WState_Created);
@@ -488,6 +479,47 @@ void QWidgetPrivate::show_sys()
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
+#ifdef Q_WS_S60
+ // Lazily initialize the S60 screen furniture when the first window is shown.
+ if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
+ && !S60->buttonGroupContainer() && !S60->statusPane()) {
+
+ bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
+ bool cbaRequested = q->windowFlags() & Qt::WindowSoftkeysVisibleHint;
+
+ // If the window is fullscreen and has not explicitly requested that the CBA be visible
+ // we delay the creation even more.
+ if ((!isFullscreen || cbaRequested) && !q->testAttribute(Qt::WA_DontShowOnScreen)) {
+
+ // Create the status pane and CBA here
+ CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
+ MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory();
+ TRAP_IGNORE(factory->ReadAppInfoResourceL(0, ui));
+ if (S60->buttonGroupContainer())
+ S60->buttonGroupContainer()->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+
+ if (S60->statusPane()) {
+ // Use QDesktopWidget as the status pane observer to proxy for the AppUi.
+ // Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver.
+ QSymbianControl *desktopControl = static_cast<QSymbianControl *>(QApplication::desktop()->winId());
+ S60->statusPane()->SetObserver(desktopControl);
+
+ // Hide the status pane if fullscreen OR
+ // Fill client area if maximized OR
+ // Put window below status pane unless the window has an explicit position.
+ if (isFullscreen) {
+ S60->statusPane()->MakeVisible(false);
+ } else if (q->windowState() & Qt::WindowMaximized) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ id->SetExtent(r.iTl, r.Size());
+ } else if (!q->testAttribute(Qt::WA_Moved)) {
+ id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
+ }
+ }
+ }
+ }
+#endif
+
id->MakeVisible(true);
if(q->isWindow())
@@ -1063,6 +1095,9 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
return;
if (isWindow()) {
+ createWinId();
+ Q_ASSERT(testAttribute(Qt::WA_WState_Created));
+
const bool wasResized = testAttribute(Qt::WA_Resized);
const bool wasMoved = testAttribute(Qt::WA_Moved);
@@ -1100,23 +1135,32 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
}
#endif // Q_WS_S60
- createWinId();
- Q_ASSERT(testAttribute(Qt::WA_WState_Created));
// Ensure the initial size is valid, since we store it as normalGeometry below.
if (!wasResized && !isVisible())
adjustSize();
QTLWExtra *top = d->topData();
- const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
-
+ QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint;
- if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint)
- setGeometry(qApp->desktop()->screenGeometry(this));
- else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint))
- setGeometry(qApp->desktop()->availableGeometry(this));
- else
+ if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint) {
+ window->SetExtentToWholeScreen();
+ } else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint)) {
+ TRect maxExtent = qt_QRect2TRect(qApp->desktop()->availableGeometry(this));
+ window->SetExtent(maxExtent.iTl, maxExtent.Size());
+ } else {
+#ifdef Q_WS_S60
+ // With delayed creation of S60 app panes, the normalGeometry calculated above is not
+ // accurate because it did not consider the status pane. This means that when returning
+ // normal mode after showing the status pane, the geometry would overlap so we should
+ // move it if it never had an explicit position.
+ if (!wasMoved && statusPane && visible) {
+ TPoint tl = static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl;
+ normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY));
+ }
+#endif
setGeometry(normalGeometry);
+ }
//restore normal geometry
top->normalGeometry = normalGeometry;
diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp
index ea9dc5d..dd4de99 100644
--- a/src/gui/painting/qprintengine_win.cpp
+++ b/src/gui/painting/qprintengine_win.cpp
@@ -965,12 +965,13 @@ void QWin32PrintEnginePrivate::queryDefault()
return;
QStringList info = output.split(QLatin1Char(','));
- if (info.size() > 0) {
+ int infoSize = info.size();
+ if (infoSize > 0) {
if (name.isEmpty())
name = info.at(0);
- if (program.isEmpty())
+ if (program.isEmpty() && infoSize > 1)
program = info.at(1);
- if (port.isEmpty())
+ if (port.isEmpty() && infoSize > 2)
port = info.at(2);
}
}
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index 3b5b9d3..feffc9f 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -112,16 +112,10 @@ void QS60MainAppUi::ConstructL()
// ENoAppResourceFile and ENonStandardResourceFile makes UI to work without
// resource files in most SDKs. S60 3rd FP1 public seems to require resource file
// even these flags are defined
- TInt flags = CAknAppUi::EAknEnableSkin;
- if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) {
- flags |= CAknAppUi::ENoScreenFurniture | CAknAppUi::ENonStandardResourceFile;
- }
+ TInt flags = CAknAppUi::EAknEnableSkin
+ | CAknAppUi::ENoScreenFurniture
+ | CAknAppUi::ENonStandardResourceFile;
BaseConstructL(flags);
-
- if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) {
- CEikButtonGroupContainer* nativeContainer = Cba();
- nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
- }
}
/*!
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 7587343..6f05908 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -651,6 +651,8 @@ void QS60StylePrivate::setFont(QWidget *widget) const
fontCategory = QS60StyleEnums::FC_Title;
} else if (qobject_cast<QMessageBox *>(widget)){
fontCategory = QS60StyleEnums::FC_Primary;
+ } else if (qobject_cast<QMenu *>(widget)){
+ fontCategory = QS60StyleEnums::FC_Primary;
}
if (fontCategory != QS60StyleEnums::FC_Undefined) {
const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont)
@@ -1744,6 +1746,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
+ optionCheckBox.rect.moveCenter(QPoint(
+ optionCheckBox.rect.center().x(),
+ menuItem->rect.center().y()));
const int moveByX = optionCheckBox.rect.width() + vSpacing;
if (optionMenuItem.direction == Qt::LeftToRight) {
textRect.translate(moveByX, 0);
@@ -2483,6 +2488,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz.setHeight(naviPaneSize.height());
}
break;
+ case CT_MenuItem:
case CT_ItemViewItem:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
if (QS60StylePrivate::isTouchSupported())
@@ -3150,6 +3156,12 @@ bool QS60Style::event(QEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
case QEvent::FocusIn:
if (QWidget *focusWidget = QApplication::focusWidget()) {
+
+ // Menus and combobox popups do not draw focus frame around them
+ if (qobject_cast<QComboBoxListView *>(focusWidget) ||
+ qobject_cast<QMenu *>(focusWidget))
+ break;
+
if (!d->m_focusFrame)
d->m_focusFrame = new QFocusFrame(focusWidget);
d->m_focusFrame->setWidget(focusWidget);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 58a7159..55aa6b0 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -310,7 +310,7 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
/* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_All, -1,-1},
/* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_All, -1,-1},
/* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_All, -1,-1},
- /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_All, -1,-1},
+ /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_All, -1,-1},
// ToolTip graphics different in 3.1 vs. 3.2+.
/* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */
@@ -919,7 +919,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(QS60StylePrivate::SkinFr
result = fromFbsBitmap(frame, NULL, flags, targetSize);
}
} else {
- TDisplayMode maskDepth = EGray2;
+ TDisplayMode maskDepth = EGray256;
// Query the skin item for possible frame graphics mask details.
if (skinInstance) {
CAknsMaskedBitmapItemData* skinMaskedBmp = static_cast<CAknsMaskedBitmapItemData*>(
@@ -983,6 +983,10 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
frameId.Set(KAknsIIDQsnFrPopupSub);
}
break;
+ case QS60StylePrivate::SF_PopupBackground:
+ centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
+ frameId.Set(KAknsIIDQsnFrPopupSub);
+ break;
case QS60StylePrivate::SF_PanelBackground:
// remove center piece for panel graphics, so that only border is drawn
centerId.Set(KAknsIIDNone);
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 81b923b..515b6c7 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1539,7 +1539,9 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QWidget *w) const
QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCache->constFind(baseStyle());
if (defaultCacheIt == styleSheetCache->constEnd()) {
defaultSs = getDefaultStyleSheet();
- styleSheetCache->insert(baseStyle(), defaultSs);
+ QStyle *bs = baseStyle();
+ styleSheetCache->insert(bs, defaultSs);
+ QObject::connect(bs, SIGNAL(destroyed(QObject*)), this, SLOT(styleDestroyed(QObject*)), Qt::UniqueConnection);
} else {
defaultSs = defaultCacheIt.value();
}
@@ -2666,6 +2668,11 @@ void QStyleSheetStyle::widgetDestroyed(QObject *o)
autoFillDisabledWidgets->remove((const QWidget *)o);
}
+void QStyleSheetStyle::styleDestroyed(QObject *o)
+{
+ styleSheetCache->remove(o);
+}
+
/*!
* Make sure that the cache will be clean by connecting destroyed if needed.
* return false if the widget is not stylable;
diff --git a/src/gui/styles/qstylesheetstyle_p.h b/src/gui/styles/qstylesheetstyle_p.h
index 50abef9..fd81437 100644
--- a/src/gui/styles/qstylesheetstyle_p.h
+++ b/src/gui/styles/qstylesheetstyle_p.h
@@ -147,6 +147,7 @@ protected:
private Q_SLOTS:
void widgetDestroyed(QObject *);
+ void styleDestroyed(QObject *);
private:
int refcount;
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index c9ff661..e557f56 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -221,9 +221,11 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout
HB_Glyph *g = glyphs->glyphs;
const unsigned char* cmap = m_extensions->cmap();
+ const bool isRtl = (flags & QTextEngine::RightToLeft);
for (int i = 0; i < len; ++i) {
const unsigned int uc = getChar(characters, i, len);
- *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, uc);
+ *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap,
+ isRtl ? QChar::mirroredChar(uc) : uc);
}
glyphs->numGlyphs = g - glyphs->glyphs;
@@ -241,8 +243,8 @@ void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla
Q_UNUSED(flags);
for (int i = 0; i < glyphs->numGlyphs; i++) {
const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]);
- glyphs->advances_x[i] = glyphs->offsets[i].x = bbox.xoff;
- glyphs->advances_y[i] = glyphs->offsets[i].y = bbox.yoff;
+ glyphs->advances_x[i] = bbox.xoff;
+ glyphs->advances_y[i] = bbox.yoff;
}
}
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 907dd14..f84059d 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -2803,7 +2803,9 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
QAction *action = d->actionAt(e->pos());
if (!action) {
- if (d->hasHadMouse)
+ if (d->hasHadMouse
+ && (!d->currentAction
+ || !(d->currentAction->menu() && d->currentAction->menu()->isVisible())))
d->setCurrentAction(0);
return;
} else if(e->buttons()) {
diff --git a/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp
index b5d673e..260110e 100644
--- a/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp
+++ b/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp
@@ -156,7 +156,8 @@ void QAudioInputPrivate::freeBlocks(WAVEHDR* blockArray)
int count = buffer_size/period_size;
for(int i = 0; i < count; i++) {
- waveInUnprepareHeader(hWaveIn,&blocks[i], sizeof(WAVEHDR));
+ if (blocks->dwFlags & WHDR_PREPARED)
+ waveInUnprepareHeader(hWaveIn,blocks, sizeof(WAVEHDR));
blocks+=sizeof(WAVEHDR);
}
HeapFree(GetProcessHeap(), 0, blockArray);
diff --git a/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp
index cf3726b..afae8b7 100644
--- a/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp
+++ b/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp
@@ -84,8 +84,7 @@ QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioF
resuming = false;
opened = false;
- QStringList list1 = QString(QLatin1String(device)).split(QLatin1String(":"));
- m_device = QByteArray(list1.at(0).toLocal8Bit().constData());
+ m_device = device;
timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),SLOT(userFeed()));
@@ -282,11 +281,11 @@ bool QAudioOutputPrivate::open()
int count=0;
unsigned int freakuency=settings.frequency();
- QString dev = QLatin1String(m_device.constData());
+ QString dev = QString(QLatin1String(m_device.constData()));
QList<QByteArray> devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput);
if(dev.compare(QLatin1String("default")) == 0) {
#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
- dev = QLatin1String(devices.first().constData());
+ dev = QLatin1String(devices.first());
#else
dev = QLatin1String("hw:0,0");
#endif
diff --git a/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp
index 13bce58..ced8c32 100644
--- a/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -150,7 +150,8 @@ void QAudioOutputPrivate::freeBlocks(WAVEHDR* blockArray)
int count = buffer_size/period_size;
for(int i = 0; i < count; i++) {
- waveOutUnprepareHeader(hWaveOut,&blocks[i], sizeof(WAVEHDR));
+ if (blocks->dwFlags & WHDR_PREPARED)
+ waveOutUnprepareHeader(hWaveOut,blocks, sizeof(WAVEHDR));
blocks+=sizeof(WAVEHDR);
}
HeapFree(GetProcessHeap(), 0, blockArray);
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index a6322a3..559124f 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -489,7 +489,11 @@ void QHttpNetworkConnectionPrivate::fillPipeline(QAbstractSocket *socket)
int i = indexOf(socket);
- if (! (defaultPipelineLength - channels[i].alreadyPipelinedRequests.length() >= 2)) {
+ // return fast if there was no reply right now processed
+ if (channels[i].reply == 0)
+ return;
+
+ if (! (defaultPipelineLength - channels[i].alreadyPipelinedRequests.length() >= defaultRePipelineLength)) {
return;
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index f9a6de8..57d995a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -384,7 +384,7 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
if (!replyPrivate->expectContent()) {
replyPrivate->state = QHttpNetworkReplyPrivate::AllDoneState;
allDone();
- return;
+ break;
}
}
break;
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index c3dc168..07a5bf3 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -689,8 +689,13 @@ QNetworkReplyImpl::QNetworkReplyImpl(QObject *parent)
QNetworkReplyImpl::~QNetworkReplyImpl()
{
Q_D(QNetworkReplyImpl);
+
+ // This code removes the data from the cache if it was prematurely aborted.
+ // See QNetworkReplyImplPrivate::completeCacheSave(), we disable caching there after the cache
+ // save had been properly finished. So if it is still enabled it means we got deleted/aborted.
if (d->isCachingEnabled())
d->networkCache()->remove(url());
+
if (d->outgoingDataBuffer)
delete d->outgoingDataBuffer;
}
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 5ae69cd..f602c73 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -182,7 +182,6 @@ public:
qreal penScale; // Pen scaling factor from "transform".
QTransform pathTransform; // Calculated VG path transformation.
- QTransform glyphTransform; // Calculated VG glyph transformation.
QTransform imageTransform; // Calculated VG image transformation.
bool pathTransformSet; // True if path transform set in the VG context.
@@ -507,24 +506,15 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
// | 1 0 0 |
// | 0 -1 devh |
// | 0 0 1 |
- // The glyph transform uses a slightly different transformation:
- // | 1 0 0 | | 1 0 0.5 | | 1 0 0.5 |
- // | 0 -1 devh - 1 | * | 0 1 -0.5 | = | 0 -1 (devh - 0.5) |
- // | 0 0 1 | | 0 0 1 | | 0 0 1 |
// The full VG transform is effectively:
// 1. Apply the user's transformation matrix.
- // 2. Translate glyphs by an extra (0.5, -0.5).
- // 3. Flip the co-ordinate system upside down.
+ // 2. Flip the co-ordinate system upside down.
QTransform viewport(1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0.0f, devh, 1.0f);
- QTransform gviewport(1.0f, 0.0f, 0.0f,
- 0.0f, -1.0f, 0.0f,
- 0.5f, devh - 0.5f, 1.0f);
// Compute the path transform and determine if it is projective.
pathTransform = transform * viewport;
- glyphTransform = transform * gviewport;
bool projective = (pathTransform.m13() != 0.0f ||
pathTransform.m23() != 0.0f ||
pathTransform.m33() != 1.0f);
@@ -533,7 +523,6 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
// so we will have to convert the co-ordinates ourselves.
// Change the matrix to just the viewport transformation.
pathTransform = viewport;
- glyphTransform = gviewport;
simpleTransform = false;
} else {
simpleTransform = true;
@@ -3242,10 +3231,10 @@ void QVGFontGlyphCache::cacheGlyphs(QVGPaintEnginePrivate *d,
vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height());
}
}
- origin[0] = -metrics.x.toReal() + 0.5f;
- origin[1] = -metrics.y.toReal() + 0.5f;
- escapement[0] = metrics.xoff.toReal();
- escapement[1] = metrics.yoff.toReal();
+ origin[0] = -metrics.x.toReal();
+ origin[1] = -metrics.y.toReal();
+ escapement[0] = 0;
+ escapement[1] = 0;
vgSetGlyphToImage(font, glyph, vgImage, origin, escapement);
vgDestroyImage(vgImage); // Reduce reference count.
#else
@@ -3261,8 +3250,8 @@ void QVGFontGlyphCache::cacheGlyphs(QVGPaintEnginePrivate *d,
}
origin[0] = 0;
origin[1] = 0;
- escapement[0] = metrics.xoff.toReal();
- escapement[1] = metrics.yoff.toReal();
+ escapement[0] = 0;
+ escapement[1] = 0;
vgSetGlyphToPath(font, glyph, vgPath, VG_FALSE, origin, escapement);
vgDestroyPath(vgPath); // Reduce reference count.
#endif // !defined(QVG_NO_IMAGE_GLYPHS)
@@ -3287,12 +3276,10 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
// Get the glyphs and positions associated with the text item.
QVarLengthArray<QFixedPoint> positions;
QVarLengthArray<glyph_t> glyphs;
- QTransform matrix = d->transform;
- matrix.translate(p.x(), p.y());
- ti.fontEngine->getGlyphPositions
- (ti.glyphs, matrix, ti.flags, glyphs, positions);
+ QTransform matrix;
+ ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
- if (!drawCachedGlyphs(glyphs.size(), glyphs.data(), ti.font(), ti.fontEngine, p))
+ if (!drawCachedGlyphs(glyphs.size(), glyphs.data(), ti.font(), ti.fontEngine, p, positions.data()))
QPaintEngineEx::drawTextItem(p, textItem);
#else
// OpenGL 1.0 does not have support for VGFont and glyphs,
@@ -3304,11 +3291,12 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
{
drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->font, textItem->fontEngine,
- QPointF(0, 0));
+ QPointF(0, 0), textItem->glyphPositions);
}
bool QVGPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFont &font,
- QFontEngine *fontEngine, const QPointF &p)
+ QFontEngine *fontEngine, const QPointF &p,
+ const QFixedPoint *positions)
{
#if !defined(QVG_NO_DRAW_GLYPHS)
Q_D(QVGPaintEngine);
@@ -3334,7 +3322,7 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
}
// Set the transformation to use for drawing the current glyphs.
- QTransform glyphTransform(d->glyphTransform);
+ QTransform glyphTransform(d->pathTransform);
glyphTransform.translate(p.x(), p.y());
#if defined(QVG_NO_IMAGE_GLYPHS)
glyphTransform.scale(glyphCache->scaleX, glyphCache->scaleY);
@@ -3344,10 +3332,18 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
// Add the glyphs from the text item into the glyph cache.
glyphCache->cacheGlyphs(d, fontEngine, glyphs, numGlyphs);
+ // Create the array of adjustments between glyphs
+ QVarLengthArray<VGfloat> adjustments_x(numGlyphs);
+ QVarLengthArray<VGfloat> adjustments_y(numGlyphs);
+ for (int i = 1; i < numGlyphs; ++i) {
+ adjustments_x[i-1] = (positions[i].x - positions[i-1].x).toReal();
+ adjustments_y[i-1] = (positions[i].y - positions[i-1].y).toReal();
+ }
+
// Set the glyph drawing origin.
VGfloat origin[2];
- origin[0] = 0;
- origin[1] = 0;
+ origin[0] = positions[0].x.toReal();
+ origin[1] = positions[0].y.toReal();
vgSetfv(VG_GLYPH_ORIGIN, 2, origin);
// Fast anti-aliasing for paths, better for images.
@@ -3362,8 +3358,7 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
// the Qt pen, not the Qt brush.
d->ensureBrush(state()->pen.brush());
vgDrawGlyphs(glyphCache->font, numGlyphs, (VGuint*)glyphs,
- NULL, NULL, VG_FILL_PATH, VG_TRUE);
-
+ adjustments_x.data(), adjustments_y.data(), VG_FILL_PATH, VG_TRUE);
return true;
#else
Q_UNUSED(numGlyphs);
@@ -3371,6 +3366,7 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
Q_UNUSED(font);
Q_UNUSED(fontEngine);
Q_UNUSED(p);
+ Q_UNUSED(positions);
return false;
#endif
}
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 1e7e26c..33c49ba 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -58,6 +58,7 @@
QT_BEGIN_NAMESPACE
+class QFixedPoint;
class QVGPaintEnginePrivate;
class QPixmapData;
class QVGEGLWindowSurfacePrivate;
@@ -143,7 +144,8 @@ public:
void drawTextItem(const QPointF &p, const QTextItem &textItem);
void drawStaticTextItem(QStaticTextItem *staticTextItem);
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFont &font,
- QFontEngine *fontEngine, const QPointF &p);
+ QFontEngine *fontEngine, const QPointF &p,
+ const QFixedPoint *positions);
void setState(QPainterState *s);
QVGPainterState *state() { return static_cast<QVGPainterState *>(QPaintEngineEx::state()); }
diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h
index b82bcb7..412a784 100644
--- a/src/script/bridge/qscriptqobject_p.h
+++ b/src/script/bridge/qscriptqobject_p.h
@@ -303,7 +303,7 @@ public:
}
protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSObject::StructureFlags;
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSC::ImplementsHasInstance | JSObject::StructureFlags;
Data *data;
};
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 24dcad9..4344af4 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -259,6 +259,7 @@ bool QSQLiteResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int i
q->setAt(QSql::AfterLastRow);
sqlite3_reset(stmt);
return false;
+ case SQLITE_CONSTRAINT:
case SQLITE_ERROR:
// SQLITE_ERROR is a generic error code and we must call sqlite3_reset()
// to get the specific error message.
diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp
index 6c76388..f0be6be 100644
--- a/src/testlib/qtestlogger.cpp
+++ b/src/testlib/qtestlogger.cpp
@@ -211,10 +211,7 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description,
QTest::qt_snprintf(buf, sizeof(buf), "%i", line);
failureElement->addAttribute(QTest::AI_Line, buf);
failureElement->addAttribute(QTest::AI_Description, description);
- const char* tag = QTestResult::currentDataTag();
- if (tag) {
- failureElement->addAttribute(QTest::AI_Tag, tag);
- }
+ addTag(failureElement);
currentLogElement->addLogElement(failureElement);
}
@@ -279,6 +276,27 @@ void QTestLogger::addBenchmarkResult(const QBenchmarkResult &result)
currentLogElement->addLogElement(benchmarkElement);
}
+void QTestLogger::addTag(QTestElement* element)
+{
+ const char *tag = QTestResult::currentDataTag();
+ const char *gtag = QTestResult::currentGlobalDataTag();
+ const char *filler = (tag && gtag) ? ":" : "";
+ if ((!tag || !tag[0]) && (!gtag || !gtag[0])) {
+ return;
+ }
+
+ if (!tag) {
+ tag = "";
+ }
+ if (!gtag) {
+ gtag = "";
+ }
+
+ QTestCharBuffer buf;
+ QTest::qt_asprintf(&buf, "%s%s%s", gtag, filler, tag);
+ element->addAttribute(QTest::AI_Tag, buf.constData());
+}
+
void QTestLogger::addMessage(MessageTypes type, const char *message, const char *file, int line)
{
QTestElement *errorElement = new QTestElement(QTest::LET_Error);
@@ -299,7 +317,7 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char
break;
case QAbstractTestLogger::QWarning:
++qwarnCounter;
- typeBuf = "qwarning";
+ typeBuf = "qwarn";
break;
case QAbstractTestLogger::QFatal:
++qfatalCounter;
@@ -320,6 +338,7 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char
errorElement->addAttribute(QTest::AI_Type, typeBuf);
errorElement->addAttribute(QTest::AI_Description, message);
+ addTag(errorElement);
if(file)
errorElement->addAttribute(QTest::AI_File, file);
diff --git a/src/testlib/qtestlogger_p.h b/src/testlib/qtestlogger_p.h
index 31f7d55..bb7a358 100644
--- a/src/testlib/qtestlogger_p.h
+++ b/src/testlib/qtestlogger_p.h
@@ -83,6 +83,7 @@ class QTestLogger : public QAbstractTestLogger
void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
void addBenchmarkResult(const QBenchmarkResult &result);
+ void addTag(QTestElement* element);
void addMessage(MessageTypes type, const char *message,
const char *file = 0, int line = 0);
diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp
index b9946e5..f63c221 100644
--- a/src/testlib/qtestxmlstreamer.cpp
+++ b/src/testlib/qtestxmlstreamer.cpp
@@ -111,12 +111,20 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer
QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
- QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <Description><![CDATA[%s]]></Description>\n</Message>\n",
+ QTestCharBuffer tagbuf;
+ if (element->attribute(QTest::AI_Tag)) {
+ QTestCharBuffer cdataTag;
+ QXmlTestLogger::xmlCdata(&cdataTag, element->attributeValue(QTest::AI_Tag));
+ QTest::qt_asprintf(&tagbuf, " <DataTag><![CDATA[%s]]></DataTag>\n", cdataTag.constData());
+ }
+
+ QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n%s <Description><![CDATA[%s]]></Description>\n</Message>\n",
element->attributeValue(QTest::AI_Type),
element->attributeName(QTest::AI_File),
quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line),
+ tagbuf.constData(),
cdataDesc.constData());
break;
}
@@ -149,7 +157,29 @@ void QTestXmlStreamer::formatEnd(const QTestElement *element, QTestCharBuffer *f
return;
if (element->elementType() == QTest::LET_TestCase) {
- QTest::qt_asprintf(formatted, "</TestFunction>\n");
+ bool failed = false;
+ for (QTestElement* child = element->childElements(); child; child = child->nextElement()) {
+ if ( child->elementType() == QTest::LET_Failure
+ && child->attribute(QTest::AI_Result)
+ && ( !strcmp(child->attributeValue(QTest::AI_Result), "fail")
+ || !strcmp(child->attributeValue(QTest::AI_Result), "xpass"))
+ )
+ {
+ failed = true;
+ break;
+ }
+ }
+
+ // For passing functions, no Incident has been output yet.
+ // For failing functions, we already output one.
+ // Please note: we are outputting "pass" even if there was an xfail etc.
+ // This is by design (arguably bad design, but dangerous to change now!)
+ if (element->attribute(QTest::AI_Result) && !failed) {
+ QTest::qt_asprintf(formatted, "<Incident type=\"pass\" file=\"\" line=\"0\" />\n</TestFunction>\n");
+ }
+ else {
+ QTest::qt_asprintf(formatted, "</TestFunction>\n");
+ }
} else {
formatted->data()[0] = '\0';
}
@@ -157,29 +187,11 @@ void QTestXmlStreamer::formatEnd(const QTestElement *element, QTestCharBuffer *f
void QTestXmlStreamer::formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
- if(!element || !formatted)
+ Q_UNUSED(element);
+ if (!formatted)
return;
- if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)){
- QTestCharBuffer buf;
- QTestCharBuffer quotedFile;
- QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
-
- QTest::qt_asprintf(&buf, "%s=\"%s\" %s=\"%s\"",
- element->attributeName(QTest::AI_File),
- quotedFile.constData(),
- element->attributeName(QTest::AI_Line),
- element->attributeValue(QTest::AI_Line));
-
- if( !element->childElements() ) {
- QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s/>\n",
- element->attributeValue(QTest::AI_Result), buf.constData());
- } else {
- formatted->data()[0] = '\0';
- }
- } else {
- formatted->data()[0] = '\0';
- }
+ formatted->data()[0] = '\0';
}
void QTestXmlStreamer::output(QTestElement *element) const
diff --git a/src/xmlpatterns/xmlpatterns.pro b/src/xmlpatterns/xmlpatterns.pro
index a224762..e50d184 100644
--- a/src/xmlpatterns/xmlpatterns.pro
+++ b/src/xmlpatterns/xmlpatterns.pro
@@ -24,13 +24,14 @@ include($$PWD/schema/schema.pri)
include($$PWD/type/type.pri)
include($$PWD/utils/utils.pri)
include($$PWD/qobjectmodel/qobjectmodel.pri, "", true)
-wince*:# The Microsoft MIPS compiler crashes if /Og is specified
-:
-# -O2/1 expands to /Og plus additional arguments.
-contains(DEFINES, MIPS): {
- QMAKE_CXXFLAGS_RELEASE ~= s/-O2/-Oi -Ot -Oy -Ob2/
- QMAKE_CXXFLAGS_RELEASE ~= s/-O1/-Os -Oy -Ob2/
+wince* {
+ # The Microsoft MIPS compiler crashes if /Og is specified.
+ # -O2/1 expands to /Og plus additional arguments.
+ contains(DEFINES, MIPS) {
+ QMAKE_CXXFLAGS_RELEASE ~= s/-O2/-Oi -Ot -Oy -Ob2/
+ QMAKE_CXXFLAGS_RELEASE ~= s/-O1/-Os -Oy -Ob2/
+ }
}
+
symbian:TARGET.UID3 = 0x2001E62B
-HEADERS +=