diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-03-15 12:11:08 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-03-15 12:11:08 (GMT) |
commit | 90d7b8dd7968c3e63cd3d9b7e8e1b5d83b20b475 (patch) | |
tree | a519424035cdbd92d665c748ffa6ecfa8d553f3b /src | |
parent | 065f26ef3996368ba67ff5d8e34b20106c359a95 (diff) | |
parent | 02d1a0422c42889813bb2586503aff43a3509e09 (diff) | |
download | Qt-90d7b8dd7968c3e63cd3d9b7e8e1b5d83b20b475.zip Qt-90d7b8dd7968c3e63cd3d9b7e8e1b5d83b20b475.tar.gz Qt-90d7b8dd7968c3e63cd3d9b7e8e1b5d83b20b475.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts:
src/gui/styles/qs60style_s60.cpp
Diffstat (limited to 'src')
77 files changed, 660 insertions, 626 deletions
diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index 2d17bd2..c556afc 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -52,22 +52,24 @@ void MMF::Utils::panic(PanicCode code) User::Panic(PanicCategory, code); } - -static const TInt KMimePrefixLength = 6; // either "audio/" or "video/" _LIT(KMimePrefixAudio, "audio/"); _LIT(KMimePrefixVideo, "video/"); +_LIT(KMimeSDP, "application/sdp"); + +enum ConstantStringLengths { + KMimePrefixLength = 6, // either "audio/" or "video/", + KMimeSDPLength = 15 // "application/sdp" +}; MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType) { - MediaType result = MediaTypeUnknown; - if (mimeType.Left(KMimePrefixLength).Compare(KMimePrefixAudio) == 0) { - result = MediaTypeAudio; - } else if (mimeType.Left(KMimePrefixLength).Compare(KMimePrefixVideo) == 0) { - result = MediaTypeVideo; - } - - return result; + return MediaTypeAudio; + } else if (mimeType.Left(KMimePrefixLength).Compare(KMimePrefixVideo) == 0 || + mimeType.Left(KMimeSDPLength).Compare(KMimeSDP) == 0) { + return MediaTypeVideo; + } else + return MediaTypeUnknown; } QString MMF::Utils::symbianErrorToString(int errorCode) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 6a2e75f..a2d5f37 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - f3110d2f94c825477afac054ed448e45d47f5670 + 266a6c4f1938dd9edf4a8125faf91c62495e3ce2 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 61c2227..a3f70d3 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,16 @@ +2010-03-11 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Avoid double-buffering with Qt image decoders + + Pass QIODevice::Unbuffered when opening the QBuffer that + wraps the image data, to hint to Qt that no extra buffering + is needed. + + * platform/graphics/qt/ImageDecoderQt.cpp: + (WebCore::ImageDecoderQt::setData): + 2010-01-14 Diego Gonzalez <diego.gonzalez@openbossa.org> Reviewed by Kenneth Christiansen. diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp index b6823dd..9bcb3e9 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp @@ -79,7 +79,7 @@ void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived) QByteArray imageData = QByteArray::fromRawData(m_data->data(), m_data->size()); m_buffer = new QBuffer; m_buffer->setData(imageData); - m_buffer->open(QBuffer::ReadOnly); + m_buffer->open(QBuffer::ReadOnly | QIODevice::Unbuffered); m_reader = new QImageReader(m_buffer, m_format); } diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 662100a..c93f0c3 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -282,8 +282,7 @@ QIODevicePrivate::~QIODevicePrivate() Certain flags, such as \c Unbuffered and \c Truncate, are meaningless when used with some subclasses. Some of these restrictions are implied by the type of device that is represented - by a subclass; for example, access to a QBuffer is always - unbuffered. In other cases, the restriction may be due to the + by a subclass. In other cases, the restriction may be due to the implementation, or may be imposed by the underlying platform; for example, QTcpSocket does not support \c Unbuffered mode, and limitations in the native API prevent QFile from supporting \c diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 1069b816..aecb66e 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -222,7 +222,6 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a } } else { qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T)); - s = asize; } } else { ptr = oldPtr; @@ -233,7 +232,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a if (QTypeInfo<T>::isComplex) { while (osize > asize) (oldPtr+(--osize))->~T(); - if( oldPtr == ptr ) + if (!QTypeInfo<T>::isStatic) s = osize; } diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 2d75913..4faa193 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -415,8 +415,15 @@ bool QDialog::event(QEvent *e) result = true; } #else - if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) - adjustPosition(parentWidget()); + if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) { + if (!testAttribute(Qt::WA_Moved)) { + Qt::WindowStates state = windowState(); + adjustPosition(parentWidget()); + setAttribute(Qt::WA_Moved, false); // not really an explicit position + if (state != windowState()) + setWindowState(state); + } + } #endif return result; } diff --git a/src/gui/dialogs/qprintdialog.h b/src/gui/dialogs/qprintdialog.h index ecd50c1..94177ea 100644 --- a/src/gui/dialogs/qprintdialog.h +++ b/src/gui/dialogs/qprintdialog.h @@ -56,7 +56,7 @@ class QPrintDialogPrivate; class QPushButton; class QPrinter; -#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) +#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) class QUnixPrintWidgetPrivate; class Q_GUI_EXPORT QUnixPrintWidget : public QWidget diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 0487f23..17283f5 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -152,6 +152,9 @@ public: bool checkFields(); void setupPrinter(); void setOptionsPane(QPrintDialogPrivate *pane); +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) + void setCupsProperties(); +#endif // slots void _q_printerChanged(int index); @@ -949,7 +952,7 @@ bool QUnixPrintWidgetPrivate::checkFields() void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked() { - if (propertiesDialog == 0) { + if (!propertiesDialog) { propertiesDialog = new QPrintPropertiesDialog(q); propertiesDialog->setResult(QDialog::Rejected); } @@ -969,6 +972,35 @@ void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked() propertiesDialog->exec(); } +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) +void QUnixPrintWidgetPrivate::setCupsProperties() +{ + if (cups && QCUPSSupport::isAvailable()) { + QPrintEngine *engine = printer->printEngine(); + const ppd_option_t* pageSizes = cups->pageSizes(); + QByteArray cupsPageSize; + for (int i = 0; i < pageSizes->num_choices; ++i) { + if (static_cast<int>(pageSizes->choices[i].marked) == 1) + cupsPageSize = pageSizes->choices[i].choice; + } + engine->setProperty(PPK_CupsStringPageSize, QString::fromLatin1(cupsPageSize)); + engine->setProperty(PPK_CupsOptions, cups->options()); + + QRect pageRect = cups->pageRect(cupsPageSize); + engine->setProperty(PPK_CupsPageRect, pageRect); + + QRect paperRect = cups->paperRect(cupsPageSize); + engine->setProperty(PPK_CupsPaperRect, paperRect); + + for (int ps = 0; ps < QPrinter::NPaperSize; ++ps) { + QPdf::PaperSize size = QPdf::paperSize(QPrinter::PaperSize(ps)); + if (size.width == paperRect.width() && size.height == paperRect.height()) + printer->setPaperSize(static_cast<QPrinter::PaperSize>(ps)); + } + } +} +#endif + void QUnixPrintWidgetPrivate::setupPrinter() { const int printerCount = widget.printers->count(); @@ -993,6 +1025,10 @@ void QUnixPrintWidgetPrivate::setupPrinter() if (propertiesDialog && propertiesDialog->result() == QDialog::Accepted) propertiesDialog->setupPrinter(); +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) + if (!propertiesDialog) + setCupsProperties(); +#endif } diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h index 033a996..c8a0028 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.h +++ b/src/gui/graphicsview/qgraphicssceneevent.h @@ -77,6 +77,8 @@ protected: QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None); QScopedPointer<QGraphicsSceneEventPrivate> d_ptr; Q_DECLARE_PRIVATE(QGraphicsSceneEvent) +private: + Q_DISABLE_COPY(QGraphicsSceneEvent) }; class QGraphicsSceneMouseEventPrivate; @@ -124,6 +126,7 @@ public: private: Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent) + Q_DISABLE_COPY(QGraphicsSceneMouseEvent) }; class QGraphicsSceneWheelEventPrivate; @@ -156,6 +159,7 @@ public: private: Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent) + Q_DISABLE_COPY(QGraphicsSceneWheelEvent) }; class QGraphicsSceneContextMenuEventPrivate; @@ -184,6 +188,7 @@ public: private: Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent) + Q_DISABLE_COPY(QGraphicsSceneContextMenuEvent) }; class QGraphicsSceneHoverEventPrivate; @@ -216,6 +221,7 @@ public: private: Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent) + Q_DISABLE_COPY(QGraphicsSceneHoverEvent) }; class QGraphicsSceneHelpEventPrivate; @@ -233,6 +239,7 @@ public: private: Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent) + Q_DISABLE_COPY(QGraphicsSceneHelpEvent) }; class QGraphicsSceneDragDropEventPrivate; @@ -275,12 +282,14 @@ public: private: Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent) + Q_DISABLE_COPY(QGraphicsSceneDragDropEvent) }; class QGraphicsSceneResizeEventPrivate; class Q_GUI_EXPORT QGraphicsSceneResizeEvent : public QGraphicsSceneEvent { Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent) + Q_DISABLE_COPY(QGraphicsSceneResizeEvent) public: QGraphicsSceneResizeEvent(); ~QGraphicsSceneResizeEvent(); @@ -296,6 +305,7 @@ class QGraphicsSceneMoveEventPrivate; class Q_GUI_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent { Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent) + Q_DISABLE_COPY(QGraphicsSceneMoveEvent) public: QGraphicsSceneMoveEvent(); ~QGraphicsSceneMoveEvent(); diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 46fd9d0..702a8bb 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -2549,7 +2549,7 @@ void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint) // check if we really need to do anything if (!d->isIndexValid(index) || (d->model->parent(index) != d->root) - || isIndexHidden(index)) + || isRowHidden(index.row()) || isColumnHidden(index.column())) return; QSpanCollection::Span span; diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index ccc39c9..4a15cf2 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1034,7 +1034,7 @@ void QSymbianControl::HandleResourceChange(int resourceType) qwidget->adjustSize(); qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize } - if (!qwidget->testAttribute(Qt::WA_Moved)) { + if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) { TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); SetPosition(r.iTl); qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index f38e4f5..ae1f60d 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -348,7 +348,8 @@ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY) \o B=1 and M=1 gives black. \o B=0 and M=1 gives white. \o B=0 and M=0 gives transparent. - \o B=1 and M=0 gives an XOR'd result. + \o B=1 and M=0 gives an XOR'd result under Windows, undefined + results on all other platforms. \endlist Use the global Qt color Qt::color0 to draw 0-pixels and Qt::color1 to diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp index 84e3c5d..e4d0bf3 100644 --- a/src/gui/kernel/qdesktopwidget_s60.cpp +++ b/src/gui/kernel/qdesktopwidget_s60.cpp @@ -88,6 +88,7 @@ QDesktopWidgetPrivate::~QDesktopWidgetPrivate() void QDesktopWidgetPrivate::init(QDesktopWidget *that) { + Q_UNUSED(that); // int screenCount=0; // ### TODO: Implement proper multi-display support diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 735ca7a..cedede1 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -68,12 +68,12 @@ #include <eikappui.h> #ifdef Q_WS_S60 -#include <aknutils.h> // AknLayoutUtils +#include <AknUtils.h> // AknLayoutUtils #include <avkon.hrh> // EEikStatusPaneUidTitle #include <akntitle.h> // CAknTitlePane #include <akncontext.h> // CAknContextPane #include <eikspane.h> // CEikStatusPane -#include <aknpopupfader.h> // MAknFadedComponent and TAknPopupFader +#include <AknPopupFader.h> // MAknFadedComponent and TAknPopupFader #endif QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 4b45abd..a0e4050 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4783,8 +4783,10 @@ void QWidgetPrivate::syncCocoaMask() if (!q->testAttribute(Qt::WA_WState_Created) || !extra) return; - if (extra->hasMask && extra->maskBits.size() != q->size()) { - extra->maskBits = QImage(q->size(), QImage::Format_Mono); + if (extra->hasMask) { + if(extra->maskBits.size() != q->size()) { + extra->maskBits = QImage(q->size(), QImage::Format_Mono); + } extra->maskBits.fill(QColor(Qt::color1).rgba()); extra->maskBits.setNumColors(2); extra->maskBits.setColor(0, QColor(Qt::color0).rgba()); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 7fb21d2..79702af 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1037,6 +1037,17 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const return widgetPos; } +static Qt::WindowStates effectiveState(Qt::WindowStates state) +{ + if (state & Qt::WindowMinimized) + return Qt::WindowMinimized; + else if (state & Qt::WindowFullScreen) + return Qt::WindowFullScreen; + else if (state & Qt::WindowMaximized) + return Qt::WindowMaximized; + return Qt::WindowNoState; +} + void QWidget::setWindowState(Qt::WindowStates newstate) { Q_D(QWidget); @@ -1052,6 +1063,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate) return; if (isWindow()) { + const bool wasResized = testAttribute(Qt::WA_Resized); + const bool wasMoved = testAttribute(Qt::WA_Moved); QSymbianControl *window = static_cast<QSymbianControl *>(effectiveWinId()); if (window && newstate & Qt::WindowMinimized) { @@ -1090,7 +1103,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) createWinId(); Q_ASSERT(testAttribute(Qt::WA_WState_Created)); // Ensure the initial size is valid, since we store it as normalGeometry below. - if (!testAttribute(Qt::WA_Resized) && !isVisible()) + if (!wasResized && !isVisible()) adjustSize(); QTLWExtra *top = d->topData(); @@ -1105,6 +1118,15 @@ void QWidget::setWindowState(Qt::WindowStates newstate) //restore normal geometry top->normalGeometry = normalGeometry; + + // FixMe QTBUG-8977 + // In some platforms, WA_Resized and WA_Moved are also not set when application window state is + // anything else than normal. In Symbian we can restore them only for normal window state since + // restoring for other modes, will make fluidlauncher to be launched in wrong size (200x100) + if (effectiveState(newstate) == Qt::WindowNoState) { + setAttribute(Qt::WA_Resized, wasResized); + setAttribute(Qt::WA_Moved, wasMoved); + } } data->window_state = newstate; diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 614d2c0..bea2b6e 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -3134,8 +3134,8 @@ SOFTWARE. ************************************************************************/ /* $XFree86: xc/lib/X11/PolyReg.c,v 1.1.1.2.8.2 1998/10/04 15:22:49 hohndel Exp $ */ -#define LARGE_COORDINATE 1000000 -#define SMALL_COORDINATE -LARGE_COORDINATE +#define LARGE_COORDINATE INT_MAX +#define SMALL_COORDINATE INT_MIN /* * InsertEdgeInET diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index 9909643..212a582 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -293,7 +293,8 @@ inline QTransform &QTransform::operator*=(qreal num) affine._dx *= num; affine._dy *= num; m_33 *= num; - m_dirty |= TxScale; + if (m_dirty < TxScale) + m_dirty = TxScale; return *this; } inline QTransform &QTransform::operator/=(qreal div) @@ -316,7 +317,7 @@ inline QTransform &QTransform::operator+=(qreal num) affine._dx += num; affine._dy += num; m_33 += num; - m_dirty |= TxProject; + m_dirty = TxProject; return *this; } inline QTransform &QTransform::operator-=(qreal num) @@ -332,7 +333,7 @@ inline QTransform &QTransform::operator-=(qreal num) affine._dx -= num; affine._dy -= num; m_33 -= num; - m_dirty |= TxProject; + m_dirty = TxProject; return *this; } diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 028ec48..d05c7e4 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -70,13 +70,13 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget) // We create empty CFbsBitmap here -> it will be resized in setGeometry CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) ); - + QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType); if (data) { data->fromSymbianBitmap(bitmap, true); d_ptr->device = QPixmap(data); } - + setStaticContentsSupport(true); } QS60WindowSurface::~QS60WindowSurface() @@ -89,24 +89,15 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn) if (!qt_widget_private(window())->isOpaque) { QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data()); pixmapData->beginDataAccess(); - QImage &image = pixmapData->image; - QRgb *data = reinterpret_cast<QRgb *>(image.bits()); - const int row_stride = image.bytesPerLine() / 4; + QPainter p(&pixmapData->image); + p.setCompositionMode(QPainter::CompositionMode_Source); const QVector<QRect> rects = rgn.rects(); + const QColor blank = Qt::transparent; for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) { - const int x_start = it->x(); - const int width = it->width(); - - const int y_start = it->y(); - const int height = it->height(); - - QRgb *row = data + row_stride * y_start; - for (int y = 0; y < height; ++y) { - qt_memfill(row + x_start, 0U, width); - row += row_stride; - } + p.fillRect(*it, blank); } + pixmapData->endDataAccess(); } } @@ -128,7 +119,7 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget) const QPoint off = offset(widget); QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image); - + QRect rect(off, widget->size()); rect &= QRect(QPoint(), img->size()); diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h index 438b80c..553675f 100644 --- a/src/gui/s60framework/qs60maindocument.h +++ b/src/gui/s60framework/qs60maindocument.h @@ -46,7 +46,7 @@ #ifdef Q_WS_S60 -#include <akndoc.h> +#include <AknDoc.h> class CEikApplication; diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri index 5884b68..6080e6d 100644 --- a/src/gui/s60framework/s60framework.pri +++ b/src/gui/s60framework/s60framework.pri @@ -5,7 +5,7 @@ minimalAppResource31 = \ "SOURCEPATH s60framework" \ "START RESOURCE s60main.rss" \ "HEADER" \ - "TARGETPATH resource\apps" \ + "TARGETPATH /resource/apps" \ "END" MMP_RULES += minimalAppResource31 diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index cb49fbc..ecac3d6 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -50,17 +50,17 @@ #include "qapplication.h" #include <w32std.h> -#include <aknsconstants.h> +#include <AknsConstants.h> #include <aknconsts.h> -#include <aknsitemid.h> -#include <aknsutils.h> -#include <aknsdrawutils.h> -#include <aknsskininstance.h> -#include <aknsbasicbackgroundcontrolcontext.h> +#include <AknsItemID.h> +#include <AknsUtils.h> +#include <AknsDrawUtils.h> +#include <AknsSkinInstance.h> +#include <AknsBasicBackgroundControlContext.h> #include <avkon.mbg> #include <aknfontaccess.h> #include <aknlayoutfont.h> -#include <aknutils.h> +#include <AknUtils.h> #include <aknnavi.h> #include <gulicon.h> #include <AknBitmapAnimation.h> diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index 676f59e..5084442 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -164,17 +164,17 @@ contains( styles, windowsmobile ) { } contains( styles, s60 ):contains(QT_CONFIG, s60) { - HEADERS += \ - styles/qs60style.h \ - styles/qs60style_p.h - SOURCES += styles/qs60style.cpp - symbian { - SOURCES += styles/qs60style_s60.cpp - LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul -lbmpanim - } else { - SOURCES += styles/qs60style_simulated.cpp - RESOURCES += styles/qstyle_s60_simulated.qrc - } + HEADERS += \ + styles/qs60style.h \ + styles/qs60style_p.h + SOURCES += styles/qs60style.cpp + symbian { + SOURCES += styles/qs60style_s60.cpp + LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils -legul -lbmpanim + } else { + SOURCES += styles/qs60style_simulated.cpp + RESOURCES += styles/qstyle_s60_simulated.qrc + } } else { - DEFINES += QT_NO_STYLE_S60 + DEFINES += QT_NO_STYLE_S60 } diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index dca2da5..140cf43 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -3085,7 +3085,8 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format) f.d = new QTextFormatPrivate; f.d->resolveFont(defaultFnt); - hashes.insert(hash, idx); + if (!hashes.contains(hash, idx)) + hashes.insert(hash, idx); } QT_CATCH(...) { formats.pop_back(); diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index 65b998f..a415180 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -62,8 +62,8 @@ const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592 #ifdef Q_WS_S60 # include <pathinfo.h> // PathInfo # ifdef USE_DOCUMENTHANDLER -# include <documenthandler.h> // CDocumentHandler -# include <aknserverapp.h> +# include <DocumentHandler.h> // CDocumentHandler +# include <AknServerApp.h> # endif #else # warning CDocumentHandler requires support for S60 diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri index cdbb7cc..3074367 100644 --- a/src/gui/util/util.pri +++ b/src/gui/util/util.pri @@ -41,5 +41,5 @@ embedded { symbian { LIBS += -lsendas2 -letext -lapmime - contains(QT_CONFIG, s60): LIBS += -lplatformenv -lcommonui + contains(QT_CONFIG, s60): LIBS += -lplatformenv -lCommonUI } diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index f44858a..806654c 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -1995,16 +1995,19 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> #ifdef QT_NO_TABBAR const int tabBarShape = 0; #endif - QDockAreaLayoutInfo *info = new QDockAreaLayoutInfo(sep, dockPos, o, - tabBarShape, mainWindow); - QDockAreaLayoutItem item(info); + QDockAreaLayoutItem item(new QDockAreaLayoutInfo(sep, dockPos, o, + tabBarShape, mainWindow)); stream >> item.pos >> item.size >> dummy >> dummy; - if (!info->restoreState(stream, widgets, testing)) + //we need to make sure the element is in the list so the dock widget can eventually be docked correctly + if (!testing) + item_list.append(item); + + //here we need to make sure we change the item in the item_list + QDockAreaLayoutItem &lastItem = testing ? item : item_list.last(); + + if (!lastItem.subinfo->restoreState(stream, widgets, testing)) return false; - if (!testing) { - item_list.append(item); - } } else { return false; } diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 2c76a5c..468c111 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -134,7 +134,7 @@ void QLineEditPrivate::_q_selectionChanged() q->initStyleOption(&opt); bool showCursor = control->hasSelectedText() ? q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q): - true; + q->hasFocus(); setCursorVisible(showCursor); } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index bf926f8..d2eda80 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -65,9 +65,6 @@ QT_BEGIN_NAMESPACE extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp QT_END_NAMESPACE #endif -#ifdef QT_SOFTKEYS_ENABLED -#include <private/qsoftkeymanager_p.h> -#endif QT_BEGIN_NAMESPACE @@ -80,9 +77,6 @@ public: #ifdef Q_WS_MAC , useHIToolBar(false) #endif -#ifdef QT_SOFTKEYS_ENABLED - , menuBarAction(0) -#endif #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) , hasOldCursor(false) , cursorAdjusted(false) #endif @@ -94,9 +88,6 @@ public: #ifdef Q_WS_MAC bool useHIToolBar; #endif -#ifdef QT_SOFTKEYS_ENABLED - QAction *menuBarAction; -#endif void init(); QList<int> hoverSeparator; QPoint hoverPos; @@ -117,10 +108,6 @@ void QMainWindowPrivate::init() const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize, 0, q); iconSize = QSize(metric, metric); q->setAttribute(Qt::WA_Hover); -#ifdef QT_SOFTKEYS_ENABLED - menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q); - menuBarAction->setVisible(false); -#endif } /* @@ -492,13 +479,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->deleteLater(); } d->layout->setMenuBar(menuBar); - -#ifdef QT_SOFTKEYS_ENABLED - if (menuBar) - addAction(d->menuBarAction); - else - removeAction(d->menuBarAction); -#endif } /*! @@ -1428,11 +1408,6 @@ bool QMainWindow::event(QEvent *event) } break; #endif -#ifdef QT_SOFTKEYS_ENABLED - case QEvent::LanguageChange: - d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey)); - break; -#endif default: break; } diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index 276ffe6..39cbbd8 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -347,7 +347,7 @@ public: void syncAction(QWceMenuAction *); inline void syncAction(QAction *a) { syncAction(findAction(a)); } void removeAction(QWceMenuAction *); - void rebuild(bool reCreate = false); + void rebuild(); inline void removeAction(QAction *a) { removeAction(findAction(a)); } inline QWceMenuAction *findAction(QAction *a) { for(int i = 0; i < actionItems.size(); i++) { diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index e46688c..7224768 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -324,6 +324,14 @@ void QMenuBarPrivate::symbianDestroyMenuBar() symbian_menubar = 0; } +void QMenuBarPrivate::reparentMenuBar(QWidget *oldParent, QWidget *newParent) +{ + if (menubars()->contains(oldParent)) { + QMenuBarPrivate *object = menubars()->take(oldParent); + menubars()->insert(newParent, object); + } +} + QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar) { d = menubar; diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index 28b6b8b..1577f0a 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -101,7 +101,6 @@ struct qt_SHMENUBARINFO COLORREF clrBk; }; -typedef int (WINAPI *superfunc)(int, int); typedef BOOL (WINAPI *AygCreateMenuBar)(qt_SHMENUBARINFO*); typedef HRESULT (WINAPI *AygEnableSoftKey)(HWND,UINT,BOOL,BOOL); @@ -254,6 +253,12 @@ static void qt_wce_insert_action(HMENU menu, QWceMenuAction *action, bool create } } +// Removes all items from the menu without destroying the handles. +static void qt_wce_clear_menu(HMENU hMenu) +{ + while (RemoveMenu(hMenu, 0, MF_BYPOSITION)); +} + /*! \internal @@ -404,7 +409,8 @@ QMenuPrivate::QWceMenuPrivate::QWceMenuPrivate() { QMenuPrivate::QWceMenuPrivate::~QWceMenuPrivate() { qt_wce_delete_action_list(&actionItems); - menuHandle = 0; + if (menuHandle) + DestroyMenu(menuHandle); } void QMenuPrivate::QWceMenuPrivate::addAction(QAction *a, QWceMenuAction *before) { @@ -439,14 +445,17 @@ HMENU QMenuPrivate::wceMenu(bool create) { if (!wce_menu) wce_menu = new QWceMenuPrivate; if (!wce_menu->menuHandle || create) - wce_menu->rebuild(create); + wce_menu->rebuild(); return wce_menu->menuHandle; } -void QMenuPrivate::QWceMenuPrivate::rebuild(bool reCreate) { - if (menuHandle && !reCreate) - DestroyMenu(menuHandle); - menuHandle = CreatePopupMenu(); +void QMenuPrivate::QWceMenuPrivate::rebuild() +{ + if (!menuHandle) + menuHandle = CreatePopupMenu(); + else + qt_wce_clear_menu(menuHandle); + for (int i = 0; i < actionItems.size(); ++i) { QWceMenuAction *action = actionItems.at(i); action->menuHandle = menuHandle; @@ -522,6 +531,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() { resourceHandle = IDR_MAIN_MENU5; } Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted"); + qt_wce_clear_menu(menuHandle); DestroyWindow(menubarHandle); menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), resourceHandle); Q_ASSERT_X(menubarHandle, "rebuild classic menu", "cannot create menubar from resource"); @@ -563,6 +573,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() { leftButtonIsMenu = (leftButtonAction && leftButtonAction->menu()); Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted"); + qt_wce_clear_menu(menuHandle); DestroyWindow(menubarHandle); if (leftButtonIsMenu) { menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), IDR_MAIN_MENU2); diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 9caadb7..13aa02b 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -71,6 +71,10 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp #endif +#ifdef QT_SOFTKEYS_ENABLED +#include <private/qsoftkeymanager_p.h> +#endif + QT_BEGIN_NAMESPACE class QMenuBarExtension : public QToolButton @@ -740,17 +744,14 @@ void QMenuBarPrivate::init() QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true); } #endif -#ifdef Q_WS_S60 - symbianCreateMenuBar(q->parentWidget()); - if(symbian_menubar) - q->hide(); -#endif - q->setBackgroundRole(QPalette::Button); oldWindow = oldParent = 0; #ifdef QT3_SUPPORT doAutoResize = false; #endif +#ifdef QT_SOFTKEYS_ENABLED + menuBarAction = 0; +#endif handleReparent(); q->setMouseTracking(q->style()->styleHint(QStyle::SH_MenuBar_MouseTracking, 0, q)); @@ -1384,10 +1385,38 @@ void QMenuBarPrivate::handleReparent() wce_menubar->rebuild(); #endif #ifdef Q_WS_S60 - if (symbian_menubar) + + // Construct symbian_menubar when this code path is entered first time + // and when newParent != NULL + if (!symbian_menubar) + symbianCreateMenuBar(newParent); + + // Reparent and rebuild menubar when parent is changed + if (symbian_menubar) { + if (oldParent != newParent) + reparentMenuBar(oldParent, newParent); + q->hide(); symbian_menubar->rebuild(); -#endif + } +#ifdef QT_SOFTKEYS_ENABLED + // Constuct menuBarAction when this code path is entered first time + if (!menuBarAction) { + if (newParent) { + menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, newParent); + menuBarAction->setVisible(false); + newParent->addAction(menuBarAction); + } + } else { + // If reparenting i.e. we already have menuBarAction, remove it from old parent + // and add for a new parent + if (oldParent) + oldParent->removeAction(menuBarAction); + if (newParent) + newParent->addAction(menuBarAction); + } +#endif // QT_SOFTKEYS_ENABLED +#endif // Q_WS_S60 } #ifdef QT3_SUPPORT @@ -1440,7 +1469,13 @@ void QMenuBar::changeEvent(QEvent *e) || e->type() == QEvent::ApplicationFontChange) { d->itemsDirty = true; d->updateGeometries(); +#ifdef QT_SOFTKEYS_ENABLED + } else if (e->type() == QEvent::LanguageChange) { + if (d->menuBarAction) + d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey)); +#endif } + QWidget::changeEvent(e); } diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index 819aee4..82070fe 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -244,6 +244,7 @@ public: #ifdef Q_WS_S60 void symbianCreateMenuBar(QWidget *); void symbianDestroyMenuBar(); + void reparentMenuBar(QWidget *oldParent, QWidget *newParent); struct QSymbianMenuBarPrivate { QList<QSymbianMenuAction*> actionItems; QMenuBarPrivate *d; @@ -268,7 +269,9 @@ public: } *symbian_menubar; static int symbianCommands(int command); - +#ifdef QT_SOFTKEYS_ENABLED + QAction *menuBarAction; +#endif #endif }; #endif diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri index 625b871c..ae28a26 100644 --- a/src/multimedia/audio/audio.pri +++ b/src/multimedia/audio/audio.pri @@ -41,6 +41,21 @@ mac { !wince*:LIBS += -lwinmm wince*:LIBS += -lcoredll +} else:symbian { + INCLUDEPATH += /epoc32/include/mmf/common + INCLUDEPATH += /epoc32/include/mmf/server + + HEADERS += $$PWD/qaudio_symbian_p.h \ + $$PWD/qaudiodeviceinfo_symbian_p.h \ + $$PWD/qaudioinput_symbian_p.h \ + $$PWD/qaudiooutput_symbian_p.h + + SOURCES += $$PWD/qaudio_symbian_p.cpp \ + $$PWD/qaudiodeviceinfo_symbian_p.cpp \ + $$PWD/qaudioinput_symbian_p.cpp \ + $$PWD/qaudiooutput_symbian_p.cpp + + LIBS += -lmmfdevsound } else:unix { unix:contains(QT_CONFIG, alsa) { linux-*|freebsd-*|openbsd-*:{ diff --git a/src/plugins/audio/symbian/symbianaudioutils.cpp b/src/multimedia/audio/qaudio_symbian_p.cpp index f04c198..58e3745 100644 --- a/src/plugins/audio/symbian/symbianaudioutils.cpp +++ b/src/multimedia/audio/qaudio_symbian_p.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "symbianaudioutils.h" +#include "qaudio_symbian_p.h" #include <mmffourcc.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/audio/symbian/symbianaudioutils.h b/src/multimedia/audio/qaudio_symbian_p.h index 53274e0..d5238b4 100644 --- a/src/plugins/audio/symbian/symbianaudioutils.h +++ b/src/multimedia/audio/qaudio_symbian_p.h @@ -39,19 +39,50 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIOUTILS_H -#define SYMBIANAUDIOUTILS_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIO_SYMBIAN_P_H +#define QAUDIO_SYMBIAN_P_H #include <QtCore/qnamespace.h> #include <QtMultimedia/qaudioformat.h> #include <QtMultimedia/qaudio.h> #include <sounddevice.h> -#include "symbianaudio.h" QT_BEGIN_NAMESPACE namespace SymbianAudio { +/** + * Default values used by audio input and output classes, when underlying + * DevSound instance has not yet been created. + */ + +const int DefaultBufferSize = 4096; // bytes +const int DefaultNotifyInterval = 1000; // ms + +/** + * Enumeration used to track state of internal DevSound instances. + * Values are translated to the corresponding QAudio::State values by + * SymbianAudio::Utils::stateNativeToQt. + */ +enum State { + ClosedState + , InitializingState + , ActiveState + , IdleState + , SuspendedState +}; + /* * Helper class for querying DevSound codec / format support */ diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp index 459b7f5..4f45110 100644 --- a/src/multimedia/audio/qaudiodevicefactory.cpp +++ b/src/multimedia/audio/qaudiodevicefactory.cpp @@ -58,6 +58,10 @@ #include "qaudiodeviceinfo_alsa_p.h" #include "qaudiooutput_alsa_p.h" #include "qaudioinput_alsa_p.h" +#elif defined(Q_OS_SYMBIAN) +#include "qaudiodeviceinfo_symbian_p.h" +#include "qaudiooutput_symbian_p.h" +#include "qaudioinput_symbian_p.h" #endif #endif @@ -128,7 +132,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode) { QList<QAudioDeviceInfo> devices; #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode)) devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); #endif @@ -158,7 +162,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); } #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); #endif #endif @@ -175,7 +179,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); } #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); #endif #endif @@ -187,7 +191,7 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re QAbstractAudioDeviceInfo *rc = 0; #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) if (realm == QLatin1String("builtin")) return new QAudioDeviceInfoInternal(handle, mode); #endif @@ -216,7 +220,7 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con if (deviceInfo.isNull()) return new QNullInputDevice(); #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) if (deviceInfo.realm() == QLatin1String("builtin")) return new QAudioInputPrivate(deviceInfo.handle(), format); #endif @@ -235,7 +239,7 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c if (deviceInfo.isNull()) return new QNullOutputDevice(); #ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA)) +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) if (deviceInfo.realm() == QLatin1String("builtin")) return new QAudioOutputPrivate(deviceInfo.handle(), format); #endif diff --git a/src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp index 9701dad..36284d3 100644 --- a/src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp @@ -39,26 +39,26 @@ ** ****************************************************************************/ -#include "symbianaudiodeviceinfo.h" -#include "symbianaudioutils.h" +#include "qaudiodeviceinfo_symbian_p.h" +#include "qaudio_symbian_p.h" QT_BEGIN_NAMESPACE -SymbianAudioDeviceInfo::SymbianAudioDeviceInfo(QByteArray device, +QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode) - : m_deviceName(device) + : m_deviceName(QLatin1String(device)) , m_mode(mode) , m_updated(false) { QT_TRAP_THROWING(m_devsound.reset(CMMFDevSound::NewL())); } -SymbianAudioDeviceInfo::~SymbianAudioDeviceInfo() +QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() { } -QAudioFormat SymbianAudioDeviceInfo::preferredFormat() const +QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const { QAudioFormat format; switch (m_mode) { @@ -100,7 +100,7 @@ QAudioFormat SymbianAudioDeviceInfo::preferredFormat() const return format; } -bool SymbianAudioDeviceInfo::isFormatSupported( +bool QAudioDeviceInfoInternal::isFormatSupported( const QAudioFormat &format) const { getSupportedFormats(); @@ -115,7 +115,7 @@ bool SymbianAudioDeviceInfo::isFormatSupported( return supported; } -QAudioFormat SymbianAudioDeviceInfo::nearestFormat(const QAudioFormat &format) const +QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat &format) const { if (isFormatSupported(format)) return format; @@ -123,56 +123,65 @@ QAudioFormat SymbianAudioDeviceInfo::nearestFormat(const QAudioFormat &format) c return preferredFormat(); } -QString SymbianAudioDeviceInfo::deviceName() const +QString QAudioDeviceInfoInternal::deviceName() const { return m_deviceName; } -QStringList SymbianAudioDeviceInfo::codecList() +QStringList QAudioDeviceInfoInternal::codecList() { getSupportedFormats(); return m_codecs; } -QList<int> SymbianAudioDeviceInfo::frequencyList() +QList<int> QAudioDeviceInfoInternal::frequencyList() { getSupportedFormats(); return m_frequencies; } -QList<int> SymbianAudioDeviceInfo::channelsList() +QList<int> QAudioDeviceInfoInternal::channelsList() { getSupportedFormats(); return m_channels; } -QList<int> SymbianAudioDeviceInfo::sampleSizeList() +QList<int> QAudioDeviceInfoInternal::sampleSizeList() { getSupportedFormats(); return m_sampleSizes; } -QList<QAudioFormat::Endian> SymbianAudioDeviceInfo::byteOrderList() +QList<QAudioFormat::Endian> QAudioDeviceInfoInternal::byteOrderList() { getSupportedFormats(); return m_byteOrders; } -QList<QAudioFormat::SampleType> SymbianAudioDeviceInfo::sampleTypeList() +QList<QAudioFormat::SampleType> QAudioDeviceInfoInternal::sampleTypeList() { getSupportedFormats(); return m_sampleTypes; } -QList<QByteArray> SymbianAudioDeviceInfo::deviceList(QAudio::Mode mode) +QByteArray QAudioDeviceInfoInternal::defaultInputDevice() { - Q_UNUSED(mode) - QList<QByteArray> devices; - devices.append("default"); - return devices; + return QByteArray("default"); } -void SymbianAudioDeviceInfo::getSupportedFormats() const +QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() +{ + return QByteArray("default"); +} + +QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode) +{ + QList<QByteArray> result; + result += QByteArray("default"); + return result; +} + +void QAudioDeviceInfoInternal::getSupportedFormats() const { if (!m_updated) { QScopedPointer<SymbianAudio::DevSoundCapabilities> caps( diff --git a/src/plugins/audio/symbian/symbianaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h index 250804d..89e539f 100644 --- a/src/plugins/audio/symbian/symbianaudiodeviceinfo.h +++ b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h @@ -39,22 +39,33 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIODEVICEINFO_H -#define SYMBIANAUDIODEVICEINFO_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIODEVICEINFO_SYMBIAN_P_H +#define QAUDIODEVICEINFO_SYMBIAN_P_H #include <QtMultimedia/qaudioengine.h> #include <sounddevice.h> QT_BEGIN_NAMESPACE -class SymbianAudioDeviceInfo +class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo { Q_OBJECT public: - SymbianAudioDeviceInfo(QByteArray device, QAudio::Mode mode); - ~SymbianAudioDeviceInfo(); + QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode); + ~QAudioDeviceInfoInternal(); // QAbstractAudioDeviceInfo QAudioFormat preferredFormat() const; @@ -67,7 +78,9 @@ public: QList<int> sampleSizeList(); QList<QAudioFormat::Endian> byteOrderList(); QList<QAudioFormat::SampleType> sampleTypeList(); - QList<QByteArray> deviceList(QAudio::Mode); + static QByteArray defaultInputDevice(); + static QByteArray defaultOutputDevice(); + static QList<QByteArray> availableDevices(QAudio::Mode); private: void getSupportedFormats() const; diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index fd892dd..10bab01 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -95,7 +95,7 @@ QT_BEGIN_NAMESPACE format.setByteOrder(QAudioFormat::LittleEndian); format.setSampleType(QAudioFormat::UnSignedInt); - if (QAudioDeviceInfo info(QAudioDeviceInfo::defaultInputDevice()); + QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice(); if (!info.isFormatSupported(format)) { qWarning()<<"default format not supported try to use nearest"; format = info.nearestFormat(format); diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp index 6010f3c..ead9995 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp @@ -121,6 +121,11 @@ int QAudioInputPrivate::xrun_recovery(int err) err = snd_pcm_prepare(handle); if(err < 0) reset = true; + else { + bytesAvailable = bytesReady(); + if (bytesAvailable <= 0) + reset = true; + } } else if((err == -ESTRPIPE)||(err == -EIO)) { errorState = QAudio::IOError; @@ -443,6 +448,7 @@ int QAudioInputPrivate::bytesReady() const if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) return 0; int frames = snd_pcm_avail_update(handle); + if (frames < 0) return frames; if((int)frames > (int)buffer_frames) frames = buffer_frames; @@ -459,6 +465,20 @@ qint64 QAudioInputPrivate::read(char* data, qint64 len) bytesAvailable = bytesReady(); + if (bytesAvailable < 0) { + // bytesAvailable as negative is error code, try to recover from it. + xrun_recovery(bytesAvailable); + bytesAvailable = bytesReady(); + if (bytesAvailable < 0) { + // recovery failed must stop and set error. + close(); + errorState = QAudio::IOError; + deviceState = QAudio::StoppedState; + emit stateChanged(deviceState); + return 0; + } + } + int count=0, err = 0; while(count < 5) { int chunks = bytesAvailable/period_size; @@ -588,7 +608,11 @@ int QAudioInputPrivate::notifyInterval() const qint64 QAudioInputPrivate::processedUSecs() const { - return qint64(1000000) * totalTimeValue / settings.frequency(); + qint64 result = qint64(1000000) * totalTimeValue / + (settings.channels()*(settings.sampleSize()/8)) / + settings.frequency(); + + return result; } void QAudioInputPrivate::suspend() diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index bd2de52..f394ca4 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -229,6 +229,7 @@ public: QObject* parent): QObject(parent), m_deviceError(false), + m_audioConverter(0), m_inputFormat(inputFormat), m_outputFormat(outputFormat) { diff --git a/src/plugins/audio/symbian/symbianaudioinput.cpp b/src/multimedia/audio/qaudioinput_symbian_p.cpp index 8200925..52daa88 100644 --- a/src/plugins/audio/symbian/symbianaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput_symbian_p.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#include "symbianaudioinput.h" -#include "symbianaudioutils.h" +#include "qaudioinput_symbian_p.h" QT_BEGIN_NAMESPACE @@ -56,7 +55,7 @@ const int PushInterval = 50; // ms //----------------------------------------------------------------------------- SymbianAudioInputPrivate::SymbianAudioInputPrivate( - SymbianAudioInput *audioDevice) + QAudioInputPrivate *audioDevice) : m_audioDevice(audioDevice) { @@ -104,7 +103,7 @@ void SymbianAudioInputPrivate::dataReady() // Public functions //----------------------------------------------------------------------------- -SymbianAudioInput::SymbianAudioInput(const QByteArray &device, +QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat &format) : m_device(device) , m_format(format) @@ -132,12 +131,12 @@ SymbianAudioInput::SymbianAudioInput(const QByteArray &device, connect(m_pullTimer.data(), SIGNAL(timeout()), this, SLOT(pullData())); } -SymbianAudioInput::~SymbianAudioInput() +QAudioInputPrivate::~QAudioInputPrivate() { close(); } -QIODevice* SymbianAudioInput::start(QIODevice *device) +QIODevice* QAudioInputPrivate::start(QIODevice *device) { stop(); @@ -157,19 +156,19 @@ QIODevice* SymbianAudioInput::start(QIODevice *device) return m_sink; } -void SymbianAudioInput::stop() +void QAudioInputPrivate::stop() { close(); } -void SymbianAudioInput::reset() +void QAudioInputPrivate::reset() { m_totalSamplesRecorded += getSamplesRecorded(); m_devSound->Stop(); startRecording(); } -void SymbianAudioInput::suspend() +void QAudioInputPrivate::suspend() { if (SymbianAudio::ActiveState == m_internalState || SymbianAudio::IdleState == m_internalState) { @@ -188,24 +187,24 @@ void SymbianAudioInput::suspend() } } -void SymbianAudioInput::resume() +void QAudioInputPrivate::resume() { if (SymbianAudio::SuspendedState == m_internalState) startDataTransfer(); } -int SymbianAudioInput::bytesReady() const +int QAudioInputPrivate::bytesReady() const { Q_ASSERT(m_devSoundBufferPos <= m_totalBytesReady); return m_totalBytesReady - m_devSoundBufferPos; } -int SymbianAudioInput::periodSize() const +int QAudioInputPrivate::periodSize() const { return bufferSize(); } -void SymbianAudioInput::setBufferSize(int value) +void QAudioInputPrivate::setBufferSize(int value) { // Note that DevSound does not allow its client to specify the buffer size. // This functionality is available via custom interfaces, but since these @@ -218,12 +217,12 @@ void SymbianAudioInput::setBufferSize(int value) m_clientBufferSize = value; } -int SymbianAudioInput::bufferSize() const +int QAudioInputPrivate::bufferSize() const { return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; } -void SymbianAudioInput::setNotifyInterval(int ms) +void QAudioInputPrivate::setNotifyInterval(int ms) { if (ms > 0) { const int oldNotifyInterval = m_notifyInterval; @@ -233,12 +232,12 @@ void SymbianAudioInput::setNotifyInterval(int ms) } } -int SymbianAudioInput::notifyInterval() const +int QAudioInputPrivate::notifyInterval() const { return m_notifyInterval; } -qint64 SymbianAudioInput::processedUSecs() const +qint64 QAudioInputPrivate::processedUSecs() const { int samplesPlayed = 0; if (m_devSound && SymbianAudio::SuspendedState != m_internalState) @@ -254,24 +253,24 @@ qint64 SymbianAudioInput::processedUSecs() const return result; } -qint64 SymbianAudioInput::elapsedUSecs() const +qint64 QAudioInputPrivate::elapsedUSecs() const { const qint64 result = (QAudio::StoppedState == state()) ? 0 : m_elapsed.elapsed() * 1000; return result; } -QAudio::Error SymbianAudioInput::error() const +QAudio::Error QAudioInputPrivate::error() const { return m_error; } -QAudio::State SymbianAudioInput::state() const +QAudio::State QAudioInputPrivate::state() const { return m_externalState; } -QAudioFormat SymbianAudioInput::format() const +QAudioFormat QAudioInputPrivate::format() const { return m_format; } @@ -280,7 +279,7 @@ QAudioFormat SymbianAudioInput::format() const // MDevSoundObserver implementation //----------------------------------------------------------------------------- -void SymbianAudioInput::InitializeComplete(TInt aError) +void QAudioInputPrivate::InitializeComplete(TInt aError) { Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, Q_FUNC_INFO, "Invalid state"); @@ -289,7 +288,7 @@ void SymbianAudioInput::InitializeComplete(TInt aError) startRecording(); } -void SymbianAudioInput::ToneFinished(TInt aError) +void QAudioInputPrivate::ToneFinished(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's tone playback functions, so should @@ -297,7 +296,7 @@ void SymbianAudioInput::ToneFinished(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::BufferToBeFilled(CMMFBuffer *aBuffer) +void QAudioInputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) { Q_UNUSED(aBuffer) // This class doesn't use DevSound in play mode, so should never receive @@ -305,7 +304,7 @@ void SymbianAudioInput::BufferToBeFilled(CMMFBuffer *aBuffer) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::PlayError(TInt aError) +void QAudioInputPrivate::PlayError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound in play mode, so should never receive @@ -313,7 +312,7 @@ void SymbianAudioInput::PlayError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::BufferToBeEmptied(CMMFBuffer *aBuffer) +void QAudioInputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) { // Following receipt of this callback, DevSound should not provide another // buffer until we have returned the current one. @@ -338,13 +337,13 @@ void SymbianAudioInput::BufferToBeEmptied(CMMFBuffer *aBuffer) } } -void SymbianAudioInput::RecordError(TInt aError) +void QAudioInputPrivate::RecordError(TInt aError) { Q_UNUSED(aError) setError(QAudio::IOError); } -void SymbianAudioInput::ConvertError(TInt aError) +void QAudioInputPrivate::ConvertError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's format conversion functions, so @@ -352,7 +351,7 @@ void SymbianAudioInput::ConvertError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioInput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) +void QAudioInputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) { Q_UNUSED(aMessageType) Q_UNUSED(aMsg) @@ -363,7 +362,7 @@ void SymbianAudioInput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) // Private functions //----------------------------------------------------------------------------- -void SymbianAudioInput::open() +void QAudioInputPrivate::open() { Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, Q_FUNC_INFO, "DevSound already opened"); @@ -388,7 +387,7 @@ void SymbianAudioInput::open() } } -void SymbianAudioInput::startRecording() +void QAudioInputPrivate::startRecording() { const int samplesRecorded = m_devSound->SamplesRecorded(); Q_ASSERT(samplesRecorded == 0); @@ -402,7 +401,7 @@ void SymbianAudioInput::startRecording() } } -void SymbianAudioInput::startDevSoundL() +void QAudioInputPrivate::startDevSoundL() { TMMFCapabilities nativeFormat = m_devSound->Config(); m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; @@ -410,7 +409,7 @@ void SymbianAudioInput::startDevSoundL() m_devSound->RecordInitL(); } -void SymbianAudioInput::startDataTransfer() +void QAudioInputPrivate::startDataTransfer() { m_notifyTimer->start(m_notifyInterval); @@ -429,7 +428,7 @@ void SymbianAudioInput::startDataTransfer() } } -CMMFDataBuffer* SymbianAudioInput::currentBuffer() const +CMMFDataBuffer* QAudioInputPrivate::currentBuffer() const { CMMFDataBuffer *result = m_devSoundBuffer; if (!result && !m_devSoundBufferQ.empty()) @@ -437,14 +436,14 @@ CMMFDataBuffer* SymbianAudioInput::currentBuffer() const return result; } -void SymbianAudioInput::pushData() +void QAudioInputPrivate::pushData() { Q_ASSERT_X(bytesReady(), Q_FUNC_INFO, "No data available"); Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, "pushData called when in pull mode"); qobject_cast<SymbianAudioInputPrivate *>(m_sink)->dataReady(); } -qint64 SymbianAudioInput::read(char *data, qint64 len) +qint64 QAudioInputPrivate::read(char *data, qint64 len) { // SymbianAudioInputPrivate is ready to read data @@ -478,7 +477,7 @@ qint64 SymbianAudioInput::read(char *data, qint64 len) return bytesRead; } -void SymbianAudioInput::pullData() +void QAudioInputPrivate::pullData() { Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, "pullData called when in push mode"); @@ -504,7 +503,7 @@ void SymbianAudioInput::pullData() } } -void SymbianAudioInput::bufferEmptied() +void QAudioInputPrivate::bufferEmptied() { m_devSoundBufferPos = 0; @@ -525,7 +524,7 @@ void SymbianAudioInput::bufferEmptied() Q_ASSERT(m_totalBytesReady >= 0); } -void SymbianAudioInput::close() +void QAudioInputPrivate::close() { m_notifyTimer->stop(); m_pullTimer->stop(); @@ -551,7 +550,7 @@ void SymbianAudioInput::close() setState(SymbianAudio::ClosedState); } -qint64 SymbianAudioInput::getSamplesRecorded() const +qint64 QAudioInputPrivate::getSamplesRecorded() const { qint64 result = 0; if (m_devSound) @@ -559,7 +558,7 @@ qint64 SymbianAudioInput::getSamplesRecorded() const return result; } -void SymbianAudioInput::setError(QAudio::Error error) +void QAudioInputPrivate::setError(QAudio::Error error) { m_error = error; @@ -576,7 +575,7 @@ void SymbianAudioInput::setError(QAudio::Error error) QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); } -void SymbianAudioInput::setState(SymbianAudio::State newInternalState) +void QAudioInputPrivate::setState(SymbianAudio::State newInternalState) { const QAudio::State oldExternalState = m_externalState; m_internalState = newInternalState; @@ -587,7 +586,7 @@ void SymbianAudioInput::setState(SymbianAudio::State newInternalState) emit stateChanged(m_externalState); } -QAudio::State SymbianAudioInput::initializingState() const +QAudio::State QAudioInputPrivate::initializingState() const { return QAudio::IdleState; } diff --git a/src/plugins/audio/symbian/symbianaudioinput.h b/src/multimedia/audio/qaudioinput_symbian_p.h index 34b7d38..ca3ccf7 100644 --- a/src/plugins/audio/symbian/symbianaudioinput.h +++ b/src/multimedia/audio/qaudioinput_symbian_p.h @@ -39,25 +39,36 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIOINPUT_H -#define SYMBIANAUDIOINPUT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIOINPUT_SYMBIAN_P_H +#define QAUDIOINPUT_SYMBIAN_P_H #include <QtMultimedia/qaudioengine.h> #include <QTime> #include <QTimer> #include <sounddevice.h> -#include "symbianaudio.h" +#include "qaudio_symbian_p.h" QT_BEGIN_NAMESPACE -class SymbianAudioInput; +class QAudioInputPrivate; class SymbianAudioInputPrivate : public QIODevice { - friend class SymbianAudioInput; + friend class QAudioInputPrivate; Q_OBJECT public: - SymbianAudioInputPrivate(SymbianAudioInput *audio); + SymbianAudioInputPrivate(QAudioInputPrivate *audio); ~SymbianAudioInputPrivate(); qint64 readData(char *data, qint64 len); @@ -66,19 +77,19 @@ public: void dataReady(); private: - SymbianAudioInput *const m_audioDevice; + QAudioInputPrivate *const m_audioDevice; }; -class SymbianAudioInput +class QAudioInputPrivate : public QAbstractAudioInput , public MDevSoundObserver { friend class SymbianAudioInputPrivate; Q_OBJECT public: - SymbianAudioInput(const QByteArray &device, + QAudioInputPrivate(const QByteArray &device, const QAudioFormat &audioFormat); - ~SymbianAudioInput(); + ~QAudioInputPrivate(); // QAbstractAudioInput QIODevice* start(QIODevice *device = 0); diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp index e49c75a..1cef335 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -648,9 +648,10 @@ void QAudioOutputPrivate::userFeed() void QAudioOutputPrivate::feedback() { - QMetaObject::invokeMethod(this, SLOT(updateAvailable()), Qt::QueuedConnection); + updateAvailable(); } + void QAudioOutputPrivate::updateAvailable() { #ifdef DEBUG_AUDIO diff --git a/src/plugins/audio/symbian/symbianaudiooutput.cpp b/src/multimedia/audio/qaudiooutput_symbian_p.cpp index 385e169..945a08d 100644 --- a/src/plugins/audio/symbian/symbianaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput_symbian_p.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#include "symbianaudiooutput.h" -#include "symbianaudioutils.h" +#include "qaudiooutput_symbian_p.h" QT_BEGIN_NAMESPACE @@ -56,7 +55,7 @@ const int UnderflowTimerInterval = 50; // ms //----------------------------------------------------------------------------- SymbianAudioOutputPrivate::SymbianAudioOutputPrivate( - SymbianAudioOutput *audioDevice) + QAudioOutputPrivate *audioDevice) : m_audioDevice(audioDevice) { @@ -99,7 +98,7 @@ qint64 SymbianAudioOutputPrivate::writeData(const char *data, qint64 len) // Public functions //----------------------------------------------------------------------------- -SymbianAudioOutput::SymbianAudioOutput(const QByteArray &device, +QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat &format) : m_device(device) , m_format(format) @@ -132,12 +131,12 @@ SymbianAudioOutput::SymbianAudioOutput(const QByteArray &device, SLOT(underflowTimerExpired())); } -SymbianAudioOutput::~SymbianAudioOutput() +QAudioOutputPrivate::~QAudioOutputPrivate() { close(); } -QIODevice* SymbianAudioOutput::start(QIODevice *device) +QIODevice* QAudioOutputPrivate::start(QIODevice *device) { stop(); @@ -164,12 +163,12 @@ QIODevice* SymbianAudioOutput::start(QIODevice *device) return m_source; } -void SymbianAudioOutput::stop() +void QAudioOutputPrivate::stop() { close(); } -void SymbianAudioOutput::reset() +void QAudioOutputPrivate::reset() { m_totalSamplesPlayed += getSamplesPlayed(); m_devSound->Stop(); @@ -177,7 +176,7 @@ void SymbianAudioOutput::reset() startPlayback(); } -void SymbianAudioOutput::suspend() +void QAudioOutputPrivate::suspend() { if (SymbianAudio::ActiveState == m_internalState || SymbianAudio::IdleState == m_internalState) { @@ -208,13 +207,13 @@ void SymbianAudioOutput::suspend() } } -void SymbianAudioOutput::resume() +void QAudioOutputPrivate::resume() { if (SymbianAudio::SuspendedState == m_internalState) startPlayback(); } -int SymbianAudioOutput::bytesFree() const +int QAudioOutputPrivate::bytesFree() const { int result = 0; if (m_devSoundBuffer) { @@ -224,12 +223,12 @@ int SymbianAudioOutput::bytesFree() const return result; } -int SymbianAudioOutput::periodSize() const +int QAudioOutputPrivate::periodSize() const { return bufferSize(); } -void SymbianAudioOutput::setBufferSize(int value) +void QAudioOutputPrivate::setBufferSize(int value) { // Note that DevSound does not allow its client to specify the buffer size. // This functionality is available via custom interfaces, but since these @@ -242,12 +241,12 @@ void SymbianAudioOutput::setBufferSize(int value) m_clientBufferSize = value; } -int SymbianAudioOutput::bufferSize() const +int QAudioOutputPrivate::bufferSize() const { return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; } -void SymbianAudioOutput::setNotifyInterval(int ms) +void QAudioOutputPrivate::setNotifyInterval(int ms) { if (ms > 0) { const int oldNotifyInterval = m_notifyInterval; @@ -257,12 +256,12 @@ void SymbianAudioOutput::setNotifyInterval(int ms) } } -int SymbianAudioOutput::notifyInterval() const +int QAudioOutputPrivate::notifyInterval() const { return m_notifyInterval; } -qint64 SymbianAudioOutput::processedUSecs() const +qint64 QAudioOutputPrivate::processedUSecs() const { int samplesPlayed = 0; if (m_devSound && SymbianAudio::SuspendedState != m_internalState) @@ -278,24 +277,24 @@ qint64 SymbianAudioOutput::processedUSecs() const return result; } -qint64 SymbianAudioOutput::elapsedUSecs() const +qint64 QAudioOutputPrivate::elapsedUSecs() const { const qint64 result = (QAudio::StoppedState == state()) ? 0 : m_elapsed.elapsed() * 1000; return result; } -QAudio::Error SymbianAudioOutput::error() const +QAudio::Error QAudioOutputPrivate::error() const { return m_error; } -QAudio::State SymbianAudioOutput::state() const +QAudio::State QAudioOutputPrivate::state() const { return m_externalState; } -QAudioFormat SymbianAudioOutput::format() const +QAudioFormat QAudioOutputPrivate::format() const { return m_format; } @@ -304,7 +303,7 @@ QAudioFormat SymbianAudioOutput::format() const // MDevSoundObserver implementation //----------------------------------------------------------------------------- -void SymbianAudioOutput::InitializeComplete(TInt aError) +void QAudioOutputPrivate::InitializeComplete(TInt aError) { Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, Q_FUNC_INFO, "Invalid state"); @@ -313,7 +312,7 @@ void SymbianAudioOutput::InitializeComplete(TInt aError) startPlayback(); } -void SymbianAudioOutput::ToneFinished(TInt aError) +void QAudioOutputPrivate::ToneFinished(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's tone playback functions, so should @@ -321,7 +320,7 @@ void SymbianAudioOutput::ToneFinished(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::BufferToBeFilled(CMMFBuffer *aBuffer) +void QAudioOutputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) { // Following receipt of this callback, DevSound should not provide another // buffer until we have returned the current one. @@ -339,7 +338,7 @@ void SymbianAudioOutput::BufferToBeFilled(CMMFBuffer *aBuffer) pullData(); } -void SymbianAudioOutput::PlayError(TInt aError) +void QAudioOutputPrivate::PlayError(TInt aError) { switch (aError) { case KErrUnderflow: @@ -355,7 +354,7 @@ void SymbianAudioOutput::PlayError(TInt aError) } } -void SymbianAudioOutput::BufferToBeEmptied(CMMFBuffer *aBuffer) +void QAudioOutputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) { Q_UNUSED(aBuffer) // This class doesn't use DevSound in record mode, so should never receive @@ -363,7 +362,7 @@ void SymbianAudioOutput::BufferToBeEmptied(CMMFBuffer *aBuffer) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::RecordError(TInt aError) +void QAudioOutputPrivate::RecordError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound in record mode, so should never receive @@ -371,7 +370,7 @@ void SymbianAudioOutput::RecordError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::ConvertError(TInt aError) +void QAudioOutputPrivate::ConvertError(TInt aError) { Q_UNUSED(aError) // This class doesn't use DevSound's format conversion functions, so @@ -379,7 +378,7 @@ void SymbianAudioOutput::ConvertError(TInt aError) Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); } -void SymbianAudioOutput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) +void QAudioOutputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) { Q_UNUSED(aMessageType) Q_UNUSED(aMsg) @@ -390,7 +389,7 @@ void SymbianAudioOutput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) // Private functions //----------------------------------------------------------------------------- -void SymbianAudioOutput::dataReady() +void QAudioOutputPrivate::dataReady() { // Client-provided QIODevice has data ready to read. @@ -401,7 +400,7 @@ void SymbianAudioOutput::dataReady() pullData(); } -void SymbianAudioOutput::underflowTimerExpired() +void QAudioOutputPrivate::underflowTimerExpired() { const TInt samplesPlayed = getSamplesPlayed(); if (m_samplesPlayed && (samplesPlayed == m_samplesPlayed)) { @@ -412,7 +411,7 @@ void SymbianAudioOutput::underflowTimerExpired() } } -void SymbianAudioOutput::open() +void QAudioOutputPrivate::open() { Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, Q_FUNC_INFO, "DevSound already opened"); @@ -438,7 +437,7 @@ void SymbianAudioOutput::open() } } -void SymbianAudioOutput::startPlayback() +void QAudioOutputPrivate::startPlayback() { TRAPD(err, startDevSoundL()); if (KErrNone == err) { @@ -462,7 +461,7 @@ void SymbianAudioOutput::startPlayback() } } -void SymbianAudioOutput::startDevSoundL() +void QAudioOutputPrivate::startDevSoundL() { TMMFCapabilities nativeFormat = m_devSound->Config(); m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; @@ -470,7 +469,7 @@ void SymbianAudioOutput::startDevSoundL() m_devSound->PlayInitL(); } -void SymbianAudioOutput::writePaddingData() +void QAudioOutputPrivate::writePaddingData() { // See comments in suspend() @@ -494,7 +493,7 @@ void SymbianAudioOutput::writePaddingData() } } -qint64 SymbianAudioOutput::pushData(const char *data, qint64 len) +qint64 QAudioOutputPrivate::pushData(const char *data, qint64 len) { // Data has been written to SymbianAudioOutputPrivate @@ -538,7 +537,7 @@ qint64 SymbianAudioOutput::pushData(const char *data, qint64 len) return bytesWritten; } -void SymbianAudioOutput::pullData() +void QAudioOutputPrivate::pullData() { Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, "pullData called when in push mode"); @@ -575,7 +574,7 @@ void SymbianAudioOutput::pullData() } } -void SymbianAudioOutput::bufferFilled() +void QAudioOutputPrivate::bufferFilled() { Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to return"); @@ -593,7 +592,7 @@ void SymbianAudioOutput::bufferFilled() m_devSound->PlayData(); } -void SymbianAudioOutput::lastBufferFilled() +void QAudioOutputPrivate::lastBufferFilled() { Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to fill"); Q_ASSERT_X(!m_lastBuffer, Q_FUNC_INFO, "Last buffer already sent"); @@ -602,7 +601,7 @@ void SymbianAudioOutput::lastBufferFilled() bufferFilled(); } -void SymbianAudioOutput::close() +void QAudioOutputPrivate::close() { m_notifyTimer->stop(); m_underflowTimer->stop(); @@ -631,7 +630,7 @@ void SymbianAudioOutput::close() setState(SymbianAudio::ClosedState); } -qint64 SymbianAudioOutput::getSamplesPlayed() const +qint64 QAudioOutputPrivate::getSamplesPlayed() const { qint64 result = 0; if (m_devSound) { @@ -651,7 +650,7 @@ qint64 SymbianAudioOutput::getSamplesPlayed() const return result; } -void SymbianAudioOutput::setError(QAudio::Error error) +void QAudioOutputPrivate::setError(QAudio::Error error) { m_error = error; @@ -671,7 +670,7 @@ void SymbianAudioOutput::setError(QAudio::Error error) QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); } -void SymbianAudioOutput::setState(SymbianAudio::State newInternalState) +void QAudioOutputPrivate::setState(SymbianAudio::State newInternalState) { const QAudio::State oldExternalState = m_externalState; m_internalState = newInternalState; @@ -682,14 +681,14 @@ void SymbianAudioOutput::setState(SymbianAudio::State newInternalState) emit stateChanged(m_externalState); } -bool SymbianAudioOutput::isDataReady() const +bool QAudioOutputPrivate::isDataReady() const { return (m_source && m_source->bytesAvailable()) || m_bytesPadding || m_pushDataReady; } -QAudio::State SymbianAudioOutput::initializingState() const +QAudio::State QAudioOutputPrivate::initializingState() const { return isDataReady() ? QAudio::ActiveState : QAudio::IdleState; } diff --git a/src/plugins/audio/symbian/symbianaudiooutput.h b/src/multimedia/audio/qaudiooutput_symbian_p.h index 8994e46..00ccb24 100644 --- a/src/plugins/audio/symbian/symbianaudiooutput.h +++ b/src/multimedia/audio/qaudiooutput_symbian_p.h @@ -39,44 +39,55 @@ ** ****************************************************************************/ -#ifndef SYMBIANAUDIOOUTPUT_H -#define SYMBIANAUDIOOUTPUT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#ifndef QAUDIOOUTPUT_SYMBIAN_P_H +#define QAUDIOOUTPUT_SYMBIAN_P_H #include <QtMultimedia/qaudioengine.h> #include <QTime> #include <QTimer> #include <sounddevice.h> -#include "symbianaudio.h" +#include "qaudio_symbian_p.h" QT_BEGIN_NAMESPACE -class SymbianAudioOutput; +class QAudioOutputPrivate; class SymbianAudioOutputPrivate : public QIODevice { - friend class SymbianAudioOutput; + friend class QAudioOutputPrivate; Q_OBJECT public: - SymbianAudioOutputPrivate(SymbianAudioOutput *audio); + SymbianAudioOutputPrivate(QAudioOutputPrivate *audio); ~SymbianAudioOutputPrivate(); qint64 readData(char *data, qint64 len); qint64 writeData(const char *data, qint64 len); private: - SymbianAudioOutput *const m_audioDevice; + QAudioOutputPrivate *const m_audioDevice; }; -class SymbianAudioOutput +class QAudioOutputPrivate : public QAbstractAudioOutput , public MDevSoundObserver { friend class SymbianAudioOutputPrivate; Q_OBJECT public: - SymbianAudioOutput(const QByteArray &device, + QAudioOutputPrivate(const QByteArray &device, const QAudioFormat &audioFormat); - ~SymbianAudioOutput(); + ~QAudioOutputPrivate(); // QAbstractAudioOutput QIODevice* start(QIODevice *device = 0); diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index c7f5752..ab8da53 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -455,6 +455,9 @@ void QAudioOutputPrivate::feedback() bool QAudioOutputPrivate::deviceReady() { + if(deviceState == QAudio::StoppedState) + return false; + if(pullMode) { int chunks = bytesAvailable/period_size; #ifdef DEBUG_AUDIO diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 4800e9d..3d0c32d 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -639,7 +639,7 @@ void qt_qhostinfo_clear_cache() } } -void Q_NETWORK_EXPORT qt_qhostinfo_enable_cache(bool e) +void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e) { QHostInfoLookupManager* manager = theHostInfoLookupManager(); if (manager) { diff --git a/src/network/ssl/qsslkey.cpp b/src/network/ssl/qsslkey.cpp index 41b2384..da39662 100644 --- a/src/network/ssl/qsslkey.cpp +++ b/src/network/ssl/qsslkey.cpp @@ -119,9 +119,7 @@ void QSslKeyPrivate::decodePem(const QByteArray &pem, const QByteArray &passPhra if (!bio) return; - void *phrase = passPhrase.isEmpty() - ? (void *)0 - : (void *)passPhrase.constData(); + void *phrase = (void *)passPhrase.constData(); if (algorithm == QSsl::Rsa) { RSA *result = (type == QSsl::PublicKey) diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index ee04166..c88c041 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -331,9 +331,14 @@ static const char* const qglslImageSrcFragmentShader = "\n\ varying highp vec2 textureCoords; \n\ uniform lowp sampler2D imageTexture; \n\ lowp vec4 srcPixel() \n\ - { \n\ - return texture2D(imageTexture, textureCoords); \n\ - }\n"; + { \n" +#ifdef QT_OPENGL_ES_2 + // work-around for driver bug + "return 1.0 * texture2D(imageTexture, textureCoords); \n" +#else + "return texture2D(imageTexture, textureCoords); \n" +#endif + "}\n"; static const char* const qglslCustomSrcFragmentShader = "\n\ varying highp vec2 textureCoords; \n\ diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index 9c44545..693312a 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -177,7 +177,8 @@ void qt_vg_unregister_pixmap(QVGPixmapData *pd) pd->prev->next = pd->next; } else { QVGSharedContext *shared = sharedContext(); - shared->firstPixmap = pd->next; + if (shared) + shared->firstPixmap = pd->next; } } diff --git a/src/plugins/audio/audio.pro b/src/plugins/audio/audio.pro index 5f75a8d..b7a775b 100644 --- a/src/plugins/audio/audio.pro +++ b/src/plugins/audio/audio.pro @@ -1,9 +1,3 @@ TEMPLATE = subdirs SUBDIRS = -contains(QT_CONFIG, audio-backend) { - symbian { - SUBDIRS += symbian - } -} - diff --git a/src/plugins/audio/symbian/main.cpp b/src/plugins/audio/symbian/main.cpp deleted file mode 100644 index 536a8ec..0000000 --- a/src/plugins/audio/symbian/main.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtMultimedia module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtMultimedia/qaudioengineplugin.h> -#include <QtMultimedia/qaudioengine.h> - -#include <qstringlist.h> -#include <qiodevice.h> -#include <qbytearray.h> -#include <qdebug.h> - -#include "symbianaudiodeviceinfo.h" -#include "symbianaudioinput.h" -#include "symbianaudiooutput.h" - -QT_BEGIN_NAMESPACE - -class SymbianAudioPlugin : public QAudioEnginePlugin -{ -public: - SymbianAudioPlugin(QObject *parent = 0); - ~SymbianAudioPlugin(); - - QStringList keys() const; - - QList<QByteArray> availableDevices(QAudio::Mode) const; - QAbstractAudioInput* createInput(const QByteArray& device, - const QAudioFormat& format = QAudioFormat()); - QAbstractAudioOutput* createOutput(const QByteArray& device, - const QAudioFormat& format = QAudioFormat()); - QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, - QAudio::Mode mode); -}; - -SymbianAudioPlugin::SymbianAudioPlugin(QObject *parent) - : QAudioEnginePlugin(parent) -{ - -} - -SymbianAudioPlugin::~SymbianAudioPlugin() -{ - -} - -QStringList SymbianAudioPlugin::keys() const -{ - QStringList keys(QLatin1String("default")); - keys << QLatin1String("default"); - return keys; -} - -QList<QByteArray> SymbianAudioPlugin::availableDevices(QAudio::Mode mode) const -{ - Q_UNUSED(mode) - QList<QByteArray> devices; - devices.append("default"); - return devices; -} - -QAbstractAudioInput* SymbianAudioPlugin::createInput( - const QByteArray &device, const QAudioFormat &format) -{ - return new SymbianAudioInput(device, format); -} - -QAbstractAudioOutput* SymbianAudioPlugin::createOutput( - const QByteArray &device, const QAudioFormat &format) -{ - return new SymbianAudioOutput(device, format); -} - -QAbstractAudioDeviceInfo* SymbianAudioPlugin::createDeviceInfo( - const QByteArray& device, QAudio::Mode mode) -{ - return new SymbianAudioDeviceInfo(device, mode); -} - -Q_EXPORT_STATIC_PLUGIN(SymbianAudioPlugin) -Q_EXPORT_PLUGIN2(qaudio, SymbianAudioPlugin) - -QT_END_NAMESPACE - diff --git a/src/plugins/audio/symbian/symbian.pro b/src/plugins/audio/symbian/symbian.pro deleted file mode 100644 index 7355daa..0000000 --- a/src/plugins/audio/symbian/symbian.pro +++ /dev/null @@ -1,31 +0,0 @@ -QT += multimedia -TARGET = qaudio - -# Paths to DevSound headers -INCLUDEPATH += /epoc32/include/mmf/common -INCLUDEPATH += /epoc32/include/mmf/server - -HEADERS += \ - symbianaudio.h \ - symbianaudiodeviceinfo.h \ - symbianaudioinput.h \ - symbianaudiooutput.h \ - symbianaudioutils.h - -SOURCES += \ - main.cpp \ - symbianaudiodeviceinfo.cpp \ - symbianaudioinput.cpp \ - symbianaudiooutput.cpp \ - symbianaudioutils.cpp - -LIBS += -lmmfdevsound - -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/audio -target.path = $$[QT_INSTALL_PLUGINS]/audio -INSTALLS += target - -include(../../qpluginbase.pri) - -TARGET.UID3 = 0x2001E630 - diff --git a/src/plugins/audio/symbian/symbianaudio.h b/src/plugins/audio/symbian/symbianaudio.h deleted file mode 100644 index 3fc0419..0000000 --- a/src/plugins/audio/symbian/symbianaudio.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtMultimedia module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef SYMBIANAUDIO_H -#define SYMBIANAUDIO_H - -#include <QtCore/qnamespace.h> - -QT_BEGIN_NAMESPACE - -namespace SymbianAudio { - -/** - * Default values used by audio input and output classes, when underlying - * DevSound instance has not yet been created. - */ - -const int DefaultBufferSize = 4096; // bytes -const int DefaultNotifyInterval = 1000; // ms - -/** - * Enumeration used to track state of internal DevSound instances. - * Values are translated to the corresponding QAudio::State values by - * SymbianAudio::Utils::stateNativeToQt. - */ -enum State { - ClosedState - , InitializingState - , ActiveState - , IdleState - , SuspendedState -}; - -} // namespace SymbianAudio - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 54f4a8a..e4a0135 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -216,12 +216,12 @@ static void initRasterFallbacksMasks(int *warningMask, int *disableMask) int idx = warning.indexOf(name); if (idx != -1) { *warningMask |= operations[i].operation; - warning.remove(warning.begin() + idx); + warning.erase(warning.begin() + idx); } idx = disable.indexOf(name); if (idx != -1) { *disableMask |= operations[i].operation; - disable.remove(disable.begin() + idx); + disable.erase(disable.begin() + idx); } } } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index b5ac67d..4219f6f 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -174,6 +174,8 @@ bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img) bool QDirectFBPixmapData::fromFile(const QString &filename, const char *format, Qt::ImageConversionFlags flags) { + if (!QFile::exists(filename)) + return false; if (flags == Qt::AutoColor) { if (filename.startsWith(QLatin1Char(':'))) { // resource QFile file(filename); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index a8bdb65..51969fc 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -61,6 +61,7 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect #endif , flipFlags(flip) , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip) + , flushPending(false) { #ifdef QT_NO_DIRECTFB_WM mode = Offscreen; @@ -80,6 +81,7 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect #endif , flipFlags(flip) , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip) + , flushPending(false) { SurfaceFlags flags = 0; if (!widget || widget->window()->windowOpacity() == 0xff) @@ -299,28 +301,19 @@ void QDirectFBWindowSurface::setPermanentState(const QByteArray &state) } } -static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy) -{ - const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() }; - surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy); - const DFBRegion region = { rect.x + dx, rect.y + dy, r.right() + dx, r.bottom() + dy }; - surface->Flip(surface, ®ion, DSFLIP_BLIT); -} - bool QDirectFBWindowSurface::scroll(const QRegion ®ion, int dx, int dy) { - if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty()) + if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.rectCount() != 1) return false; - dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); - if (region.rectCount() == 1) { - scrollSurface(dfbSurface, region.boundingRect(), dx, dy); + if (flushPending) { + dfbSurface->Flip(dfbSurface, 0, DSFLIP_BLIT); } else { - const QVector<QRect> rects = region.rects(); - const int n = rects.size(); - for (int i=0; i<n; ++i) { - scrollSurface(dfbSurface, rects.at(i), dx, dy); - } + flushPending = true; } + dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); + const QRect r = region.boundingRect(); + const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() }; + dfbSurface->Blit(dfbSurface, dfbSurface, &rect, r.x() + dx, r.y() + dy); return true; } @@ -384,6 +377,7 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, timer.restart(); } #endif + flushPending = false; } void QDirectFBWindowSurface::beginPaint(const QRegion &) @@ -391,6 +385,7 @@ void QDirectFBWindowSurface::beginPaint(const QRegion &) if (!engine) { engine = new QDirectFBPaintEngine(this); } + flushPending = true; } void QDirectFBWindowSurface::endPaint(const QRegion &) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h index a6138f6..4370a8f 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h @@ -114,6 +114,7 @@ private: DFBSurfaceFlipFlags flipFlags; bool boundingRectFlip; + bool flushPending; #ifdef QT_DIRECTFB_TIMING int frames; QTime timer; diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp index e78fec1..f5ad70c 100644 --- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp +++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp @@ -2163,6 +2163,9 @@ bool QVNCScreen::connect(const QString &displaySpec) if (QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive)) { const int id = getDisplayId(dspec); QScreen *s = qt_get_screen(id, dspec.toLatin1().constData()); + if (s->pixelFormat() == QImage::Format_Indexed8 + || s->pixelFormat() == QImage::Format_Invalid && s->depth() == 8) + qFatal("QVNCScreen: unsupported screen format"); setScreen(s); } else { // create virtual screen #if Q_BYTE_ORDER == Q_BIG_ENDIAN diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 0f0d6f6..abe3ffe 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -766,7 +766,11 @@ bool QJpegHandler::canRead(QIODevice *device) return false; } - return device->peek(2) == "\xFF\xD8"; + char buffer[2]; + if (device->peek(buffer, 2) != 2) + return false; + + return uchar(buffer[0]) == 0xff && uchar(buffer[1]) == 0xd8; } bool QJpegHandler::read(QImage *image) diff --git a/src/plugins/s60/3_2/3_2.pro b/src/plugins/s60/3_2/3_2.pro index 4b28eb9..468197d 100644 --- a/src/plugins/s60/3_2/3_2.pro +++ b/src/plugins/s60/3_2/3_2.pro @@ -10,7 +10,7 @@ contains(S60_VERSION, 3.1) { SOURCES += ../src/qlocale_3_2.cpp \ ../src/qdesktopservices_3_2.cpp \ ../src/qcoreapplication_3_2.cpp - LIBS += -ldirectorylocalizer -lefsrv + LIBS += -lDirectoryLocalizer -lefsrv INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro index 4cdce12..86e3dc9 100644 --- a/src/plugins/s60/5_0/5_0.pro +++ b/src/plugins/s60/5_0/5_0.pro @@ -10,7 +10,7 @@ contains(S60_VERSION, 3.1) { SOURCES += ../src/qlocale_3_2.cpp \ ../src/qdesktopservices_3_2.cpp \ ../src/qcoreapplication_3_2.cpp - LIBS += -ldirectorylocalizer -lefsrv + LIBS += -lDirectoryLocalizer -lefsrv INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp index a2f30f2..b4ca9a3 100644 --- a/src/plugins/s60/src/qdesktopservices_3_2.cpp +++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp @@ -45,7 +45,7 @@ #ifdef Q_WS_S60 #include <e32base.h> // CBase -> Required by cdirectorylocalizer.h -#include <cdirectorylocalizer.h> // CDirectoryLocalizer +#include <CDirectoryLocalizer.h> // CDirectoryLocalizer EXPORT_C QString localizedDirectoryName(QString& rawPath) { diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro index c609a9e..fb31233 100644 --- a/src/plugins/sqldrivers/sqlite/sqlite.pro +++ b/src/plugins/sqldrivers/sqlite/sqlite.pro @@ -14,4 +14,6 @@ SOURCES = smain.cpp \ QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE } +wince*: DEFINES += HAVE_LOCALTIME_S=0 + include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip Binary files differindex 923cca4..df78644 100644 --- a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip +++ b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 9379163..2feaffd 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -8995,7 +8995,7 @@ EXPORTS ?setFocus@QTextControl@@QAEX_NW4FocusReason@Qt@@@Z @ 8994 NONAME ; void QTextControl::setFocus(bool, enum Qt::FocusReason) ?setFocus@QWidget@@QAEXW4FocusReason@Qt@@@Z @ 8995 NONAME ; void QWidget::setFocus(enum Qt::FocusReason) ?setFocus@QWidget@@QAEXXZ @ 8996 NONAME ; void QWidget::setFocus(void) - ?setFocusHelper@QGraphicsItemPrivate@@QAEXW4FocusReason@Qt@@_N@Z @ 8997 NONAME ; void QGraphicsItemPrivate::setFocusHelper(enum Qt::FocusReason, bool) + ?setFocusHelper@QGraphicsItemPrivate@@QAEXW4FocusReason@Qt@@_N@Z @ 8997 NONAME ABSENT ; void QGraphicsItemPrivate::setFocusHelper(enum Qt::FocusReason, bool) ?setFocusItem@QGraphicsScene@@QAEXPAVQGraphicsItem@@W4FocusReason@Qt@@@Z @ 8998 NONAME ; void QGraphicsScene::setFocusItem(class QGraphicsItem *, enum Qt::FocusReason) ?setFocusPolicy@QGraphicsWidget@@QAEXW4FocusPolicy@Qt@@@Z @ 8999 NONAME ; void QGraphicsWidget::setFocusPolicy(enum Qt::FocusPolicy) ?setFocusPolicy@QWidget@@QAEXW4FocusPolicy@Qt@@@Z @ 9000 NONAME ; void QWidget::setFocusPolicy(enum Qt::FocusPolicy) diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index b82fe4c..7c91264 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -4663,7 +4663,7 @@ EXPORTS _ZN20QGraphicsItemPrivate12resolveDepthEv @ 4662 NONAME _ZN20QGraphicsItemPrivate12setPosHelperERK7QPointF @ 4663 NONAME _ZN20QGraphicsItemPrivate13clearSubFocusEP13QGraphicsItem @ 4664 NONAME - _ZN20QGraphicsItemPrivate14setFocusHelperEN2Qt11FocusReasonEb @ 4665 NONAME + _ZN20QGraphicsItemPrivate14setFocusHelperEN2Qt11FocusReasonEb @ 4665 NONAME ABSENT _ZN20QGraphicsItemPrivate15resetFocusProxyEv @ 4666 NONAME _ZN20QGraphicsItemPrivate16setEnabledHelperEbbb @ 4667 NONAME _ZN20QGraphicsItemPrivate16setVisibleHelperEbbb @ 4668 NONAME diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index 724451b..ec019e2 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -3,92 +3,57 @@ #include <bldvariant.hrh> -// Dependancies for more than one module -#include <base.iby> -#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine, -#include <cone.iby> // QtGui, QtOpenGL -#include <stdcpp.iby> // for std C++ support - -// QtGui dependancies -#include <bafl.iby> -#include <store.iby> -#include <fntstore.iby> -#include <ecom.iby> -#include <fontutils.iby> -#include <fepbase.iby> -#include <fbserv.iby> -#include <bitgdi.iby> -#include <gdi.iby> -#include <wserv.iby> -#include <apparc.iby> -#include <uikon.iby> -#include <etext.iby> -#include <emime.iby> -#include <eikstd.iby> -#include <mmf.iby> -#include <avkon.iby> -#include <commonui.iby> -#include <platformenv.iby> -#include <senduiservices.iby> -#include <aknicon.iby> -#include <aknskins.iby> - -// QtNetwork dependancies -#include <esock_core.iby> -#include <insock.iby> - -// QtOpenGL dependancies -///@todo Problem here as we need libegl.dll and libglesv2.dll but they may come from a variety of places -/// depending on the platform we're on - #warning("qt.iby: hack - BINARY_SELECTION_ORDER really needs to be at the baseport/device level as it depends on the device type"); BINARY_SELECTION_ORDER ARMV6,ARMV5 // hack - this really needs to be at the baseport/device level as it depends on the device type -file=ABI_DIR\BUILD_DIR\QtCore.dll SHARED_LIB_DIR\QtCore.dll PAGED -file=ABI_DIR\BUILD_DIR\QtGui.dll SHARED_LIB_DIR\QtGui.dll PAGED -file=ABI_DIR\BUILD_DIR\QtOpenGL.dll SHARED_LIB_DIR\QtOpenGL.dll PAGED -file=ABI_DIR\BUILD_DIR\QtOpenVG.dll SHARED_LIB_DIR\QtOpenVG.dll PAGED -file=ABI_DIR\BUILD_DIR\QtSvg.dll SHARED_LIB_DIR\QtSvg.dll PAGED -file=ABI_DIR\BUILD_DIR\QtSql.dll SHARED_LIB_DIR\QtSql.dll PAGED -file=ABI_DIR\BUILD_DIR\QtXml.dll SHARED_LIB_DIR\QtXml.dll PAGED -file=ABI_DIR\BUILD_DIR\QtNetwork.dll SHARED_LIB_DIR\QtNetwork.dll PAGED -file=ABI_DIR\BUILD_DIR\QtScript.dll SHARED_LIB_DIR\QtScript.dll PAGED -file=ABI_DIR\BUILD_DIR\QtTest.dll SHARED_LIB_DIR\QtTest.dll PAGED -file=ABI_DIR\BUILD_DIR\QtWebKit.dll SHARED_LIB_DIR\QtWebKit.dll PAGED -file=ABI_DIR\BUILD_DIR\phonon.dll SHARED_LIB_DIR\phonon.dll PAGED -file=ABI_DIR\BUILD_DIR\QtMultimedia.dll SHARED_LIB_DIR\QtMultimedia.dll PAGED -file=ABI_DIR\BUILD_DIR\QtXmlPatterns.dll SHARED_LIB_DIR\QtXmlPatterns.dll PAGED -file=ABI_DIR\BUILD_DIR\QtDeclarative.dll SHARED_LIB_DIR\QtDeclarative.dll PAGED +file=ABI_DIR\BUILD_DIR\QtCore.dll SHARED_LIB_DIR\QtCore.dll +file=ABI_DIR\BUILD_DIR\QtGui.dll SHARED_LIB_DIR\QtGui.dll +file=ABI_DIR\BUILD_DIR\QtOpenVG.dll SHARED_LIB_DIR\QtOpenVG.dll +file=ABI_DIR\BUILD_DIR\QtSvg.dll SHARED_LIB_DIR\QtSvg.dll +file=ABI_DIR\BUILD_DIR\QtSql.dll SHARED_LIB_DIR\QtSql.dll +file=ABI_DIR\BUILD_DIR\QtXml.dll SHARED_LIB_DIR\QtXml.dll +file=ABI_DIR\BUILD_DIR\QtNetwork.dll SHARED_LIB_DIR\QtNetwork.dll +file=ABI_DIR\BUILD_DIR\QtScript.dll SHARED_LIB_DIR\QtScript.dll +file=ABI_DIR\BUILD_DIR\QtTest.dll SHARED_LIB_DIR\QtTest.dll +file=ABI_DIR\BUILD_DIR\QtWebKit.dll SHARED_LIB_DIR\QtWebKit.dll +file=ABI_DIR\BUILD_DIR\phonon.dll SHARED_LIB_DIR\phonon.dll +file=ABI_DIR\BUILD_DIR\QtMultimedia.dll SHARED_LIB_DIR\QtMultimedia.dll +file=ABI_DIR\BUILD_DIR\QtXmlPatterns.dll SHARED_LIB_DIR\QtXmlPatterns.dll +file=ABI_DIR\BUILD_DIR\QtDeclarative.dll SHARED_LIB_DIR\QtDeclarative.dll // imageformats -file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll PAGED -file=ABI_DIR\BUILD_DIR\qico.dll SHARED_LIB_DIR\qico.dll PAGED -file=ABI_DIR\BUILD_DIR\qjpeg.dll SHARED_LIB_DIR\qjpeg.dll PAGED -file=ABI_DIR\BUILD_DIR\qmng.dll SHARED_LIB_DIR\qmng.dll PAGED -file=ABI_DIR\BUILD_DIR\qsvg.dll SHARED_LIB_DIR\qsvg.dll PAGED -file=ABI_DIR\BUILD_DIR\qtiff.dll SHARED_LIB_DIR\qtiff.dll PAGED +file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll +file=ABI_DIR\BUILD_DIR\qico.dll SHARED_LIB_DIR\qico.dll +file=ABI_DIR\BUILD_DIR\qjpeg.dll SHARED_LIB_DIR\qjpeg.dll +file=ABI_DIR\BUILD_DIR\qmng.dll SHARED_LIB_DIR\qmng.dll +file=ABI_DIR\BUILD_DIR\qsvg.dll SHARED_LIB_DIR\qsvg.dll +file=ABI_DIR\BUILD_DIR\qtiff.dll SHARED_LIB_DIR\qtiff.dll // codecs -file=ABI_DIR\BUILD_DIR\qcncodecs.dll SHARED_LIB_DIR\qcncodecs.dll PAGED -file=ABI_DIR\BUILD_DIR\qjpcodecs.dll SHARED_LIB_DIR\qjpcodecs.dll PAGED -file=ABI_DIR\BUILD_DIR\qkrcodecs.dll SHARED_LIB_DIR\qkrcodecs.dll PAGED -file=ABI_DIR\BUILD_DIR\qtwcodecs.dll SHARED_LIB_DIR\qtwcodecs.dll PAGED +file=ABI_DIR\BUILD_DIR\qcncodecs.dll SHARED_LIB_DIR\qcncodecs.dll +file=ABI_DIR\BUILD_DIR\qjpcodecs.dll SHARED_LIB_DIR\qjpcodecs.dll +file=ABI_DIR\BUILD_DIR\qkrcodecs.dll SHARED_LIB_DIR\qkrcodecs.dll +file=ABI_DIR\BUILD_DIR\qtwcodecs.dll SHARED_LIB_DIR\qtwcodecs.dll // iconengines -file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll PAGED +file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll // Phonon MMF backend -file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll PAGED +// This is commented out by default, as normally Helix backend will be used. +// If the Helix backend is present, it will override MMF backend, so make sure to remove it from +// image creation in addition to uncommenting the following lines if you want to use MMF backend. +//file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll +//data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // QtMultimedia audio backend -file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll PAGED +file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll // graphicssystems -file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll PAGED +file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll // S60 version compatibility plugins for 5.0 (3.1 and 3.2 devices are never likely to have this in ROM, // so don't bother including those plugins -file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll PAGED +file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll S60_APP_RESOURCE(s60main) @@ -109,8 +74,6 @@ data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resou // iconengines stubs data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin -// Phonon MMF backend -data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // QtMultimedia audio backend data=\epoc32\data\qt\qtlibspluginstubs\qaudio.qtplugin resource\qt\plugins\audio\qaudio.qtplugin @@ -123,3 +86,4 @@ data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis data=ZSYSTEM\install\qtwebkit_stub.sis System\Install\qtwebkit_stub.sis #endif // __QT_IBY__ + diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 5d5bee9..841fce4 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -78,12 +78,6 @@ symbian: { DEPLOYMENT += phonon_backend_plugins } - contains(QT_CONFIG, audio-backend) { - qaudio_backend_plugins.sources += qaudio.dll - qaudio_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/audio - DEPLOYMENT += qaudio_backend_plugins - } - # Support backup & restore for Qt libraries qtbackup.sources = backup_registration.xml qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) @@ -134,5 +128,5 @@ symbian: { } BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" - BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)" + BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)" } diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index de2be89..2f0cfdc 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -523,7 +523,7 @@ QVariant::Type qDecodeOCIType(const QString& ocitype, QSql::NumericalPrecisionPo } else if (ocitype == QLatin1String("LONG") || ocitype == QLatin1String("NCLOB") || ocitype == QLatin1String("CLOB")) - type = QVariant::String; + type = QVariant::ByteArray; else if (ocitype == QLatin1String("RAW") || ocitype == QLatin1String("LONG RAW") || ocitype == QLatin1String("ROWID") || ocitype == QLatin1String("BLOB") || ocitype == QLatin1String("CFILE") || ocitype == QLatin1String("BFILE")) @@ -549,7 +549,6 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis case SQLT_AVC: case SQLT_RDD: case SQLT_LNG: - case SQLT_CLOB: #ifdef SQLT_INTERVAL_YM case SQLT_INTERVAL_YM: #endif @@ -587,6 +586,7 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis case SQLT_LVC: case SQLT_LVB: case SQLT_BLOB: + case SQLT_CLOB: case SQLT_FILE: case SQLT_NTY: case SQLT_REF: diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 4590f17..63e22cc 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -980,7 +980,7 @@ static void qParseArgs(int argc, char *argv[]) " -xunitxml : Outputs results as XML XUnit document\n" " -xml : Outputs results as XML document\n" " -lightxml : Outputs results as stream of XML tags\n" - " -flush : Flushes the resutls\n" + " -flush : Flushes the results\n" " -o filename: Writes all output into a file\n" " -silent : Only outputs warnings and failures\n" " -v1 : Print enter messages for each testfunction\n" diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp index 6ed28af..fd0b95c 100644 --- a/src/xmlpatterns/schema/qxsdschemaparser.cpp +++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp @@ -264,16 +264,31 @@ XsdSchemaParser::XsdSchemaParser(const XsdSchemaContext::Ptr &context, const Xsd setupBuiltinTypeNames(); } +void XsdSchemaParser::addIncludedSchemas(const NamespaceSet &schemas) +{ + m_includedSchemas += schemas; +} + void XsdSchemaParser::setIncludedSchemas(const NamespaceSet &schemas) { m_includedSchemas = schemas; } +void XsdSchemaParser::addImportedSchemas(const NamespaceSet &schemas) +{ + m_importedSchemas += schemas; +} + void XsdSchemaParser::setImportedSchemas(const NamespaceSet &schemas) { m_importedSchemas = schemas; } +void XsdSchemaParser::addRedefinedSchemas(const NamespaceSet &schemas) +{ + m_redefinedSchemas += schemas; +} + void XsdSchemaParser::setRedefinedSchemas(const NamespaceSet &schemas) { m_redefinedSchemas = schemas; @@ -297,6 +312,7 @@ void XsdSchemaParser::setDocumentURI(const QUrl &uri) // prevent to get included/imported/redefined twice m_includedSchemas.insert(uri); m_importedSchemas.insert(uri); + m_redefinedSchemas.insert(uri); } QUrl XsdSchemaParser::documentURI() const @@ -594,8 +610,14 @@ void XsdSchemaParser::parseInclude() parser.setIncludedSchemas(m_includedSchemas); parser.setImportedSchemas(m_importedSchemas); parser.setRedefinedSchemas(m_redefinedSchemas); - if (!parser.parse(XsdSchemaParser::IncludeParser)) + if (!parser.parse(XsdSchemaParser::IncludeParser)) { return; + } else { + // add indirectly loaded schemas to the list of already loaded ones + addIncludedSchemas(parser.m_includedSchemas); + addImportedSchemas(parser.m_importedSchemas); + addRedefinedSchemas(parser.m_redefinedSchemas); + } } } @@ -684,8 +706,14 @@ void XsdSchemaParser::parseImport() parser.setIncludedSchemas(m_includedSchemas); parser.setImportedSchemas(m_importedSchemas); parser.setRedefinedSchemas(m_redefinedSchemas); - if (!parser.parse(XsdSchemaParser::ImportParser)) + if (!parser.parse(XsdSchemaParser::ImportParser)) { return; + } else { + // add indirectly loaded schemas to the list of already loaded ones + addIncludedSchemas(parser.m_includedSchemas); + addImportedSchemas(parser.m_importedSchemas); + addRedefinedSchemas(parser.m_redefinedSchemas); + } } } } else { @@ -702,8 +730,14 @@ void XsdSchemaParser::parseImport() parser.setIncludedSchemas(m_includedSchemas); parser.setImportedSchemas(m_importedSchemas); parser.setRedefinedSchemas(m_redefinedSchemas); - if (!parser.parse(XsdSchemaParser::ImportParser)) + if (!parser.parse(XsdSchemaParser::ImportParser)) { return; + } else { + // add indirectly loaded schemas to the list of already loaded ones + addIncludedSchemas(parser.m_includedSchemas); + addImportedSchemas(parser.m_importedSchemas); + addRedefinedSchemas(parser.m_redefinedSchemas); + } } } } else { @@ -839,8 +873,14 @@ void XsdSchemaParser::parseRedefine() parser.setIncludedSchemas(m_includedSchemas); parser.setImportedSchemas(m_importedSchemas); parser.setRedefinedSchemas(m_redefinedSchemas); - if (!parser.parse(XsdSchemaParser::RedefineParser)) + if (!parser.parse(XsdSchemaParser::RedefineParser)) { return; + } else { + // add indirectly loaded schemas to the list of already loaded ones + addIncludedSchemas(parser.m_includedSchemas); + addImportedSchemas(parser.m_importedSchemas); + addRedefinedSchemas(parser.m_redefinedSchemas); + } delete reply; } diff --git a/src/xmlpatterns/schema/qxsdschemaparser_p.h b/src/xmlpatterns/schema/qxsdschemaparser_p.h index ad5e9ce..80d44a5 100644 --- a/src/xmlpatterns/schema/qxsdschemaparser_p.h +++ b/src/xmlpatterns/schema/qxsdschemaparser_p.h @@ -120,20 +120,38 @@ namespace QPatternist typedef QSet<QUrl> NamespaceSet; /** + * Adds @p schemas to the list of already included schemas, so the parser + * can detect multiple includes of the same schema. + */ + void addIncludedSchemas(const NamespaceSet &schemas); + + /** * Sets which @p schemas have been included already, so the parser - * can detect circular includes. + * can detect multiple includes of the same schema. */ void setIncludedSchemas(const NamespaceSet &schemas); /** + * Adds @p schemas to the list of already imported schemas, so the parser + * can detect multiple imports of the same schema. + */ + void addImportedSchemas(const NamespaceSet &schemas); + + /** * Sets which @p schemas have been imported already, so the parser * can detect circular imports. */ void setImportedSchemas(const NamespaceSet &schemas); /** + * Adds @p schemas to the list of already redefined schemas, so the parser + * can detect multiple redefines of the same schema. + */ + void addRedefinedSchemas(const NamespaceSet &schemas); + + /** * Sets which @p schemas have been redefined already, so the parser - * can detect circular redefines. + * can detect multiple redefines of the same schema. */ void setRedefinedSchemas(const NamespaceSet &schemas); |