diff options
Diffstat (limited to 'src')
25 files changed, 200 insertions, 59 deletions
diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm index 9a3c811..23c76e3 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm @@ -1106,7 +1106,8 @@ NSString* QuickTimeVideoPlayer::pathToCompactDisc() { PhononAutoReleasePool pool; NSArray *devices = [[NSWorkspace sharedWorkspace] mountedRemovableMedia]; - for (NSString *dev in devices) { + for (unsigned int i=0; i<[devices count]; ++i) { + NSString *dev = [devices objectAtIndex:i]; if (isCompactDisc(dev)) return [dev retain]; } diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index ab4199e..a393ec7 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -275,7 +275,10 @@ public: // data QStringList watching; QFileSystemModel *model; + +#ifndef QT_NO_COMPLETER QFSCompletor *completer; +#endif //QT_NO_COMPLETER QFileDialog::FileMode fileMode; QFileDialog::AcceptMode acceptMode; diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 30f3151..289459c 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -1249,9 +1249,9 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr QInputDialog dialog(parent, flags); dialog.setWindowTitle(title); dialog.setLabelText(label); + dialog.setDoubleDecimals(decimals); dialog.setDoubleRange(min, max); dialog.setDoubleValue(value); - dialog.setDoubleDecimals(decimals); int ret = dialog.exec(); if (ok) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 0377ca7..75538a8 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4281,6 +4281,11 @@ QImage QImage::mirrored(bool horizontal, bool vertical) const int h = d->height; // Create result image, copy colormap QImage result(d->width, d->height, d->format); + + // check if we ran out of of memory.. + if (!result.d) + return QImage(); + result.d->colortable = d->colortable; result.d->has_alpha_clut = d->has_alpha_clut; diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index cbb1f45..4ab653d 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3565,10 +3565,12 @@ bool QApplication::notify(QObject *receiver, QEvent *e) #if !defined(QT_NO_WHEELEVENT) || !defined(QT_NO_TABLETEVENT) else if ( # ifndef QT_NO_WHEELEVENT - e->type() == QEvent::Wheel || + e->type() == QEvent::Wheel +# else + false # endif # ifndef QT_NO_TABLETEVENT - e->type() == QEvent::TabletMove + || e->type() == QEvent::TabletMove || e->type() == QEvent::TabletPress || e->type() == QEvent::TabletRelease # endif diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 8ebea19..720f5c3 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2103,14 +2103,6 @@ void qt_init(QApplicationPrivate *priv, int, X11->xfixes_major = major; } } - if (X11->use_xfixes && X11->ptrXFixesSelectSelectionInput) { - const unsigned long eventMask = - XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask; - X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(0), - XA_PRIMARY, eventMask); - X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(0), - ATOM(CLIPBOARD), eventMask); - } #endif // QT_NO_XFIXES #ifndef QT_NO_XCURSOR diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index d7eb111..b85e024 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -428,6 +428,20 @@ QClipboard::QClipboard(QObject *parent) // XFixesSelectionNotify events when someone changes the // clipboard. (void)QApplication::desktop(); + +#ifndef QT_NO_XFIXES + if (X11->use_xfixes && X11->ptrXFixesSelectSelectionInput) { + const unsigned long eventMask = + XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask; + for (int i = 0; i < X11->screenCount; ++i) { + X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(i), + XA_PRIMARY, eventMask); + X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(i), + ATOM(CLIPBOARD), eventMask); + } + } +#endif // QT_NO_XFIXES + if (X11->time == CurrentTime) { // send a dummy event to myself to get the timestamp from X11. qt_init_timestamp_data data; diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d5fdd93..db73c07 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5635,8 +5635,8 @@ bool QWidget::hasFocus() const called from focusOutEvent() or focusInEvent(), you may get an infinite recursion. - \sa hasFocus(), clearFocus(), focusInEvent(), focusOutEvent(), - setFocusPolicy(), QApplication::focusWidget(), grabKeyboard(), + \sa focus(), hasFocus(), clearFocus(), focusInEvent(), focusOutEvent(), + setFocusPolicy(), focusWidget(), QApplication::focusWidget(), grabKeyboard(), grabMouse(), {Keyboard Focus} */ diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index 3d0a1b7..854bbaf 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -1496,23 +1496,23 @@ QCoreGraphicsPaintEnginePrivate::setStrokePen(const QPen &pen) for(int i = 0; i < customs.size(); ++i) linedashes.append(customs.at(i)); } else if(pen.style() == Qt::DashLine) { - linedashes.append(3); - linedashes.append(1); + linedashes.append(4); + linedashes.append(2); } else if(pen.style() == Qt::DotLine) { linedashes.append(1); - linedashes.append(1); + linedashes.append(2); } else if(pen.style() == Qt::DashDotLine) { - linedashes.append(3); - linedashes.append(1); - linedashes.append(1); + linedashes.append(4); + linedashes.append(2); linedashes.append(1); + linedashes.append(2); } else if(pen.style() == Qt::DashDotDotLine) { - linedashes.append(3); - linedashes.append(1); - linedashes.append(1); - linedashes.append(1); + linedashes.append(4); + linedashes.append(2); linedashes.append(1); + linedashes.append(2); linedashes.append(1); + linedashes.append(2); } const CGFloat cglinewidth = pen.widthF() <= 0.0f ? 1.0f : float(pen.widthF()); for(int i = 0; i < linedashes.size(); ++i) { diff --git a/src/gui/painting/qpaintengine_x11_p.h b/src/gui/painting/qpaintengine_x11_p.h index f277eeb..f3dd283 100644 --- a/src/gui/painting/qpaintengine_x11_p.h +++ b/src/gui/painting/qpaintengine_x11_p.h @@ -153,6 +153,7 @@ public: txop = QTransform::TxNone; has_clipping = false; render_hints = 0; + xform_scale = 1; #ifndef QT_NO_XRENDER tessellator = 0; #endif diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 74eacf6..3999d48 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -849,7 +849,7 @@ void QCommonStylePrivate::lookupIconTheme() const dataDirs = QLatin1String("/usr/local/share/:/usr/share/"); dataDirs += QLatin1Char(':') + QApplicationPrivate::kdeHome() + QLatin1String("/share"); dataDirs.prepend(QDir::homePath() + QLatin1String("/:")); - QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':')); + QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':'), QString::SkipEmptyParts); foreach (const QString &dirName, kdeDirs) dataDirs.append(QLatin1Char(':') + dirName + QLatin1String("/share")); iconDirs = dataDirs.split(QLatin1Char(':')); diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index cf40ad8..1cb806d 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -855,6 +855,24 @@ void QTextDocumentLayoutPrivate::drawBorder(QPainter *painter, const QRectF &rec void QTextDocumentLayoutPrivate::drawFrameDecoration(QPainter *painter, QTextFrame *frame, QTextFrameData *fd, const QRectF &clip, const QRectF &rect) const { + + const QBrush bg = frame->frameFormat().background(); + if (bg != Qt::NoBrush) { + QRectF bgRect = rect; + bgRect.adjust((fd->leftMargin + fd->border).toReal(), + (fd->topMargin + fd->border).toReal(), + - (fd->rightMargin + fd->border).toReal(), + - (fd->bottomMargin + fd->border).toReal()); + + QRectF gradientRect; // invalid makes it default to bgRect + QPointF origin = bgRect.topLeft(); + if (!frame->parentFrame()) { + bgRect = clip; + gradientRect.setWidth(painter->device()->width()); + gradientRect.setHeight(painter->device()->height()); + } + fillBackground(painter, bgRect, bg, origin, gradientRect); + } if (fd->border != 0) { painter->save(); painter->setBrush(Qt::lightGray); @@ -875,24 +893,6 @@ void QTextDocumentLayoutPrivate::drawFrameDecoration(QPainter *painter, QTextFra painter->restore(); } - - const QBrush bg = frame->frameFormat().background(); - if (bg != Qt::NoBrush) { - QRectF bgRect = rect; - bgRect.adjust((fd->leftMargin + fd->border).toReal(), - (fd->topMargin + fd->border).toReal(), - - (fd->rightMargin + fd->border).toReal(), - - (fd->bottomMargin + fd->border).toReal()); - - QRectF gradientRect; // invalid makes it default to bgRect - QPointF origin = bgRect.topLeft(); - if (!frame->parentFrame()) { - bgRect = clip; - gradientRect.setWidth(painter->device()->width()); - gradientRect.setHeight(painter->device()->height()); - } - fillBackground(painter, bgRect, bg, origin, gradientRect); - } } static void adjustContextSelectionsForCell(QAbstractTextDocumentLayout::PaintContext &cell_context, diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 7ee0f07..1403b26 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -362,7 +362,7 @@ QMultiMap<QSsl::AlternateNameEntryType, QString> QSslCertificate::alternateSubje if (!d->x509) return result; - STACK *altNames = (STACK *)q_X509_get_ext_d2i(d->x509, NID_subject_alt_name, 0, 0); + STACK_OF(GENERAL_NAME) *altNames = (STACK_OF(GENERAL_NAME)*)q_X509_get_ext_d2i(d->x509, NID_subject_alt_name, 0, 0); if (altNames) { for (int i = 0; i < q_sk_GENERAL_NAME_num(altNames); ++i) { @@ -383,7 +383,7 @@ QMultiMap<QSsl::AlternateNameEntryType, QString> QSslCertificate::alternateSubje else if (genName->type == GEN_EMAIL) result.insert(QSsl::EmailEntry, altName); } - q_sk_free(altNames); + q_sk_free((STACK*)altNames); } return result; diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 0a049b8..4a50c5b 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1557,7 +1557,7 @@ void QSslSocket::startServerEncryption() { Q_D(QSslSocket); if (d->mode != UnencryptedMode) { - qWarning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection"); + qWarning("QSslSocket::startServerEncryption: cannot start handshake on non-plain connection"); return; } #ifdef QSSLSOCKET_DEBUG diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 4017c4d..d71682a 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -888,7 +888,14 @@ QSslCipher QSslSocketBackendPrivate::sessionCipher() const { if (!ssl || !ctx) return QSslCipher(); +#if OPENSSL_VERSION_NUMBER >= 0x10000000L + // FIXME This is fairly evil, but needed to keep source level compatibility + // with the OpenSSL 0.9.x implementation at maximum -- some other functions + // don't take a const SSL_CIPHER* when they should + SSL_CIPHER *sessionCipher = const_cast<SSL_CIPHER *>(q_SSL_get_current_cipher(ssl)); +#else SSL_CIPHER *sessionCipher = q_SSL_get_current_cipher(ssl); +#endif return sessionCipher ? QSslCipher_from_SSL_CIPHER(sessionCipher) : QSslCipher(); } diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index f53d4e8..dc649e3 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -78,6 +78,10 @@ #include <openssl/x509v3.h> #include <openssl/x509_vfy.h> +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +typedef _STACK STACK; +#endif + QT_BEGIN_NAMESPACE class QSslSocketBackendPrivate : public QSslSocketPrivate diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 42c09f5..feec0a7 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -144,7 +144,11 @@ DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return) DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG) DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG) DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return) +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return) +#else DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return) +#endif DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return) DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return) DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return) @@ -157,7 +161,11 @@ DEFINEFUNC(int, SSL_CTX_check_private_key, SSL_CTX *a, a, return -1, return) #endif DEFINEFUNC4(long, SSL_CTX_ctrl, SSL_CTX *a, a, int b, b, long c, c, void *d, d, return -1, return) DEFINEFUNC(void, SSL_CTX_free, SSL_CTX *a, a, return, DUMMYARG) +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +DEFINEFUNC(SSL_CTX *, SSL_CTX_new, const SSL_METHOD *a, a, return 0, return) +#else DEFINEFUNC(SSL_CTX *, SSL_CTX_new, SSL_METHOD *a, a, return 0, return) +#endif DEFINEFUNC2(int, SSL_CTX_set_cipher_list, SSL_CTX *a, a, const char *b, b, return -1, return) DEFINEFUNC(int, SSL_CTX_set_default_verify_paths, SSL_CTX *a, a, return -1, return) DEFINEFUNC3(void, SSL_CTX_set_verify, SSL_CTX *a, a, int b, b, int (*c)(int, X509_STORE_CTX *), c, return, DUMMYARG) @@ -174,7 +182,11 @@ DEFINEFUNC(STACK_OF(SSL_CIPHER) *, SSL_get_ciphers, const SSL *a, a, return 0, r #else DEFINEFUNC(STACK_OF(SSL_CIPHER) *, SSL_get_ciphers, SSL *a, a, return 0, return) #endif +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +DEFINEFUNC(const SSL_CIPHER *, SSL_get_current_cipher, SSL *a, a, return 0, return) +#else DEFINEFUNC(SSL_CIPHER *, SSL_get_current_cipher, SSL *a, a, return 0, return) +#endif DEFINEFUNC2(int, SSL_get_error, SSL *a, a, int b, b, return -1, return) DEFINEFUNC(STACK_OF(X509) *, SSL_get_peer_cert_chain, SSL *a, a, return 0, return) DEFINEFUNC(X509 *, SSL_get_peer_certificate, SSL *a, a, return 0, return) @@ -192,6 +204,16 @@ DEFINEFUNC3(void, SSL_set_bio, SSL *a, a, BIO *b, b, BIO *c, c, return, DUMMYARG DEFINEFUNC(void, SSL_set_accept_state, SSL *a, a, return, DUMMYARG) DEFINEFUNC(void, SSL_set_connect_state, SSL *a, a, return, DUMMYARG) DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, return) +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return) +DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return) +#else DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return) @@ -200,6 +222,7 @@ DEFINEFUNC(SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, retu DEFINEFUNC(SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return) +#endif DEFINEFUNC3(int, SSL_write, SSL *a, a, const void *b, b, int c, c, return -1, return) DEFINEFUNC2(int, X509_cmp, X509 *a, a, X509 *b, b, return -1, return) #ifndef SSLEAY_MACROS diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index c6ae91e..bf5cfbb 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -256,7 +256,11 @@ int q_RAND_status(); void q_RSA_free(RSA *a); void q_sk_free(STACK *a); int q_sk_num(STACK *a); +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +void * q_sk_value(STACK *a, int b); +#else char * q_sk_value(STACK *a, int b); +#endif int q_SSL_accept(SSL *a); int q_SSL_clear(SSL *a); char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c); @@ -269,7 +273,11 @@ int q_SSL_CTX_check_private_key(SSL_CTX *a); #endif long q_SSL_CTX_ctrl(SSL_CTX *a, int b, long c, void *d); void q_SSL_CTX_free(SSL_CTX *a); +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +SSL_CTX *q_SSL_CTX_new(const SSL_METHOD *a); +#else SSL_CTX *q_SSL_CTX_new(SSL_METHOD *a); +#endif int q_SSL_CTX_set_cipher_list(SSL_CTX *a, const char *b); int q_SSL_CTX_set_default_verify_paths(SSL_CTX *a); void q_SSL_CTX_set_verify(SSL_CTX *a, int b, int (*c)(int, X509_STORE_CTX *)); @@ -286,7 +294,11 @@ STACK_OF(SSL_CIPHER) *q_SSL_get_ciphers(const SSL *a); #else STACK_OF(SSL_CIPHER) *q_SSL_get_ciphers(SSL *a); #endif +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +const SSL_CIPHER *q_SSL_get_current_cipher(SSL *a); +#else SSL_CIPHER *q_SSL_get_current_cipher(SSL *a); +#endif int q_SSL_get_error(SSL *a, int b); STACK_OF(X509) *q_SSL_get_peer_cert_chain(SSL *a); X509 *q_SSL_get_peer_certificate(SSL *a); @@ -304,6 +316,16 @@ void q_SSL_set_bio(SSL *a, BIO *b, BIO *c); void q_SSL_set_accept_state(SSL *a); void q_SSL_set_connect_state(SSL *a); int q_SSL_shutdown(SSL *a); +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +const SSL_METHOD *q_SSLv2_client_method(); +const SSL_METHOD *q_SSLv3_client_method(); +const SSL_METHOD *q_SSLv23_client_method(); +const SSL_METHOD *q_TLSv1_client_method(); +const SSL_METHOD *q_SSLv2_server_method(); +const SSL_METHOD *q_SSLv3_server_method(); +const SSL_METHOD *q_SSLv23_server_method(); +const SSL_METHOD *q_TLSv1_server_method(); +#else SSL_METHOD *q_SSLv2_client_method(); SSL_METHOD *q_SSLv3_client_method(); SSL_METHOD *q_SSLv23_client_method(); @@ -312,6 +334,7 @@ SSL_METHOD *q_SSLv2_server_method(); SSL_METHOD *q_SSLv3_server_method(); SSL_METHOD *q_SSLv23_server_method(); SSL_METHOD *q_TLSv1_server_method(); +#endif int q_SSL_write(SSL *a, const void *b, int c); int q_X509_cmp(X509 *a, X509 *b); #ifdef SSLEAY_MACROS diff --git a/src/phonon/phonon.pro b/src/phonon/phonon.pro index ec7e46a..9e7879f 100644 --- a/src/phonon/phonon.pro +++ b/src/phonon/phonon.pro @@ -1,5 +1,5 @@ TARGET = phonon -include($$QT_SOURCE_TREE/src/qbase.pri) +include(../qbase.pri) PHONON_MAJOR_VERSION = $${QT_MAJOR_VERSION} PHONON_MINOR_VERSION = 3 diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 2fb533a..5be4d47 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -532,7 +532,9 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, d->prepareForBlit(QDirectFBScreen::hasAlpha(imgSurface)); d->blit(r, imgSurface, sr); if (release) { +#if (Q_DIRECTFB_VERSION >= 0x010000) imgSurface->ReleaseSource(imgSurface); +#endif imgSurface->Release(imgSurface); } #endif @@ -897,7 +899,9 @@ void QDirectFBPaintEnginePrivate::end() { lockedMemory = 0; dfbDevice = 0; +#if (Q_DIRECTFB_VERSION >= 0x010000) surface->ReleaseSource(surface); +#endif surface->SetClip(surface, NULL); surface = 0; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 18754f5..8184073 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -225,7 +225,9 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) const DFBRectangle blitRect = { rect.x(), rect.y(), rect.width(), rect.height() }; DFBResult result = dfbSurface->Blit(dfbSurface, src, &blitRect, 0, 0); +#if (Q_DIRECTFB_VERSION >= 0x010000) dfbSurface->ReleaseSource(dfbSurface); +#endif if (result != DFB_OK) { DirectFBError("QDirectFBPixmapData::copy()", result); invalidate(); @@ -316,8 +318,9 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform, const DFBRectangle destRect = { 0, 0, size.width(), size.height() }; data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect); +#if (Q_DIRECTFB_VERSION >= 0x010000) data->dfbSurface->ReleaseSource(data->dfbSurface); - +#endif return QPixmap(data); } @@ -336,7 +339,9 @@ QImage QDirectFBPixmapData::toImage() const imgSurface->SetBlittingFlags(imgSurface, DSBLIT_NOFX); } imgSurface->Blit(imgSurface, dfbSurface, 0, 0, 0); +#if (Q_DIRECTFB_VERSION >= 0x010000) imgSurface->ReleaseSource(imgSurface); +#endif imgSurface->Release(imgSurface); return ret; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 9e35a66..f694ed9 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -196,7 +196,9 @@ IDirectFBSurface *QDirectFBScreen::copyDFBSurface(IDirectFBSurface *src, surface->SetBlittingFlags(surface, flags); surface->Blit(surface, src, 0, 0, 0); +#if (Q_DIRECTFB_VERSION >= 0x010000) surface->ReleaseSource(surface); +#endif return surface; } @@ -317,7 +319,9 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img, DFBResult result = dfbSurface->Blit(dfbSurface, imgSurface, 0, 0, 0); if (result != DFB_OK) DirectFBError("QDirectFBScreen::copyToDFBSurface()", result); +#if (Q_DIRECTFB_VERSION >= 0x010000) dfbSurface->ReleaseSource(dfbSurface); +#endif imgSurface->Release(imgSurface); #else // QT_NO_DIRECTFB_PREALLOCATED Q_ASSERT(image.format() == pixmapFormat); @@ -388,10 +392,12 @@ DFBSurfacePixelFormat QDirectFBScreen::getSurfacePixelFormat(QImage::Format form #endif case QImage::Format_RGB16: return DSPF_RGB16; +#if (Q_DIRECTFB_VERSION >= 0x010000) case QImage::Format_ARGB6666_Premultiplied: return DSPF_ARGB6666; case QImage::Format_RGB666: return DSPF_RGB18; +#endif case QImage::Format_RGB32: return DSPF_RGB32; case QImage::Format_ARGB32_Premultiplied: @@ -423,10 +429,12 @@ QImage::Format QDirectFBScreen::getImageFormat(IDirectFBSurface *surface) return QImage::Format_RGB555; case DSPF_RGB16: return QImage::Format_RGB16; +#if (Q_DIRECTFB_VERSION >= 0x010000) case DSPF_ARGB6666: return QImage::Format_ARGB6666_Premultiplied; case DSPF_RGB18: return QImage::Format_RGB666; +#endif case DSPF_RGB32: return QImage::Format_RGB32; case DSPF_ARGB: { @@ -778,9 +786,13 @@ static const FlagDescription blitDescriptions[] = { { " DSBLIT_DST_PREMULTIPLY", DSBLIT_DST_PREMULTIPLY }, { " DSBLIT_DEMULTIPLY", DSBLIT_DEMULTIPLY }, { " DSBLIT_DEINTERLACE", DSBLIT_DEINTERLACE }, +#if (Q_DIRECTFB_VERSION >= 0x000923) { " DSBLIT_SRC_PREMULTCOLOR", DSBLIT_SRC_PREMULTCOLOR }, { " DSBLIT_XOR", DSBLIT_XOR }, +#endif +#if (Q_DIRECTFB_VERSION >= 0x010000) { " DSBLIT_INDEX_TRANSLATION", DSBLIT_INDEX_TRANSLATION }, +#endif { 0, 0 } }; @@ -798,6 +810,7 @@ static const FlagDescription drawDescriptions[] = { +#if (Q_DIRECTFB_VERSION >= 0x000923) static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags) { #ifdef QT_NO_DEBUG @@ -818,9 +831,6 @@ static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags return (QLatin1Char(' ') + list.join(QLatin1String("|"))).toLatin1(); #endif } - - - static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) { DFBResult result; @@ -845,6 +855,7 @@ static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), (dev.video_memory >> 10)); } +#endif static inline bool setIntOption(const QStringList &arguments, const QString &variable, int *value) { @@ -1039,8 +1050,10 @@ bool QDirectFBScreen::connect(const QString &displaySpec) setGraphicsSystem(d_ptr); +#if (Q_DIRECTFB_VERSION >= 0x000923) if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); +#endif return true; } @@ -1223,7 +1236,9 @@ void QDirectFBScreen::compose(const QRegion ®ion) blit(surface->image(), offset, r); } } +#if (Q_DIRECTFB_VERSION >= 0x010000) d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface); +#endif } // Normally, when using DirectFB to compose the windows (I.e. when @@ -1271,7 +1286,9 @@ void QDirectFBScreen::blit(const QImage &img, const QPoint &topLeft, return; } blit(src, topLeft, reg); +#if (Q_DIRECTFB_VERSION >= 0x010000) d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface); +#endif src->Release(src); } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index 84199a2..c105590 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -177,11 +177,15 @@ inline bool QDirectFBScreen::hasAlpha(DFBSurfacePixelFormat format) case DSPF_A1: case DSPF_ARGB2554: case DSPF_ARGB4444: +#if (Q_DIRECTFB_VERSION >= 0x000923) case DSPF_AYUV: +#endif +#if (Q_DIRECTFB_VERSION >= 0x010000) case DSPF_A4: case DSPF_ARGB1666: case DSPF_ARGB6666: case DSPF_LUT2: +#endif return true; default: return false; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 330eb88..442f8dd 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -188,14 +188,25 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask) if (!dfbWindow) createWindow(); - if (isResize && isMove) +#if (Q_DIRECTFB_VERSION >= 0x010000) + if (isResize && isMove) { result = dfbWindow->SetBounds(dfbWindow, rect.x(), rect.y(), rect.width(), rect.height()); - else if (isResize) + } else if (isResize) { result = dfbWindow->Resize(dfbWindow, rect.width(), rect.height()); - else if (isMove) + } else if (isMove) { result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y()); + } +#else + if (isResize) { + result = dfbWindow->Resize(dfbWindow, + rect.width(), rect.height()); + } + if (isMove) { + result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y()); + } +#endif #endif } diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp index 41b247b..405a760 100644 --- a/src/plugins/imageformats/svg/qsvgiohandler.cpp +++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp @@ -64,6 +64,7 @@ public: } bool load(QIODevice *device); + static bool findSvgTag(QIODevice *device); QSvgRenderer *r; QSize defaultSize; @@ -86,6 +87,33 @@ bool QSvgIOHandlerPrivate::load(QIODevice *device) return loaded; } +bool QSvgIOHandlerPrivate::findSvgTag(QIODevice *device) +{ + qint64 pos = device->pos(); + device->seek(0); + char buffer[256]; + const char svg_tag[] = "<svg"; + + while (1) { + int size = device->read(buffer, 256); + for (int i=0; i<size - 5; ++i) { + if (!memcmp(buffer + i, svg_tag, 4)) { + if (buffer[i+4] == ' ' || buffer[i+4] == '\t' + || buffer[i+4] == '\n' || buffer[i+4] == '\r') + { + device->seek(pos); + return true; + } + } + } + if (device->atEnd()) + break; + device->seek(device->pos()-4); + } + device->seek(pos); + return false; +} + QSvgIOHandler::QSvgIOHandler() : d(new QSvgIOHandlerPrivate()) { @@ -101,9 +129,7 @@ QSvgIOHandler::~QSvgIOHandler() bool QSvgIOHandler::canRead() const { - QByteArray contents = device()->peek(80); - - return contents.contains("<svg"); + return QSvgIOHandlerPrivate::findSvgTag(device()); } @@ -182,8 +208,7 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const bool QSvgIOHandler::canRead(QIODevice *device) { - QByteArray contents = device->peek(80); - return contents.contains("<svg"); + return QSvgIOHandlerPrivate::findSvgTag(device); } QT_END_NAMESPACE |