From f7338759ef86deba18b27ee72b3afcf40f3a5aaf Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 4 Jun 2009 09:07:38 -0700 Subject: Make sure to retain alpha information in copy We need to set alpha to the right value when copying pixmaps. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index dba1b51..18754f5 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -202,11 +202,12 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) } IDirectFBSurface *src = static_cast(data)->directFBSurface(); - const bool hasAlpha = data->hasAlphaChannel(); - format = (hasAlpha + alpha = data->hasAlphaChannel(); + format = (alpha ? QDirectFBScreen::instance()->alphaPixmapFormat() : QDirectFBScreen::instance()->pixelFormat()); + dfbSurface = screen->createDFBSurface(rect.size(), format, QDirectFBScreen::TrackSurface); if (!dfbSurface) { @@ -215,7 +216,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) return; } - if (hasAlpha) { + if (alpha) { dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_BLEND_ALPHACHANNEL); } else { -- cgit v0.12 From cdb0222129a139dfe1b7e4fb4b401556989901b4 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 5 Jun 2009 10:45:26 +0200 Subject: My changelog for 4.5.2 --- dist/changes-4.5.2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 04a29ba..5de0dbe 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -67,6 +67,17 @@ Third party components - QDir * Fix reentrency (listing directories in different threads) +- QFileSystemModel + * [254701] QFileSystemModel doesn't sort subfolders when using it in a QTreeView + * [251295] Windows path names incorrectly constructed in calls to updateIcon() + +- QFileDialog + * [251341] It is not possible to remove a directory of the sidebar if the directory does not exist + * [251321] Hidden path in QFileDialog's sidebar cannot be opened + * [226483] setSidebarUrls() handles the urls case sensitive so that adding the same directory twice is possible - Windows + * [252068] QFileDialog with QSortFilterProxyModel crashes + * [254490] QFileDialog selectFile doesn't clear the selection if we call it several times. + - QMacStyle * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. -- cgit v0.12 From 3e1bbbda44258005b20862effe495cfb664627ca Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Jun 2009 10:52:01 +0200 Subject: link qmake without /DEBUG on Windows Reviewed-by: mariusSO --- qmake/Makefile.win32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 39bac81..53130aa 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -41,7 +41,7 @@ CFLAGS = -c -Fo$@ \ CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = ole32.lib advapi32.lib -LINKQMAKE = $(LINK) $(LFLAGS) -DEBUG -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) +LINKQMAKE = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk !ELSE -- cgit v0.12 From 6fff92a31c4acd270d0ecb4cda336ba098801ffb Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 12:12:21 +0200 Subject: Doc - cleaned up a sentence to improve clarity Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index bf202b2..5a49901 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -454,7 +454,7 @@ \snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals The image below is our expected graphical user interface. Notice that it - is getting closer to our expected final output. + is getting closer to our final application. \image addressbook-tutorial-part3-screenshot.png -- cgit v0.12 From 95ceabf52d79b922a87f7c023c9606e633ab1ea2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 15:03:31 +0200 Subject: Autotest: Fixed a race condition in the network self test. Some of the tests (including the httpsServer one) requested that the server close the connection (Connection: close). It could happen that, well, the server did close the connection and we noticed it while doing the waitForBytesWritten in the doSocketFlush function. Then we'd create an error in the next step because the socket wasn't connected. Reviewed-by: TrustMe --- tests/auto/_networkselftest/tst_networkselftest.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index 0fa001a..eac603f 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -190,12 +190,6 @@ static void netChat(int port, const QList &chat) // now start the chat QList::ConstIterator it = chat.constBegin(); for (int i = 1; it != chat.constEnd(); ++it, ++i) { - if (it->type != Chat::Reconnect - && socket.state() != QAbstractSocket::ConnectedState - && socket.state() != QAbstractSocket::ClosingState) - QFAIL(QString("Internal error: socket is in invalid state %1 in step %2") - .arg(socket.state()).arg(i).toLocal8Bit()); - switch (it->type) { case Chat::Expect: { qDebug() << i << "Expecting" << prettyByteArray(it->data); -- cgit v0.12 From 799a9ddf0a53ecdd6e097b2efd7418fd6ab9b655 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 12:29:27 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 5a49901..4ab549a 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -510,7 +510,7 @@ \list \o If the iterator is at the end of \c contacts, we clear the display and return. - \o If the iterator is the beginning of \c contacts, we move it to + \o If the iterator is at the beginning of \c contacts, we move it to the end. \o We then decrement the iterator by one. \endlist -- cgit v0.12 From 35bdd8942716c716113e5b795186ca76199e8d96 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Fri, 5 Jun 2009 12:32:51 +0200 Subject: Fixed text drawing on Windows in 16 bit mode. There were several problems with antialiased text in 16 bit mode under Windows. No gamma correction was done, yet we prepared the cached glyphs for gamma correction. The mask format we rendered the glyphs into was also set to the desktop depth, which implied that information was lost and the text looked rather odd. Reviewed-by: Samuel BT: yes --- src/gui/text/qfontengine_win.cpp | 26 ++++++++++++++------------ src/gui/text/qfontengine_win_p.h | 3 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 7341665..dc2e1ff 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1335,7 +1335,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin, - const QTransform &t) + const QTransform &t, QImage::Format mask_format) { glyph_metrics_t gm = boundingBox(glyph); @@ -1408,7 +1408,7 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4, ih + 2 * margin + 4, - QNativeImage::systemFormat(), true); + mask_format, true); ni->image.fill(0xffffffff); HDC hdc = ni->hdc; @@ -1448,8 +1448,12 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) lf.lfQuality = ANTIALIASED_QUALITY; font = CreateFontIndirectW(&lf); } + QImage::Format mask_format = QNativeImage::systemFormat(); +#ifndef Q_OS_WINCE + mask_format = QImage::Format_RGB32; +#endif - QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform); + QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform, mask_format); if (mask == 0) return QImage(); @@ -1466,22 +1470,20 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) // Alpha channel of the ni.image pixels... for (int y=0; yheight(); ++y) { uchar *dest = indexed.scanLine(y); - if (mask->systemFormat() == QImage::Format_RGB16) { + if (mask->image.format() == QImage::Format_RGB16) { const qint16 *src = (qint16 *) ((const QImage &) mask->image).scanLine(y); - for (int x=0; xwidth(); ++x) { -#ifdef Q_OS_WINCE + for (int x=0; xwidth(); ++x) dest[x] = 255 - qGray(src[x]); -#else - dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); -#endif - } } else { const uint *src = (uint *) ((const QImage &) mask->image).scanLine(y); for (int x=0; xwidth(); ++x) { #ifdef Q_OS_WINCE dest[x] = 255 - qGray(src[x]); #else - dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); + if (QNativeImage::systemFormat() == QImage::Format_RGB16) + dest[x] = 255 - qGray(src[x]); + else + dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); #endif } } @@ -1507,7 +1509,7 @@ QImage QFontEngineWin::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTra SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &contrast, 0); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) 1000, 0); - QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t); + QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t, QImage::Format_RGB32); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) contrast, 0); if (mask == 0) diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h index 6f37e91..f78bc6a 100644 --- a/src/gui/text/qfontengine_win_p.h +++ b/src/gui/text/qfontengine_win_p.h @@ -138,7 +138,8 @@ public: mutable int designAdvancesSize; private: - QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform); + QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform, + QImage::Format mask_format); }; -- cgit v0.12 From 5740b034811794e0c33496cf0eeb81ba471cc018 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 5 Jun 2009 13:30:03 +0200 Subject: Example MDI: keybord focus not working correctly! The reason is that cocoa looses the first responder when we raise the fake window inside the MDA area. So we need to re-set the first responder again Task-number: 255040 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c82b87d..68eaf6f 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3603,11 +3603,15 @@ void QWidgetPrivate::raise_sys() } } else { // Cocoa doesn't really have an idea of Z-ordering, but you can - // fake it by changing the order of it. + // fake it by changing the order of it. But beware, removing an + // NSView will also remove it as the first responder. So we re-set + // the first responder just in case: NSView *view = qt_mac_nativeview_for(q); NSView *parentView = [view superview]; + NSResponder *firstResponder = [[view window] firstResponder]; [view removeFromSuperview]; [parentView addSubview:view]; + [[view window] makeFirstResponder:firstResponder]; } #else if(q->isWindow()) { @@ -3645,6 +3649,7 @@ void QWidgetPrivate::lower_sys() NSArray *tmpViews = [parentView subviews]; NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]]; [subviews addObjectsFromArray:tmpViews]; + NSResponder *firstResponder = [[myview window] firstResponder]; // Implicit assumption that myViewIndex is included in subviews, that's why I'm not checking // myViewIndex. NSUInteger index = 0; @@ -3664,6 +3669,7 @@ void QWidgetPrivate::lower_sys() for (NSView *subview in subviews) [parentView addSubview:subview]; [subviews release]; + [[myview window] makeFirstResponder:firstResponder]; } #else if(q->isWindow()) { -- cgit v0.12 From a45ba34ead80d7e19e62eff571d094c9417fd876 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 13:46:14 +0200 Subject: Revert "BT: Fixed crash on Mac caused by erroneous handling of native focus events." This reverts commit 7314c07a3e443b1d5349b419a03db8d41ca43f7e. As reported by Eike, this patch caused several problems for Qt Creator. Potentially it may cause problems for other (external) applications as well. An alternative fix (scheduled for 4.5.x) needs to be found for tasks 254456 and 254460. Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwidget_mac.mm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 68eaf6f..b2256cd 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1296,11 +1296,8 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if(part == kControlFocusNoPart){ if (widget->hasFocus()) QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); - } else if (widget->focusPolicy() != Qt::NoFocus) { + } else widget->setFocus(); - } else { - handled_event = false; - } } if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); -- cgit v0.12 From 5455f9c7a3ec8ed591666a2f4384c10de31f6a60 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 5 Jun 2009 14:06:03 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 5de0dbe..84460e3 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -210,7 +210,9 @@ Qt for Embedded Linux Qt for Windows CE ----------------- -[248846] handle the back soft key on Windows mobile. +[248846] Handle the back soft key on Windows mobile. +[252319] Fix regression in native menu integration. +[242484] Fixed crash if Qt::WindowCancelButtonHint is used for a QDialog **************************************************************************** -- cgit v0.12 From 2734d8fa8c26c8498091348305b2616ecacfad85 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 15:01:16 +0200 Subject: My changes for 4.5.2. --- dist/changes-4.5.2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 84460e3..1984881 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -59,6 +59,10 @@ Third party components - QAbstractNetworkCache * Only cache responses to HTTP GET by default, not HTTP PUT or POST +- QApplication + * [249589] Fixed bug that prevented any part of the application to receive + focus when Graphics View was disabled using QT_NO_GRAPHICSVIEW. + - QComboBox * [253944] Changing the style doesn't reset custom item delegate anymore. * [254589] Fixed the frame appearing if setting a stylesheet with a border @@ -88,6 +92,9 @@ Third party components - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. +- QGraphicsWidget + * Fixed a bug with Qt::WidgetWithChildren shortcut context. + - QLocalSocket * [247144] correctly handle remote disconnects @@ -107,6 +114,10 @@ Third party components * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute in conjunction with style sheets. +- QWizard + * [252662] Fixed crash that could happen when compiling on Windows XP and + running on older Windows versions like 98 and 2000. + - QObject * Fixed possible race condition if two QObject connected together with signals and slot are destroyed in different threads @@ -121,6 +132,9 @@ Third party components * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. +- QProgressBar + * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it. + - QSelectionModel * [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled. @@ -135,6 +149,10 @@ Third party components - QString * Fixed reentrency of QString::squeeze() +- QTabBar + * [252472] Fixed problem with the current tab not being visible after calling + setTabButton() on a scrolled tab bar. + - QTransform * Fixed issue in QTransform::type() causing a projective transform to be treated as a scaling transform. -- cgit v0.12 From f6fc34ea5b247d1b56e113663958176b095a58a6 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 15:44:24 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 4ab549a..e5657e7 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -529,7 +529,7 @@ \example tutorials/addressbook/part4 \title Address Book 4 - Editing and Removing Addresses - In this chapter, we look at ways to modify the contents of contact stored + In this chapter, we look at ways to modify the contents of contacts stored in the address book application. \image addressbook-tutorial-screenshot.png -- cgit v0.12 From 4515b690829a639283a9b660893ff3f0f7ff598b Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 15:59:59 +0200 Subject: Doc - fixed another typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index e5657e7..4de334d 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -539,7 +539,7 @@ edit and remove functions so that a contact's details can be changed when needed. However, this requires a little improvement, in the form of enums. In our previous chapters, we had two modes: \c{AddingMode} and - \c{NavigationMode} - but they weren't defined as enums. Instead, we + \c{NavigationMode} - but they were not defined as enums. Instead, we enabled and disabled the corresponding buttons manually, resulting in multiple lines of repeated code. -- cgit v0.12 From b59d84fe67caedeb8c11d2530ddee2017a376920 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 16:31:24 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 4de334d..9a1af85 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -573,8 +573,7 @@ \dots \snippet tutorials/addressbook/part4/addressbook.h mode declaration - Lastly, we declare \c currentMode to keep track of the current mode of the - enum. + Lastly, we declare \c currentMode to keep track of the enum's current mode. \section1 Implementing the AddressBook Class -- cgit v0.12 From d29da4699a2887cdf0836ff39652524d015431c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 16:41:23 +0200 Subject: Fixed an issue with graphicssystem raster on 8 and 16 bit X servers. We didn't actually check the depth of the target window before calling the qt_x11_drawImage() fu, that will only work with depths >= 24. Task-number: 255311 Reviewed-by: Samuel BT: yes --- src/gui/painting/qwindowsurface_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 110ba2f..0a6a04e 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -229,7 +229,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi { const QImage &src = d->image->image; br = br.intersected(src.rect()); - if (src.format() != QImage::Format_RGB32) { + if (src.format() != QImage::Format_RGB32 || widget->x11Info().depth() < 24) { QX11PixmapData *data = new QX11PixmapData(QPixmapData::PixmapType); data->xinfo = widget->x11Info(); data->fromImage(src, Qt::AutoColor); -- cgit v0.12 From 7f21512826689df38678c4cb954e9c347c01df8b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 5 Jun 2009 17:13:17 +0200 Subject: explicitly handle windows and mac9 line endings in practice, this matters only for backslashed line continuations Task-number: 255336 --- tools/linguist/shared/cpp.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/tools/linguist/shared/cpp.cpp b/tools/linguist/shared/cpp.cpp index 2e137cf..0aab661 100644 --- a/tools/linguist/shared/cpp.cpp +++ b/tools/linguist/shared/cpp.cpp @@ -134,13 +134,28 @@ static uint getChar() if (yyInPos >= yyInStr.size()) return EOF; uint c = yyInStr[yyInPos++].unicode(); - if (c == '\\' && yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') { - ++yyCurLineNo; - ++yyInPos; - continue; + if (c == '\\' && yyInPos < yyInStr.size()) { + if (yyInStr[yyInPos].unicode() == '\n') { + ++yyCurLineNo; + ++yyInPos; + continue; + } + if (yyInStr[yyInPos].unicode() == '\r') { + ++yyCurLineNo; + ++yyInPos; + if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') + ++yyInPos; + continue; + } } - if (c == '\n') + if (c == '\r') { + if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') + ++yyInPos; + c = '\n'; ++yyCurLineNo; + } else if (c == '\n') { + ++yyCurLineNo; + } return c; } } -- cgit v0.12 From dabeec5e1d3f43b54a58b2f8667ac552a7c24685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 17:46:48 +0200 Subject: My 4.5.2 changes. --- dist/changes-4.5.2 | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 1984881..810c022 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -131,6 +131,8 @@ Third party components * Fixed crash when drawing on a null pixmap. * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. + * [253663] Fixed an issue with implicitly closed poly lines when using + perspective transforms. - QProgressBar * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it. @@ -165,6 +167,8 @@ Third party components engine. * [251485] Fixed crash that could occur with projective transforms and high quality antialiasing. + * [253468] Fixed a crash in the GL 2 paint engine that could occur + when drawing text. - QCssParser * [252311] "font-family:" now handle fallback font specified with a comas @@ -186,6 +190,28 @@ Third party components - QPrintDialog * [253135] Crash in QPrintDialog when editing output filename + * [252873] Fixed an issue that could cause QPrintDialog to invalidate + a valid QPrinter object. + * [224728] Fixed an issue under X11 where QPrintDialog didn't update + the print-to-file state, if it was passed a QPrinter set up to + print PDF or PostScript. + +- QPrinter + * [252873] Fixed an issue with QPrinter::NativeFormat printers not + being valid. + * [248881] Fixed an issue under Windows where QPrinter::pageRect() returned + the wrong rect when QPrinter::fullPage() was set. + * [199271] Fixed an issue with QPrinter::setPrinterName()/printerName() + on Mac. + +- QSvg + * [253614] Fixed an issue with parsing the 'stroke-dasharray' SVG attribute. + +- QSvgIconEngine + * [251106] Fixed an issue that would cause QIcon::actualSize() to reparse + the SVG file for each acutalSize() call, until QIcon::pixmap() was called. + * [248848] Fixed an issue that would cause QIcon::pixmap() to reparse the + SVG file, even though there was a cached pixmap for that size available. **************************************************************************** * Database Drivers * @@ -202,17 +228,30 @@ Qt for Linux/X11 legacy freetype headers. [241361] Prevented asynchronous access to non-thread safe libfontconfig API. [244362] Worked around X server crash when calling XFillPolygon with more than -200000 points by falling back to raster paint engine. + 200000 points by falling back to raster paint engine. [250326] Titlebar wasn't shown on X11 with Qt::CustomizeWindowHint for fixed-size windows. [251925] Improved showing QMessageBox on small screens. [252042] Fixed the loading of the OpenSSL libraries on OpenBSD. +[255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers. +[252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and + fontconfig enabled. +[248720] Fixed and issue with using '-graphicssystem raster' on X servers with + BGR color layout. +[196152] Fixed a problem with QPixmap::toImage() on big endian systems that + would cause the R and B channels to be swapped for 32 bit pixmaps. Qt for Windows -------------- +Fixed and issue with text rendering in 16 bit mode. + +[246196] Fixed an issue with clipped glyphs when rendering text with + certain fonts. [251259] Switching to another app left text cursor in line edits with QtMfc framework. +[253367] Fixed a memory leak when loading system icons on Windows. + Qt for Mac OS X --------------- @@ -220,6 +259,9 @@ Qt for Mac OS X [252176] Fix regression in drawing parts of pixmaps on Panther. [253402] Fix a crash when a Cocoa window that used to be a QWidget would get events after the QWidget was destroyed. +[249178] Fixed an issue with drawing text to QImages on Mac/Cocoa. +[250066] Fixed an issue that caused reparenting of QGLWidgets to output warnings + on Mac/Cocoa. Qt for Embedded Linux -- cgit v0.12 From f2b307342a0effed58436dd199a0d80c5e651755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 17:48:37 +0200 Subject: Fixed typos. --- dist/changes-4.5.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 810c022..39082f6 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -236,7 +236,7 @@ legacy freetype headers. [255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers. [252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and fontconfig enabled. -[248720] Fixed and issue with using '-graphicssystem raster' on X servers with +[248720] Fixed an issue with using '-graphicssystem raster' on X servers with BGR color layout. [196152] Fixed a problem with QPixmap::toImage() on big endian systems that would cause the R and B channels to be swapped for 32 bit pixmaps. @@ -244,7 +244,7 @@ legacy freetype headers. Qt for Windows -------------- -Fixed and issue with text rendering in 16 bit mode. +Fixed an issue with text rendering in 16 bit mode. [246196] Fixed an issue with clipped glyphs when rendering text with certain fonts. -- cgit v0.12 From 8411fe233021f8609250b7cf47353e3128521406 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sat, 6 Jun 2009 23:17:29 +0200 Subject: Add a comment for the translator so the placeholders are described Reviewed-by: TrustMe --- tools/assistant/lib/qhelpdbreader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/assistant/lib/qhelpdbreader.cpp b/tools/assistant/lib/qhelpdbreader.cpp index 76994a7..27bc4d7 100644 --- a/tools/assistant/lib/qhelpdbreader.cpp +++ b/tools/assistant/lib/qhelpdbreader.cpp @@ -92,6 +92,9 @@ bool QHelpDBReader::init() QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId); db.setDatabaseName(m_dbName); if (!db.open()) { + /*: The placeholders are: %1 - The name of the database which cannot be opened + %2 - The unique id for the connection + %3 - The actual error string */ m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text()); QSqlDatabase::removeDatabase(m_uniqueId); return false; -- cgit v0.12 From 0fafad31feb518453c7c25b2e29a8b26d7018978 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 8 Jun 2009 07:53:58 +0200 Subject: Ensure that the manifest files are placed correctly If OBJECTS_DIR was empty then it would create a directory for the manifest files in the root directory. This is not desired as it should create a directory in the build directory instead. Reviewed-by: Marius Storm-Olsen --- mkspecs/features/win32/embed_manifest_dll.prf | 8 +++++--- mkspecs/features/win32/embed_manifest_exe.prf | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf index 90d9a2b..76a8ed1 100644 --- a/mkspecs/features/win32/embed_manifest_dll.prf +++ b/mkspecs/features/win32/embed_manifest_dll.prf @@ -1,11 +1,13 @@ +MANIFEST_DIR = $$OBJECTS_DIR +isEmpty(MANIFEST_DIR):MANIFEST_DIR = . !if(plugin:no_plugin_manifest):if(win32-msvc2005|win32-msvc2008):!static:!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "lib") { NOPATH_TARGET = $$TARGET NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) NOPATH_TARGET ~= s,\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths - QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") + QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK - QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf index e1747f1..d2800a1 100644 --- a/mkspecs/features/win32/embed_manifest_exe.prf +++ b/mkspecs/features/win32/embed_manifest_exe.prf @@ -1,11 +1,13 @@ +MANIFEST_DIR = $$OBJECTS_DIR +isEmpty(MANIFEST_DIR):MANIFEST_DIR = . if(win32-msvc2005|win32-msvc2008):!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "app") { NOPATH_TARGET = $$TARGET NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) NOPATH_TARGET ~= s,\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths - QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") + QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK - QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } -- cgit v0.12 From 3b2b9d727f0fadf607968c73003e7550c8bd0296 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 8 Jun 2009 08:03:17 +0200 Subject: Set the error to be HostUnreacheable if WSAEHOSTUNREACH is recieved This was a contribution sent via the public bugs channel. Task-number: 255161 Reviewed-by: Marius Storm-Olsen --- src/network/socket/qnativesocketengine_win.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index b08d7b0..8c6cd31 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -570,6 +570,11 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin socketState = QAbstractSocket::UnconnectedState; break; } + if (value == WSAEHOSTUNREACH) { + setError(QAbstractSocket::NetworkError, HostUnreachableErrorString); + socketState = QAbstractSocket::UnconnectedState; + break; + } } // fall through } -- cgit v0.12 From ec110c41175daae436d49b1e2369f80587ba5b65 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 8 Jun 2009 10:55:45 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 39082f6..6049a4d 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -304,6 +304,10 @@ Qt for Windows CE QDesignerFormWindowCursor::setProperty(). * [253539] Prevent crash in Designer with the Cocoa port when when using a scroll wheel to change a property. + * [252333] Fixed a regression crash in uic triggered when icon was set with different modes + than normal off. + * [252414, 252416, 252502] Fixed a crash in case of setting invalid point size + of font property in property editor - Linguist - Linguist GUI -- cgit v0.12 From 6a2202b544e3d7809312f74b0cf0b2b392bd78b7 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 8 Jun 2009 10:53:05 +0200 Subject: Doc typo fix in QSslSocket Reviewed-by: TrustMe --- src/network/ssl/qsslsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index ea64042..cf2512e 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -450,7 +450,7 @@ QSslSocket::SslMode QSslSocket::mode() const Returns true if the socket is encrypted; otherwise, false is returned. An encrypted socket encrypts all data that is written by calling write() - or putChar() before the data is written to the network, and descrypts all + or putChar() before the data is written to the network, and decrypts all incoming data as the data is received from the network, before you call read(), readLine() or getChar(). -- cgit v0.12 From 61d1dcea0efa6b0809639b781bb49baf252b3aad Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 8 Jun 2009 09:09:29 +0200 Subject: Mac: play music from CD does not work in Phonon ...because it was never implemented. This patch does that. Task-number: 255377 --- src/3rdparty/phonon/qt7/mediaobject.h | 18 ++- src/3rdparty/phonon/qt7/mediaobject.mm | 147 +++++++++++++-------- src/3rdparty/phonon/qt7/quicktimemetadata.h | 8 +- src/3rdparty/phonon/qt7/quicktimemetadata.mm | 41 ++++-- src/3rdparty/phonon/qt7/quicktimevideoplayer.h | 19 ++- src/3rdparty/phonon/qt7/quicktimevideoplayer.mm | 163 ++++++++++++++++++++++-- 6 files changed, 313 insertions(+), 83 deletions(-) diff --git a/src/3rdparty/phonon/qt7/mediaobject.h b/src/3rdparty/phonon/qt7/mediaobject.h index 27949ec..d59ee77 100644 --- a/src/3rdparty/phonon/qt7/mediaobject.h +++ b/src/3rdparty/phonon/qt7/mediaobject.h @@ -38,7 +38,10 @@ namespace QT7 class MediaObjectAudioNode; class MediaObject : public MediaNode, - public Phonon::MediaObjectInterface, public Phonon::AddonInterface + public Phonon::MediaObjectInterface +#ifndef QT_NO_PHONON_MEDIACONTROLLER + , public Phonon::AddonInterface +#endif { Q_OBJECT Q_INTERFACES(Phonon::MediaObjectInterface Phonon::AddonInterface) @@ -105,6 +108,16 @@ namespace QT7 void metaDataChanged(QMultiMap); void currentSourceChanged(const MediaSource &newSource); + // Add-on interface: + void availableSubtitlesChanged(); + void availableAudioChannelsChanged(); + void titleChanged(int); + void availableTitlesChanged(int); + void chapterChanged(int); + void availableChaptersChanged(int); + void angleChanged(int); + void availableAnglesChanged(int); + protected: void mediaNodeEvent(const MediaNodeEvent *event); bool event(QEvent *event); @@ -118,7 +131,6 @@ namespace QT7 QuickTimeVideoPlayer *m_nextVideoPlayer; QuickTimeAudioPlayer *m_nextAudioPlayer; MediaObjectAudioNode *m_mediaObjectAudioNode; - QuickTimeMetaData *m_metaData; qint32 m_tickInterval; qint32 m_transitionTime; @@ -133,6 +145,7 @@ namespace QT7 bool m_waitNextSwap; int m_swapTimeLeft; QTime m_swapTime; + bool m_autoplayTitles; void synchAudioVideo(); void updateCurrentTime(); @@ -154,6 +167,7 @@ namespace QT7 void inspectVideoGraphRecursive(MediaNode *node, int &effectCount, int &outputCount); void inspectGraph(); bool isCrossFading(); + void setCurrentTrack(int track); QString m_errorString; Phonon::ErrorType m_errorType; diff --git a/src/3rdparty/phonon/qt7/mediaobject.mm b/src/3rdparty/phonon/qt7/mediaobject.mm index 002c337..95859ef 100644 --- a/src/3rdparty/phonon/qt7/mediaobject.mm +++ b/src/3rdparty/phonon/qt7/mediaobject.mm @@ -46,7 +46,6 @@ MediaObject::MediaObject(QObject *parent) : MediaNode(AudioSource | VideoSource, m_mediaObjectAudioNode = new MediaObjectAudioNode(m_audioPlayer, m_nextAudioPlayer); setAudioNode(m_mediaObjectAudioNode); - m_metaData = new QuickTimeMetaData(); m_audioGraph = new AudioGraph(this); m_tickInterval = 0; @@ -55,6 +54,7 @@ MediaObject::MediaObject(QObject *parent) : MediaNode(AudioSource | VideoSource, m_transitionTime = 0; m_percentageLoaded = 0; m_waitNextSwap = false; + m_autoplayTitles = true; m_audioEffectCount = 0; m_audioOutputCount = 0; m_videoEffectCount = 0; @@ -70,13 +70,12 @@ MediaObject::MediaObject(QObject *parent) : MediaNode(AudioSource | VideoSource, } MediaObject::~MediaObject() -{ +{ // m_mediaObjectAudioNode is owned by super class. m_audioPlayer->unsetVideoPlayer(); m_nextAudioPlayer->unsetVideoPlayer(); delete m_videoPlayer; delete m_nextVideoPlayer; - delete m_metaData; checkForError(); } @@ -122,7 +121,7 @@ void MediaObject::inspectGraph() // Inspect the graph to check wether there are any // effects or outputs connected. This will have // influence on the audio system and video system that ends up beeing used: - int prevVideoOutputCount = m_videoOutputCount; + int prevVideoOutputCount = m_videoOutputCount; m_audioEffectCount = 0; m_audioOutputCount = 0; m_videoEffectCount = 0; @@ -134,7 +133,7 @@ void MediaObject::inspectGraph() if (m_videoOutputCount != prevVideoOutputCount){ MediaNodeEvent e1(MediaNodeEvent::VideoOutputCountChanged, &m_videoOutputCount); notify(&e1); - } + } } void MediaObject::setupAudioSystem() @@ -167,14 +166,14 @@ void MediaObject::setupAudioSystem() if (newAudioSystem == m_audioSystem) return; - + // Enable selected audio system: - m_audioSystem = newAudioSystem; + m_audioSystem = newAudioSystem; switch (newAudioSystem){ case AS_Silent: m_audioGraph->stop(); m_videoPlayer->enableAudio(false); - m_nextVideoPlayer->enableAudio(false); + m_nextVideoPlayer->enableAudio(false); m_audioPlayer->enableAudio(false); m_nextAudioPlayer->enableAudio(false); break; @@ -214,28 +213,28 @@ void MediaObject::setSource(const MediaSource &source) IMPLEMENTED; PhononAutoReleasePool pool; setState(Phonon::LoadingState); - + // Save current state for event/signal handling below: bool prevHasVideo = m_videoPlayer->hasVideo(); qint64 prevTotalTime = totalTime(); + int prevTrackCount = m_videoPlayer->trackCount(); m_waitNextSwap = false; - + // Cancel cross-fade if any: m_nextVideoPlayer->pause(); m_nextAudioPlayer->pause(); m_mediaObjectAudioNode->cancelCrossFade(); - + // Set new source: m_audioPlayer->unsetVideoPlayer(); m_videoPlayer->setMediaSource(source); m_audioPlayer->setVideoPlayer(m_videoPlayer); - m_metaData->setVideo(m_videoPlayer); - m_audioGraph->updateStreamSpecifications(); + m_audioGraph->updateStreamSpecifications(); m_nextAudioPlayer->unsetVideoPlayer(); - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_currentTime = 0; - + // Emit/notify information about the new source: QRect videoRect = m_videoPlayer->videoRect(); MediaNodeEvent e1(MediaNodeEvent::VideoFrameSizeChanged, &videoRect); @@ -246,12 +245,14 @@ void MediaObject::setSource(const MediaSource &source) updateVideo(emptyFrame); emit currentSourceChanged(source); - emit metaDataChanged(m_metaData->metaData()); + emit metaDataChanged(m_videoPlayer->metaData()); if (prevHasVideo != m_videoPlayer->hasVideo()) - emit hasVideoChanged(m_videoPlayer->hasVideo()); + emit hasVideoChanged(m_videoPlayer->hasVideo()); if (prevTotalTime != totalTime()) - emit totalTimeChanged(totalTime()); + emit totalTimeChanged(totalTime()); + if (prevTrackCount != m_videoPlayer->trackCount()) + emit availableTitlesChanged(m_videoPlayer->trackCount()); if (checkForError()) return; if (!m_videoPlayer->isDrmAuthorized()) @@ -260,7 +261,7 @@ void MediaObject::setSource(const MediaSource &source) return; if (!m_videoPlayer->canPlayMedia()) SET_ERROR("Cannot play media.", FATAL_ERROR) - + // The state might have changed from LoadingState // as a response to an error state change. So we // need to check it before stopping: @@ -287,28 +288,30 @@ void MediaObject::swapCurrentWithNext(qint32 transitionTime) // Save current state for event/signal handling below: bool prevHasVideo = m_videoPlayer->hasVideo(); qint64 prevTotalTime = totalTime(); + int prevTrackCount = m_videoPlayer->trackCount(); qSwap(m_audioPlayer, m_nextAudioPlayer); qSwap(m_videoPlayer, m_nextVideoPlayer); m_mediaObjectAudioNode->startCrossFade(transitionTime); m_audioGraph->updateStreamSpecifications(); - m_metaData->setVideo(m_videoPlayer); m_waitNextSwap = false; m_currentTime = 0; - + // Emit/notify information about the new source: QRect videoRect = m_videoPlayer->videoRect(); MediaNodeEvent e1(MediaNodeEvent::VideoFrameSizeChanged, &videoRect); notify(&e1); emit currentSourceChanged(m_videoPlayer->mediaSource()); - emit metaDataChanged(m_metaData->metaData()); + emit metaDataChanged(m_videoPlayer->metaData()); if (prevHasVideo != m_videoPlayer->hasVideo()) - emit hasVideoChanged(m_videoPlayer->hasVideo()); + emit hasVideoChanged(m_videoPlayer->hasVideo()); if (prevTotalTime != totalTime()) emit totalTimeChanged(totalTime()); + if (prevTrackCount != m_videoPlayer->trackCount()) + emit availableTitlesChanged(m_videoPlayer->trackCount()); if (checkForError()) return; if (!m_videoPlayer->isDrmAuthorized()) @@ -332,15 +335,15 @@ void MediaObject::updateTimer(int &timer, int interval) if (timer) killTimer(timer); timer = 0; - if (interval >= 0) - timer = startTimer(interval); + if (interval >= 0) + timer = startTimer(interval); } void MediaObject::play_internal() { // Play main audio/video: m_videoPlayer->play(); - m_audioPlayer->play(); + m_audioPlayer->play(); updateLipSynch(0); // Play old audio/video to finish cross-fade: if (m_nextVideoPlayer->currentTime() > 0){ @@ -382,7 +385,7 @@ void MediaObject::play() if (!m_videoPlayer->canPlayMedia()) return; if (!setState(Phonon::PlayingState)) - return; + return; if (m_audioSystem == AS_Graph){ m_audioGraph->start(); m_mediaObjectAudioNode->setMute(true); @@ -423,7 +426,7 @@ void MediaObject::stop() if (!setState(Phonon::StoppedState)) return; m_waitNextSwap = false; - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_nextAudioPlayer->unsetVideoPlayer(); pause_internal(); seek(0); @@ -435,9 +438,9 @@ void MediaObject::seek(qint64 milliseconds) IMPLEMENTED; if (m_state == Phonon::ErrorState) return; - + // Stop cross-fade if any: - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_nextAudioPlayer->unsetVideoPlayer(); m_mediaObjectAudioNode->cancelCrossFade(); @@ -446,7 +449,7 @@ void MediaObject::seek(qint64 milliseconds) m_videoPlayer->seek(milliseconds); m_audioPlayer->seek(m_videoPlayer->currentTime()); m_mediaObjectAudioNode->setMute(false); - + // Update time and cancel pending swap: if (m_currentTime < m_videoPlayer->duration()) m_waitNextSwap = false; @@ -557,7 +560,7 @@ bool MediaObject::isSeekable() const qint64 MediaObject::currentTime() const { IMPLEMENTED_SILENT; - const_cast(this)->updateCurrentTime(); + const_cast(this)->updateCurrentTime(); return m_currentTime; } @@ -567,19 +570,24 @@ void MediaObject::updateCurrentTime() m_currentTime = (m_audioSystem == AS_Graph) ? m_audioPlayer->currentTime() : m_videoPlayer->currentTime(); quint64 total = m_videoPlayer->duration(); - // Check if it's time to emit aboutToFinish: - quint32 mark = qMax(quint64(0), qMin(total, total + m_transitionTime - 2000)); - if (lastUpdateTime < mark && mark <= m_currentTime) - emit aboutToFinish(); - - // Check if it's time to emit prefinishMarkReached: - mark = qMax(quint64(0), total - m_prefinishMark); - if (lastUpdateTime < mark && mark <= m_currentTime) - emit prefinishMarkReached(total - m_currentTime); + if (m_videoPlayer->currentTrack() < m_videoPlayer->trackCount() - 1){ + // There are still more tracks to play after the current track. + if (m_autoplayTitles) { + if (lastUpdateTime < m_currentTime && m_currentTime == total) + setCurrentTrack(m_videoPlayer->currentTrack() + 1); + } + } else if (m_nextVideoPlayer->state() == QuickTimeVideoPlayer::NoMedia){ + // There is no more sources or tracks to play after the current source. + // Check if it's time to emit aboutToFinish: + quint32 mark = qMax(quint64(0), qMin(total, total + m_transitionTime - 2000)); + if (lastUpdateTime < mark && mark <= m_currentTime) + emit aboutToFinish(); + + // Check if it's time to emit prefinishMarkReached: + mark = qMax(quint64(0), total - m_prefinishMark); + if (lastUpdateTime < mark && mark <= m_currentTime) + emit prefinishMarkReached(total - m_currentTime); - if (m_nextVideoPlayer->state() == QuickTimeVideoPlayer::NoMedia){ - // There is no next source in que. - // Check if it's time to emit finished: if (lastUpdateTime < m_currentTime && m_currentTime == total){ emit finished(); m_currentTime = (m_audioSystem == AS_Graph) ? m_audioPlayer->currentTime() : m_videoPlayer->currentTime(); @@ -589,7 +597,7 @@ void MediaObject::updateCurrentTime() } else { // We have a next source. // Check if it's time to swap to next source: - mark = qMax(quint64(0), total + m_transitionTime); + quint32 mark = qMax(quint64(0), total + m_transitionTime); if (m_waitNextSwap && m_state == Phonon::PlayingState && m_transitionTime < m_swapTime.msecsTo(QTime::currentTime())){ swapCurrentWithNext(0); @@ -692,14 +700,14 @@ bool MediaObject::setAudioDeviceOnMovie(int id) void MediaObject::updateCrossFade() { - m_mediaObjectAudioNode->updateCrossFade(m_currentTime); + m_mediaObjectAudioNode->updateCrossFade(m_currentTime); // Clean-up previous movie if done fading: if (m_mediaObjectAudioNode->m_fadeDuration == 0){ if (m_nextVideoPlayer->isPlaying() || m_nextAudioPlayer->isPlaying()){ - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_nextAudioPlayer->unsetVideoPlayer(); } - } + } } void MediaObject::updateBufferStatus() @@ -728,7 +736,7 @@ void MediaObject::updateVideoFrames() // Draw next frame if awailable: if (m_videoPlayer->videoFrameChanged()){ updateLipSynch(50); - VideoFrame frame(m_videoPlayer); + VideoFrame frame(m_videoPlayer); if (m_nextVideoPlayer->isPlaying() && m_nextVideoPlayer->hasVideo() && isCrossFading()){ @@ -736,9 +744,9 @@ void MediaObject::updateVideoFrames() frame.setBackgroundFrame(bgFrame); frame.setBaseOpacity(m_mediaObjectAudioNode->m_volume1); } - + // Send the frame through the graph: - updateVideo(frame); + updateVideo(frame); checkForError(); } } @@ -749,7 +757,7 @@ void MediaObject::updateLipSynch(int allowedOffset) return; if (m_videoSinkList.isEmpty() || m_audioSinkList.isEmpty()) return; - + if (m_videoPlayer->hasVideo()){ qint64 diff = m_audioPlayer->currentTime() - m_videoPlayer->currentTime(); if (-allowedOffset > diff || diff > allowedOffset) @@ -834,13 +842,42 @@ bool MediaObject::event(QEvent *event) return QObject::event(event); } -bool MediaObject::hasInterface(Interface /*interface*/) const +void MediaObject::setCurrentTrack(int track) +{ + if (track == m_videoPlayer->currentTrack() || track < 0 || track >= m_videoPlayer->trackCount()) + return; + + m_videoPlayer->setCurrentTrack(track); + emit titleChanged(track); + emit metaDataChanged(m_videoPlayer->metaData()); +} + +bool MediaObject::hasInterface(Interface iface) const { - return false; + return iface == AddonInterface::TitleInterface; } -QVariant MediaObject::interfaceCall(Interface /*interface*/, int /*command*/, const QList &/*arguments*/) +QVariant MediaObject::interfaceCall(Interface iface, int command, const QList ¶ms) { + switch (iface) { + case TitleInterface: + switch (command) { + case availableTitles: + return m_videoPlayer->trackCount(); + case title: + return m_videoPlayer->currentTrack(); + case setTitle: + setCurrentTrack(params.first().toInt()); + break; + case autoplayTitles: + return m_autoplayTitles; + case setAutoplayTitles: + m_autoplayTitles = params.first().toBool(); + break; + } + default: + break; + } return QVariant(); } diff --git a/src/3rdparty/phonon/qt7/quicktimemetadata.h b/src/3rdparty/phonon/qt7/quicktimemetadata.h index d524183..c589535 100644 --- a/src/3rdparty/phonon/qt7/quicktimemetadata.h +++ b/src/3rdparty/phonon/qt7/quicktimemetadata.h @@ -38,10 +38,8 @@ namespace QT7 class QuickTimeMetaData { public: - QuickTimeMetaData(); - virtual ~QuickTimeMetaData(); - - void setVideo(QuickTimeVideoPlayer *videoPlayer); + QuickTimeMetaData(QuickTimeVideoPlayer *videoPlayer); + void update(); QMultiMap metaData(); private: @@ -49,6 +47,8 @@ namespace QT7 bool m_movieChanged; QuickTimeVideoPlayer *m_videoPlayer; void readMetaData(); + void guessMetaDataForCD(); + void readMetaDataFromMovie(); #ifdef QUICKTIME_C_API_AVAILABLE QString stripCopyRightSymbol(const QString &key); diff --git a/src/3rdparty/phonon/qt7/quicktimemetadata.mm b/src/3rdparty/phonon/qt7/quicktimemetadata.mm index 851e707..2dcc152 100644 --- a/src/3rdparty/phonon/qt7/quicktimemetadata.mm +++ b/src/3rdparty/phonon/qt7/quicktimemetadata.mm @@ -15,6 +15,7 @@ along with this library. If not, see . */ +#include #include "quicktimemetadata.h" #include "quicktimevideoplayer.h" @@ -25,19 +26,14 @@ namespace Phonon namespace QT7 { -QuickTimeMetaData::QuickTimeMetaData() +QuickTimeMetaData::QuickTimeMetaData(QuickTimeVideoPlayer *videoPlayer) { - m_videoPlayer = 0; + m_videoPlayer = videoPlayer; m_movieChanged = false; } -QuickTimeMetaData::~QuickTimeMetaData() +void QuickTimeMetaData::update() { -} - -void QuickTimeMetaData::setVideo(QuickTimeVideoPlayer *videoPlayer) -{ - m_videoPlayer = videoPlayer; m_movieChanged = true; m_metaData.clear(); } @@ -145,14 +141,22 @@ void QuickTimeMetaData::readFormattedData(QTMetaDataRef metaDataRef, OSType form #endif // QUICKTIME_C_API_AVAILABLE -void QuickTimeMetaData::readMetaData() +void QuickTimeMetaData::guessMetaDataForCD() +{ + QString album = QFileInfo(m_videoPlayer->movieCompactDiscPath()).fileName(); + QString title = QFileInfo(m_videoPlayer->currentTrackPath()).fileName(); + title = title.left(title.lastIndexOf('.')); + m_metaData.insert(QLatin1String("ALBUM"), album); + m_metaData.insert(QLatin1String("TITLE"), title); + m_metaData.insert(QLatin1String("TRACKNUMBER"), QString::number(m_videoPlayer->currentTrack())); +} + +void QuickTimeMetaData::readMetaDataFromMovie() { - if (!m_videoPlayer) - return; QMultiMap metaMap; - + #ifdef QUICKTIME_C_API_AVAILABLE - QTMetaDataRef metaDataRef; + QTMetaDataRef metaDataRef; OSStatus err = QTCopyMovieMetaData([m_videoPlayer->qtMovie() quickTimeMovie], &metaDataRef); BACKEND_ASSERT2(err == noErr, "Could not read QuickTime meta data", NORMAL_ERROR) @@ -173,6 +177,17 @@ void QuickTimeMetaData::readMetaData() m_metaData.insert(QLatin1String("DESCRIPTION"), metaMap.value(QLatin1String("des"))); } +void QuickTimeMetaData::readMetaData() +{ + if (!m_videoPlayer) + return; + + if (m_videoPlayer->mediaSource().type() == Phonon::MediaSource::Disc) + guessMetaDataForCD(); + else + readMetaDataFromMovie(); +} + QMultiMap QuickTimeMetaData::metaData() { if (m_videoPlayer && m_videoPlayer->hasMovie() && m_movieChanged) diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.h b/src/3rdparty/phonon/qt7/quicktimevideoplayer.h index b80570a..8495e18 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.h +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.h @@ -39,6 +39,7 @@ namespace Phonon namespace QT7 { class QuickTimeStreamReader; + class QuickTimeMetaData; class VideoRenderWidgetQTMovieView; class QuickTimeVideoPlayer : QObject @@ -56,7 +57,7 @@ namespace QT7 void setMediaSource(const MediaSource &source); MediaSource mediaSource() const; - void unsetVideo(); + void unsetCurrentMediaSource(); void play(); void pause(); @@ -84,6 +85,7 @@ namespace QT7 bool setAudioDevice(int id); void setPlaybackRate(float rate); QTMovie *qtMovie() const; + QMultiMap metaData(); float playbackRate() const; float prefferedPlaybackRate() const; @@ -103,6 +105,12 @@ namespace QT7 float percentageLoaded(); quint64 timeLoaded(); + int trackCount() const; + int currentTrack() const; + void setCurrentTrack(int track); + QString movieCompactDiscPath() const; + QString currentTrackPath() const; + static QString timeToString(quint64 ms); // Help functions when drawing to more that one widget in cocoa 64: @@ -116,6 +124,7 @@ namespace QT7 QTMovie *m_QTMovie; State m_state; QGLPixelBuffer *m_QImagePixelBuffer; + QuickTimeMetaData *m_metaData; bool m_playbackRateSat; bool m_isDrmProtected; @@ -133,6 +142,9 @@ namespace QT7 qreal m_contrast; qreal m_hue; qreal m_saturation; + NSArray *m_folderTracks; + int m_currentTrack; + QString m_movieCompactDiscPath; #ifdef QUICKTIME_C_API_AVAILABLE QTVisualContextRef m_visualContext; @@ -140,16 +152,21 @@ namespace QT7 VideoFrame m_currentFrame; QuickTimeStreamReader *m_streamReader; + void prepareCurrentMovieForPlayback(); void createVisualContext(); void openMovieFromCurrentMediaSource(); void openMovieFromDataRef(QTDataReference *dataRef); void openMovieFromFile(); void openMovieFromUrl(); void openMovieFromStream(); + void openMovieFromCompactDisc(); void openMovieFromData(QByteArray *data, char *fileType); void openMovieFromDataGuessType(QByteArray *data); QString mediaSourcePath(); bool codecExistsAccordingToSuffix(const QString &fileName); + NSString* pathToCompactDisc(); + bool isCompactDisc(NSString *path); + NSArray* scanFolder(NSString *path); void setError(NSError *error); bool errorOccured(); diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm index 3f76132..93867e2 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm @@ -20,6 +20,7 @@ #include "videowidget.h" #include "audiodevice.h" #include "quicktimestreamreader.h" +#include "quicktimemetadata.h" #include #include @@ -52,6 +53,7 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0) { m_state = NoMedia; m_mediaSource = MediaSource(); + m_metaData = new QuickTimeMetaData(this); m_QTMovie = 0; m_streamReader = 0; m_playbackRate = 1.0f; @@ -67,6 +69,8 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0) m_primaryRenderingTarget = 0; m_primaryRenderingCIImage = 0; m_QImagePixelBuffer = 0; + m_folderTracks = 0; + m_currentTrack = 0; #ifdef QUICKTIME_C_API_AVAILABLE OSStatus err = EnterMovies(); @@ -77,7 +81,8 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0) QuickTimeVideoPlayer::~QuickTimeVideoPlayer() { - unsetVideo(); + unsetCurrentMediaSource(); + delete m_metaData; [(NSObject*)m_primaryRenderingTarget release]; m_primaryRenderingTarget = 0; #ifdef QUICKTIME_C_API_AVAILABLE @@ -397,7 +402,7 @@ QRect QuickTimeVideoPlayer::videoRect() const return QRect(0, 0, size.width, size.height); } -void QuickTimeVideoPlayer::unsetVideo() +void QuickTimeVideoPlayer::unsetCurrentMediaSource() { if (!m_QTMovie) return; @@ -411,10 +416,13 @@ void QuickTimeVideoPlayer::unsetVideo() m_isDrmProtected = false; m_isDrmAuthorized = true; m_mediaSource = MediaSource(); + m_movieCompactDiscPath.clear(); [(CIImage *)m_primaryRenderingCIImage release]; m_primaryRenderingCIImage = 0; delete m_QImagePixelBuffer; m_QImagePixelBuffer = 0; + [m_folderTracks release]; + m_folderTracks = 0; } QuickTimeVideoPlayer::State QuickTimeVideoPlayer::state() const @@ -524,18 +532,25 @@ bool QuickTimeVideoPlayer::codecExistsAccordingToSuffix(const QString &fileName) void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource) { PhononAutoReleasePool pool; - unsetVideo(); + unsetCurrentMediaSource(); + m_mediaSource = mediaSource; if (mediaSource.type() == MediaSource::Empty || mediaSource.type() == MediaSource::Invalid){ m_state = NoMedia; return; } + openMovieFromCurrentMediaSource(); if (errorOccured()){ - unsetVideo(); + unsetCurrentMediaSource(); return; } + prepareCurrentMovieForPlayback(); +} + +void QuickTimeVideoPlayer::prepareCurrentMovieForPlayback() +{ #ifdef QUICKTIME_C_API_AVAILABLE if (m_visualContext) SetMovieVisualContext([m_QTMovie quickTimeMovie], m_visualContext); @@ -543,14 +558,14 @@ void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource) waitStatePlayable(); if (errorOccured()){ - unsetVideo(); + unsetCurrentMediaSource(); return; } readProtection(); preRollMovie(); if (errorOccured()){ - unsetVideo(); + unsetCurrentMediaSource(); return; } @@ -560,6 +575,7 @@ void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource) enableAudio(m_audioEnabled); setMute(m_mute); setVolume(m_masterVolume, m_relativeVolume); + m_metaData->update(); pause(); } @@ -573,7 +589,7 @@ void QuickTimeVideoPlayer::openMovieFromCurrentMediaSource() openMovieFromUrl(); break; case MediaSource::Disc: - CASE_UNSUPPORTED("Could not open media source.", FATAL_ERROR) + openMovieFromCompactDisc(); break; case MediaSource::Stream: openMovieFromStream(); @@ -635,7 +651,7 @@ void QuickTimeVideoPlayer::openMovieFromDataGuessType(QByteArray *data) // than using e.g [QTMovie movieFileTypes:QTIncludeCommonTypes]. Some // codecs *think* they can decode the stream, and crash... #define TryOpenMovieWithCodec(type) gClearError(); \ - openMovieFromData(data, "."type); \ + openMovieFromData(data, (char *)"."type); \ if (m_QTMovie) return; TryOpenMovieWithCodec("avi"); @@ -675,6 +691,50 @@ void QuickTimeVideoPlayer::openMovieFromStream() openMovieFromDataGuessType(m_streamReader->pointerToData()); } +typedef void (*qt_sighandler_t)(int); +static void sigtest(int) { + qApp->exit(0); +} + +void QuickTimeVideoPlayer::openMovieFromCompactDisc() +{ + // Interrupting the application while the device is open + // causes the application to hang. So we need to handle + // this in a more graceful way: + qt_sighandler_t hndl = signal(SIGINT, sigtest); + if (hndl) + signal(SIGINT, hndl); + + PhononAutoReleasePool pool; + NSString *cd = 0; + QString devName = m_mediaSource.deviceName(); + if (devName.isEmpty()) { + cd = pathToCompactDisc(); + if (!cd) { + SET_ERROR("Could not open media source.", NORMAL_ERROR) + return; + } + m_movieCompactDiscPath = PhononCFString::toQString(reinterpret_cast(cd)); + } else { + if (!QFileInfo(devName).isAbsolute()) + devName = QLatin1String("/Volumes/") + devName; + cd = [reinterpret_cast(PhononCFString::toCFStringRef(devName)) autorelease]; + if (!isCompactDisc(cd)) { + SET_ERROR("Could not open media source.", NORMAL_ERROR) + return; + } + m_movieCompactDiscPath = devName; + } + + m_folderTracks = [scanFolder(cd) retain]; + setCurrentTrack(0); +} + +QString QuickTimeVideoPlayer::movieCompactDiscPath() const +{ + return m_movieCompactDiscPath; +} + MediaSource QuickTimeVideoPlayer::mediaSource() const { return m_mediaSource; @@ -950,6 +1010,93 @@ void QuickTimeVideoPlayer::readProtection() } } +QMultiMap QuickTimeVideoPlayer::metaData() +{ + return m_metaData->metaData(); +} + +int QuickTimeVideoPlayer::trackCount() const +{ + if (!m_folderTracks) + return 0; + return [m_folderTracks count]; +} + +int QuickTimeVideoPlayer::currentTrack() const +{ + return m_currentTrack; +} + +QString QuickTimeVideoPlayer::currentTrackPath() const +{ + if (!m_folderTracks) + return QString(); + + PhononAutoReleasePool pool; + NSString *trackPath = [m_folderTracks objectAtIndex:m_currentTrack]; + return PhononCFString::toQString(reinterpret_cast(trackPath)); +} + +NSString* QuickTimeVideoPlayer::pathToCompactDisc() +{ + PhononAutoReleasePool pool; + NSArray *devices = [[NSWorkspace sharedWorkspace] mountedRemovableMedia]; + for (NSString *dev in devices) { + if (isCompactDisc(dev)) + return [dev retain]; + } + return 0; +} + +bool QuickTimeVideoPlayer::isCompactDisc(NSString *path) +{ + PhononAutoReleasePool pool; + NSString *type = [NSString string]; + [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:path + isRemovable:0 + isWritable:0 + isUnmountable:0 + description:0 + type:&type]; + return [type hasPrefix:@"cdd"]; +} + +NSArray* QuickTimeVideoPlayer::scanFolder(NSString *path) +{ + NSMutableArray *tracks = [NSMutableArray arrayWithCapacity:20]; + if (!path) + return tracks; + + NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path]; + while (NSString *track = [enumerator nextObject]) { + if (![track hasPrefix:@"."]) + [tracks addObject:[path stringByAppendingPathComponent:track]]; + } + return tracks; +} + +void QuickTimeVideoPlayer::setCurrentTrack(int track) +{ + PhononAutoReleasePool pool; + [m_QTMovie release]; + m_QTMovie = 0; + m_currentTime = 0; + m_currentTrack = track; + + if (!m_folderTracks) + return; + if (track < 0 || track >= (int)[m_folderTracks count]) + return; + + NSString *trackPath = [m_folderTracks objectAtIndex:track]; + QTDataReference *dataRef = [QTDataReference dataReferenceWithReferenceToFile:trackPath]; + State currentState = m_state; + openMovieFromDataRef(dataRef); + prepareCurrentMovieForPlayback(); + if (currentState == Playing) + play(); +} + }} QT_END_NAMESPACE -- cgit v0.12