summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-08 12:12:17 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-08 12:12:17 (GMT)
commit21fef75cd50b00609a803f123cc27ad0ee9ba509 (patch)
treeca96462e89b9c4828c7792e62def95e77d69d277
parent11303c676166cda3aae33e7e97939e9d2942271f (diff)
parent61d1dcea0efa6b0809639b781bb49baf252b3aad (diff)
downloadQt-21fef75cd50b00609a803f123cc27ad0ee9ba509.zip
Qt-21fef75cd50b00609a803f123cc27ad0ee9ba509.tar.gz
Qt-21fef75cd50b00609a803f123cc27ad0ee9ba509.tar.bz2
Merge commit 'origin/4.5'
Conflicts: src/3rdparty/phonon/qt7/mediaobject.mm src/3rdparty/phonon/qt7/quicktimevideoplayer.mm src/gui/text/qfontengine_win.cpp tools/linguist/shared/cpp.cpp
-rw-r--r--dist/changes-4.5.281
-rw-r--r--doc/src/tutorials/addressbook.qdoc11
-rw-r--r--mkspecs/features/win32/embed_manifest_dll.prf8
-rw-r--r--mkspecs/features/win32/embed_manifest_exe.prf8
-rw-r--r--qmake/Makefile.win322
-rw-r--r--src/3rdparty/phonon/qt7/mediaobject.h18
-rw-r--r--src/3rdparty/phonon/qt7/mediaobject.mm109
-rw-r--r--src/3rdparty/phonon/qt7/quicktimemetadata.h8
-rw-r--r--src/3rdparty/phonon/qt7/quicktimemetadata.mm41
-rw-r--r--src/3rdparty/phonon/qt7/quicktimevideoplayer.h19
-rw-r--r--src/3rdparty/phonon/qt7/quicktimevideoplayer.mm163
-rw-r--r--src/gui/kernel/qwidget_mac.mm13
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp2
-rw-r--r--src/gui/text/qfontengine_win.cpp24
-rw-r--r--src/gui/text/qfontengine_win_p.h3
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp5
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp7
-rw-r--r--tests/auto/_networkselftest/tst_networkselftest.cpp6
-rw-r--r--tools/assistant/lib/qhelpdbreader.cpp3
-rw-r--r--tools/linguist/lupdate/cpp.cpp25
21 files changed, 446 insertions, 112 deletions
diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2
index 04a29ba..6049a4d 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
@@ -67,6 +71,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.
@@ -77,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
@@ -96,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
@@ -109,6 +131,11 @@ 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.
- QSelectionModel
* [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled.
@@ -124,6 +151,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.
@@ -136,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
@@ -157,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 *
@@ -173,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 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.
Qt for Windows
--------------
+Fixed an 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
---------------
@@ -191,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
@@ -199,7 +270,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
****************************************************************************
@@ -231,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
diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc
index e2f12f4..465eb91 100644
--- a/doc/src/tutorials/addressbook.qdoc
+++ b/doc/src/tutorials/addressbook.qdoc
@@ -457,7 +457,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
@@ -513,7 +513,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
@@ -532,7 +532,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
@@ -542,7 +542,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.
@@ -576,8 +576,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
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\"
}
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
diff --git a/src/3rdparty/phonon/qt7/mediaobject.h b/src/3rdparty/phonon/qt7/mediaobject.h
index ae623a9..c93eddc 100644
--- a/src/3rdparty/phonon/qt7/mediaobject.h
+++ b/src/3rdparty/phonon/qt7/mediaobject.h
@@ -42,7 +42,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)
@@ -113,6 +116,16 @@ namespace QT7
void metaDataChanged(QMultiMap<QString,QString>);
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);
@@ -126,7 +139,6 @@ namespace QT7
QuickTimeVideoPlayer *m_nextVideoPlayer;
QuickTimeAudioPlayer *m_nextAudioPlayer;
MediaObjectAudioNode *m_mediaObjectAudioNode;
- QuickTimeMetaData *m_metaData;
#if QT_ALLOW_QUICKTIME
CVDisplayLinkRef m_displayLink;
@@ -150,6 +162,7 @@ namespace QT7
bool m_waitNextSwap;
int m_swapTimeLeft;
QTime m_swapTime;
+ bool m_autoplayTitles;
void synchAudioVideo();
void updateCurrentTime();
@@ -170,6 +183,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 6886a3c..677640c 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;
@@ -85,7 +85,6 @@ MediaObject::~MediaObject()
m_nextAudioPlayer->unsetVideoPlayer();
delete m_videoPlayer;
delete m_nextVideoPlayer;
- delete m_metaData;
checkForError();
}
@@ -131,7 +130,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;
@@ -143,7 +142,7 @@ void MediaObject::inspectGraph()
if (m_videoOutputCount != prevVideoOutputCount){
MediaNodeEvent e1(MediaNodeEvent::VideoOutputCountChanged, &m_videoOutputCount);
notify(&e1);
- }
+ }
}
void MediaObject::setupAudioSystem()
@@ -176,14 +175,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;
@@ -227,6 +226,7 @@ void MediaObject::setSource(const MediaSource &source)
// 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:
@@ -238,11 +238,10 @@ void MediaObject::setSource(const MediaSource &source)
m_audioPlayer->unsetVideoPlayer();
m_videoPlayer->setMediaSource(source);
m_audioPlayer->setVideoPlayer(m_videoPlayer);
- m_metaData->setVideo(m_videoPlayer);
m_audioGraph->updateStreamSpecifications();
m_nextAudioPlayer->unsetVideoPlayer();
- m_nextVideoPlayer->unsetVideo();
+ m_nextVideoPlayer->unsetCurrentMediaSource();
m_currentTime = 0;
// Emit/notify information about the new source:
@@ -255,12 +254,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())
@@ -269,7 +270,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:
@@ -296,12 +297,12 @@ 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;
@@ -312,12 +313,14 @@ void MediaObject::swapCurrentWithNext(qint32 transitionTime)
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());
if (prevTotalTime != totalTime())
emit totalTimeChanged(totalTime());
+ if (prevTrackCount != m_videoPlayer->trackCount())
+ emit availableTitlesChanged(m_videoPlayer->trackCount());
if (checkForError())
return;
if (!m_videoPlayer->isDrmAuthorized())
@@ -517,7 +520,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);
@@ -531,7 +534,7 @@ void MediaObject::seek(qint64 milliseconds)
return;
// Stop cross-fade if any:
- m_nextVideoPlayer->unsetVideo();
+ m_nextVideoPlayer->unsetCurrentMediaSource();
m_nextAudioPlayer->unsetVideoPlayer();
m_mediaObjectAudioNode->cancelCrossFade();
@@ -651,7 +654,7 @@ bool MediaObject::isSeekable() const
qint64 MediaObject::currentTime() const
{
IMPLEMENTED_SILENT;
- const_cast<MediaObject *>(this)->updateCurrentTime();
+ const_cast<MediaObject *>(this)->updateCurrentTime();
return m_currentTime;
}
@@ -661,19 +664,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();
@@ -683,7 +691,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);
@@ -786,11 +794,11 @@ 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();
}
}
@@ -927,13 +935,42 @@ bool MediaObject::event(QEvent *event)
return QObject::event(event);
}
-bool MediaObject::hasInterface(Interface /*interface*/) const
+void MediaObject::setCurrentTrack(int track)
{
- return false;
+ 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 iface == AddonInterface::TitleInterface;
}
-QVariant MediaObject::interfaceCall(Interface /*interface*/, int /*command*/, const QList<QVariant> &/*arguments*/)
+QVariant MediaObject::interfaceCall(Interface iface, int command, const QList<QVariant> &params)
{
+ 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<QString, QString> 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 <http://www.gnu.org/licenses/>.
*/
+#include <QtCore/QFileInfo>
#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<QString, QString> 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<QString, QString> 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 bf4f216..98eacb5 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();
@@ -86,6 +87,7 @@ namespace QT7
bool setAudioDevice(int id);
void setPlaybackRate(float rate);
QTMovie *qtMovie() const;
+ QMultiMap<QString, QString> metaData();
float playbackRate() const;
float prefferedPlaybackRate() const;
@@ -105,6 +107,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:
@@ -118,6 +126,7 @@ namespace QT7
QTMovie *m_QTMovie;
State m_state;
QGLPixelBuffer *m_QImagePixelBuffer;
+ QuickTimeMetaData *m_metaData;
CVOpenGLTextureRef m_cachedCVTextureRef;
QImage m_cachedQImage;
@@ -140,6 +149,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;
@@ -147,16 +159,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 de7c6ed..9a3c811 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 <QtCore/QCoreApplication>
#include <QtCore/QEventLoop>
@@ -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;
@@ -69,6 +71,8 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0)
m_primaryRenderingCIImage = 0;
m_QImagePixelBuffer = 0;
m_cachedCVTextureRef = 0;
+ m_folderTracks = 0;
+ m_currentTrack = 0;
#ifdef QUICKTIME_C_API_AVAILABLE
OSStatus err = EnterMovies();
@@ -80,7 +84,8 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0)
QuickTimeVideoPlayer::~QuickTimeVideoPlayer()
{
PhononAutoReleasePool pool;
- unsetVideo();
+ unsetCurrentMediaSource();
+ delete m_metaData;
[(NSObject*)m_primaryRenderingTarget release];
m_primaryRenderingTarget = 0;
#ifdef QUICKTIME_C_API_AVAILABLE
@@ -420,7 +425,7 @@ QRect QuickTimeVideoPlayer::videoRect() const
return QRect(0, 0, size.width, size.height);
}
-void QuickTimeVideoPlayer::unsetVideo()
+void QuickTimeVideoPlayer::unsetCurrentMediaSource()
{
if (!m_QTMovie)
return;
@@ -436,11 +441,14 @@ void QuickTimeVideoPlayer::unsetVideo()
m_hasVideo = false;
m_staticFps = 0;
m_mediaSource = MediaSource();
+ m_movieCompactDiscPath.clear();
[(CIImage *)m_primaryRenderingCIImage release];
m_primaryRenderingCIImage = 0;
delete m_QImagePixelBuffer;
m_QImagePixelBuffer = 0;
releaseImageCache();
+ [m_folderTracks release];
+ m_folderTracks = 0;
}
QuickTimeVideoPlayer::State QuickTimeVideoPlayer::state() const
@@ -550,18 +558,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);
@@ -569,14 +584,14 @@ void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource)
waitStatePlayable();
if (errorOccured()){
- unsetVideo();
+ unsetCurrentMediaSource();
return;
}
readProtection();
preRollMovie();
if (errorOccured()){
- unsetVideo();
+ unsetCurrentMediaSource();
return;
}
@@ -587,6 +602,7 @@ void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource)
enableAudio(m_audioEnabled);
setMute(m_mute);
setVolume(m_masterVolume, m_relativeVolume);
+ m_metaData->update();
pause();
}
@@ -600,7 +616,7 @@ void QuickTimeVideoPlayer::openMovieFromCurrentMediaSource()
openMovieFromUrl();
break;
case MediaSource::Disc:
- CASE_UNSUPPORTED("Could not open media source.", FATAL_ERROR)
+ openMovieFromCompactDisc();
break;
case MediaSource::Stream:
openMovieFromStream();
@@ -662,7 +678,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");
@@ -702,6 +718,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<CFStringRef>(cd));
+ } else {
+ if (!QFileInfo(devName).isAbsolute())
+ devName = QLatin1String("/Volumes/") + devName;
+ cd = [reinterpret_cast<const NSString *>(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;
@@ -1015,6 +1075,93 @@ void QuickTimeVideoPlayer::readProtection()
}
}
+QMultiMap<QString, QString> 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<CFStringRef>(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
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index f389bfd..f5a8c5f 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1304,11 +1304,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);
@@ -3593,11 +3590,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()) {
@@ -3635,6 +3636,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;
@@ -3654,6 +3656,7 @@ void QWidgetPrivate::lower_sys()
for (NSView *subview in subviews)
[parentView addSubview:subview];
[subviews release];
+ [[myview window] makeFirstResponder:firstResponder];
}
#else
if(q->isWindow()) {
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index 3e7b015..6d0d155 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);
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index d172a81..4d3633b 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1336,7 +1336,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con
extern bool qt_cleartype_enabled;
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);
@@ -1452,8 +1452,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();
@@ -1470,22 +1474,20 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
// Alpha channel of the ni.image pixels...
for (int y=0; y<mask->height(); ++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; x<mask->width(); ++x) {
-#ifdef Q_OS_WINCE
+ for (int x=0; x<mask->width(); ++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; x<mask->width(); ++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
}
}
@@ -1511,7 +1513,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);
};
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
}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 16033b6..0a049b8 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -480,7 +480,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().
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<const QDirectFBPixmapData*>(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 {
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> &chat)
// now start the chat
QList<Chat>::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);
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;
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 9f28d1d..b9e8406 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -319,12 +319,27 @@ uint CppParser::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;
+ yyAtNewline = true;
+ } else if (c == '\n') {
++yyCurLineNo;
yyAtNewline = true;
} else if (c != ' ' && c != '\t' && c != '#') {