summaryrefslogtreecommitdiffstats
path: root/library/ttk/vistaTheme.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/ttk/vistaTheme.tcl')
-rw-r--r--library/ttk/vistaTheme.tcl292
1 files changed, 146 insertions, 146 deletions
diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl
index d5ec4d2..bbddb8c 100644
--- a/library/ttk/vistaTheme.tcl
+++ b/library/ttk/vistaTheme.tcl
@@ -42,49 +42,49 @@ namespace eval ttk::theme::vista {
# Treeview:
ttk::style configure Heading -font TkHeadingFont
ttk::style configure Treeview -background SystemWindow \
- -stripedbackground System3dLight
+ -stripedbackground System3dLight
ttk::style configure Treeview.Separator \
- -background System3dLight
+ -background System3dLight
ttk::style map Treeview \
-background [list disabled SystemButtonFace \
selected SystemHighlight] \
-foreground [list disabled SystemGrayText \
selected SystemHighlightText]
- # Label and Toolbutton
+ # Label and Toolbutton
ttk::style configure TLabelframe.Label -foreground SystemButtonText
ttk::style configure Toolbutton -padding 3p
- # Combobox
+ # Combobox
ttk::style configure TCombobox -padding 1.5p
- ttk::style element create Combobox.border vsapi \
- COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1}
- ttk::style element create Combobox.background vsapi \
- EDIT 3 {disabled 3 readonly 5 focus 4 hover 2 {} 1}
- ttk::style element create Combobox.rightdownarrow vsapi \
- COMBOBOX 6 {disabled 4 pressed 3 active 2 {} 1} \
- -syssize {SM_CXVSCROLL SM_CYVSCROLL}
- ttk::style layout TCombobox {
- Combobox.border -sticky nswe -border 0 -children {
- Combobox.rightdownarrow -side right -sticky ns
- Combobox.padding -sticky nswe -children {
- Combobox.background -sticky nswe -children {
- Combobox.focus -sticky nswe -children {
- Combobox.textarea -sticky nswe
- }
- }
- }
- }
- }
- # Vista.Combobox droplist frame
- ttk::style element create ComboboxPopdownFrame.background vsapi\
- LISTBOX 3 {disabled 4 active 3 focus 2 {} 1}
- ttk::style layout ComboboxPopdownFrame {
- ComboboxPopdownFrame.background -sticky news -border 1 -children {
- ComboboxPopdownFrame.padding -sticky news
- }
- }
+ ttk::style element create Combobox.border vsapi \
+ COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1}
+ ttk::style element create Combobox.background vsapi \
+ EDIT 3 {disabled 3 readonly 5 focus 4 hover 2 {} 1}
+ ttk::style element create Combobox.rightdownarrow vsapi \
+ COMBOBOX 6 {disabled 4 pressed 3 active 2 {} 1} \
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
+ ttk::style layout TCombobox {
+ Combobox.border -sticky nswe -border 0 -children {
+ Combobox.rightdownarrow -side right -sticky ns
+ Combobox.padding -sticky nswe -children {
+ Combobox.background -sticky nswe -children {
+ Combobox.focus -sticky nswe -children {
+ Combobox.textarea -sticky nswe
+ }
+ }
+ }
+ }
+ }
+ # Vista.Combobox droplist frame
+ ttk::style element create ComboboxPopdownFrame.background vsapi\
+ LISTBOX 3 {disabled 4 active 3 focus 2 {} 1}
+ ttk::style layout ComboboxPopdownFrame {
+ ComboboxPopdownFrame.background -sticky news -border 1 -children {
+ ComboboxPopdownFrame.padding -sticky news
+ }
+ }
ttk::style map TCombobox \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText] \
@@ -94,136 +94,136 @@ namespace eval ttk::theme::vista {
] \
-focusfill [list {readonly focus} SystemHighlight]
- # Entry
- ttk::style configure TEntry -padding {1 1 1 1} ;# Needs lookup
- ttk::style element create Entry.field vsapi \
- EDIT 6 {disabled 4 focus 3 hover 2 {} 1} -padding {2 2 2 2}
- ttk::style element create Entry.background vsapi \
- EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}
- ttk::style layout TEntry {
- Entry.field -sticky news -border 0 -children {
- Entry.background -sticky news -children {
- Entry.padding -sticky news -children {
- Entry.textarea -sticky news
- }
- }
- }
- }
+ # Entry
+ ttk::style configure TEntry -padding {1 1 1 1} ;# Needs lookup
+ ttk::style element create Entry.field vsapi \
+ EDIT 6 {disabled 4 focus 3 hover 2 {} 1} -padding {2 2 2 2}
+ ttk::style element create Entry.background vsapi \
+ EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}
+ ttk::style layout TEntry {
+ Entry.field -sticky news -border 0 -children {
+ Entry.background -sticky news -children {
+ Entry.padding -sticky news -children {
+ Entry.textarea -sticky news
+ }
+ }
+ }
+ }
ttk::style map TEntry \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText]
- # Spinbox
- ttk::style configure TSpinbox -padding 0
- ttk::style element create Spinbox.field vsapi \
- EDIT 9 {disabled 4 focus 3 hover 2 {} 1} -padding {1 1 1 2}
- ttk::style element create Spinbox.background vsapi \
- EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}
- ttk::style element create Spinbox.innerbg vsapi \
- EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}\
- -padding {2 0 15 2}
- ttk::style element create Spinbox.uparrow vsapi \
- SPIN 1 {disabled 4 pressed 3 active 2 {} 1} \
- -padding 1 -halfheight 1 \
- -syssize { SM_CXVSCROLL SM_CYVSCROLL }
- ttk::style element create Spinbox.downarrow vsapi \
- SPIN 2 {disabled 4 pressed 3 active 2 {} 1} \
- -padding 1 -halfheight 1 \
- -syssize { SM_CXVSCROLL SM_CYVSCROLL }
- ttk::style layout TSpinbox {
- Spinbox.field -sticky nswe -children {
- Spinbox.background -sticky news -children {
- Spinbox.padding -sticky news -children {
- Spinbox.innerbg -sticky news -children {
- Spinbox.textarea
- }
- }
- Spinbox.uparrow -side top -sticky ens
- Spinbox.downarrow -side bottom -sticky ens
- }
- }
- }
+ # Spinbox
+ ttk::style configure TSpinbox -padding 0
+ ttk::style element create Spinbox.field vsapi \
+ EDIT 9 {disabled 4 focus 3 hover 2 {} 1} -padding {1 1 1 2}
+ ttk::style element create Spinbox.background vsapi \
+ EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}
+ ttk::style element create Spinbox.innerbg vsapi \
+ EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}\
+ -padding {2 0 15 2}
+ ttk::style element create Spinbox.uparrow vsapi \
+ SPIN 1 {disabled 4 pressed 3 active 2 {} 1} \
+ -padding 1 -halfheight 1 \
+ -syssize { SM_CXVSCROLL SM_CYVSCROLL }
+ ttk::style element create Spinbox.downarrow vsapi \
+ SPIN 2 {disabled 4 pressed 3 active 2 {} 1} \
+ -padding 1 -halfheight 1 \
+ -syssize { SM_CXVSCROLL SM_CYVSCROLL }
+ ttk::style layout TSpinbox {
+ Spinbox.field -sticky nswe -children {
+ Spinbox.background -sticky news -children {
+ Spinbox.padding -sticky news -children {
+ Spinbox.innerbg -sticky news -children {
+ Spinbox.textarea
+ }
+ }
+ Spinbox.uparrow -side top -sticky ens
+ Spinbox.downarrow -side bottom -sticky ens
+ }
+ }
+ }
ttk::style map TSpinbox \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText]
- # SCROLLBAR elements (Vista includes a state for 'hover')
- ttk::style element create Vertical.Scrollbar.uparrow vsapi \
- SCROLLBAR 1 {disabled 4 pressed 3 active 2 hover 17 {} 1} \
- -syssize {SM_CXVSCROLL SM_CYVSCROLL}
- ttk::style element create Vertical.Scrollbar.downarrow vsapi \
- SCROLLBAR 1 {disabled 8 pressed 7 active 6 hover 18 {} 5} \
- -syssize {SM_CXVSCROLL SM_CYVSCROLL}
- ttk::style element create Vertical.Scrollbar.trough vsapi \
- SCROLLBAR 7 {disabled 4 pressed 3 active 2 hover 5 {} 1}
- ttk::style element create Vertical.Scrollbar.thumb vsapi \
- SCROLLBAR 3 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
- -syssize {SM_CXVSCROLL SM_CYVSCROLL}
- ttk::style element create Vertical.Scrollbar.grip vsapi \
- SCROLLBAR 9 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
- -syssize {SM_CXVSCROLL SM_CYVSCROLL}
- ttk::style element create Horizontal.Scrollbar.leftarrow vsapi \
- SCROLLBAR 1 {disabled 12 pressed 11 active 10 hover 19 {} 9} \
- -syssize {SM_CXHSCROLL SM_CYHSCROLL}
- ttk::style element create Horizontal.Scrollbar.rightarrow vsapi \
- SCROLLBAR 1 {disabled 16 pressed 15 active 14 hover 20 {} 13} \
- -syssize {SM_CXHSCROLL SM_CYHSCROLL}
- ttk::style element create Horizontal.Scrollbar.trough vsapi \
- SCROLLBAR 5 {disabled 4 pressed 3 active 2 hover 5 {} 1}
- ttk::style element create Horizontal.Scrollbar.thumb vsapi \
- SCROLLBAR 2 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
- -syssize {SM_CXHSCROLL SM_CYHSCROLL}
- ttk::style element create Horizontal.Scrollbar.grip vsapi \
- SCROLLBAR 8 {disabled 4 pressed 3 active 2 hover 5 {} 1}
+ # SCROLLBAR elements (Vista includes a state for 'hover')
+ ttk::style element create Vertical.Scrollbar.uparrow vsapi \
+ SCROLLBAR 1 {disabled 4 pressed 3 active 2 hover 17 {} 1} \
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
+ ttk::style element create Vertical.Scrollbar.downarrow vsapi \
+ SCROLLBAR 1 {disabled 8 pressed 7 active 6 hover 18 {} 5} \
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
+ ttk::style element create Vertical.Scrollbar.trough vsapi \
+ SCROLLBAR 7 {disabled 4 pressed 3 active 2 hover 5 {} 1}
+ ttk::style element create Vertical.Scrollbar.thumb vsapi \
+ SCROLLBAR 3 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
+ ttk::style element create Vertical.Scrollbar.grip vsapi \
+ SCROLLBAR 9 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
+ -syssize {SM_CXVSCROLL SM_CYVSCROLL}
+ ttk::style element create Horizontal.Scrollbar.leftarrow vsapi \
+ SCROLLBAR 1 {disabled 12 pressed 11 active 10 hover 19 {} 9} \
+ -syssize {SM_CXHSCROLL SM_CYHSCROLL}
+ ttk::style element create Horizontal.Scrollbar.rightarrow vsapi \
+ SCROLLBAR 1 {disabled 16 pressed 15 active 14 hover 20 {} 13} \
+ -syssize {SM_CXHSCROLL SM_CYHSCROLL}
+ ttk::style element create Horizontal.Scrollbar.trough vsapi \
+ SCROLLBAR 5 {disabled 4 pressed 3 active 2 hover 5 {} 1}
+ ttk::style element create Horizontal.Scrollbar.thumb vsapi \
+ SCROLLBAR 2 {disabled 4 pressed 3 active 2 hover 5 {} 1} \
+ -syssize {SM_CXHSCROLL SM_CYHSCROLL}
+ ttk::style element create Horizontal.Scrollbar.grip vsapi \
+ SCROLLBAR 8 {disabled 4 pressed 3 active 2 hover 5 {} 1}
- # Progressbar
- ttk::style element create Horizontal.Progressbar.pbar vsapi \
- PROGRESS 3 {{} 1} -padding 8
- ttk::style layout Horizontal.TProgressbar {
- Horizontal.Progressbar.trough -sticky nswe -children {
- Horizontal.Progressbar.pbar -side left -sticky ns
- Horizontal.Progressbar.ctext -sticky nesw
- }
- }
- ttk::style element create Vertical.Progressbar.pbar vsapi \
- PROGRESS 3 {{} 1} -padding 8
- ttk::style layout Vertical.TProgressbar {
- Vertical.Progressbar.trough -sticky nswe -children {
- Vertical.Progressbar.pbar -side bottom -sticky we
- }
- }
+ # Progressbar
+ ttk::style element create Horizontal.Progressbar.pbar vsapi \
+ PROGRESS 3 {{} 1} -padding 8
+ ttk::style layout Horizontal.TProgressbar {
+ Horizontal.Progressbar.trough -sticky nswe -children {
+ Horizontal.Progressbar.pbar -side left -sticky ns
+ Horizontal.Progressbar.ctext -sticky nesw
+ }
+ }
+ ttk::style element create Vertical.Progressbar.pbar vsapi \
+ PROGRESS 3 {{} 1} -padding 8
+ ttk::style layout Vertical.TProgressbar {
+ Vertical.Progressbar.trough -sticky nswe -children {
+ Vertical.Progressbar.pbar -side bottom -sticky we
+ }
+ }
- # Scale
- ttk::style element create Horizontal.Scale.slider vsapi \
- TRACKBAR 3 {disabled 5 focus 4 pressed 3 active 2 {} 1} \
- -width 6 -height 12
- ttk::style layout Horizontal.TScale {
- Scale.focus -sticky nswe -children {
- Horizontal.Scale.trough -sticky nswe -children {
- Horizontal.Scale.track -sticky we
- Horizontal.Scale.slider -side left -sticky {}
- }
- }
- }
- ttk::style element create Vertical.Scale.slider vsapi \
- TRACKBAR 6 {disabled 5 focus 4 pressed 3 active 2 {} 1} \
- -width 12 -height 6
- ttk::style layout Vertical.TScale {
- Scale.focus -sticky nswe -children {
- Vertical.Scale.trough -sticky nswe -children {
- Vertical.Scale.track -sticky ns
- Vertical.Scale.slider -side top -sticky {}
- }
- }
- }
+ # Scale
+ ttk::style element create Horizontal.Scale.slider vsapi \
+ TRACKBAR 3 {disabled 5 focus 4 pressed 3 active 2 {} 1} \
+ -width 6 -height 12
+ ttk::style layout Horizontal.TScale {
+ Scale.focus -sticky nswe -children {
+ Horizontal.Scale.trough -sticky nswe -children {
+ Horizontal.Scale.track -sticky we
+ Horizontal.Scale.slider -side left -sticky {}
+ }
+ }
+ }
+ ttk::style element create Vertical.Scale.slider vsapi \
+ TRACKBAR 6 {disabled 5 focus 4 pressed 3 active 2 {} 1} \
+ -width 12 -height 6
+ ttk::style layout Vertical.TScale {
+ Scale.focus -sticky nswe -children {
+ Vertical.Scale.trough -sticky nswe -children {
+ Vertical.Scale.track -sticky ns
+ Vertical.Scale.slider -side top -sticky {}
+ }
+ }
+ }
- # Treeview
- ttk::style configure Item -padding {3p 0 0 0}
+ # Treeview
+ ttk::style configure Item -padding {3p 0 0 0}
ttk::style configure Treeview -indent 15p
ttk::setTreeviewRowHeight
- package provide ttk::theme::vista 1.0
+ package provide ttk::theme::vista 1.0
}
}
elistmodelworkeragent.cpp?h=v4.8.5&id=f23bce37a8a3536bfedce7cc2d57f0761b2d1e31'>src/declarative/util/qdeclarativelistmodelworkeragent.cpp2
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp33
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p_p.h1
-rw-r--r--src/declarative/util/qdeclarativespringanimation.cpp37
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp5
-rw-r--r--src/gui/accessible/qaccessible_win.cpp134
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp12
-rw-r--r--src/gui/dialogs/qwizard_win.cpp6
-rw-r--r--src/gui/egl/qegl.cpp2
-rw-r--r--src/gui/egl/qegl_p.h4
-rw-r--r--src/gui/egl/qeglcontext_p.h3
-rw-r--r--src/gui/egl/qeglproperties.cpp2
-rw-r--r--src/gui/embedded/qsoundqss_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp7
-rw-r--r--src/gui/image/qpixmap_s60_p.h5
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp11
-rw-r--r--src/gui/itemviews/qabstractproxymodel.cpp16
-rw-r--r--src/gui/kernel/qaction.cpp3
-rw-r--r--src/gui/kernel/qapplication.cpp33
-rw-r--r--src/gui/kernel/qapplication_win.cpp38
-rw-r--r--src/gui/kernel/qapplication_x11.cpp28
-rw-r--r--src/gui/kernel/qdesktopwidget_win.cpp6
-rw-r--r--src/gui/kernel/qgesture.cpp2
-rw-r--r--src/gui/kernel/qgesture.h4
-rw-r--r--src/gui/kernel/qgesture_p.h18
-rw-r--r--src/gui/kernel/qgesturemanager.cpp2
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp2
-rw-r--r--src/gui/kernel/qstandardgestures.cpp16
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/kernel/qwidget_win.cpp6
-rw-r--r--src/gui/painting/qdrawhelper.cpp139
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp15
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp75
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp6
-rw-r--r--src/gui/painting/qgraphicssystem_runtime_p.h1
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/gui/painting/qstroker.cpp2
-rw-r--r--src/gui/painting/qtransform.h1
-rw-r--r--src/gui/styles/qwindowsstyle.cpp8
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp3
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp4
-rw-r--r--src/gui/text/qfont_s60.cpp13
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp136
-rw-r--r--src/gui/text/qfontdatabase_win.cpp10
-rw-r--r--src/gui/text/qfontengine.cpp4
-rw-r--r--src/gui/text/qfontengine_win.cpp7
-rw-r--r--src/gui/text/qstatictext.cpp3
-rw-r--r--src/gui/util/qdesktopservices_win.cpp6
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp8
-rw-r--r--src/gui/widgets/qcombobox.cpp3
-rw-r--r--src/gui/widgets/qdockarealayout.cpp10
-rw-r--r--src/gui/widgets/qdockwidget.cpp37
-rw-r--r--src/gui/widgets/qlinecontrol.cpp2
-rw-r--r--src/gui/widgets/qlineedit.cpp4
-rw-r--r--src/gui/widgets/qmainwindow.cpp71
-rw-r--r--src/gui/widgets/qmainwindowlayout.cpp11
-rw-r--r--src/gui/widgets/qmainwindowlayout_p.h2
-rw-r--r--src/gui/widgets/qtoolbar.cpp20
-rw-r--r--src/gui/widgets/qtoolbararealayout.cpp5
-rw-r--r--src/gui/widgets/qtoolbarlayout.cpp7
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp4
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.h2
-rw-r--r--src/network/access/qnetworkreply.cpp6
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp1
-rw-r--r--src/network/bearer/qbearerengine.cpp3
-rw-r--r--src/network/kernel/qauthenticator.cpp39
-rw-r--r--src/network/kernel/qauthenticator_p.h1
-rw-r--r--src/network/kernel/qhostinfo_win.cpp14
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp3
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp15
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp193
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h77
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp36
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qpixmapdata_gl.cpp40
-rw-r--r--src/opengl/qpixmapdata_gl_p.h3
-rw-r--r--src/opengl/qwindowsurface_gl.cpp23
-rw-r--r--src/openvg/qpaintengine_vg.cpp160
-rw-r--r--src/openvg/qvg_symbian.cpp31
-rw-r--r--src/openvg/qvgimagepool.cpp13
-rw-r--r--src/plugins/bearer/bearer.pro6
-rw-r--r--src/plugins/bearer/connman/qofonoservice_linux_p.h2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp11
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp2
-rw-r--r--src/plugins/graphicssystems/graphicssystems.pro4
-rw-r--r--src/plugins/graphicssystems/meego/meego.pro13
-rw-r--r--src/plugins/graphicssystems/meego/qmeegoextensions.cpp129
-rw-r--r--src/plugins/graphicssystems/meego/qmeegoextensions.h89
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp247
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.h85
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystemplugin.cpp58
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystemplugin.h54
-rw-r--r--src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp206
-rw-r--r--src/plugins/graphicssystems/meego/qmeegopixmapdata.h73
-rw-r--r--src/qt3support/network/q3dns.cpp3
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def3038
-rw-r--r--src/s60installs/bwins/QtGuiu.def557
-rw-r--r--src/s60installs/bwins/QtMultimediau.def12
-rw-r--r--src/s60installs/bwins/QtNetworku.def232
-rw-r--r--src/s60installs/bwins/QtOpenGLu.def701
-rw-r--r--src/s60installs/bwins/QtOpenVGu.def4
-rw-r--r--src/s60installs/bwins/QtScriptu.def64
-rw-r--r--src/s60installs/bwins/QtTestu.def4
-rw-r--r--src/s60installs/bwins/phononu.def106
-rw-r--r--src/s60installs/eabi/QtCoreu.def88
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def2642
-rw-r--r--src/s60installs/eabi/QtGuiu.def543
-rw-r--r--src/s60installs/eabi/QtNetworku.def319
-rw-r--r--src/s60installs/eabi/QtOpenGLu.def705
-rw-r--r--src/s60installs/eabi/QtOpenVGu.def4
-rw-r--r--src/s60installs/eabi/QtScriptu.def88
-rw-r--r--src/tools/bootstrap/bootstrap.pro3
-rw-r--r--src/tools/rcc/rcc.cpp7
-rw-r--r--src/tools/uic/cpp/cppextractimages.cpp8
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp10
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp35
-rw-r--r--src/tools/uic/driver.cpp5
-rw-r--r--src/tools/uic/option.h8
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp17
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp16
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp68
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro6
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp21
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp15
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml14
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp32
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange6.qml30
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp15
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp11
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp67
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.pngbin0 -> 3692 bytes-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.pngbin0 -> 3697 bytes-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.pngbin0 -> 3696 bytes-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml795
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml100
-rw-r--r--tests/auto/gestures/tst_gestures.cpp26
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp41
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result16
-rw-r--r--tests/auto/moc/tst_moc.cpp8
-rw-r--r--tests/auto/q3table/tst_q3table.cpp8
-rw-r--r--tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp6
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp4
-rw-r--r--tests/auto/qdir/tst_qdir.cpp99
-rw-r--r--tests/auto/qeasingcurve/tst_qeasingcurve.cpp21
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp65
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp29
-rw-r--r--tests/auto/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp8
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp20
-rw-r--r--tests/auto/qimage/tst_qimage.cpp4
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp21
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp19
-rw-r--r--tests/auto/qmainwindow/tst_qmainwindow.cpp3
-rw-r--r--tests/auto/qobject/tst_qobject.cpp8
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp66
-rw-r--r--tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp4
-rw-r--r--tests/auto/qsettings/tst_qsettings.cpp63
-rw-r--r--tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp39
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp11
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp69
-rw-r--r--tests/auto/qurl/tst_qurl.cpp16
-rw-r--r--tools/assistant/tools/assistant/helpenginewrapper.cpp2
-rw-r--r--tools/assistant/tools/qhelpconverter/filespage.cpp4
-rw-r--r--tools/assistant/tools/qhelpconverter/filterpage.cpp2
-rw-r--r--tools/configure/configure.pro1
-rw-r--r--tools/configure/configureapp.cpp4
-rw-r--r--tools/designer/src/components/formeditor/formeditor.qrc1
-rw-r--r--tools/designer/src/components/formeditor/formeditor_optionspage.cpp6
-rw-r--r--tools/linguist/linguist/mainwindow.cpp6
-rw-r--r--tools/linguist/linguist/sourcecodeview.cpp2
-rw-r--r--tools/linguist/lupdate/cpp.cpp19
-rw-r--r--tools/linguist/shared/translator.h4
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf2
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp133
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h175
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro10
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoliveimage.cpp115
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoliveimage.h106
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoliveimage_p.h63
-rw-r--r--tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp163
-rw-r--r--tools/qmeegographicssystemhelper/qmeegolivepixmap.h98
-rw-r--r--tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h66
-rw-r--r--tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp99
-rw-r--r--tools/qmeegographicssystemhelper/qmeegooverlaywidget.h86
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.cpp158
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.h61
-rw-r--r--tools/runonphone/ossignalconverter.cpp1
-rw-r--r--tools/tools.pro4
-rw-r--r--translations/assistant_de.ts540
-rw-r--r--translations/designer_de.ts56
-rw-r--r--translations/linguist_de.ts686
-rw-r--r--translations/qt_de.ts46
-rw-r--r--translations/qt_help_de.ts2
290 files changed, 13296 insertions, 5606 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index 2569a66..361b32d 100755
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -308,7 +308,7 @@ if($stub) {
mkpath($systeminstall);
my $stub_sis_name = $systeminstall."/".$stub_sis_name;
# Create stub SIS.
- system ("makesis -s $pkgoutput $stub_sis_name");
+ system ("$ENV{EPOCROOT}epoc32/tools/makesis -s $pkgoutput $stub_sis_name");
} else {
if ($certtext eq "Self Signed"
&& !@certificates
@@ -321,7 +321,11 @@ if($stub) {
# Create SIS.
# The 'and' is because system uses 0 to indicate success.
- system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
+ if($ENV{EPOCROOT}) {
+ system ("$ENV{EPOCROOT}epoc32/tools/makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
+ } else {
+ system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
+ }
print("\n");
my $targetInsert = "";
diff --git a/bin/syncqt b/bin/syncqt
index 907869d..c73d119 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -51,6 +51,7 @@ my %modules = ( # path to module name map
"QtWebKit" => "$basedir/src/3rdparty/webkit/WebCore",
"phonon" => "$basedir/src/phonon",
"QtMultimedia" => "$basedir/src/multimedia",
+ "QtMeeGoGraphicsSystemHelper" => "$basedir/tools/qmeegographicssystemhelper",
);
my %moduleheaders = ( # restrict the module headers to those found in relative path
"QtWebKit" => "../WebKit/qt/Api",
diff --git a/config.tests/symbian/audio/audio.pro b/config.tests/symbian/audio/audio.pro
index abbde6e..b2a1986 100644
--- a/config.tests/symbian/audio/audio.pro
+++ b/config.tests/symbian/audio/audio.pro
@@ -3,5 +3,7 @@ SOURCES = audio.cpp
INCLUDEPATH += $${EPOCROOT}epoc32/include/mmf/server
INCLUDEPATH += $${EPOCROOT}epoc32/include/mmf/common
+INCLUDEPATH += $${EPOCROOT}epoc32/include/platform
LIBS += -lmmfdevsound
+QT =
diff --git a/configure b/configure
index f2b6455..1ad0181 100755
--- a/configure
+++ b/configure
@@ -1434,9 +1434,6 @@ while [ "$#" -gt 0 ]; do
solaris-64)
PLATFORM=solaris-cc-64
;;
- solaris-64)
- PLATFORM=solaris-cc-64
- ;;
openunix-cc)
PLATFORM=unixware-cc
;;
@@ -2870,7 +2867,7 @@ if [ -z "${CFG_HOST_ARCH}" ]; then
;;
i86pc)
case "$PLATFORM" in
- *-64)
+ *-64*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 64-bit AMD 80x86 (x86_64)"
fi
@@ -7184,6 +7181,7 @@ if [ "$CFG_WEBKIT" = "yes" ]; then
# The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
CFG_WEBKIT="yes"
else
+ rm -f "$outpath/mkspecs/modules/qt_webkit_version.pri"
CFG_WEBKIT="no"
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
fi
diff --git a/demos/declarative/flickr/common/Progress.qml b/demos/declarative/flickr/common/Progress.qml
index 99e1a7b..23bffb9 100644
--- a/demos/declarative/flickr/common/Progress.qml
+++ b/demos/declarative/flickr/common/Progress.qml
@@ -68,6 +68,6 @@ Item {
text: Math.round(progress * 100) + "%"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- color: "white"; font.bold: true
+ color: "white"; font.bold: true; font.pixelSize: 15
}
}
diff --git a/demos/declarative/flickr/mobile/Button.qml b/demos/declarative/flickr/mobile/Button.qml
index 93a6661..6228606 100644
--- a/demos/declarative/flickr/mobile/Button.qml
+++ b/demos/declarative/flickr/mobile/Button.qml
@@ -66,7 +66,7 @@ Item {
}
Text {
color: "white"
- anchors.centerIn: buttonImage; font.bold: true
+ anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15
text: container.text; style: Text.Raised; styleColor: "black"
}
states: [
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 7441ecc..6408fc6 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -96,7 +96,7 @@ Flipable {
Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
Common.Progress {
- anchors.centerIn: parent; width: 200; height: 18
+ anchors.centerIn: parent; width: 200; height: 22
progress: bigImage.progress; visible: bigImage.status != Image.Ready
}
diff --git a/demos/declarative/flickr/mobile/ListDelegate.qml b/demos/declarative/flickr/mobile/ListDelegate.qml
index 3dd2868..9ec02e1 100644
--- a/demos/declarative/flickr/mobile/ListDelegate.qml
+++ b/demos/declarative/flickr/mobile/ListDelegate.qml
@@ -55,9 +55,9 @@ Component {
}
Column {
x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
- Text { text: title; color: "white"; width: parent.width; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
- Text { text: photoAuthor; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
- Text { text: photoDate; width: parent.width; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
+ Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
}
}
}
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index 335c315..60ca4dc 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -78,7 +78,7 @@ Item {
}
elide: Text.ElideLeft
text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags)
- font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black"
+ font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black"
}
Button {
diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml
index 145c189..70de81d 100644
--- a/demos/declarative/twitter/TwitterCore/TitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml
@@ -94,10 +94,21 @@ Item {
}
}
+ Image {
+ id: quitButton
+ x: 5
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
Text {
id: categoryText
anchors {
- left: imageBox.right; right: parent.right; leftMargin: 10; rightMargin: 10
+ left: quitButton.right; right: parent.right; leftMargin: 10; rightMargin: 10
verticalCenter: parent.verticalCenter
}
elide: Text.ElideLeft
diff --git a/demos/embedded/flightinfo/flightinfo.pro b/demos/embedded/flightinfo/flightinfo.pro
index 985cc42..bd21e97 100644
--- a/demos/embedded/flightinfo/flightinfo.pro
+++ b/demos/embedded/flightinfo/flightinfo.pro
@@ -8,8 +8,6 @@ QT += network
symbian {
TARGET.UID3 = 0xA000CF74
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
}
diff --git a/demos/embedded/weatherinfo/weatherinfo.pro b/demos/embedded/weatherinfo/weatherinfo.pro
index 9addbbb..bc9b966 100644
--- a/demos/embedded/weatherinfo/weatherinfo.pro
+++ b/demos/embedded/weatherinfo/weatherinfo.pro
@@ -7,8 +7,6 @@ QT += network svg
symbian {
TARGET.UID3 = 0xA000CF77
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
- LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
}
diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index a5939e3..53e51f8 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -371,6 +371,10 @@ Qt for Symbian
- QSplashScreen
* [QTBUG-11129] Fixed a hanging bug in QSplashScreen on 3.1 devices.
+ - QS60Main... classes
+ * The future compatibility of QS60MainAppUi, QS60MainDocument and
+ QS60MainApplication are improved by removing the need for any
+ sub-class to link to Avkon functions that may not exist in future.
****************************************************************************
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index 18da3d2..d290690 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -173,6 +173,40 @@ handler to execute at startup, they are run sequentially in an undefined order.
Likewise, the \l {Component::onDestruction} attached property is triggered on
component destruction.
+
+\section1 Property Assignment vs Property Binding
+
+When working with both QML and JavaScript, it is important to differentiate between
+QML \l {Property Binding} and JavaScript value assignment. In QML, a property
+binding is created using the \e {property: value} syntax:
+
+\code
+Rectangle {
+ width: otherItem.width
+}
+\endcode
+
+The \c width of the above \l Rectangle is updated whenever \c otherItem.width changes. On the other
+hand, take the following JavaScript code snippet, that runs when the \l Rectangle is created:
+
+\code
+Rectangle {
+
+ Component.onCompleted: {
+ width = otherItem.width;
+ }
+}
+\endcode
+
+The \c width of this \l Rectangle is \e assigned the value of \c otherItem.width using the
+\e {property = value} syntax in JavaScript. Unlike the QML \e {property: value} syntax, this
+does not invoke QML property binding; the \c rectangle.width property is set to the value
+of \c otherItem.width at the time of the assignment and will not be updated if that value
+changes.
+
+See \l {Property Binding} for more information.
+
+
\section1 QML JavaScript Restrictions
QML executes standard JavaScript code, with the following restrictions:
diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc
index 552b9e4..314bf67 100644
--- a/doc/src/declarative/propertybinding.qdoc
+++ b/doc/src/declarative/propertybinding.qdoc
@@ -94,10 +94,29 @@ Rectangle {
}
\endcode
-Imperatively assigning a value directly to a property will also implicitly remove a binding
-on a property. A property can only have one value at a time, and if code explicitly sets
-this value the binding must be removed. The \l Rectangle in the example below will have
-a width of 13, regardless of the otherItem's width.
+
+\section1 Effects of Property Assignment in JavaScript
+
+Assigning a property value from JavaScript does \e not create a property binding.
+For example:
+
+\code
+Rectangle {
+
+ Component.onCompleted: {
+ width = otherItem.width;
+ }
+}
+\endcode
+
+Instead of creating a property binding, this simply sets the \c width of the \l Rectangle
+to the value of \c other.width at the time the JavaScript code is invoked. See
+\l {Property Assignment vs Property Binding} for more details.
+
+Also note that assigning a value to a property that is currently bound will remove the binding.
+A property can only have one value at a time, and if any code explicitly sets
+this value, the binding is removed. The \l Rectangle in the example below will have
+a width of 13, regardless of the \c otherItem's width.
\code
Rectangle {
@@ -109,7 +128,9 @@ Rectangle {
}
\endcode
-There is no way to create a property binding directly from imperative JavaScript code.
+There is no way to create a property binding directly from imperative JavaScript code,
+although it is possible to set up a \l Binding object (shown below).
+
\section1 Binding Element
@@ -126,5 +147,7 @@ Binding {
value: slider.value
}
\endqml
+
+
*/
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index 44658bc..f4becf8 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1693,6 +1693,8 @@
for building a project. The value of this variable is typically
handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ \bold{Note:} On the Symbian platform, this variable is ignored.
+
\target MAKEFILE_GENERATOR
\section1 MAKEFILE_GENERATOR
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index edb4d1e..77856ec 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -77,7 +77,7 @@
<ul>
<li><a href="qtquick.html">Qt Quick</a></li>
<li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
- <li><a href="qmlelements.html">QML Elements</a></li>
+ <li><a href="qdeclarativeelements.html">QML Elements</a></li>
<li><a href="qdeclarativeexamples.html">QML Examples and Demos</a></li>
</ul>
</div>
diff --git a/examples/examples.pro b/examples/examples.pro
index 1fdd774..f233aba 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -19,7 +19,6 @@ SUBDIRS = \
linguist \
mainwindows \
painting \
- qtconcurrent \
richtext \
sql \
tools \
@@ -67,6 +66,7 @@ contains(QT_CONFIG, declarative): SUBDIRS += declarative
win32: SUBDIRS += activeqt
contains(QT_CONFIG, xmlpatterns):!contains(QT_CONFIG, no-gui): SUBDIRS += xmlpatterns
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
+contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent
# install
sources.files = README *.pro
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index ecc2a93..5ec9d53 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -107,7 +107,7 @@ void SessionWidget::updateSession()
if (session->state() == QNetworkSession::Connected)
statsTimer = startTimer(1000);
- else
+ else if (statsTimer != -1)
killTimer(statsTimer);
if (session->configuration().type() == QNetworkConfiguration::InternetAccessPoint)
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 4fd804d..e59319f 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -36,7 +36,7 @@ INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picki
win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt
# As order does matter for static libs, we reorder the QT variable here
-TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core
+TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core meegographicssystemhelper
for(QTLIB, $$list($$TMPLIBS)) {
contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB
}
@@ -175,6 +175,7 @@ for(QTLIB, $$list($$lower($$unique(QT)))) {
}
} else:isEqual(QTLIB, declarative):qlib = QtDeclarative
else:isEqual(QTLIB, multimedia):qlib = QtMultimedia
+ else:isEqual(QTLIB, meegographicssystemhelper):qlib = QtMeeGoGraphicsSystemHelper
else:message("Unknown QT: $$QTLIB"):qlib =
!isEmpty(qlib) {
target_qt:isEqual(TARGET, qlib) {
diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/symbian/sis_targets.prf
index 800a04c..800a04c 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/symbian/sis_targets.prf
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 0b621a3..539609d 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -50,22 +50,22 @@ defineReplace(processSymbianLibrary) {
return($$qt_library)
}
-qt_libraries = $$split(LIBS, " ")
-LIBS =
-for(qt_library, qt_libraries) {
- qt_newLib = $$processSymbianLibrary($$qt_library)
- contains(qt_newLib, ".*\\.dso$")|contains(qt_newLib, ".*\\.lib$"):PRE_TARGETDEPS += $$qt_newLib
- linux-gcce:qt_newLib = "-l:$$qt_newLib"
- LIBS += $$qt_newLib
-}
-
-qt_libraries = $$split(QMAKE_LIBS, " ")
-QMAKE_LIBS =
-for(qt_library, qt_libraries) {
- qt_newLib = $$processSymbianLibrary($$qt_library)
- contains(qt_newLib, ".*\\.dso$")|contains(qt_newLib, ".*\\.lib$"):PRE_TARGETDEPS += $$qt_newLib
- linux-gcce:qt_newLib = "-l:$$qt_newLib"
- QMAKE_LIBS += $$qt_newLib
+# This part turn "-llibc" into "libc.dso", and moves -L entries to QMAKE_LIBDIR.
+libsToProcess = LIBS QMAKE_LIBS
+for(libToProcess, libsToProcess) {
+ qt_libraries = $$split($$libToProcess, " ")
+ eval($$libToProcess =)
+ for(qt_library, qt_libraries) {
+ contains(qt_library, "^-L.*") {
+ qt_library = $$replace(qt_library, "^-L", "")
+ QMAKE_LIBDIR += $$qt_library
+ } else {
+ qt_newLib = $$processSymbianLibrary($$qt_library)
+ contains(qt_newLib, ".*\\.dso$")|contains(qt_newLib, ".*\\.lib$"):PRE_TARGETDEPS += $$qt_newLib
+ linux-gcce:qt_newLib = "-l:$$qt_newLib"
+ eval($$libToProcess += \$\$qt_newLib)
+ }
+ }
}
elf2e32_LIBPATH =
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 354a73f..4d0121c 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -84,6 +84,7 @@ QTOBJS= \
qtemporaryfile.obj \
qabstractfileengine.obj \
qfsfileengine_win.obj \
+ qsystemlibrary.obj \
qfsfileengine_iterator_win.obj \
qfileinfo.obj \
qglobal.obj \
@@ -125,6 +126,7 @@ clean::
-del $(OBJS)
-del qmake_pch.obj
-del qmake_pch.pch
+ -del qsystemlibrary.obj
-del vc60.pdb
-del vc70.pdb
-del qmake.pdb
@@ -148,6 +150,9 @@ distclean:: clean
$(OBJS): qmake_pch.obj
+qsystemlibrary.obj: $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp
+
$(QTOBJS): qmake_pch.obj
qmake_pch.obj:
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index e52b8c6..f313f9e 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -79,6 +79,7 @@ QTOBJS= \
qutfcodec.o \
qstring.o \
qstringlist.o \
+ qsystemlibrary.o \
qtextstream.o \
quuid.o \
qvector.o \
@@ -234,6 +235,9 @@ qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp
+
qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh
index e4e2e6a..af54288 100644
--- a/qmake/Makefile.win32-g++-sh
+++ b/qmake/Makefile.win32-g++-sh
@@ -79,6 +79,7 @@ QTOBJS= \
qutfcodec.o \
qstring.o \
qstringlist.o \
+ qsystemlibrary.o \
qtextstream.o \
quuid.o \
qvector.o \
@@ -233,6 +234,9 @@ qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp
+ $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp
+
qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
$(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index c7b1473..cd034b8 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1794,10 +1794,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
const QString c = Option::fixPathToLocalOS(cmdline.at(argv0), true);
if(exists(c)) {
cmdline[argv0] = escapeFilePath(Option::fixPathToLocalOS(cmdline.at(argv0), false));
- tmp_dep_cmd = cmdline.join(" ");
} else {
cmdline[argv0] = escapeFilePath(cmdline.at(argv0));
}
+ tmp_dep_cmd = cmdline.join(" ");
}
dep_cd_cmd = QLatin1String("cd ")
+ escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index cf6bd13..0b0033a 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -272,7 +272,8 @@ void SymbianMakefileGenerator::init()
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS"));
project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE"));
- // bld.inf
+ // Disallow renaming of bld.inf.
+ project->values("MAKEFILE").clear();
project->values("MAKEFILE") += BLD_INF_FILENAME;
// .mmp
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index a7e0ab1..36c5d36 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -132,7 +132,8 @@ bootstrap { #Qt code
LIBS += -framework ApplicationServices
}
} else:win32 {
- SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp
+ SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp \
+ qsystemlibrary.cpp
win32-msvc*:LIBS += ole32.lib advapi32.lib
win32-g++*:LIBS += -lole32 -luuid
}
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index d31a2b4..ae33228 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-72b1c38579ca1fdb3f242e29cd16e5bfb4925813
+715b53069911a31a559aa0b3d94ffc6a5ac20988
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index c09ad79..9922da6 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,72 @@
+2010-06-16 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ Reindent the asm code I've moved to inside the function
+ (previous commit)
+
+ * jit/JITStubs.cpp:
+
+2010-06-16 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ Fix the JIT compilation with the Intel 32-bit C++ compiler.
+
+ ICC doesn't understand the use of "asm" statements outside of
+ function bodies, so move the assembly code inside a dummy
+ function (and mark it so that the compiler doesn't remove it
+ altogether).
+
+ Also removed the ".text" entry that I had added because now
+ the assembly code is properly inside a code section (fixes
+ compilation with -ffunction-sections).
+
+ * jit/JITStubs.cpp:
+
+2010-06-16 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ Don't use __attribute__((may_alias)) with the Intel compiler,
+ as it doesn't understand it.
+
+ * wtf/Vector.h:
+
+2010-06-16 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ Fix compilation with the Intel C++ compiler (11.1.072).
+
+ Like RVCT, label pointers must be void*, not const void*.
+
+ * bytecode/Opcode.h:
+
+2010-06-16 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ Add the WTF_COMPILER_INTEL for when the Intel compiler is used
+ for building. Usually, the Intel compiler masquerades as
+ another compiler in the system and gets away with it, but some
+ times specific fixes are required (such as when using language
+ extensions).
+
+ * wtf/Platform.h:
+
+2010-07-08 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Oliver Hunt.
+
+ Interpreter: Crash in op_load_varargs on 64-bit
+ https://bugs.webkit.org/show_bug.cgi?id=41795
+
+ Added missing cast of argCount to int32_t in op_load_varargs.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+
2010-07-02 Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed by Oliver Hunt.
diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h
index 509daeb..f7f53fd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h
+++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h
@@ -206,7 +206,7 @@ namespace JSC {
#undef VERIFY_OPCODE_ID
#if HAVE(COMPUTED_GOTO)
-#if COMPILER(RVCT)
+#if COMPILER(RVCT) || COMPILER(INTEL)
typedef void* Opcode;
#else
typedef const void* Opcode;
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
index 73efc0d..a56040c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
@@ -3465,17 +3465,17 @@ skip_id_custom_self:
goto vm_throw;
}
ASSERT(!callFrame->callee()->isHostFunction());
- uint32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount();
- uint32_t inplaceArgs = min(argCount, expectedParams);
- uint32_t i = 0;
+ int32_t expectedParams = callFrame->callee()->jsExecutable()->parameterCount();
+ int32_t inplaceArgs = min(static_cast<int32_t>(argCount), expectedParams);
+ int32_t i = 0;
Register* argStore = callFrame->registers() + argsOffset;
// First step is to copy the "expected" parameters from their normal location relative to the callframe
for (; i < inplaceArgs; i++)
argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams];
// Then we copy any additional arguments that may be further up the stack ('-1' to account for 'this')
- for (; i < argCount; i++)
- argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams - argCount - 1];
+ for (; i < static_cast<int32_t>(argCount); i++)
+ argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams - static_cast<int32_t>(argCount) - 1];
} else if (!arguments.isUndefinedOrNull()) {
if (!arguments.isObject()) {
exceptionValue = createInvalidParamError(callFrame, "Function.prototype.apply", arguments, vPC - callFrame->codeBlock()->instructions().begin(), callFrame->codeBlock());
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
index e5fcdc4..23fcb96 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
@@ -113,56 +113,59 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x3c, JITStackFrame_s
COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x58, JITStackFrame_callFrame_offset_matches_ctiTrampoline);
COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x50, JITStackFrame_code_offset_matches_ctiTrampoline);
-asm volatile (
-".text\n"
-".globl " SYMBOL_STRING(ctiTrampoline) "\n"
-HIDE_SYMBOL(ctiTrampoline) "\n"
-SYMBOL_STRING(ctiTrampoline) ":" "\n"
- "pushl %ebp" "\n"
- "movl %esp, %ebp" "\n"
- "pushl %esi" "\n"
- "pushl %edi" "\n"
- "pushl %ebx" "\n"
- "subl $0x3c, %esp" "\n"
- "movl $512, %esi" "\n"
- "movl 0x58(%esp), %edi" "\n"
- "call *0x50(%esp)" "\n"
- "addl $0x3c, %esp" "\n"
- "popl %ebx" "\n"
- "popl %edi" "\n"
- "popl %esi" "\n"
- "popl %ebp" "\n"
- "ret" "\n"
-);
-
-asm volatile (
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
+static void __attribute__((used)) asm_wrapper()
+{
+ asm volatile (
+ ".text\n"
+ ".globl " SYMBOL_STRING(ctiTrampoline) "\n"
+ HIDE_SYMBOL(ctiTrampoline) "\n"
+ SYMBOL_STRING(ctiTrampoline) ":" "\n"
+ "pushl %ebp" "\n"
+ "movl %esp, %ebp" "\n"
+ "pushl %esi" "\n"
+ "pushl %edi" "\n"
+ "pushl %ebx" "\n"
+ "subl $0x3c, %esp" "\n"
+ "movl $512, %esi" "\n"
+ "movl 0x58(%esp), %edi" "\n"
+ "call *0x50(%esp)" "\n"
+ "addl $0x3c, %esp" "\n"
+ "popl %ebx" "\n"
+ "popl %edi" "\n"
+ "popl %esi" "\n"
+ "popl %ebp" "\n"
+ "ret" "\n"
+ );
+
+ asm volatile (
+ ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+ HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
+ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
#if !USE(JIT_STUB_ARGUMENT_VA_LIST)
- "movl %esp, %ecx" "\n"
+ "movl %esp, %ecx" "\n"
#endif
- "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
- "addl $0x3c, %esp" "\n"
- "popl %ebx" "\n"
- "popl %edi" "\n"
- "popl %esi" "\n"
- "popl %ebp" "\n"
- "ret" "\n"
-);
-
-asm volatile (
-".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
-HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
-SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
- "addl $0x3c, %esp" "\n"
- "popl %ebx" "\n"
- "popl %edi" "\n"
- "popl %esi" "\n"
- "popl %ebp" "\n"
- "ret" "\n"
-);
+ "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
+ "addl $0x3c, %esp" "\n"
+ "popl %ebx" "\n"
+ "popl %edi" "\n"
+ "popl %esi" "\n"
+ "popl %ebp" "\n"
+ "ret" "\n"
+ );
+ asm volatile (
+ ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
+ HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
+ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
+ "addl $0x3c, %esp" "\n"
+ "popl %ebx" "\n"
+ "popl %edi" "\n"
+ "popl %esi" "\n"
+ "popl %ebp" "\n"
+ "ret" "\n"
+ );
+}
+
#elif COMPILER(GCC) && CPU(X86_64)
#if USE(JIT_STUB_ARGUMENT_VA_LIST)
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
index 84b6153..15f0ffc 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
@@ -99,7 +99,10 @@
#undef _WIN32
#endif
-
+/* COMPILER(INTEL) - Intel C++ Compiler */
+#if defined(__INTEL_COMPILER)
+#define WTF_COMPILER_INTEL 1
+#endif
/* ==== CPU() - the target CPU architecture ==== */
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
index 4d9ea61..c267050 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
@@ -49,7 +49,7 @@ namespace WTF {
#error WTF_ALIGN macros need alignment control.
#endif
- #if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
+ #if COMPILER(GCC) && !COMPILER(INTEL) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
typedef char __attribute__((__may_alias__)) AlignedBufferChar;
#else
typedef char AlignedBufferChar;
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 62aa8ce..f919bdf 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- 72b1c38579ca1fdb3f242e29cd16e5bfb4925813
+ 715b53069911a31a559aa0b3d94ffc6a5ac20988
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 98d4d51..2d20cbd 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,105 @@
+2010-09-09 Kristian Amlie <kristian.amlie@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fixed incorrect Symbian scoping.
+
+ The missing install functionality is only true for mmp based systems.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45268
+
+ * WebCore.pro:
+
+2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] fix qt_webkit_version.pri install for in-Qt builds
+
+ Always add the target, even if building inside Qt - as opposed to the
+ headers and libraries, there are no rules for that coming from
+ qbase.pri.
+
+ Task-number: QTBUG-13306
+
+ * WebCore.pro:
+
+2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Let QtWebKit inject itself into the qt configuration
+
+ i.e., don't explicitly deal with qt_webkit_version.pri outside of the
+ webkit source directory.
+
+ Task-number: QTBUG-12379
+
+ * WebCore.pro:
+
+2010-08-20 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] When using the raster graphics system on Maemo5, allow
+ Flash to render directly into the raster window surface.
+ wmode=transparent is now supported as a result of this change.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::paintUsingImageSurfaceExtension):
+
+2010-08-18 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement Maemo5 local rendering NPAPI extension. See
+ https://wiki.mozilla.org/Plugins:NokiaMaemoImageSurface for details.
+
+ With the local rendering extension, Flash will paint into a 16-bit surface.
+ For wmode=transparent, Flash expects the surface to contain the contents
+ beneath it. As it is tricky to implement the content propagation across all
+ graphics systems, transparent Flash is not supported. We just fill the surface
+ with white and wmode=transparent behaves the same as wmode=opaque with a white
+ background.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * WebCore.pro:
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::setValue):
+ (WebCore::PluginView::PluginView):
+ * plugins/PluginView.h:
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+ (WebCore::PluginView::paintUsingImageSurfaceExtension):
+ (WebCore::PluginView::paint):
+ (WebCore::PluginView::platformGetValueStatic):
+
+2010-08-17 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] On Maemo5, there is no libgdk-x11-2.0.so symlink. Look for
+ libgdk-x11-2.0.so.0 instead on X11 and Maemo5.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::getPluginDisplay):
+
+2010-08-17 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Kenneth Rohde Christiansen.
+ Set PluginQuirkRequiresDefaultScreenDepth for all Flash versions and not
+ just Flash 10.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * plugins/PluginPackage.cpp:
+ (WebCore::PluginPackage::determineQuirks):
+
2010-08-10 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 5ea1e77..87638a0 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -2192,6 +2192,9 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
CONFIG += x11
LIBS += -lXrender
}
+ maemo5 {
+ DEFINES += MOZ_PLATFORM_MAEMO=5
+ }
SOURCES += \
plugins/qt/PluginContainerQt.cpp \
plugins/qt/PluginPackageQt.cpp \
@@ -2857,13 +2860,13 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
}
}
-!symbian-abld:!symbian-sbsv2 {
+!symbian {
modfile.files = $$moduleFile
modfile.path = $$[QMAKE_MKSPECS]/modules
INSTALLS += modfile
} else {
- # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
+ # INSTALLS is not implemented in qmake's s60 generators, copy headers manually
inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
inst_modfile.input = moduleFile
@@ -2883,7 +2886,7 @@ HEADERS += $$WEBKIT_API_HEADERS
exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
- !symbian {
+ !symbian-abld:!symbian-sbsv2 {
headers.files = $$WEBKIT_INSTALL_HEADERS
!isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
@@ -2894,7 +2897,7 @@ HEADERS += $$WEBKIT_API_HEADERS
INSTALLS += target headers
} else {
- # INSTALLS is not implemented in qmake's s60 generators, copy headers manually
+ # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
inst_headers.input = WEBKIT_INSTALL_HEADERS
inst_headers.CONFIG = no_clean
diff --git a/src/3rdparty/webkit/WebCore/bridge/npapi.h b/src/3rdparty/webkit/WebCore/bridge/npapi.h
index 533fcba..daa3a36 100644
--- a/src/3rdparty/webkit/WebCore/bridge/npapi.h
+++ b/src/3rdparty/webkit/WebCore/bridge/npapi.h
@@ -247,6 +247,12 @@ typedef struct _NPRect
} NPRect;
+typedef struct _NPSize
+{
+ int32 width;
+ int32 height;
+} NPSize;
+
#ifdef XP_UNIX
/*
* Unix specific structures and definitions
@@ -373,6 +379,11 @@ typedef enum {
/* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
NPPVpluginCoreAnimationLayer = 1003
#endif
+
+
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ NPPVpluginWindowlessLocalBool = 2002
+#endif
} NPPVariable;
/*
@@ -419,6 +430,9 @@ typedef enum {
, NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
#endif /* XP_MACOSX */
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ , NPNVSupportsWindowlessLocal = 2002
+#endif
} NPNVariable;
typedef enum {
@@ -539,6 +553,23 @@ typedef struct _NPWindow
} NPWindow;
+typedef struct _NPImageExpose
+{
+ char* data; /* image pointer */
+ int32 stride; /* Stride of data image pointer */
+ int32 depth; /* Depth of image pointer */
+ int32 x; /* Expose x */
+ int32 y; /* Expose y */
+ uint32 width; /* Expose width */
+ uint32 height; /* Expose height */
+ NPSize dataSize; /* Data buffer size */
+ float translateX; /* translate X matrix value */
+ float translateY; /* translate Y matrix value */
+ float scaleX; /* scale X matrix value */
+ float scaleY; /* scale Y matrix value */
+} NPImageExpose;
+
+
typedef struct _NPFullPrint
{
NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp
index ad03ecd..3881f54 100644
--- a/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp
@@ -185,12 +185,12 @@ void PluginPackage::determineQuirks(const String& mimeType)
#if PLATFORM(QT)
m_quirks.add(PluginQuirkRequiresGtkToolKit);
#endif
- m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
} else {
// Flash 9 and older requests windowless plugins if we return a mozilla user agent
m_quirks.add(PluginQuirkWantsMozillaUserAgent);
}
+ m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
m_quirks.add(PluginQuirkThrottleInvalidate);
m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
m_quirks.add(PluginQuirkFlashURLNotifyBug);
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
index df9a29b..b8b2f2f 100644
--- a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2010 Girish Ramakrishnan <girish@forwardbias.in>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -679,6 +680,12 @@ NPError PluginView::setValue(NPPVariable variable, void* value)
}
#endif // defined(XP_MACOSX)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ case NPPVpluginWindowlessLocalBool:
+ m_renderToImage = true;
+ return NPERR_NO_ERROR;
+#endif
+
default:
notImplemented();
return NPERR_GENERIC_ERROR;
@@ -852,6 +859,9 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p
, m_colormap(0)
, m_pluginDisplay(0)
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ , m_renderToImage(false)
+#endif
, m_loadManually(loadManually)
, m_manualStream(0)
, m_isJavaScriptPaused(false)
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.h b/src/3rdparty/webkit/WebCore/plugins/PluginView.h
index 51b2127..f346134 100644
--- a/src/3rdparty/webkit/WebCore/plugins/PluginView.h
+++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.h
@@ -54,6 +54,10 @@ typedef PlatformWidget PlatformPluginWidget;
#include <QPixmap>
#endif
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#include <QImage>
+class QPainter;
+#endif
namespace JSC {
namespace Bindings {
@@ -371,6 +375,12 @@ private:
void initXEvent(XEvent* event);
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ QImage m_image;
+ bool m_renderToImage;
+ void paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect);
+#endif
+
IntRect m_clipRect; // The clip rect to apply to a windowed plug-in
IntRect m_windowRect; // Our window rect.
diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
index fb88b87..8dadc11 100644
--- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp
@@ -110,12 +110,20 @@ void PluginView::updatePluginWidget()
return;
if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) {
- if (m_drawable)
- XFreePixmap(QX11Info::display(), m_drawable);
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ // On Maemo5, Flash always renders to 16-bit buffer
+ if (m_renderToImage)
+ m_image = QImage(m_windowRect.width(), m_windowRect.height(), QImage::Format_RGB16);
+ else
+#endif
+ {
+ if (m_drawable)
+ XFreePixmap(QX11Info::display(), m_drawable);
- m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
- ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
- QApplication::syncX(); // make sure that the server knows about the Drawable
+ m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
+ ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
+ QApplication::syncX(); // make sure that the server knows about the Drawable
+ }
}
// do not call setNPWindowIfNeeded immediately, will be called on paint()
@@ -154,6 +162,71 @@ void PluginView::hide()
Widget::hide();
}
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+void PluginView::paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect)
+{
+ NPImageExpose imageExpose;
+ QPoint offset;
+ QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
+ const bool surfaceHasUntransformedContents = client && qobject_cast<QWidget*>(client->pluginParent());
+
+ QPaintDevice* surface = QPainter::redirected(painter->device(), &offset);
+
+ // If the surface is a QImage, we can render directly into it
+ if (surfaceHasUntransformedContents && surface && surface->devType() == QInternal::Image) {
+ QImage* image = static_cast<QImage*>(surface);
+ offset = -offset; // negating the offset gives us the offset of the view within the surface
+ imageExpose.data = reinterpret_cast<char*>(image->bits());
+ imageExpose.dataSize.width = image->width();
+ imageExpose.dataSize.height = image->height();
+ imageExpose.stride = image->bytesPerLine();
+ imageExpose.depth = image->depth(); // this is guaranteed to be 16 on Maemo5
+ imageExpose.translateX = offset.x() + m_windowRect.x();
+ imageExpose.translateY = offset.y() + m_windowRect.y();
+ imageExpose.scaleX = 1;
+ imageExpose.scaleY = 1;
+ } else {
+ if (m_isTransparent) {
+ // On Maemo5, Flash expects the buffer to contain the contents that are below it.
+ // We don't support transparency for non-raster graphicssystem, so clean the image
+ // before giving to Flash.
+ QPainter imagePainter(&m_image);
+ imagePainter.fillRect(exposedRect, Qt::white);
+ }
+
+ imageExpose.data = reinterpret_cast<char*>(m_image.bits());
+ imageExpose.dataSize.width = m_image.width();
+ imageExpose.dataSize.height = m_image.height();
+ imageExpose.stride = m_image.bytesPerLine();
+ imageExpose.depth = m_image.depth();
+ imageExpose.translateX = 0;
+ imageExpose.translateY = 0;
+ imageExpose.scaleX = 1;
+ imageExpose.scaleY = 1;
+ }
+ imageExpose.x = exposedRect.x();
+ imageExpose.y = exposedRect.y();
+ imageExpose.width = exposedRect.width();
+ imageExpose.height = exposedRect.height();
+
+ XEvent xevent;
+ memset(&xevent, 0, sizeof(XEvent));
+ XGraphicsExposeEvent& exposeEvent = xevent.xgraphicsexpose;
+ exposeEvent.type = GraphicsExpose;
+ exposeEvent.display = 0;
+ exposeEvent.drawable = reinterpret_cast<XID>(&imageExpose);
+ exposeEvent.x = exposedRect.x();
+ exposeEvent.y = exposedRect.y();
+ exposeEvent.width = exposedRect.width();
+ exposeEvent.height = exposedRect.height();
+
+ dispatchNPEvent(xevent);
+
+ if (!surfaceHasUntransformedContents || !surface || surface->devType() != QInternal::Image)
+ painter->drawImage(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), m_image, exposedRect);
+}
+#endif
+
void PluginView::paint(GraphicsContext* context, const IntRect& rect)
{
if (!m_isStarted) {
@@ -166,19 +239,32 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
setNPWindowIfNeeded();
- if (m_isWindowed || !m_drawable)
+ if (m_isWindowed)
return;
- const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
+ if (!m_drawable
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ && m_image.isNull()
+#endif
+ )
+ return;
QPainter* painter = context->platformContext();
IntRect exposedRect(rect);
exposedRect.intersect(frameRect());
exposedRect.move(-frameRect().x(), -frameRect().y());
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ if (!m_image.isNull()) {
+ paintUsingImageSurfaceExtension(painter, exposedRect);
+ return;
+ }
+#endif
+
QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
ASSERT(drawableDepth == qtDrawable.depth());
+ const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
// When printing, Qt uses a QPicture to capture the output in preview mode. The
// QPicture holds a reference to the X Pixmap. As a result, the print preview would
@@ -576,6 +662,13 @@ bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPErr
*result = NPERR_NO_ERROR;
return true;
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ case NPNVSupportsWindowlessLocal:
+ *static_cast<NPBool*>(value) = true;
+ *result = NPERR_NO_ERROR;
+ return true;
+#endif
+
default:
return false;
}
@@ -651,7 +744,7 @@ static Display *getPluginDisplay()
// support gdk based plugins (like flash) that use a different X connection.
// The code below has the same effect as this one:
// Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
- QLibrary library("libgdk-x11-2.0");
+ QLibrary library("libgdk-x11-2.0.so.0");
if (!library.load())
return 0;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
index 665bf1b..63d9e55 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
@@ -22,9 +22,9 @@
#include <QtCore/qglobal.h>
-#define QTWEBKIT_VERSION_STR "2.0.0"
+#define QTWEBKIT_VERSION_STR "2.0.1"
// QTWEBKIT_VERSION is (major << 16) + (minor << 8) + patch. Similar to Qt.
-#define QTWEBKIT_VERSION 0x020000
+#define QTWEBKIT_VERSION 0x020001
// Use: #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 0, 0)). Similar to Qt.
#define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 5083ba5..c6c3d72 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,80 @@
+2010-09-12 Martin Smith <martin.smith@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ doc: Changed the title so lists of contents sort better.
+
+ * docs/qtwebkit.qdoc:
+
+2010-09-12 David Boddie <david.boddie@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: More work on the QML documentation.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-09-12 Martin Jones <martin.jones@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qml] Ensure WebView gets focus when an editable node is clicked on.
+
+ Task-number: QTBUG-13342
+
+ * declarative/qdeclarativewebview.cpp:
+ (GraphicsWebView::mousePressEvent):
+
+2010-09-12 David Boddie <david.boddie@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: qdoc fixes.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-09-12 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] let WebKit inject itself into the qt configuration
+
+ Task-number: QTBUG-12379
+
+ * qt_webkit_version.pri: Use the faster + instead of *
+ operator to add webkit to the config.
+
+2010-09-12 Martin Smith <martin.smith@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix group of declarative web view in QML docs.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-08-20 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Allow wmode=transparent in QWebView on Maemo5 after r65775.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2010-08-19 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Inject wmode=opaque for both QWebView and QGraphicsWebView on Maemo5
+ as Flash XEmbed support is flaky.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
2010-08-05 David Leong <david.leong@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 713fa39..dcbf614 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -4,7 +4,7 @@
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
* Coypright (C) 2008 Holger Hans Peter Freyther
- * Coypright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ * Coypright (C) 2009, 2010 Girish Ramakrishnan <girish@forwardbias.in>
*
* All rights reserved.
*
@@ -1349,7 +1349,19 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
Vector<String> values = paramValues;
if (mimeType == "application/x-shockwave-flash") {
QWebPageClient* client = m_webFrame->page()->d->client;
- if (!client || !qobject_cast<QWidget*>(client->pluginParent())) {
+ const bool isQWebView = client && qobject_cast<QWidget*>(client->pluginParent());
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ size_t wmodeIndex = params.find("wmode");
+ if (wmodeIndex == -1) {
+ // Disable XEmbed mode and force it to opaque mode
+ params.append("wmode");
+ values.append("opaque");
+ } else if (!isQWebView) {
+ // Disable transparency if client is not a QWebView
+ values[wmodeIndex] = "opaque";
+ }
+#else
+ if (!isQWebView) {
// inject wmode=opaque when there is no client or the client is not a QWebView
size_t wmodeIndex = params.find("wmode");
if (wmodeIndex == -1) {
@@ -1358,6 +1370,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
} else
values[wmodeIndex] = "opaque";
}
+#endif
}
RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url,
diff --git a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index 4594d1e..f2282f8 100644
--- a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
@@ -1,5 +1,5 @@
-QT_WEBKIT_VERSION = 4.7.0
+QT_WEBKIT_VERSION = 4.7.1
QT_WEBKIT_MAJOR_VERSION = 4
QT_WEBKIT_MINOR_VERSION = 7
-QT_WEBKIT_PATCH_VERSION = 0
+QT_WEBKIT_PATCH_VERSION = 1
QT_CONFIG += webkit
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index ca16b39..d8e7ea3 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -2730,6 +2730,19 @@ HRESULT WINAPI QAxServerBase::Load(IStream *pStm)
qtarray.resize(stat.cbSize.LowPart);
ULONG read;
pStm->Read(qtarray.data(), stat.cbSize.LowPart, &read);
+ } else if (hres == E_NOTIMPL) {
+ ULONG read = 0;
+ while (hres != S_FALSE) {
+ QByteArray arrayRead;
+ arrayRead.resize(4098);
+ hres = pStm->Read(arrayRead.data(), arrayRead.size(), &read);
+ if (hres != S_OK && hres != S_FALSE) {
+ qtarray.resize(0);
+ break;
+ } else if (read == 0)
+ break;
+ qtarray.append(arrayRead);
+ }
}
const QMetaObject *mo = qt.object->metaObject();
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index 0cfc7eb..957733e 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -52,7 +52,7 @@
#include <qobject.h>
#ifdef QAX_SERVER
# include <qaxfactory.h>
-# include <qlibrary.h>
+# include <private/qsystemlibrary_p.h>
#else
# include <quuid.h>
# include <qaxobject.h>
@@ -666,7 +666,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
static bool resolved = false;
if (!resolved) {
resolved = true;
- pGetRecordInfoFromTypeInfo = (PGetRecordInfoFromTypeInfo)QLibrary::resolve(QLatin1String("oleaut32"),
+ pGetRecordInfoFromTypeInfo = (PGetRecordInfoFromTypeInfo)QSystemLibrary::resolve(QLatin1String("oleaut32"),
"GetRecordInfoFromTypeInfo");
}
if (!pGetRecordInfoFromTypeInfo)
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 68702c4..3952836 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -92,6 +92,7 @@ Qt {
Q_ENUMS(ConnectionType)
#ifndef QT_NO_GESTURES
Q_ENUMS(GestureState)
+ Q_ENUMS(GestureType)
#endif
#endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN))
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index e54d95e..fcd17f7 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -82,20 +82,69 @@ static QString driveSpec(const QString &path)
//************* QDirPrivate
class QDirPrivate
+ : public QSharedData
{
- friend struct QScopedPointerDeleter<QDirPrivate>;
-
public:
- QDirPrivate(const QDir *copy = 0);
- ~QDirPrivate();
-
- void updateFileLists() const;
- void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *) const;
+ QDirPrivate(const QString &path,
+ const QStringList &nameFilters_ = QStringList(),
+ QDir::SortFlags sort_ = QDir::SortFlags(QDir::Name | QDir::IgnoreCase),
+ QDir::Filters filters_ = QDir::AllEntries)
+ : QSharedData()
+ , nameFilters(nameFilters_)
+ , sort(sort_)
+ , filters(filters_)
+#ifdef QT3_SUPPORT
+ , filterSepChar(0)
+ , matchAllDirs(false)
+#endif
+ , fileListsInitialized(false)
+ {
+ setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
+
+ bool empty = nameFilters.isEmpty();
+ if (!empty) {
+ empty = true;
+ for (int i = 0; i < nameFilters.size(); ++i) {
+ if (!nameFilters.at(i).isEmpty()) {
+ empty = false;
+ break;
+ }
+ }
+ }
+ if (empty)
+ nameFilters = QStringList(QString::fromLatin1("*"));
+ }
+ QDirPrivate(const QDirPrivate &copy)
+ : QSharedData(copy)
+ , path(copy.path)
+ , nameFilters(copy.nameFilters)
+ , sort(copy.sort)
+ , filters(copy.filters)
#ifdef QT3_SUPPORT
- QChar filterSepChar;
- bool matchAllDirs;
+ , filterSepChar(copy.filterSepChar)
+ , matchAllDirs(copy.matchAllDirs)
#endif
+ , fileListsInitialized(false)
+ {
+ }
+
+ bool exists() const
+ {
+ const QAbstractFileEngine::FileFlags info =
+ fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
+ | QAbstractFileEngine::ExistsFlag
+ | QAbstractFileEngine::Refresh);
+ if (!(info & QAbstractFileEngine::DirectoryType))
+ return false;
+ return info & QAbstractFileEngine::ExistsFlag;
+ }
+
+ void initFileEngine();
+ void initFileLists() const;
+
+ static void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *);
+
static inline QChar getFilterSepChar(const QString &nameFilter)
{
QChar sep(QLatin1Char(';'));
@@ -104,7 +153,9 @@ public:
sep = QChar(QLatin1Char(' '));
return sep;
}
- static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0) {
+
+ static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0)
+ {
if (sep == 0)
sep = getFilterSepChar(nameFilter);
QStringList ret = nameFilter.split(sep);
@@ -113,80 +164,46 @@ public:
return ret;
}
- struct Data {
- inline Data()
- : ref(1), fileEngine(0), listsDirty(1)
- {}
- inline Data(const Data &copy)
- : ref(1), path(copy.path), nameFilters(copy.nameFilters), sort(copy.sort),
- filters(copy.filters), fileEngine(0), listsDirty(1)
- {}
- inline ~Data()
- { delete fileEngine; }
-
- inline void clear() {
- listsDirty = 1;
- files.clear();
- fileInfos.clear();
- }
- mutable QAtomicInt ref;
-
- QString path;
- QStringList nameFilters;
- QDir::SortFlags sort;
- QDir::Filters filters;
-
- mutable QAbstractFileEngine *fileEngine;
-
- mutable uint listsDirty : 1;
- mutable QStringList files;
- mutable QFileInfoList fileInfos;
- } *data;
- inline void setPath(const QString &p)
+ inline void setPath(QString p)
{
- detach(false);
- QString path = p;
- if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\')))
- && path.length() > 1) {
+ if ((p.endsWith(QLatin1Char('/')) || p.endsWith(QLatin1Char('\\')))
+ && p.length() > 1) {
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
- if (!(path.length() == 3 && path.at(1) == QLatin1Char(':')))
+ if (!(p.length() == 3 && p.at(1) == QLatin1Char(':')))
#endif
- path.truncate(path.length() - 1);
+ p.truncate(p.length() - 1);
}
- delete data->fileEngine;
- data->fileEngine = QAbstractFileEngine::create(path);
+ path = p;
+ initFileEngine();
// set the path to be the qt friendly version so then we can operate on it using just /
- data->path = data->fileEngine->fileName(QAbstractFileEngine::DefaultName);
- data->clear();
+ path = fileEngine->fileName(QAbstractFileEngine::DefaultName);
+ clearFileLists();
}
- inline void reset() {
- detach();
- data->clear();
+
+ inline void clearFileLists() {
+ fileListsInitialized = false;
+ files.clear();
+ fileInfos.clear();
}
- void detach(bool createFileEngine = true);
-};
-QDirPrivate::QDirPrivate(const QDir *copy)
+ QString path;
+ QStringList nameFilters;
+ QDir::SortFlags sort;
+ QDir::Filters filters;
+
#ifdef QT3_SUPPORT
- : filterSepChar(0), matchAllDirs(false)
+ QChar filterSepChar;
+ bool matchAllDirs;
#endif
-{
- if (copy) {
- copy->d_func()->data->ref.ref();
- data = copy->d_func()->data;
- } else {
- data = new QDirPrivate::Data;
- }
-}
-QDirPrivate::~QDirPrivate()
-{
- if (!data->ref.deref())
- delete data;
- data = 0;
-}
+ QScopedPointer<QAbstractFileEngine> fileEngine;
+
+ mutable bool fileListsInitialized;
+ mutable QStringList files;
+ mutable QFileInfoList fileInfos;
+};
/* For sorting */
struct QDirSortItem
@@ -269,7 +286,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt
}
inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
- QStringList *names, QFileInfoList *infos) const
+ QStringList *names, QFileInfoList *infos)
{
// names and infos are always empty lists or 0 here
int n = l.size();
@@ -299,28 +316,23 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
}
}
-inline void QDirPrivate::updateFileLists() const
+inline void QDirPrivate::initFileLists() const
{
- if (data->listsDirty) {
+ if (!fileListsInitialized) {
QFileInfoList l;
- QDirIterator it(data->path, data->nameFilters, data->filters);
+ QDirIterator it(path, nameFilters, filters);
while (it.hasNext()) {
it.next();
l.append(it.fileInfo());
}
- sortFileList(data->sort, l, &data->files, &data->fileInfos);
- data->listsDirty = 0;
+ sortFileList(sort, l, &files, &fileInfos);
+ fileListsInitialized = true;
}
}
-void QDirPrivate::detach(bool createFileEngine)
+inline void QDirPrivate::initFileEngine()
{
- qAtomicDetach(data);
- if (createFileEngine) {
- QAbstractFileEngine *newFileEngine = QAbstractFileEngine::create(data->path);
- delete data->fileEngine;
- data->fileEngine = newFileEngine;
- }
+ fileEngine.reset(QAbstractFileEngine::create(path));
}
/*!
@@ -504,13 +516,8 @@ void QDirPrivate::detach(bool createFileEngine)
\sa currentPath()
*/
-QDir::QDir(const QString &path) : d_ptr(new QDirPrivate)
+QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(path))
{
- Q_D(QDir);
- d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
- d->data->nameFilters = QStringList(QString::fromLatin1("*"));
- d->data->filters = AllEntries;
- d->data->sort = SortFlags(Name | IgnoreCase);
}
/*!
@@ -532,25 +539,9 @@ QDir::QDir(const QString &path) : d_ptr(new QDirPrivate)
\sa exists(), setPath(), setNameFilter(), setFilter(), setSorting()
*/
QDir::QDir(const QString &path, const QString &nameFilter,
- SortFlags sort, Filters filters) : d_ptr(new QDirPrivate)
-{
- Q_D(QDir);
- d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
- d->data->nameFilters = QDir::nameFiltersFromString(nameFilter);
- bool empty = d->data->nameFilters.isEmpty();
- if (!empty) {
- empty = true;
- for (int i = 0; i < d->data->nameFilters.size(); ++i) {
- if (!d->data->nameFilters.at(i).isEmpty()) {
- empty = false;
- break;
- }
- }
- }
- if (empty)
- d->data->nameFilters = QStringList(QString::fromLatin1("*"));
- d->data->sort = sort;
- d->data->filters = filters;
+ SortFlags sort, Filters filters)
+ : d_ptr(new QDirPrivate(path, QDir::nameFiltersFromString(nameFilter), sort, filters))
+{
}
/*!
@@ -559,7 +550,8 @@ QDir::QDir(const QString &path, const QString &nameFilter,
\sa operator=()
*/
-QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(&dir))
+QDir::QDir(const QDir &dir)
+ : d_ptr(dir.d_ptr)
{
}
@@ -589,8 +581,7 @@ QDir::~QDir()
*/
void QDir::setPath(const QString &path)
{
- Q_D(QDir);
- d->setPath(path);
+ d_ptr->setPath(path);
}
/*!
@@ -605,8 +596,8 @@ void QDir::setPath(const QString &path)
*/
QString QDir::path() const
{
- Q_D(const QDir);
- return d->data->path;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->path;
}
/*!
@@ -619,8 +610,8 @@ QString QDir::path() const
*/
QString QDir::absolutePath() const
{
- Q_D(const QDir);
- QString ret = d->data->path;
+ const QDirPrivate* d = d_ptr.constData();
+ QString ret = d->path;
if (QDir::isRelativePath(ret))
ret = absoluteFilePath(QString::fromLatin1(""));
return cleanPath(ret);
@@ -644,11 +635,7 @@ QString QDir::absolutePath() const
*/
QString QDir::canonicalPath() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return QLatin1String("");
- return cleanPath(d->data->fileEngine->fileName(QAbstractFileEngine::CanonicalName));
+ return cleanPath(d_ptr->fileEngine->fileName(QAbstractFileEngine::CanonicalName));
}
/*!
@@ -664,11 +651,11 @@ QString QDir::canonicalPath() const
*/
QString QDir::dirName() const
{
- Q_D(const QDir);
- int pos = d->data->path.lastIndexOf(QLatin1Char('/'));
+ const QDirPrivate* d = d_ptr.constData();
+ int pos = d->path.lastIndexOf(QLatin1Char('/'));
if (pos == -1)
- return d->data->path;
- return d->data->path.mid(pos + 1);
+ return d->path;
+ return d->path.mid(pos + 1);
}
/*!
@@ -682,11 +669,11 @@ QString QDir::dirName() const
*/
QString QDir::filePath(const QString &fileName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (isAbsolutePath(fileName))
return QString(fileName);
- QString ret = d->data->path;
+ QString ret = d->path;
if (!fileName.isEmpty()) {
if (!ret.isEmpty() && ret[(int)ret.length()-1] != QLatin1Char('/') && fileName[0] != QLatin1Char('/'))
ret += QLatin1Char('/');
@@ -705,21 +692,19 @@ QString QDir::filePath(const QString &fileName) const
*/
QString QDir::absoluteFilePath(const QString &fileName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (isAbsolutePath(fileName))
return fileName;
- if (!d->data->fileEngine)
- return fileName;
QString ret;
#ifndef QT_NO_FSFILEENGINE
- if (isRelativePath(d->data->path)) //get pwd
+ if (isRelativePath(d->path)) //get pwd
ret = QFSFileEngine::currentPath(fileName);
#endif
- if (!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) {
+ if (!d->path.isEmpty() && d->path != QLatin1String(".")) {
if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
ret += QLatin1Char('/');
- ret += d->data->path;
+ ret += d->path;
}
if (!fileName.isEmpty()) {
if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
@@ -867,11 +852,12 @@ QString QDir::fromNativeSeparators(const QString &pathName)
*/
bool QDir::cd(const QString &dirName)
{
- Q_D(QDir);
+ // Don't detach just yet.
+ const QDirPrivate * const d = d_ptr.constData();
if (dirName.isEmpty() || dirName == QLatin1String("."))
return true;
- QString newPath = d->data->path;
+ QString newPath = d->path;
if (isAbsolutePath(dirName)) {
newPath = cleanPath(dirName);
} else {
@@ -884,7 +870,7 @@ bool QDir::cd(const QString &dirName)
newPath += dirName;
if (dirName.indexOf(QLatin1Char('/')) >= 0
- || d->data->path == QLatin1String(".")
+ || d->path == QLatin1String(".")
|| dirName == QLatin1String("..")) {
newPath = cleanPath(newPath);
/*
@@ -901,12 +887,13 @@ bool QDir::cd(const QString &dirName)
}
}
- QDir dir(*this);
- dir.setPath(newPath);
- if (!dir.exists())
+ QScopedPointer<QDirPrivate> dir(new QDirPrivate(*d_ptr.constData()));
+ dir->setPath(newPath);
+
+ if (!dir->exists())
return false;
- *this = dir;
+ d_ptr = dir.take();
return true;
}
@@ -930,9 +917,8 @@ bool QDir::cdUp()
*/
QStringList QDir::nameFilters() const
{
- Q_D(const QDir);
-
- return d->data->nameFilters;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->nameFilters;
}
/*!
@@ -952,10 +938,11 @@ QStringList QDir::nameFilters() const
*/
void QDir::setNameFilters(const QStringList &nameFilters)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
- d->data->nameFilters = nameFilters;
+ d->nameFilters = nameFilters;
}
/*!
@@ -1058,9 +1045,8 @@ QStringList QDir::searchPaths(const QString &prefix)
*/
QDir::Filters QDir::filter() const
{
- Q_D(const QDir);
-
- return d->data->filters;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->filters;
}
/*!
@@ -1141,10 +1127,11 @@ QDir::Filters QDir::filter() const
*/
void QDir::setFilter(Filters filters)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
- d->data->filters = filters;
+ d->filters = filters;
}
/*!
@@ -1154,9 +1141,8 @@ void QDir::setFilter(Filters filters)
*/
QDir::SortFlags QDir::sorting() const
{
- Q_D(const QDir);
-
- return d->data->sort;
+ const QDirPrivate* d = d_ptr.constData();
+ return d->sort;
}
/*!
@@ -1199,10 +1185,11 @@ QDir::SortFlags QDir::sorting() const
*/
void QDir::setSorting(SortFlags sort)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
- d->data->sort = sort;
+ d->sort = sort;
}
/*!
@@ -1214,10 +1201,9 @@ void QDir::setSorting(SortFlags sort)
*/
uint QDir::count() const
{
- Q_D(const QDir);
-
- d->updateFileLists();
- return d->data->files.count();
+ const QDirPrivate* d = d_ptr.constData();
+ d->initFileLists();
+ return d->files.count();
}
/*!
@@ -1229,10 +1215,9 @@ uint QDir::count() const
*/
QString QDir::operator[](int pos) const
{
- Q_D(const QDir);
-
- d->updateFileLists();
- return d->data->files[pos];
+ const QDirPrivate* d = d_ptr.constData();
+ d->initFileLists();
+ return d->files[pos];
}
/*!
@@ -1256,9 +1241,8 @@ QString QDir::operator[](int pos) const
*/
QStringList QDir::entryList(Filters filters, SortFlags sort) const
{
- Q_D(const QDir);
-
- return entryList(d->data->nameFilters, filters, sort);
+ const QDirPrivate* d = d_ptr.constData();
+ return entryList(d->nameFilters, filters, sort);
}
@@ -1280,9 +1264,8 @@ QStringList QDir::entryList(Filters filters, SortFlags sort) const
*/
QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const
{
- Q_D(const QDir);
-
- return entryInfoList(d->data->nameFilters, filters, sort);
+ const QDirPrivate* d = d_ptr.constData();
+ return entryInfoList(d->nameFilters, filters, sort);
}
/*!
@@ -1304,24 +1287,24 @@ QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const
QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
SortFlags sort) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (filters == NoFilter)
- filters = d->data->filters;
+ filters = d->filters;
#ifdef QT3_SUPPORT
if (d->matchAllDirs)
filters |= AllDirs;
#endif
if (sort == NoSort)
- sort = d->data->sort;
+ sort = d->sort;
- if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) {
- d->updateFileLists();
- return d->data->files;
+ if (filters == d->filters && sort == d->sort && nameFilters == d->nameFilters) {
+ d->initFileLists();
+ return d->files;
}
QFileInfoList l;
- QDirIterator it(d->data->path, nameFilters, filters);
+ QDirIterator it(d->path, nameFilters, filters);
while (it.hasNext()) {
it.next();
l.append(it.fileInfo());
@@ -1350,24 +1333,24 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filters,
SortFlags sort) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (filters == NoFilter)
- filters = d->data->filters;
+ filters = d->filters;
#ifdef QT3_SUPPORT
if (d->matchAllDirs)
filters |= AllDirs;
#endif
if (sort == NoSort)
- sort = d->data->sort;
+ sort = d->sort;
- if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) {
- d->updateFileLists();
- return d->data->fileInfos;
+ if (filters == d->filters && sort == d->sort && nameFilters == d->nameFilters) {
+ d->initFileLists();
+ return d->fileInfos;
}
QFileInfoList l;
- QDirIterator it(d->data->path, nameFilters, filters);
+ QDirIterator it(d->path, nameFilters, filters);
while (it.hasNext()) {
it.next();
l.append(it.fileInfo());
@@ -1386,17 +1369,15 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
*/
bool QDir::mkdir(const QString &dirName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirName.isEmpty()) {
qWarning("QDir::mkdir: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirName);
- return d->data->fileEngine->mkdir(fn, false);
+ return d->fileEngine->mkdir(fn, false);
}
/*!
@@ -1410,17 +1391,15 @@ bool QDir::mkdir(const QString &dirName) const
*/
bool QDir::rmdir(const QString &dirName) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirName.isEmpty()) {
qWarning("QDir::rmdir: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirName);
- return d->data->fileEngine->rmdir(fn, false);
+ return d->fileEngine->rmdir(fn, false);
}
/*!
@@ -1435,17 +1414,15 @@ bool QDir::rmdir(const QString &dirName) const
*/
bool QDir::mkpath(const QString &dirPath) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirPath.isEmpty()) {
qWarning("QDir::mkpath: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirPath);
- return d->data->fileEngine->mkdir(fn, true);
+ return d->fileEngine->mkdir(fn, true);
}
/*!
@@ -1461,17 +1438,15 @@ bool QDir::mkpath(const QString &dirPath) const
*/
bool QDir::rmpath(const QString &dirPath) const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
if (dirPath.isEmpty()) {
qWarning("QDir::rmpath: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QString fn = filePath(dirPath);
- return d->data->fileEngine->rmdir(fn, true);
+ return d->fileEngine->rmdir(fn, true);
}
/*!
@@ -1485,12 +1460,10 @@ bool QDir::rmpath(const QString &dirPath) const
*/
bool QDir::isReadable() const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
- if (!d->data->fileEngine)
- return false;
const QAbstractFileEngine::FileFlags info =
- d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
+ d->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
| QAbstractFileEngine::PermsMask);
if (!(info & QAbstractFileEngine::DirectoryType))
return false;
@@ -1510,17 +1483,7 @@ bool QDir::isReadable() const
*/
bool QDir::exists() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return false;
- const QAbstractFileEngine::FileFlags info =
- d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
- | QAbstractFileEngine::ExistsFlag
- | QAbstractFileEngine::Refresh);
- if (!(info & QAbstractFileEngine::DirectoryType))
- return false;
- return info & QAbstractFileEngine::ExistsFlag;
+ return d_ptr->exists();
}
/*!
@@ -1537,11 +1500,7 @@ bool QDir::exists() const
*/
bool QDir::isRoot() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return true;
- return d->data->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
+ return d_ptr->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
}
/*!
@@ -1571,11 +1530,7 @@ bool QDir::isRoot() const
*/
bool QDir::isRelative() const
{
- Q_D(const QDir);
-
- if (!d->data->fileEngine)
- return false;
- return d->data->fileEngine->isRelativePath();
+ return d_ptr->fileEngine->isRelativePath();
}
@@ -1588,18 +1543,17 @@ bool QDir::isRelative() const
*/
bool QDir::makeAbsolute() // ### What do the return values signify?
{
- Q_D(QDir);
-
- if (!d->data->fileEngine)
- return false;
- QString absolutePath = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
+ QString absolutePath = d_ptr.constData()->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
if (QDir::isRelativePath(absolutePath))
return false;
- d->detach();
- d->data->path = absolutePath;
- d->data->fileEngine->setFileName(absolutePath);
- if (!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType))
+
+ QScopedPointer<QDirPrivate> dir(new QDirPrivate(*d_ptr.constData()));
+ dir->setPath(absolutePath);
+
+ if (!(dir->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType))
return false;
+
+ d_ptr = dir.take();
return true;
}
@@ -1614,19 +1568,18 @@ bool QDir::makeAbsolute() // ### What do the return values signify?
*/
bool QDir::operator==(const QDir &dir) const
{
- const QDirPrivate *d = d_func();
- const QDirPrivate *other = dir.d_func();
+ const QDirPrivate *d = d_ptr.constData();
+ const QDirPrivate *other = dir.d_ptr.constData();
- if (d->data == other->data)
+ if (d == other)
return true;
- Q_ASSERT(d->data->fileEngine && other->data->fileEngine);
- if (d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive())
+ if (d->fileEngine->caseSensitive() != other->fileEngine->caseSensitive())
return false;
- if (d->data->filters == other->data->filters
- && d->data->sort == other->data->sort
- && d->data->nameFilters == other->data->nameFilters) {
+ if (d->filters == other->filters
+ && d->sort == other->sort
+ && d->nameFilters == other->nameFilters) {
QString dir1 = absolutePath(), dir2 = dir.absolutePath();
- if (!other->data->fileEngine->caseSensitive())
+ if (!other->fileEngine->caseSensitive())
return (dir1.toLower() == dir2.toLower());
return (dir1 == dir2);
@@ -1641,11 +1594,7 @@ bool QDir::operator==(const QDir &dir) const
*/
QDir &QDir::operator=(const QDir &dir)
{
- if (this == &dir)
- return *this;
-
- Q_D(QDir);
- qAtomicAssign(d->data, dir.d_func()->data);
+ d_ptr = dir.d_ptr;
return *this;
}
@@ -1659,9 +1608,7 @@ QDir &QDir::operator=(const QDir &dir)
*/
QDir &QDir::operator=(const QString &path)
{
- Q_D(QDir);
-
- d->setPath(path);
+ d_ptr->setPath(path);
return *this;
}
@@ -1705,14 +1652,10 @@ bool QDir::remove(const QString &fileName)
*/
bool QDir::rename(const QString &oldName, const QString &newName)
{
- Q_D(QDir);
-
if (oldName.isEmpty() || newName.isEmpty()) {
qWarning("QDir::rename: Empty or null file name(s)");
return false;
}
- if (!d->data->fileEngine)
- return false;
QFile file(filePath(oldName));
if (!file.exists())
@@ -2150,9 +2093,9 @@ bool QDir::isRelativePath(const QString &path)
*/
void QDir::refresh() const
{
- Q_D(const QDir);
-
- const_cast<QDirPrivate *>(d)->reset();
+ QDirPrivate *d = const_cast<QDir*>(this)->d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
}
/*!
@@ -2228,7 +2171,7 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter)
*/
bool QDir::matchAllDirs() const
{
- Q_D(const QDir);
+ const QDirPrivate* d = d_ptr.constData();
return d->matchAllDirs;
}
@@ -2240,9 +2183,10 @@ bool QDir::matchAllDirs() const
*/
void QDir::setMatchAllDirs(bool on)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
- d->reset();
d->matchAllDirs = on;
}
@@ -2251,8 +2195,7 @@ void QDir::setMatchAllDirs(bool on)
*/
QString QDir::nameFilter() const
{
- Q_D(const QDir);
-
+ const QDirPrivate* d = d_ptr.constData();
return nameFilters().join(QString(d->filterSepChar));
}
@@ -2278,10 +2221,12 @@ QString QDir::nameFilter() const
*/
void QDir::setNameFilter(const QString &nameFilter)
{
- Q_D(QDir);
+ QDirPrivate* d = d_ptr.data();
+ d->initFileEngine();
+ d->clearFileLists();
d->filterSepChar = QDirPrivate::getFilterSepChar(nameFilter);
- setNameFilters(QDirPrivate::splitFilters(nameFilter, d->filterSepChar));
+ d->nameFilters = QDirPrivate::splitFilters(nameFilter, d->filterSepChar);
}
/*!
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index 28da271..7e5fbac 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -45,7 +45,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qstringlist.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qshareddata.h>
QT_BEGIN_HEADER
@@ -58,9 +58,8 @@ class QDirPrivate;
class Q_CORE_EXPORT QDir
{
protected:
- QScopedPointer<QDirPrivate> d_ptr;
-private:
- Q_DECLARE_PRIVATE(QDir)
+ QSharedDataPointer<QDirPrivate> d_ptr;
+
public:
enum Filter { Dirs = 0x001,
Files = 0x002,
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 61f7180..7eca212 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -47,59 +47,27 @@
QT_BEGIN_NAMESPACE
-QFileInfoPrivate::QFileInfoPrivate(const QFileInfo *copy)
-{
- if (copy) {
- copy->d_func()->data->ref.ref();
- data = copy->d_func()->data;
- } else {
- data = new QFileInfoPrivate::Data;
- }
-}
-
-QFileInfoPrivate::~QFileInfoPrivate()
-{
- if (!data->ref.deref())
- delete data;
- data = 0;
-}
-
-void QFileInfoPrivate::initFileEngine(const QString &file)
-{
- detach();
- delete data->fileEngine;
- data->fileEngine = 0;
- data->clear();
- data->fileEngine = QAbstractFileEngine::create(file);
- data->fileName = file;
-}
-
-void QFileInfoPrivate::detach()
-{
- qAtomicDetach(data);
-}
-
QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
{
- if (data->cache_enabled && !data->fileNames[(int)name].isNull())
- return data->fileNames[(int)name];
- QString ret = data->fileEngine->fileName(name);
+ if (cache_enabled && !fileNames[(int)name].isNull())
+ return fileNames[(int)name];
+ QString ret = fileEngine->fileName(name);
if (ret.isNull())
ret = QLatin1String("");
- if (data->cache_enabled)
- data->fileNames[(int)name] = ret;
+ if (cache_enabled)
+ fileNames[(int)name] = ret;
return ret;
}
QString QFileInfoPrivate::getFileOwner(QAbstractFileEngine::FileOwner own) const
{
- if (data->cache_enabled && !data->fileOwners[(int)own].isNull())
- return data->fileOwners[(int)own];
- QString ret = data->fileEngine->owner(own);
+ if (cache_enabled && !fileOwners[(int)own].isNull())
+ return fileOwners[(int)own];
+ QString ret = fileEngine->owner(own);
if (ret.isNull())
ret = QLatin1String("");
- if (data->cache_enabled)
- data->fileOwners[(int)own] = ret;
+ if (cache_enabled)
+ fileOwners[(int)own] = ret;
return ret;
}
@@ -118,7 +86,7 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
uint cachedFlags = 0;
if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) {
- if (!data->getCachedFlag(CachedFileFlags)) {
+ if (!getCachedFlag(CachedFileFlags)) {
req |= QAbstractFileEngine::FlagsMask;
req |= QAbstractFileEngine::TypesMask;
req &= (~QAbstractFileEngine::LinkType);
@@ -128,14 +96,14 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
}
if (request & QAbstractFileEngine::LinkType) {
- if (!data->getCachedFlag(CachedLinkTypeFlag)) {
+ if (!getCachedFlag(CachedLinkTypeFlag)) {
req |= QAbstractFileEngine::LinkType;
cachedFlags |= CachedLinkTypeFlag;
}
}
if (request & QAbstractFileEngine::BundleType) {
- if (!data->getCachedFlag(CachedBundleTypeFlag)) {
+ if (!getCachedFlag(CachedBundleTypeFlag)) {
req |= QAbstractFileEngine::BundleType;
cachedFlags |= CachedBundleTypeFlag;
}
@@ -143,30 +111,30 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
}
if (request & QAbstractFileEngine::PermsMask) {
- if (!data->getCachedFlag(CachedPerms)) {
+ if (!getCachedFlag(CachedPerms)) {
req |= QAbstractFileEngine::PermsMask;
cachedFlags |= CachedPerms;
}
}
if (req) {
- if (data->cache_enabled)
+ if (cache_enabled)
req &= (~QAbstractFileEngine::Refresh);
else
req |= QAbstractFileEngine::Refresh;
- QAbstractFileEngine::FileFlags flags = data->fileEngine->fileFlags(req);
- data->fileFlags |= uint(flags);
- data->setCachedFlag(cachedFlags);
+ QAbstractFileEngine::FileFlags flags = fileEngine->fileFlags(req);
+ fileFlags |= uint(flags);
+ setCachedFlag(cachedFlags);
}
- return data->fileFlags & request;
+ return fileFlags & request;
}
QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const
{
- if (!data->cache_enabled)
- data->clearFlags();
+ if (!cache_enabled)
+ clearFlags();
uint cf;
if (request == QAbstractFileEngine::CreationTime)
cf = CachedCTime;
@@ -174,11 +142,11 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
cf = CachedMTime;
else
cf = CachedATime;
- if (!data->getCachedFlag(cf)) {
- data->fileTimes[request] = data->fileEngine->fileTime(request);
- data->setCachedFlag(cf);
+ if (!getCachedFlag(cf)) {
+ fileTimes[request] = fileEngine->fileTime(request);
+ setCachedFlag(cf);
}
- return data->fileTimes[request];
+ return fileTimes[request];
}
//************* QFileInfo
@@ -285,9 +253,8 @@ QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate())
\sa setFile(), isRelative(), QDir::setCurrent(), QDir::isRelativePath()
*/
-QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate())
+QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate(file))
{
- d_ptr->initFileEngine(file);
}
/*!
@@ -299,9 +266,8 @@ QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate())
\sa isRelative()
*/
-QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate())
+QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate(file.fileName()))
{
- d_ptr->initFileEngine(file.fileName());
}
/*!
@@ -316,15 +282,16 @@ QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate())
\sa isRelative()
*/
-QFileInfo::QFileInfo(const QDir &dir, const QString &file) : d_ptr(new QFileInfoPrivate())
+QFileInfo::QFileInfo(const QDir &dir, const QString &file)
+ : d_ptr(new QFileInfoPrivate(dir.filePath(file)))
{
- d_ptr->initFileEngine(dir.filePath(file));
}
/*!
Constructs a new QFileInfo that is a copy of the given \a fileinfo.
*/
-QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fileinfo))
+QFileInfo::QFileInfo(const QFileInfo &fileinfo)
+ : d_ptr(fileinfo.d_ptr)
{
}
@@ -359,17 +326,17 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
Q_D(const QFileInfo);
// ### Qt 5: understand long and short file names on Windows
// ### (GetFullPathName()).
- if (fileinfo.d_func()->data == d->data)
+ if (fileinfo.d_ptr == d_ptr)
return true;
- if (!d->data->fileEngine || !fileinfo.d_func()->data->fileEngine)
+ if (d->isDefaultConstructed || fileinfo.d_ptr->isDefaultConstructed)
return false;
- if (d->data->fileEngine->caseSensitive() != fileinfo.d_func()->data->fileEngine->caseSensitive())
+ if (d->fileEngine->caseSensitive() != fileinfo.d_ptr->fileEngine->caseSensitive())
return false;
if (fileinfo.size() == size()) { //if the size isn't the same...
QString file1 = canonicalFilePath(),
file2 = fileinfo.canonicalFilePath();
if (file1.length() == file2.length()) {
- if (!fileinfo.d_func()->data->fileEngine->caseSensitive()) {
+ if (!fileinfo.d_ptr->fileEngine->caseSensitive()) {
for (int i = 0; i < file1.length(); i++) {
if (file1.at(i).toLower() != file2.at(i).toLower())
return false;
@@ -407,8 +374,7 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo)
*/
QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
{
- Q_D(QFileInfo);
- qAtomicAssign(d->data, fileinfo.d_func()->data);
+ d_ptr = fileinfo.d_ptr;
return *this;
}
@@ -429,7 +395,9 @@ QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
*/
void QFileInfo::setFile(const QString &file)
{
+ bool caching = d_ptr.constData()->cache_enabled;
*this = QFileInfo(file);
+ d_ptr->cache_enabled = caching;
}
/*!
@@ -445,7 +413,7 @@ void QFileInfo::setFile(const QString &file)
*/
void QFileInfo::setFile(const QFile &file)
{
- *this = QFileInfo(file.fileName());
+ setFile(file.fileName());
}
/*!
@@ -461,7 +429,7 @@ void QFileInfo::setFile(const QFile &file)
*/
void QFileInfo::setFile(const QDir &dir, const QString &file)
{
- *this = QFileInfo(dir.filePath(file));
+ setFile(dir.filePath(file));
}
/*!
@@ -488,7 +456,7 @@ void QFileInfo::setFile(const QDir &dir, const QString &file)
QString QFileInfo::absoluteFilePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::AbsoluteName);
}
@@ -505,7 +473,7 @@ QString QFileInfo::absoluteFilePath() const
QString QFileInfo::canonicalFilePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::CanonicalName);
}
@@ -532,9 +500,9 @@ QString QFileInfo::absolutePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine) {
+ if (d->isDefaultConstructed) {
return QLatin1String("");
- } else if (d->data->fileName.isEmpty()) {
+ } else if (d->fileName.isEmpty()) {
qWarning("QFileInfo::absolutePath: Constructed with empty filename");
return QLatin1String("");
}
@@ -552,7 +520,7 @@ QString QFileInfo::absolutePath() const
QString QFileInfo::canonicalPath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::CanonicalPathName);
}
@@ -569,7 +537,7 @@ QString QFileInfo::canonicalPath() const
QString QFileInfo::path() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::PathName);
}
@@ -593,9 +561,9 @@ QString QFileInfo::path() const
bool QFileInfo::isRelative() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return true;
- return d->data->fileEngine->isRelativePath();
+ return d->fileEngine->isRelativePath();
}
/*!
@@ -607,11 +575,13 @@ bool QFileInfo::isRelative() const
*/
bool QFileInfo::makeAbsolute()
{
- Q_D(QFileInfo);
- if (!d->data->fileEngine || !d->data->fileEngine->isRelativePath())
+ if (d_ptr.constData()->isDefaultConstructed
+ || !d_ptr.constData()->fileEngine->isRelativePath())
return false;
- QString absFileName = d->getFileName(QAbstractFileEngine::AbsoluteName);
- d->initFileEngine(absFileName);
+ QString absFileName = d_ptr.constData()->getFileName(QAbstractFileEngine::AbsoluteName);
+ // QSharedDataPointer::operator->() will detach.
+
+ setFile(absFileName);
return true;
}
@@ -624,7 +594,7 @@ bool QFileInfo::makeAbsolute()
bool QFileInfo::exists() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::ExistsFlag);
}
@@ -639,7 +609,7 @@ bool QFileInfo::exists() const
void QFileInfo::refresh()
{
Q_D(QFileInfo);
- d->reset();
+ d->clear();
}
/*!
@@ -651,7 +621,7 @@ void QFileInfo::refresh()
QString QFileInfo::filePath() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::DefaultName);
}
@@ -670,7 +640,7 @@ QString QFileInfo::filePath() const
QString QFileInfo::fileName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::BaseName);
}
@@ -690,7 +660,7 @@ QString QFileInfo::fileName() const
QString QFileInfo::bundleName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::BundleName);
}
@@ -714,7 +684,7 @@ QString QFileInfo::bundleName() const
QString QFileInfo::baseName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::BaseName).section(QLatin1Char('.'), 0, 0);
}
@@ -733,7 +703,7 @@ QString QFileInfo::baseName() const
QString QFileInfo::completeBaseName() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
QString name = d->getFileName(QAbstractFileEngine::BaseName);
int index = name.lastIndexOf(QLatin1Char('.'));
@@ -754,7 +724,7 @@ QString QFileInfo::completeBaseName() const
QString QFileInfo::completeSuffix() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
QString fileName = d->getFileName(QAbstractFileEngine::BaseName);
int firstDot = fileName.indexOf(QLatin1Char('.'));
@@ -781,7 +751,7 @@ QString QFileInfo::completeSuffix() const
QString QFileInfo::suffix() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
QString fileName = d->getFileName(QAbstractFileEngine::BaseName);
int lastDot = fileName.lastIndexOf(QLatin1Char('.'));
@@ -846,7 +816,7 @@ QDir QFileInfo::dir(bool absPath) const
bool QFileInfo::isReadable() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::ReadUserPerm);
}
@@ -859,7 +829,7 @@ bool QFileInfo::isReadable() const
bool QFileInfo::isWritable() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::WriteUserPerm);
}
@@ -872,7 +842,7 @@ bool QFileInfo::isWritable() const
bool QFileInfo::isExecutable() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::ExeUserPerm);
}
@@ -886,7 +856,7 @@ bool QFileInfo::isExecutable() const
bool QFileInfo::isHidden() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::HiddenFlag);
}
@@ -901,7 +871,7 @@ bool QFileInfo::isHidden() const
bool QFileInfo::isFile() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::FileType);
}
@@ -915,7 +885,7 @@ bool QFileInfo::isFile() const
bool QFileInfo::isDir() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::DirectoryType);
}
@@ -931,7 +901,7 @@ bool QFileInfo::isDir() const
bool QFileInfo::isBundle() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::BundleType);
}
@@ -956,7 +926,7 @@ bool QFileInfo::isBundle() const
bool QFileInfo::isSymLink() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::LinkType);
}
@@ -969,7 +939,7 @@ bool QFileInfo::isSymLink() const
bool QFileInfo::isRoot() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return true;
return d->getFileFlags(QAbstractFileEngine::RootFlag);
}
@@ -997,7 +967,7 @@ bool QFileInfo::isRoot() const
QString QFileInfo::readLink() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileName(QAbstractFileEngine::LinkName);
}
@@ -1015,7 +985,7 @@ QString QFileInfo::readLink() const
QString QFileInfo::owner() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileOwner(QAbstractFileEngine::OwnerUser);
}
@@ -1031,9 +1001,9 @@ QString QFileInfo::owner() const
uint QFileInfo::ownerId() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
- return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
+ return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
}
/*!
@@ -1049,7 +1019,7 @@ uint QFileInfo::ownerId() const
QString QFileInfo::group() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QLatin1String("");
return d->getFileOwner(QAbstractFileEngine::OwnerGroup);
}
@@ -1065,9 +1035,9 @@ QString QFileInfo::group() const
uint QFileInfo::groupId() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
- return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
+ return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
}
/*!
@@ -1086,7 +1056,7 @@ uint QFileInfo::groupId() const
bool QFileInfo::permission(QFile::Permissions permissions) const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return false;
return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions;
}
@@ -1098,7 +1068,7 @@ bool QFileInfo::permission(QFile::Permissions permissions) const
QFile::Permissions QFileInfo::permissions() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
}
@@ -1113,13 +1083,13 @@ QFile::Permissions QFileInfo::permissions() const
qint64 QFileInfo::size() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return 0;
- if (!d->data->getCachedFlag(QFileInfoPrivate::CachedSize)) {
- d->data->setCachedFlag(QFileInfoPrivate::CachedSize);
- d->data->fileSize = d->data->fileEngine->size();
+ if (!d->getCachedFlag(QFileInfoPrivate::CachedSize)) {
+ d->setCachedFlag(QFileInfoPrivate::CachedSize);
+ d->fileSize = d->fileEngine->size();
}
- return d->data->fileSize;
+ return d->fileSize;
}
/*!
@@ -1138,7 +1108,7 @@ qint64 QFileInfo::size() const
QDateTime QFileInfo::created() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QDateTime();
return d->getFileTime(QAbstractFileEngine::CreationTime);
}
@@ -1151,7 +1121,7 @@ QDateTime QFileInfo::created() const
QDateTime QFileInfo::lastModified() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QDateTime();
return d->getFileTime(QAbstractFileEngine::ModificationTime);
}
@@ -1167,7 +1137,7 @@ QDateTime QFileInfo::lastModified() const
QDateTime QFileInfo::lastRead() const
{
Q_D(const QFileInfo);
- if (!d->data->fileEngine)
+ if (d->isDefaultConstructed)
return QDateTime();
return d->getFileTime(QAbstractFileEngine::AccessTime);
}
@@ -1177,8 +1147,7 @@ QDateTime QFileInfo::lastRead() const
*/
void QFileInfo::detach()
{
- Q_D(QFileInfo);
- d->detach();
+ d_ptr.detach();
}
/*!
@@ -1189,7 +1158,7 @@ void QFileInfo::detach()
bool QFileInfo::caching() const
{
Q_D(const QFileInfo);
- return d->data->cache_enabled;
+ return d->cache_enabled;
}
/*!
@@ -1207,8 +1176,7 @@ bool QFileInfo::caching() const
void QFileInfo::setCaching(bool enable)
{
Q_D(QFileInfo);
- detach();
- d->data->cache_enabled = enable;
+ d->cache_enabled = enable;
}
/*!
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 7e82aed..f0128b1 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -44,7 +44,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qlist.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qshareddata.h>
QT_BEGIN_HEADER
@@ -166,10 +166,20 @@ public:
#endif
protected:
- QScopedPointer<QFileInfoPrivate> d_ptr;
+ QSharedDataPointer<QFileInfoPrivate> d_ptr;
private:
- Q_DECLARE_PRIVATE(QFileInfo)
+ inline QFileInfoPrivate* d_func()
+ {
+ detach();
+ return const_cast<QFileInfoPrivate *>(d_ptr.constData());
+ }
+
+ inline const QFileInfoPrivate* d_func() const
+ {
+ return d_ptr.constData();
+ }
};
+
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
#ifdef QT3_SUPPORT
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 306ffe1..b9b1092 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -57,71 +57,83 @@
#include "qabstractfileengine.h"
#include "qdatetime.h"
#include "qatomic.h"
+#include "qshareddata.h"
QT_BEGIN_NAMESPACE
-class QFileInfoPrivate
+class QFileInfoPrivate : public QSharedData
{
public:
- QFileInfoPrivate(const QFileInfo *copy=0);
- ~QFileInfoPrivate();
- void initFileEngine(const QString &);
+ enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04,
+ CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40,
+ CachedSize =0x08, CachedPerms=0x80 };
+
+ inline QFileInfoPrivate()
+ : QSharedData(), fileEngine(0),
+ cachedFlags(0),
+ isDefaultConstructed(true),
+ cache_enabled(true), fileFlags(0), fileSize(0)
+ {}
+ inline QFileInfoPrivate(const QFileInfoPrivate &copy)
+ : QSharedData(copy), fileEngine(QAbstractFileEngine::create(copy.fileName)),
+ fileName(copy.fileName),
+ cachedFlags(0),
+#ifndef QT_NO_FSFILEENGINE
+ isDefaultConstructed(false),
+#else
+ isDefaultConstructed(!fileEngine),
+#endif
+ cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0)
+ {}
+ inline QFileInfoPrivate(const QString &file)
+ : QSharedData(), fileEngine(QAbstractFileEngine::create(file)),
+ fileName(file),
+ cachedFlags(0),
+#ifndef QT_NO_FSFILEENGINE
+ isDefaultConstructed(false),
+#else
+ isDefaultConstructed(!fileEngine),
+#endif
+ cache_enabled(true), fileFlags(0), fileSize(0)
+ {
+ }
+
+ inline void clearFlags() const {
+ fileFlags = 0;
+ cachedFlags = 0;
+ if (fileEngine)
+ (void)fileEngine->fileFlags(QAbstractFileEngine::Refresh);
+ }
+ inline void clear() {
+ clearFlags();
+ for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i)
+ fileNames[i].clear();
+ fileOwners[1].clear();
+ fileOwners[0].clear();
+ }
uint getFileFlags(QAbstractFileEngine::FileFlags) const;
QDateTime &getFileTime(QAbstractFileEngine::FileTime) const;
QString getFileName(QAbstractFileEngine::FileName) const;
QString getFileOwner(QAbstractFileEngine::FileOwner own) const;
- enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04,
- CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40,
- CachedSize =0x08, CachedPerms=0x80 };
- struct Data {
- inline Data()
- : ref(1), fileEngine(0),
- cachedFlags(0), cache_enabled(1), fileFlags(0), fileSize(0)
- {}
- inline Data(const Data &copy)
- : ref(1), fileEngine(QAbstractFileEngine::create(copy.fileName)),
- fileName(copy.fileName),
- cachedFlags(0), cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0)
- {}
- inline ~Data() { delete fileEngine; }
- inline void clearFlags() {
- fileFlags = 0;
- cachedFlags = 0;
- if (fileEngine)
- (void)fileEngine->fileFlags(QAbstractFileEngine::Refresh);
- }
- inline void clear() {
- clearFlags();
- for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i)
- fileNames[i].clear();
- fileOwners[1].clear();
- fileOwners[0].clear();
- }
- mutable QAtomicInt ref;
+ QScopedPointer<QAbstractFileEngine> const fileEngine;
- QAbstractFileEngine *fileEngine;
- mutable QString fileName;
- mutable QString fileNames[QAbstractFileEngine::NFileNames];
- mutable QString fileOwners[2];
+ mutable QString fileName;
+ mutable QString fileNames[QAbstractFileEngine::NFileNames];
+ mutable QString fileOwners[2];
- mutable uint cachedFlags : 31;
- mutable uint cache_enabled : 1;
- mutable uint fileFlags;
- mutable qint64 fileSize;
- mutable QDateTime fileTimes[3];
- inline bool getCachedFlag(uint c) const
- { return cache_enabled ? (cachedFlags & c) : 0; }
- inline void setCachedFlag(uint c)
- { if (cache_enabled) cachedFlags |= c; }
- } *data;
- inline void reset() {
- detach();
- data->clear();
- }
- void detach();
+ mutable uint cachedFlags : 30;
+ bool const isDefaultConstructed : 1; // QFileInfo is a default constructed instance
+ bool cache_enabled : 1;
+ mutable uint fileFlags;
+ mutable qint64 fileSize;
+ mutable QDateTime fileTimes[3];
+ inline bool getCachedFlag(uint c) const
+ { return cache_enabled ? (cachedFlags & c) : 0; }
+ inline void setCachedFlag(uint c) const
+ { if (cache_enabled) cachedFlags |= c; }
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 35fa04b..d5c53bb 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -43,6 +43,7 @@
#include "qplatformdefs.h"
#include "qabstractfileengine.h"
#include "private/qfsfileengine_p.h"
+#include <private/qsystemlibrary_p.h>
#include <qdebug.h>
#include "qfile.h"
@@ -177,7 +178,7 @@ void QFSFileEnginePrivate::resolveLibs()
triedResolve = true;
#if !defined(Q_OS_WINCE)
- HINSTANCE advapiHnd = LoadLibrary(L"advapi32");
+ HINSTANCE advapiHnd = QSystemLibrary::load(L"advapi32");
if (advapiHnd) {
ptrGetNamedSecurityInfoW = (PtrGetNamedSecurityInfoW)GetProcAddress(advapiHnd, "GetNamedSecurityInfoW");
ptrLookupAccountSidW = (PtrLookupAccountSidW)GetProcAddress(advapiHnd, "LookupAccountSidW");
@@ -209,7 +210,7 @@ void QFSFileEnginePrivate::resolveLibs()
ptrFreeSid(pWorld);
}
}
- HINSTANCE userenvHnd = LoadLibrary(L"userenv");
+ HINSTANCE userenvHnd = QSystemLibrary::load(L"userenv");
if (userenvHnd)
ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW");
#endif
@@ -240,7 +241,7 @@ bool QFSFileEnginePrivate::resolveUNCLibs()
#endif
triedResolve = true;
#if !defined(Q_OS_WINCE)
- HINSTANCE hLib = LoadLibrary(L"netapi32");
+ HINSTANCE hLib = QSystemLibrary::load(L"Netapi32");
if (hLib) {
ptrNetShareEnum = (PtrNetShareEnum)GetProcAddress(hLib, "NetShareEnum");
if (ptrNetShareEnum)
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index f802412..edd6d2b 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -69,7 +69,7 @@
#ifdef Q_OS_WIN // for homedirpath reading from registry
#include "qt_windows.h"
-#include "qlibrary.h"
+#include <private/qsystemlibrary_p.h>
#endif // Q_OS_WIN
#endif // QT_NO_QOBJECT
@@ -1046,9 +1046,9 @@ static QString windowsConfigPath(int type)
// We can't use QLibrary if there is QT_NO_QOBJECT is defined
// This only happens when bootstrapping qmake.
#ifndef Q_OS_WINCE
- QLibrary library(QLatin1String("shell32"));
+ QSystemLibrary library(QLatin1String("shell32"));
#else
- QLibrary library(QLatin1String("coredll"));
+ QSystemLibrary library(QLatin1String("coredll"));
#endif // Q_OS_WINCE
typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW");
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index de96e06..b3fe734 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -535,6 +535,15 @@ bool QWinSettingsPrivate::readKey(HKEY parentHandle, const QString &rSubKey, QVa
break;
}
+ case REG_QWORD: {
+ Q_ASSERT(data.size() == sizeof(qint64));
+ qint64 i;
+ memcpy((char*)&i, data.constData(), sizeof(qint64));
+ if (value != 0)
+ *value = i;
+ break;
+ }
+
default:
qWarning("QSettings: Unknown data %d type in Windows registry", static_cast<int>(dataType));
if (value != 0)
@@ -683,10 +692,19 @@ void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
break;
}
- case QVariant::Int: {
+ case QVariant::Int:
+ case QVariant::UInt: {
type = REG_DWORD;
- int i = value.toInt();
- regValueBuff = QByteArray((const char*)&i, sizeof(int));
+ qint32 i = value.toInt();
+ regValueBuff = QByteArray((const char*)&i, sizeof(qint32));
+ break;
+ }
+
+ case QVariant::LongLong:
+ case QVariant::ULongLong: {
+ type = REG_QWORD;
+ qint64 i = value.toLongLong();
+ regValueBuff = QByteArray((const char*)&i, sizeof(qint64));
break;
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 56a03c9..d1fab2d 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3399,23 +3399,26 @@ QString QUrlPrivate::canonicalHost() const
if (host.contains(QLatin1Char(':'))) {
// This is an IP Literal, use _IPLiteral to validate
QByteArray ba = host.toLatin1();
+ bool needsBraces = false;
if (!ba.startsWith('[')) {
// surround the IP Literal with [ ] if it's not already done so
ba.reserve(ba.length() + 2);
ba.prepend('[');
ba.append(']');
+ needsBraces = true;
}
const char *ptr = ba.constData();
if (!_IPLiteral(&ptr))
that->host.clear();
+ else if (needsBraces)
+ that->host = QString::fromLatin1(ba.toLower());
else
that->host = host.toLower();
} else {
that->host = qt_ACE_do(host, NormalizeAce);
- if (that->host.isNull())
- that->isHostValid = false;
}
+ that->isHostValid = !that->host.isNull();
return that->host;
}
@@ -3730,6 +3733,10 @@ void QUrlPrivate::validate() const
QString auth = authority(); // causes the non-encoded forms to be valid
+ // authority() calls canonicalHost() which sets this
+ if (!isHostValid)
+ return;
+
if (scheme == QLatin1String("mailto")) {
if (!host.isEmpty() || port != -1 || !userName.isEmpty() || !password.isEmpty()) {
that->isValid = false;
@@ -3903,9 +3910,10 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const
url += scheme.toLatin1();
url += ':';
}
+ QString savedHost = host; // pre-validation, may be invalid!
QString auth = authority();
bool doFileScheme = scheme == QLatin1String("file") && encodedPath.startsWith('/');
- if ((options & QUrl::RemoveAuthority) != QUrl::RemoveAuthority && (!auth.isEmpty() || doFileScheme)) {
+ if ((options & QUrl::RemoveAuthority) != QUrl::RemoveAuthority && (!auth.isEmpty() || doFileScheme || !savedHost.isEmpty())) {
if (doFileScheme && !encodedPath.startsWith('/'))
url += '/';
url += "//";
@@ -3931,6 +3939,12 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const
url += '[';
url += host.toLatin1();
url += ']';
+ } else if (host.isEmpty() && !savedHost.isEmpty()) {
+ // this case is only possible with an invalid URL
+ // it's here only so that we can keep the original, invalid hostname
+ // in encodedOriginal.
+ // QUrl::isValid() will return false, so toEncoded() can be anything (it's not valid)
+ url += savedHost.toUtf8();
} else {
url += QUrl::toAce(host);
}
@@ -4050,7 +4064,7 @@ const QByteArray &QUrlPrivate::normalized() const
QString QUrlPrivate::createErrorString()
{
- if (isValid)
+ if (isValid && isHostValid)
return QString();
QString errorString(QLatin1String(QT_TRANSLATE_NOOP(QUrl, "Invalid URL \"")));
@@ -4074,7 +4088,10 @@ QString QUrlPrivate::createErrorString()
errorString += QLatin1String(QT_TRANSLATE_NOOP(QUrl, "\'"));
} else {
errorString += QLatin1String(QT_TRANSLATE_NOOP(QUrl, ": "));
- errorString += QLatin1String(errorInfo._message);
+ if (isHostValid)
+ errorString += QLatin1String(errorInfo._message);
+ else
+ errorString += QLatin1String(QT_TRANSLATE_NOOP(QUrl, "invalid hostname"));
}
if (errorInfo._found) {
errorString += QLatin1String(QT_TRANSLATE_NOOP(QUrl, ", but found \'"));
@@ -4437,7 +4454,7 @@ void QUrl::setAuthority(const QString &authority)
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
detach();
- QURL_UNSETFLAG(d->stateFlags, QUrlPrivate::Validated | QUrlPrivate::Normalized);
+ QURL_UNSETFLAG(d->stateFlags, QUrlPrivate::Validated | QUrlPrivate::Normalized | QUrlPrivate::HostCanonicalized);
d->setAuthority(authority);
}
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index e3fce18..9a99ea1 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2603,9 +2603,13 @@ bool QAbstractItemModel::beginMoveRows(const QModelIndex &sourceParent, int sour
return false;
}
- d->changes.push(QAbstractItemModelPrivate::Change(sourceParent, sourceFirst, sourceLast));
+ QAbstractItemModelPrivate::Change sourceChange(sourceParent, sourceFirst, sourceLast);
+ sourceChange.needsAdjust = sourceParent.isValid() && sourceParent.row() >= destinationChild && sourceParent.parent() == destinationParent;
+ d->changes.push(sourceChange);
int destinationLast = destinationChild + (sourceLast - sourceFirst);
- d->changes.push(QAbstractItemModelPrivate::Change(destinationParent, destinationChild, destinationLast));
+ QAbstractItemModelPrivate::Change destinationChange(destinationParent, destinationChild, destinationLast);
+ destinationChange.needsAdjust = destinationParent.isValid() && destinationParent.row() >= sourceLast && destinationParent.parent() == sourceParent;
+ d->changes.push(destinationChange);
emit rowsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
emit layoutAboutToBeChanged();
@@ -2635,7 +2639,17 @@ void QAbstractItemModel::endMoveRows()
d->itemsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first, Qt::Vertical);
- emit rowsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first);
+ QModelIndex adjustedSource = removeChange.parent;
+ QModelIndex adjustedDestination = insertChange.parent;
+
+ const int numMoved = removeChange.last - removeChange.first + 1;
+ if (insertChange.needsAdjust)
+ adjustedDestination = createIndex(adjustedDestination.row() - numMoved, adjustedDestination.column(), adjustedDestination.internalPointer());
+
+ if (removeChange.needsAdjust)
+ adjustedSource = createIndex(adjustedSource.row() + numMoved, adjustedSource.column(), adjustedSource.internalPointer());
+
+ emit rowsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first);
emit layoutChanged();
}
@@ -2812,9 +2826,13 @@ bool QAbstractItemModel::beginMoveColumns(const QModelIndex &sourceParent, int s
return false;
}
- d->changes.push(QAbstractItemModelPrivate::Change(sourceParent, sourceFirst, sourceLast));
+ QAbstractItemModelPrivate::Change sourceChange(sourceParent, sourceFirst, sourceLast);
+ sourceChange.needsAdjust = sourceParent.isValid() && sourceParent.row() >= destinationChild && sourceParent.parent() == destinationParent;
+ d->changes.push(sourceChange);
int destinationLast = destinationChild + (sourceLast - sourceFirst);
- d->changes.push(QAbstractItemModelPrivate::Change(destinationParent, destinationChild, destinationLast));
+ QAbstractItemModelPrivate::Change destinationChange(destinationParent, destinationChild, destinationLast);
+ destinationChange.needsAdjust = destinationParent.isValid() && destinationParent.row() >= sourceLast && destinationParent.parent() == sourceParent;
+ d->changes.push(destinationChange);
d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Horizontal);
@@ -2845,7 +2863,17 @@ void QAbstractItemModel::endMoveColumns()
d->itemsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first, Qt::Horizontal);
- emit columnsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first);
+ QModelIndex adjustedSource = removeChange.parent;
+ QModelIndex adjustedDestination = insertChange.parent;
+
+ const int numMoved = removeChange.last - removeChange.first + 1;
+ if (insertChange.needsAdjust)
+ adjustedDestination = createIndex(adjustedDestination.row(), adjustedDestination.column() - numMoved, adjustedDestination.internalPointer());
+
+ if (removeChange.needsAdjust)
+ adjustedSource = createIndex(adjustedSource.row(), adjustedSource.column() + numMoved, adjustedSource.internalPointer());
+
+ emit columnsMoved(adjustedSource, removeChange.first, removeChange.last, adjustedDestination, insertChange.first);
emit layoutChanged();
}
diff --git a/src/corelib/kernel/qabstractitemmodel_p.h b/src/corelib/kernel/qabstractitemmodel_p.h
index 7844a10..3113dff 100644
--- a/src/corelib/kernel/qabstractitemmodel_p.h
+++ b/src/corelib/kernel/qabstractitemmodel_p.h
@@ -133,11 +133,26 @@ public:
struct Change {
Change() : first(-1), last(-1) {}
- Change(const Change &c) : parent(c.parent), first(c.first), last(c.last) {}
- Change(const QModelIndex &p, int f, int l) : parent(p), first(f), last(l) {}
+ Change(const Change &c) : parent(c.parent), first(c.first), last(c.last), needsAdjust(c.needsAdjust) {}
+ Change(const QModelIndex &p, int f, int l) : parent(p), first(f), last(l), needsAdjust(false) {}
QModelIndex parent;
int first, last;
+
+ // In cases such as this:
+ // - A
+ // - B
+ // - C
+ // - - D
+ // - - E
+ // - - F
+ //
+ // If B is moved to above E, C is the source parent in the signal and its row is 2. When the move is
+ // completed however, C is at row 1 and there is no row 2 at the same level in the model at all.
+ // The QModelIndex is adjusted to correct that in those cases before reporting it though the
+ // rowsMoved signal.
+ bool needsAdjust;
+
bool isValid() { return first >= 0 && last >= 0; }
};
QStack<Change> changes;
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 5afde9a..66296b0 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -131,7 +131,6 @@ public:
private:
void init()
{
-#ifdef Q_OS_SYMBIAN
_LIT(KLibName_3_1, "qts60plugin_3_1" QT_LIBINFIX_UNICODE L".dll");
_LIT(KLibName_3_2, "qts60plugin_3_2" QT_LIBINFIX_UNICODE L".dll");
_LIT(KLibName_5_0, "qts60plugin_5_0" QT_LIBINFIX_UNICODE L".dll");
@@ -157,7 +156,12 @@ private:
TUidType libUid(KDynamicLibraryUid, KSharedLibraryUid, TUid::Uid(uidValue));
lib.Load(libName, libUid);
-#endif
+
+ // Duplicate lib handle to enable process wide access to it. Since Duplicate overwrites
+ // existing handle without closing it, store original for subsequent closing.
+ RLibrary origHandleCloser = lib;
+ lib.Duplicate(RThread(), EOwnerProcess);
+ origHandleCloser.Close();
}
RLibrary lib;
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 9dadd82..f50994c 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -549,18 +549,22 @@ int QTimerInfoList::activateTimers()
if (qt_disable_lowpriority_timers || isEmpty())
return 0; // nothing to do
- bool firstTime = true;
- timeval currentTime;
- int n_act = 0, maxCount = count();
+ int n_act = 0, maxCount = 0;
firstTimerInfo = 0;
- while (maxCount--) {
- currentTime = updateCurrentTime();
- if (firstTime) {
- repairTimersIfNeeded();
- firstTime = false;
- }
+ timeval currentTime = updateCurrentTime();
+ repairTimersIfNeeded();
+
+ // Find out how many timer have expired
+ for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) {
+ if (currentTime < (*it)->timeout)
+ break;
+ maxCount++;
+ }
+
+ //fire the timers.
+ while (maxCount--) {
if (isEmpty())
break;
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index e3f537f..153ccdf 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -43,7 +43,7 @@
#include "qcoreapplication.h"
#include "qhash.h"
-#include "qlibrary.h"
+#include <private/qsystemlibrary_p.h>
#include "qpair.h"
#include "qset.h"
#include "qsocketnotifier.h"
@@ -65,7 +65,11 @@ extern uint qGlobalPostedEventsCount();
#endif
#ifndef QS_RAWINPUT
+# ifdef Q_OS_WINCE
+# define QS_RAWINPUT 0x0000
+# else
# define QS_RAWINPUT 0x0400
+# endif
#endif
#ifndef WM_TOUCH
@@ -80,8 +84,7 @@ extern uint qGlobalPostedEventsCount();
enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
- WM_QT_SENDPOSTEDEVENTS = WM_USER + 1,
- SendPostedEventsTimerId = ~1u
+ WM_QT_SENDPOSTEDEVENTS = WM_USER + 1
};
#if defined(Q_OS_WINCE)
@@ -323,11 +326,11 @@ static void resolveTimerAPI()
#endif
triedResolve = true;
#if !defined(Q_OS_WINCE)
- qtimeSetEvent = (ptimeSetEvent)QLibrary::resolve(QLatin1String("winmm"), "timeSetEvent");
- qtimeKillEvent = (ptimeKillEvent)QLibrary::resolve(QLatin1String("winmm"), "timeKillEvent");
+ qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeSetEvent");
+ qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeKillEvent");
#else
- qtimeSetEvent = (ptimeSetEvent)QLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent");
- qtimeKillEvent = (ptimeKillEvent)QLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent");
+ qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent");
+ qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent");
#endif
}
}
@@ -516,12 +519,10 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
if (q) {
QEventDispatcherWin32Private *d = q->d_func();
int localSerialNumber = d->serialNumber;
-#ifdef Q_OS_WINCE
- MSG dummyMsg;
- if (HIWORD(GetQueueStatus(QS_INPUT)) == 0
- && PeekMessage(&dummyMsg, 0, WM_TIMER, WM_TIMER, PM_NOREMOVE) == 0
-#else
- if (HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT | QS_TIMER)) == 0
+ MSG unused;
+ if ((HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT)) == 0
+ && PeekMessage(&unused, 0, WM_TIMER, WM_TIMER, PM_NOREMOVE) == 0)
+#ifndef Q_OS_WINCE
|| GetMessageTime() - d->lastMessageTime >= 10
#endif
) {
@@ -824,7 +825,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
pHandles[i] = d->winEventNotifierList.at(i)->handle();
emit aboutToBlock();
- waitRet = MsgWaitForMultipleObjectsEx(nCount, pHandles, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE);
+ waitRet = MsgWaitForMultipleObjectsEx(nCount, pHandles, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE | MWMO_INPUTAVAILABLE);
emit awake();
if (waitRet >= WAIT_OBJECT_0 && waitRet < WAIT_OBJECT_0 + nCount) {
d->activateEventNotifier(d->winEventNotifierList.at(waitRet - WAIT_OBJECT_0));
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 1b613a6..d98d1f0 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -325,95 +325,6 @@ Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QString
const QMetaObject &mo, QList<void *> *list);
Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo);
-#if defined Q_CC_MSVC && _MSC_VER < 1300
-
-template<typename T>
-inline T qFindChild(const QObject *o, const QString &name, T)
-{ return static_cast<T>(qt_qFindChild_helper(o, name, ((T)0)->staticMetaObject)); }
-
-template<typename T>
-inline QList<T> qFindChildren(const QObject *o, const QString &name, T)
-{
- QList<T> list;
- union {
- QList<T> *typedList;
- QList<void *> *voidList;
- } u;
- u.typedList = &list;
- qt_qFindChildren_helper(o, name, 0, ((T)0)->staticMetaObject, u.voidList);
- return list;
-}
-
-template<typename T>
-inline T qFindChild(const QObject *o, const QString &name)
-{ return qFindChild<T>(o, name, T(0)); }
-
-template<typename T>
-inline T qFindChild(const QObject *o)
-{ return qFindChild<T>(o, QString(), T(0)); }
-
-template<typename T>
-inline QList<T> qFindChildren(const QObject *o, const QString &name)
-{ return qFindChildren<T>(o, name, T(0)); }
-
-template<typename T>
-inline QList<T> qFindChildren(const QObject *o)
-{ return qFindChildren<T>(o, QString(), T(0)); }
-
-#ifndef QT_NO_REGEXP
-template<typename T>
-inline QList<T> qFindChildren(const QObject *o, const QRegExp &re, T)
-{
- QList<T> list;
- union {
- QList<T> *typedList;
- QList<void *> *voidList;
- } u;
- u.typedList = &list;
- qt_qFindChildren_helper(o, 0, &re, ((T)0)->staticMetaObject, u.voidList);
- return list;
-}
-
-template<typename T>
-inline QList<T> qFindChildren(const QObject *o, const QRegExp &re)
-{ return qFindChildren<T>(o, re, T(0)); }
-
-#endif
-
-#ifdef Q_MOC_RUN
-# define Q_DECLARE_INTERFACE(IFace, IId) Q_DECLARE_INTERFACE(IFace, IId)
-#endif // Q_MOC_RUN
-
-
-template <class T> inline const char * qobject_interface_iid()
-{ return 0; }
-
-template <class T> inline T qobject_cast_helper(QObject *object, T)
-{ return static_cast<T>(((T)0)->staticMetaObject.cast(object)); }
-
-template <class T> inline T qobject_cast_helper(const QObject *object, T)
-{ return static_cast<T>(const_cast<const QObject *>(((T)0)->staticMetaObject.cast(const_cast<QObject *>(object)))); }
-
-template <class T>
-inline T qobject_cast(QObject *object)
-{ return qobject_cast_helper<T>(object, T(0)); }
-
-template <class T>
-inline T qobject_cast(const QObject *object)
-{ return qobject_cast_helper<T>(object, T(0)); }
-
-#ifndef Q_MOC_RUN
-# define Q_DECLARE_INTERFACE(IFace, IId) \
- template <> inline const char *qobject_interface_iid<IFace *>() \
- { return IId; } \
- template <> inline IFace *qobject_cast_helper<IFace *>(QObject *object, IFace *) \
- { return (IFace *)(object ? object->qt_metacast(IId) : 0); } \
- template <> inline IFace *qobject_cast_helper<IFace *>(const QObject *object, IFace *) \
- { return (IFace *)(object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0); }
-#endif // Q_MOC_RUN
-
-#else
-
template<typename T>
inline T qFindChild(const QObject *o, const QString &name)
{ return static_cast<T>(qt_qFindChild_helper(o, name, reinterpret_cast<T>(0)->staticMetaObject)); }
@@ -482,8 +393,6 @@ template <class T> inline const char * qobject_interface_iid()
{ return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0)); }
#endif // Q_MOC_RUN
-#endif
-
#ifndef QT_NO_DEBUG_STREAM
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
#endif
diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri
index c05ff48..ba86353 100644
--- a/src/corelib/plugin/plugin.pri
+++ b/src/corelib/plugin/plugin.pri
@@ -7,7 +7,8 @@ HEADERS += \
plugin/qlibrary_p.h \
plugin/qplugin.h \
plugin/quuid.h \
- plugin/qfactoryloader_p.h
+ plugin/qfactoryloader_p.h \
+ plugin/qsystemlibrary_p.h
SOURCES += \
plugin/qpluginloader.cpp \
@@ -16,7 +17,9 @@ SOURCES += \
plugin/qlibrary.cpp
win32 {
- SOURCES += plugin/qlibrary_win.cpp
+ SOURCES += \
+ plugin/qlibrary_win.cpp \
+ plugin/qsystemlibrary.cpp
}
unix {
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 62d565a..a26dcd8 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -244,6 +244,14 @@ QObject *QFactoryLoader::instance(const QString &key) const
return 0;
}
+#ifdef Q_WS_X11
+QLibraryPrivate *QFactoryLoader::library(const QString &key) const
+{
+ Q_D(const QFactoryLoader);
+ return d->keyMap.value(d->cs ? key : key.toLower());
+}
+#endif
+
void QFactoryLoader::refreshAll()
{
QMutexLocker locker(qt_factoryloader_mutex());
diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h
index 10e6e2a..068c6c7 100644
--- a/src/corelib/plugin/qfactoryloader_p.h
+++ b/src/corelib/plugin/qfactoryloader_p.h
@@ -77,6 +77,10 @@ public:
QStringList keys() const;
QObject *instance(const QString &key) const;
+#ifdef Q_WS_X11
+ QLibraryPrivate *library(const QString &key) const;
+#endif
+
void update();
static void refreshAll();
diff --git a/src/corelib/plugin/qsystemlibrary.cpp b/src/corelib/plugin/qsystemlibrary.cpp
new file mode 100644
index 0000000..eeb142b
--- /dev/null
+++ b/src/corelib/plugin/qsystemlibrary.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qsystemlibrary_p.h"
+#include <QtCore/qvarlengtharray.h>
+#include <QtCore/qstringlist.h>
+#include <QtCore/qfileinfo.h>
+
+/*!
+
+ \internal
+ \class QSystemLibrary
+
+ The purpose of this class is to load only libraries that are located in
+ well-known and trusted locations on the filesystem. It does not suffer from
+ the security problem that QLibrary has, therefore it will never search in
+ the current directory.
+
+ The search order is the same as the order in DLL Safe search mode Windows,
+ except that we don't search:
+ * The current directory
+ * The 16-bit system directory. (normally c:\windows\system)
+ * The Windows directory. (normally c:\windows)
+
+ This means that the effective search order is:
+ 1. Application path.
+ 2. System libraries path.
+ 3. Trying all paths inside the PATH environment variable.
+
+ Note, when onlySystemDirectory is true it will skip 1) and 3).
+
+ DLL Safe search mode is documented in the "Dynamic-Link Library Search
+ Order" document on MSDN.
+
+ Since library loading code is sometimes shared between Windows and WinCE,
+ this class can also be used on WinCE. However, its implementation just
+ calls the LoadLibrary() function. This is ok since it is documented as not
+ loading from the current directory on WinCE. This behaviour is documented
+ in the documentation for LoadLibrary for Windows CE at MSDN.
+ (http://msdn.microsoft.com/en-us/library/ms886736.aspx)
+*/
+#if defined(Q_OS_WINCE)
+HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirectory /* = true */)
+{
+ return ::LoadLibrary(libraryName);
+}
+#else
+
+#if !defined(QT_BOOTSTRAPPED)
+extern QString qAppFileName();
+#endif
+
+static QString qSystemDirectory()
+{
+ QVarLengthArray<wchar_t, MAX_PATH> fullPath;
+
+ UINT retLen = ::GetSystemDirectory(fullPath.data(), MAX_PATH);
+ if (retLen > MAX_PATH) {
+ fullPath.resize(retLen);
+ retLen = ::GetSystemDirectory(fullPath.data(), retLen);
+ }
+ // in some rare cases retLen might be 0
+ return QString::fromWCharArray(fullPath.constData(), int(retLen));
+}
+
+HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirectory /* = true */)
+{
+ QStringList searchOrder;
+
+#if !defined(QT_BOOTSTRAPPED)
+ if (!onlySystemDirectory)
+ searchOrder << QFileInfo(qAppFileName()).path();
+#endif
+ searchOrder << qSystemDirectory();
+
+ if (!onlySystemDirectory) {
+ const QString PATH(QLatin1String(qgetenv("PATH").constData()));
+ searchOrder << PATH.split(QLatin1Char(';'), QString::SkipEmptyParts);
+ }
+ QString fileName = QString::fromWCharArray(libraryName);
+ fileName.append(QLatin1String(".dll"));
+
+ // Start looking in the order specified
+ for (int i = 0; i < searchOrder.count(); ++i) {
+ QString fullPathAttempt = searchOrder.at(i);
+ if (!fullPathAttempt.endsWith(QLatin1Char('\\'))) {
+ fullPathAttempt.append(QLatin1Char('\\'));
+ }
+ fullPathAttempt.append(fileName);
+ HINSTANCE inst = ::LoadLibrary((const wchar_t *)fullPathAttempt.utf16());
+ if (inst != 0)
+ return inst;
+ }
+ return 0;
+
+}
+
+#endif //Q_OS_WINCE
diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h
new file mode 100644
index 0000000..3251a3c
--- /dev/null
+++ b/src/corelib/plugin/qsystemlibrary_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSYSTEMLIBRARY_P_H
+#define QSYSTEMLIBRARY_P_H
+
+#include <QtCore/qglobal.h>
+#ifdef Q_OS_WIN
+#include <qt_windows.h>
+#include <QtCore/qstring.h>
+
+class QSystemLibrary
+{
+public:
+ explicit QSystemLibrary(const QString &libraryName)
+ {
+ m_libraryName = libraryName;
+ m_handle = 0;
+ m_didLoad = false;
+ }
+
+ explicit QSystemLibrary(const wchar_t *libraryName)
+ {
+ m_libraryName = QString::fromWCharArray(libraryName);
+ m_handle = 0;
+ m_didLoad = false;
+ }
+
+ bool load(bool onlySystemDirectory = true)
+ {
+ m_handle = load((const wchar_t *)m_libraryName.utf16(), onlySystemDirectory);
+ m_didLoad = true;
+ return (m_handle != 0);
+ }
+
+ bool isLoaded()
+ {
+ return (m_handle != 0);
+ }
+
+ void *resolve(const char *symbol)
+ {
+ if (!m_didLoad)
+ load();
+ if (!m_handle)
+ return 0;
+#ifdef Q_OS_WINCE
+ return (void*)GetProcAddress(m_handle, (const wchar_t*)QString::fromLatin1(symbol).utf16());
+#else
+ return (void*)GetProcAddress(m_handle, symbol);
+#endif
+ }
+
+ static void *resolve(const QString &libraryName, const char *symbol)
+ {
+ return QSystemLibrary(libraryName).resolve(symbol);
+ }
+
+ static Q_CORE_EXPORT HINSTANCE load(const wchar_t *lpFileName, bool onlySystemDirectory = true);
+private:
+ HINSTANCE m_handle;
+ QString m_libraryName;
+ bool m_didLoad;
+};
+
+#endif //Q_OS_WIN
+
+#endif //QSYSTEMLIBRARY_P_H
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index d193b2e..2824e15 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -142,6 +142,20 @@ static void destroy_current_thread_data_key()
}
Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key)
+#ifdef Q_OS_SYMBIAN
+static void init_symbian_thread_handle(RThread &thread)
+{
+ thread = RThread();
+ TThreadId threadId = thread.Id();
+ thread.Open(threadId);
+
+ // Make thread handle accessible process wide
+ RThread originalCloser = thread;
+ thread.Duplicate(thread, EOwnerProcess);
+ originalCloser.Close();
+}
+#endif
+
QThreadData *QThreadData::current()
{
pthread_once(&current_thread_data_once, create_current_thread_data_key);
@@ -182,9 +196,7 @@ void QAdoptedThread::init()
Q_D(QThread);
d->thread_id = pthread_self();
#ifdef Q_OS_SYMBIAN
- d->data->symbian_thread_handle = RThread();
- TThreadId threadId = d->data->symbian_thread_handle.Id();
- d->data->symbian_thread_handle.Open(threadId);
+ init_symbian_thread_handle(d->data->symbian_thread_handle);
#endif
}
@@ -244,9 +256,8 @@ void *QThreadPrivate::start(void *arg)
// RThread and pthread_t, we must delay initialization of the RThread
// handle when creating a thread, until we are running in the new thread.
// Here, we pick up the current thread and assign that to the handle.
- data->symbian_thread_handle = RThread();
- TThreadId threadId = data->symbian_thread_handle.Id();
- data->symbian_thread_handle.Open(threadId);
+ init_symbian_thread_handle(data->symbian_thread_handle);
+
// On symbian, threads other than the main thread are non critical by default
// This means a worker thread can crash without crashing the application - to
// use this feature, we would need to use RThread::Logon in the main thread
@@ -657,6 +668,18 @@ bool QThread::wait(unsigned long time)
return true;
while (d->running) {
+#ifdef Q_OS_SYMBIAN
+ // Check if thread still exists. Needed because kernel will kill it without notification
+ // before global statics are deleted at application exit.
+ if (d->data->symbian_thread_handle.Handle()
+ && d->data->symbian_thread_handle.ExitType() != EExitPending) {
+ // Cannot call finish here as wait is typically called from another thread.
+ // It won't be necessary anyway, as we should never get here under normal operations;
+ // all QThreads are EProcessCritical and therefore cannot normally exit
+ // undetected (i.e. panic) as long as all thread control is via QThread.
+ return true;
+ }
+#endif
if (!d->thread_done.wait(locker.mutex(), time))
return false;
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 8d38e4c..033da90 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -850,7 +850,7 @@ QByteArray::Data QByteArray::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1),
This operation takes \l{constant time}, because QByteArray is
\l{implicitly shared}. This makes returning a QByteArray from a
function very fast. If a shared instance is modified, it will be
- copied (copy-on-write), and that takes \l{linear time}.
+ copied (copy-on-write), taking \l{linear time}.
\sa operator=()
*/
@@ -1186,10 +1186,18 @@ void QByteArray::chop(int n)
Example:
\snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 12
- This operation is typically very fast (\l{constant time}),
- because QByteArray preallocates extra space at the end of the
- character data so it can grow without reallocating the entire
- data each time.
+ Note: QByteArray is an \l{implicitly shared} class. Consequently,
+ if \e this is an empty QByteArray, then \e this will just share
+ the data held in \a ba. In this case, no copying of data is done,
+ taking \l{constant time}. If a shared instance is modified, it will
+ be copied (copy-on-write), taking \l{linear time}.
+
+ If \e this is not an empty QByteArray, a deep copy of the data is
+ performed, taking \l{linear time}.
+
+ This operation typically does not suffer from allocation overhead,
+ because QByteArray preallocates extra space at the end of the data
+ so that it may grow without reallocating for each append operation.
\sa append(), prepend()
*/
@@ -1474,7 +1482,12 @@ QByteArray QByteArray::nulTerminated() const
Note: QByteArray is an \l{implicitly shared} class. Consequently,
if \e this is an empty QByteArray, then \e this will just share
- the data held in \a ba. In this case, no copying of data is done.
+ the data held in \a ba. In this case, no copying of data is done,
+ taking \l{constant time}. If a shared instance is modified, it will
+ be copied (copy-on-write), taking \l{linear time}.
+
+ If \e this is not an empty QByteArray, a deep copy of the data is
+ performed, taking \l{linear time}.
\sa append(), insert()
*/
@@ -1547,14 +1560,18 @@ QByteArray &QByteArray::prepend(char ch)
This is the same as insert(size(), \a ba).
- This operation is typically very fast (\l{constant time}),
- because QByteArray preallocates extra space at the end of the
- character data so it can grow without reallocating the entire
- data each time.
-
Note: QByteArray is an \l{implicitly shared} class. Consequently,
if \e this is an empty QByteArray, then \e this will just share
- the data held in \a ba. In this case, no copying of data is done.
+ the data held in \a ba. In this case, no copying of data is done,
+ taking \l{constant time}. If a shared instance is modified, it will
+ be copied (copy-on-write), taking \l{linear time}.
+
+ If \e this is not an empty QByteArray, a deep copy of the data is
+ performed, taking \l{linear time}.
+
+ This operation typically does not suffer from allocation overhead,
+ because QByteArray preallocates extra space at the end of the data
+ so that it may grow without reallocating for each append operation.
\sa operator+=(), prepend(), insert()
*/
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index ee791e0..7fe9170 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -332,7 +332,7 @@ public:
enum Type { In, Out, InOut, OutIn };
QEasingCurveFunction(QEasingCurveFunction::Type type = In, qreal period = 0.3, qreal amplitude = 1.0,
- qreal overshoot = 1.70158f)
+ qreal overshoot = 1.70158)
: _t(type), _p(period), _a(amplitude), _o(overshoot)
{ }
virtual ~QEasingCurveFunction() {}
@@ -359,9 +359,9 @@ QEasingCurveFunction *QEasingCurveFunction::copy() const
bool QEasingCurveFunction::operator==(const QEasingCurveFunction& other)
{
return _t == other._t &&
- _p == other._p &&
- _a == other._a &&
- _o == other._o;
+ qFuzzyCompare(_p, other._p) &&
+ qFuzzyCompare(_a, other._a) &&
+ qFuzzyCompare(_o, other._o);
}
QT_BEGIN_INCLUDE_NAMESPACE
@@ -400,8 +400,8 @@ struct ElasticEase : public QEasingCurveFunction
qreal value(qreal t)
{
- qreal p = (_p < 0) ? 0.3f : _p;
- qreal a = (_a < 0) ? 1.0f : _a;
+ qreal p = (_p < 0) ? qreal(0.3) : _p;
+ qreal a = (_a < 0) ? qreal(1.0) : _a;
switch(_t) {
case In:
return easeInElastic(t, a, p);
@@ -420,7 +420,7 @@ struct ElasticEase : public QEasingCurveFunction
struct BounceEase : public QEasingCurveFunction
{
BounceEase(Type type)
- : QEasingCurveFunction(type, 0.3f, 1.0f)
+ : QEasingCurveFunction(type, qreal(0.3), qreal(1.0))
{ }
QEasingCurveFunction *copy() const
@@ -432,7 +432,7 @@ struct BounceEase : public QEasingCurveFunction
qreal value(qreal t)
{
- qreal a = (_a < 0) ? 1.0f : _a;
+ qreal a = (_a < 0) ? qreal(1.0) : _a;
switch(_t) {
case In:
return easeInBounce(t, a);
@@ -451,7 +451,7 @@ struct BounceEase : public QEasingCurveFunction
struct BackEase : public QEasingCurveFunction
{
BackEase(Type type)
- : QEasingCurveFunction(type, 0.3f, 1.0f, 1.70158f)
+ : QEasingCurveFunction(type, qreal(0.3), qreal(1.0), qreal(1.70158))
{ }
QEasingCurveFunction *copy() const
@@ -463,7 +463,7 @@ struct BackEase : public QEasingCurveFunction
qreal value(qreal t)
{
- qreal o = (_o < 0) ? 1.70158f : _o;
+ qreal o = (_o < 0) ? qreal(1.70158) : _o;
switch(_t) {
case In:
return easeInBack(t, o);
@@ -595,7 +595,7 @@ static QEasingCurveFunction *curveToFunctionObject(QEasingCurve::Type type)
curveFunc = new BackEase(BackEase::OutIn);
break;
default:
- curveFunc = new QEasingCurveFunction(QEasingCurveFunction::In, 0.3f, 1.0f, 1.70158f); // ###
+ curveFunc = new QEasingCurveFunction(QEasingCurveFunction::In, qreal(0.3), qreal(1.0), qreal(1.70158));
}
return curveFunc;
@@ -657,9 +657,17 @@ bool QEasingCurve::operator==(const QEasingCurve &other) const
{
bool res = d_ptr->func == other.d_ptr->func
&& d_ptr->type == other.d_ptr->type;
- if (res && d_ptr->config && other.d_ptr->config) {
+ if (res) {
+ if (d_ptr->config && other.d_ptr->config) {
// catch the config content
- res = d_ptr->config->operator==(*(other.d_ptr->config));
+ res = d_ptr->config->operator==(*(other.d_ptr->config));
+
+ } else if (d_ptr->config || other.d_ptr->config) {
+ // one one has a config object, which could contain default values
+ res = qFuzzyCompare(amplitude(), other.amplitude()) &&
+ qFuzzyCompare(period(), other.period()) &&
+ qFuzzyCompare(overshoot(), other.overshoot());
+ }
}
return res;
}
@@ -681,7 +689,7 @@ bool QEasingCurve::operator==(const QEasingCurve &other) const
*/
qreal QEasingCurve::amplitude() const
{
- return d_ptr->config ? d_ptr->config->_a : 1.0;
+ return d_ptr->config ? d_ptr->config->_a : qreal(1.0);
}
/*!
@@ -705,7 +713,7 @@ void QEasingCurve::setAmplitude(qreal amplitude)
*/
qreal QEasingCurve::period() const
{
- return d_ptr->config ? d_ptr->config->_p : 0.3;
+ return d_ptr->config ? d_ptr->config->_p : qreal(0.3);
}
/*!
@@ -729,7 +737,7 @@ void QEasingCurve::setPeriod(qreal period)
*/
qreal QEasingCurve::overshoot() const
{
- return d_ptr->config ? d_ptr->config->_o : 1.70158f;
+ return d_ptr->config ? d_ptr->config->_o : qreal(1.70158) ;
}
/*!
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index a9c33f1..7babf3a 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -286,10 +286,13 @@ static inline uint detectProcessorFeatures()
uint feature_result = 0;
#if defined(Q_CC_GNU)
- asm ("cpuid"
- : "=c" (feature_result)
+ long tmp;
+ asm ("xchg %%rbx, %1\n"
+ "cpuid\n"
+ "xchg %%rbx, %1\n"
+ : "=c" (feature_result), "=&r" (tmp)
: "a" (1)
- : "%ebx", "%edx"
+ : "%edx"
);
#elif defined (Q_OS_WIN64)
{
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index b762b8a..2b8d054 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -293,9 +293,9 @@ public:
#ifndef QT_NO_STL
static inline QVector<T> fromStdVector(const std::vector<T> &vector)
- { QVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
+ { QVector<T> tmp; tmp.reserve(vector.size()); qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
inline std::vector<T> toStdVector() const
- { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
+ { std::vector<T> tmp; tmp.reserve(size()); qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
#endif
private:
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 477c511..2921ecd 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -128,8 +128,8 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
, flickingHorizontally(false), flickingVertically(false)
, hMoved(false), vMoved(false)
, movingHorizontally(false), movingVertically(false)
- , stealMouse(false), pressed(false)
- , interactive(true), deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100)
+ , stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
+ , deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100)
, delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(600)
, vTime(0), visibleArea(0)
, flickableDirection(QDeclarativeFlickable::AutoFlickDirection)
@@ -982,7 +982,7 @@ void QDeclarativeFlickable::viewportMoved()
qreal prevY = d->lastFlickablePosition.x();
qreal prevX = d->lastFlickablePosition.y();
d->velocityTimeline.clear();
- if (d->pressed) {
+ if (d->pressed || d->calcVelocity) {
int elapsed = QDeclarativeItemPrivate::restart(d->velocityTime);
if (elapsed > 0) {
qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / elapsed;
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index c398faa..2da034c 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -141,6 +141,7 @@ public:
bool stealMouse : 1;
bool pressed : 1;
bool interactive : 1;
+ bool calcVelocity : 1;
QElapsedTimer lastPosTime;
QPointF lastPos;
QPointF pressPos;
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index f152d0d..8d08c99 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2255,7 +2255,9 @@ void QDeclarativeGridView::trackedPositionChanged()
}
if (viewPos != pos) {
cancelFlick();
+ d->calcVelocity = true;
d->setPosition(pos);
+ d->calcVelocity = false;
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index f0293d6..02b4807 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -129,27 +129,25 @@ QSize QDeclarativeImageBase::sourceSize() const
void QDeclarativeImageBase::load()
{
Q_D(QDeclarativeImageBase);
- if (d->progress != 0.0) {
- d->progress = 0.0;
- emit progressChanged(d->progress);
- }
if (d->url.isEmpty()) {
d->pix.clear();
d->status = Null;
+ d->progress = 0.0;
setImplicitWidth(0);
setImplicitHeight(0);
+ emit progressChanged(d->progress);
emit statusChanged(d->status);
pixmapChange();
update();
} else {
-
- d->status = Loading;
- emit statusChanged(d->status);
-
d->pix.load(qmlEngine(this), d->url, d->sourcesize, d->async);
if (d->pix.isLoading()) {
+ d->progress = 0.0;
+ d->status = Loading;
+ emit progressChanged(d->progress);
+ emit statusChanged(d->status);
static int thisRequestProgress = -1;
static int thisRequestFinished = -1;
@@ -173,6 +171,9 @@ void QDeclarativeImageBase::requestFinished()
{
Q_D(QDeclarativeImageBase);
+ QDeclarativeImageBase::Status oldStatus = d->status;
+ qreal oldProgress = d->progress;
+
if (d->pix.isError()) {
d->status = Error;
qmlInfo(this) << d->pix.error();
@@ -191,8 +192,10 @@ void QDeclarativeImageBase::requestFinished()
emit sourceSizeChanged();
}
- emit statusChanged(d->status);
- emit progressChanged(d->progress);
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
pixmapChange();
update();
}
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
index f5896b1..68eb8d0 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
@@ -58,7 +58,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeImageBase : public QDeclarativeItem
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
-
Q_PROPERTY(QSize sourceSize READ sourceSize WRITE setSourceSize NOTIFY sourceSizeChanged)
public:
@@ -79,7 +78,7 @@ public:
Q_SIGNALS:
void sourceChanged(const QUrl &);
void sourceSizeChanged();
- void statusChanged(Status);
+ void statusChanged(QDeclarativeImageBase::Status);
void progressChanged(qreal progress);
void asynchronousChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 8382970..c1e6aaa 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -2735,7 +2735,9 @@ void QDeclarativeListView::trackedPositionChanged()
}
if (viewPos != pos) {
cancelFlick();
+ d->calcVelocity = true;
d->setPosition(pos);
+ d->calcVelocity = false;
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 666f5e1..a0208ef 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -333,7 +333,9 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
position of the release of the click, and whether the click was held.
- The \e accepted property of the MouseEvent parameter is ignored in this handler.
+ If the \e accepted property of the \l {MouseEvent}{mouse} parameter is set to false
+ in the handler, the onPressed/onReleased/onClicked handlers will be called for the second
+ click; otherwise they are supressed. The accepted property defaults to true.
*/
/*!
@@ -563,12 +565,13 @@ void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even
if (!d->absorb) {
QDeclarativeItem::mouseDoubleClickEvent(event);
} else {
- QDeclarativeItem::mouseDoubleClickEvent(event);
- if (event->isAccepted()) {
- // Only deliver the event if we have accepted the press.
- d->saveEvent(event);
- QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, false);
- emit this->doubleClicked(&me);
+ d->saveEvent(event);
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, false);
+ me.setAccepted(d->isDoubleClickConnected());
+ emit this->doubleClicked(&me);
+ if (!me.isAccepted()) {
+ // Only deliver the press event if we haven't accepted the double click.
+ QDeclarativeItem::mouseDoubleClickEvent(event);
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index cf9dc18..48a56d9 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -95,6 +95,12 @@ public:
return QObjectPrivate::get(q)->isSignalConnected(idx);
}
+ bool isDoubleClickConnected() {
+ Q_Q(QDeclarativeMouseArea);
+ static int idx = QObjectPrivate::get(q)->signalIndex("doubleClicked(QDeclarativeMouseEvent*)");
+ return QObjectPrivate::get(q)->isSignalConnected(idx);
+ }
+
bool absorb : 1;
bool hovered : 1;
bool pressed : 1;
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index fd3a1f7..14194a0 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -429,6 +429,9 @@ void QDeclarativeText::setStyle(QDeclarativeText::TextStyle style)
if (d->style == style)
return;
+ // changing to/from Normal requires the boundingRect() to change
+ if (isComponentComplete() && (d->style == Normal || style == Normal))
+ prepareGeometryChange();
d->style = style;
d->markImgDirty();
emit styleChanged(d->style);
@@ -494,8 +497,9 @@ void QDeclarativeText::setHAlign(HAlignment align)
if (d->hAlign == align)
return;
+ if (isComponentComplete())
+ prepareGeometryChange();
d->hAlign = align;
- update();
emit horizontalAlignmentChanged(align);
}
@@ -511,8 +515,9 @@ void QDeclarativeText::setVAlign(VAlignment align)
if (d->vAlign == align)
return;
+ if (isComponentComplete())
+ prepareGeometryChange();
d->vAlign = align;
- update();
emit verticalAlignmentChanged(align);
}
@@ -805,7 +810,6 @@ void QDeclarativeTextPrivate::updateSize()
else
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
dy -= (int)doc->size().height();
- q->prepareGeometryChange();
QSize dsize = doc->size().toSize();
if (dsize != cachedLayoutSize) {
q->prepareGeometryChange();
@@ -882,8 +886,6 @@ void QDeclarativeTextPrivate::drawOutline()
ppm.drawPixmap(pos, imgCache);
ppm.end();
- if (imgCache.size() != img.size())
- q_func()->prepareGeometryChange();
imgCache = img;
}
@@ -902,8 +904,6 @@ void QDeclarativeTextPrivate::drawOutline(int yOffset)
ppm.drawPixmap(pos, imgCache);
ppm.end();
- if (imgCache.size() != img.size())
- q_func()->prepareGeometryChange();
imgCache = img;
}
@@ -1054,8 +1054,6 @@ void QDeclarativeTextPrivate::checkImgCache()
if (style != QDeclarativeText::Normal)
imgStyleCache = wrappedTextImage(true); //### should use styleColor
}
- if (imgCache.size() != newImgCache.size())
- q_func()->prepareGeometryChange();
imgCache = newImgCache;
if (!empty)
switch (style) {
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index c6b64ae..985ab72 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -269,7 +269,7 @@ int qmlRegisterInterface(const char *typeName)
QByteArray pointerName(name + '*');
QByteArray listName("QDeclarativeListProperty<" + name + ">");
- QDeclarativePrivate::RegisterInterface interface = {
+ QDeclarativePrivate::RegisterInterface qmlInterface = {
0,
qRegisterMetaType<T *>(pointerName.constData()),
@@ -278,7 +278,7 @@ int qmlRegisterInterface(const char *typeName)
qobject_interface_iid<T *>()
};
- return QDeclarativePrivate::qmlregister(QDeclarativePrivate::InterfaceRegistration, &interface);
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::InterfaceRegistration, &qmlInterface);
}
template<typename T>
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 9d74238..ab6ff74 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -843,7 +843,7 @@ QDeclarativeObjectMethodScriptClass::Value QDeclarativeObjectMethodScriptClass::
for (int ii = 0; ii < argTypeNames.count(); ++ii) {
argTypes[ii] = QMetaType::type(argTypeNames.at(ii));
if (argTypes[ii] == QVariant::Invalid)
- argTypes[ii] = enumType(method->object->metaObject(), argTypeNames.at(ii));
+ argTypes[ii] = enumType(method->object->metaObject(), QString::fromLatin1(argTypeNames.at(ii)));
if (argTypes[ii] == QVariant::Invalid)
return Value(ctxt, ctxt->throwError(QString::fromLatin1("Unknown method parameter type: %1").arg(QLatin1String(argTypeNames.at(ii)))));
}
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index c956051..57cc9ab 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -895,7 +895,7 @@ QList<QDeclarativeError> QDeclarativeScriptParser::errors() const
static void replaceWithSpace(QString &str, int idx, int n)
{
QChar *data = str.data() + idx;
- QChar space(' ');
+ const QChar space(QLatin1Char(' '));
for (int ii = 0; ii < n; ++ii)
*data++ = space;
}
diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp
index 9b42065..061f309 100644
--- a/src/declarative/qml/qdeclarativetypeloader.cpp
+++ b/src/declarative/qml/qdeclarativetypeloader.cpp
@@ -804,7 +804,7 @@ void QDeclarativeTypeData::done()
error.setUrl(finalUrl());
error.setLine(script.location.line);
error.setColumn(script.location.column);
- error.setDescription(typeLoader()->tr("Script %1 unavailable").arg(script.script->url().toString()));
+ error.setDescription(QDeclarativeTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString()));
errors.prepend(error);
setError(errors);
}
@@ -822,7 +822,7 @@ void QDeclarativeTypeData::done()
error.setUrl(finalUrl());
error.setLine(type.location.line);
error.setColumn(type.location.column);
- error.setDescription(typeLoader()->tr("Type %1 unavailable").arg(typeName));
+ error.setDescription(QDeclarativeTypeLoader::tr("Type %1 unavailable").arg(typeName));
errors.prepend(error);
setError(errors);
}
@@ -995,9 +995,9 @@ void QDeclarativeTypeData::resolveTypes()
QString userTypeName = parserRef->name;
userTypeName.replace(QLatin1Char('/'),QLatin1Char('.'));
if (typeNamespace)
- error.setDescription(typeLoader()->tr("Namespace %1 cannot be used as a type").arg(userTypeName));
+ error.setDescription(QDeclarativeTypeLoader::tr("Namespace %1 cannot be used as a type").arg(userTypeName));
else
- error.setDescription(typeLoader()->tr("%1 %2").arg(userTypeName).arg(errorString));
+ error.setDescription(QDeclarativeTypeLoader::tr("%1 %2").arg(userTypeName).arg(errorString));
if (!parserRef->refObjects.isEmpty()) {
QDeclarativeParser::Object *obj = parserRef->refObjects.first();
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index d832638..332acc4 100644
--- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -1640,8 +1640,8 @@ static QScriptValue qmlxmlhttprequest_responseXML(QScriptContext *context, QScri
THROW_REFERENCE("Not an XMLHttpRequest object");
if (!request->receivedXml() ||
- request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
- request->readyState() != QDeclarativeXMLHttpRequest::Done)
+ (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done))
return engine->nullValue();
else
return Document::load(engine, request->rawResponseBody());
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 3c09747..ea3da25 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -2699,14 +2699,15 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions,
qreal scale = 1;
qreal rotation = 0;
- if (ok && transform.type() != QTransform::TxRotate) {
+ bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
+ if (ok && !isRotate) {
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
qmlInfo(this) << QDeclarativeParentAnimation::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
- } else if (ok && transform.type() == QTransform::TxRotate) {
+ } else if (ok && isRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index d3cf9c8..cf2eada 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -1298,7 +1298,6 @@ void ModelNode::setObjectValue(const QScriptValue& valuemap) {
}
void ModelNode::setListValue(const QScriptValue& valuelist) {
- QScriptValueIterator it(valuelist);
values.clear();
int size = valuelist.property(QLatin1String("length")).toInt32();
for (int i=0; i<size; i++) {
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
index 498de6d..d9df169 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
@@ -232,7 +232,7 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
emit m_orig->itemsMoved(change.index, change.to, change.count);
break;
case Change::Changed:
- emit m_orig->itemsMoved(change.index, change.to, change.count);
+ emit m_orig->itemsChanged(change.index, change.to, orig->m_roles.keys());
break;
}
}
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index b2f02e6..ca83c52 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -214,22 +214,23 @@ void QSmoothedAnimation::init()
}
bool hasReversed = trackVelocity != 0. &&
- ((trackVelocity > 0) == ((initialValue - to) > 0));
+ ((!invert) == ((initialValue - to) > 0));
if (hasReversed) {
switch (reversingMode) {
default:
case QDeclarativeSmoothedAnimation::Eased:
+ initialVelocity = -trackVelocity;
break;
case QDeclarativeSmoothedAnimation::Sync:
QDeclarativePropertyPrivate::write(target, to,
QDeclarativePropertyPrivate::BypassInterceptor
| QDeclarativePropertyPrivate::DontRemoveBinding);
+ trackVelocity = 0;
stop();
return;
case QDeclarativeSmoothedAnimation::Immediate:
initialVelocity = 0;
- delayedStop();
break;
}
}
@@ -311,6 +312,17 @@ QDeclarativeSmoothedAnimationPrivate::QDeclarativeSmoothedAnimationPrivate()
QDeclarative_setParent_noEvent(anim, q);
}
+void QDeclarativeSmoothedAnimationPrivate::updateRunningAnimations()
+{
+ foreach(QSmoothedAnimation* ease, activeAnimations.values()){
+ ease->maximumEasingTime = anim->maximumEasingTime;
+ ease->reversingMode = anim->reversingMode;
+ ease->velocity = anim->velocity;
+ ease->userDuration = anim->userDuration;
+ ease->init();
+ }
+}
+
QAbstractAnimation* QDeclarativeSmoothedAnimation::qtAnimation()
{
Q_D(QDeclarativeSmoothedAnimation);
@@ -340,7 +352,6 @@ void QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions
ease = d->activeAnimations.value((*d->actions)[i].property);
needsRestart = true;
}
-
ease->target = (*d->actions)[i].property;
ease->to = (*d->actions)[i].toValue.toReal();
@@ -394,6 +405,7 @@ void QDeclarativeSmoothedAnimation::setReversingMode(ReversingMode m)
d->anim->reversingMode = m;
emit reversingModeChanged();
+ d->updateRunningAnimations();
}
/*!
@@ -402,6 +414,9 @@ void QDeclarativeSmoothedAnimation::setReversingMode(ReversingMode m)
This property holds the animation duration, in msecs, used when tracking the source.
Setting this to -1 (the default) disables the duration value.
+
+ If the velocity value and the duration value are both enabled, then the animation will
+ use whichever gives the shorter duration.
*/
int QDeclarativeSmoothedAnimation::duration() const
{
@@ -414,7 +429,10 @@ void QDeclarativeSmoothedAnimation::setDuration(int duration)
Q_D(QDeclarativeSmoothedAnimation);
if (duration != -1)
QDeclarativeNumberAnimation::setDuration(duration);
+ if(duration == d->anim->userDuration)
+ return;
d->anim->userDuration = duration;
+ d->updateRunningAnimations();
}
qreal QDeclarativeSmoothedAnimation::velocity() const
@@ -431,6 +449,9 @@ qreal QDeclarativeSmoothedAnimation::velocity() const
The default velocity of SmoothedAnimation is 200 units/second.
Setting this to -1 disables the velocity value.
+
+ If the velocity value and the duration value are both enabled, then the animation will
+ use whichever gives the shorter duration.
*/
void QDeclarativeSmoothedAnimation::setVelocity(qreal v)
{
@@ -440,12 +461,13 @@ void QDeclarativeSmoothedAnimation::setVelocity(qreal v)
d->anim->velocity = v;
emit velocityChanged();
+ d->updateRunningAnimations();
}
/*!
\qmlproperty int SmoothedAnimation::maximumEasingTime
- This property specifies the maximum time, in msecs, an "eases" during the follow should take.
+ This property specifies the maximum time, in msecs, any "eases" during the follow should take.
Setting this property causes the velocity to "level out" after at a time. Setting
a negative value reverts to the normal mode of easing over the entire animation
duration.
@@ -461,8 +483,11 @@ int QDeclarativeSmoothedAnimation::maximumEasingTime() const
void QDeclarativeSmoothedAnimation::setMaximumEasingTime(int v)
{
Q_D(QDeclarativeSmoothedAnimation);
+ if(v == d->anim->maximumEasingTime)
+ return;
d->anim->maximumEasingTime = v;
emit maximumEasingTimeChanged();
+ d->updateRunningAnimations();
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
index 8cdbea2..cb0f4c2 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
@@ -123,6 +123,7 @@ class QDeclarativeSmoothedAnimationPrivate : public QDeclarativePropertyAnimatio
Q_DECLARE_PUBLIC(QDeclarativeSmoothedAnimation)
public:
QDeclarativeSmoothedAnimationPrivate();
+ void updateRunningAnimations();
QParallelAnimationGroup *wrapperGroup;
QSmoothedAnimation *anim;
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index fce4097..e0fc45d 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -62,10 +62,12 @@ public:
struct SpringAnimation {
SpringAnimation()
- : currentValue(0), to(0), velocity(0){}
+ : currentValue(0), to(0), velocity(0), start(0), duration(0) {}
qreal currentValue;
qreal to;
qreal velocity;
+ int start;
+ int duration;
};
QHash<QDeclarativeProperty, SpringAnimation> activeAnimations;
@@ -135,7 +137,6 @@ void QDeclarativeSpringAnimationPrivate::tick(int time)
bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &property, SpringAnimation &animation, int elapsed)
{
-
qreal srcVal = animation.to;
bool stop = false;
@@ -192,18 +193,14 @@ bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &pro
animation.currentValue += moveBy;
if (haveModulus)
animation.currentValue = fmod(animation.currentValue, modulus);
- if (animation.currentValue > animation.to) {
- animation.currentValue = animation.to;
- stop = true;
- }
} else {
animation.currentValue -= moveBy;
if (haveModulus && animation.currentValue < 0.0)
animation.currentValue = fmod(animation.currentValue, modulus) + modulus;
- if (animation.currentValue < animation.to) {
- animation.currentValue = animation.to;
- stop = true;
- }
+ }
+ if (lastTime - animation.start >= animation.duration) {
+ animation.currentValue = animation.to;
+ stop = true;
}
}
@@ -222,8 +219,18 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
mode = Track;
else if (spring > 0.)
mode = Spring;
- else
+ else {
mode = Velocity;
+ QHash<QDeclarativeProperty, SpringAnimation>::iterator it;
+ for (it = activeAnimations.begin(); it != activeAnimations.end(); ++it) {
+ SpringAnimation &animation = *it;
+ animation.start = lastTime;
+ qreal dist = qAbs(animation.currentValue - animation.to);
+ if (haveModulus && dist > modulus / 2)
+ dist = modulus - fmod(dist, modulus);
+ animation.duration = dist / velocityms;
+ }
+ }
}
/*!
@@ -378,6 +385,7 @@ void QDeclarativeSpringAnimation::setModulus(qreal modulus)
if (d->modulus != modulus) {
d->haveModulus = modulus != 0.0;
d->modulus = modulus;
+ d->updateMode();
emit modulusChanged();
}
}
@@ -429,10 +437,17 @@ void QDeclarativeSpringAnimation::transition(QDeclarativeStateActions &actions,
QDeclarativeSpringAnimationPrivate::SpringAnimation &animation
= d->activeAnimations[property];
animation.to = d->actions->at(i).toValue.toReal();
+ animation.start = d->lastTime;
if (d->fromIsDefined)
animation.currentValue = d->actions->at(i).fromValue.toReal();
else
animation.currentValue = property.read().toReal();
+ if (d->mode == QDeclarativeSpringAnimationPrivate::Velocity) {
+ qreal dist = qAbs(animation.currentValue - animation.to);
+ if (d->haveModulus && dist > d->modulus / 2)
+ dist = d->modulus - fmod(dist, d->modulus);
+ animation.duration = dist / d->velocityms;
+ }
}
}
}
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 845b3da..a78fc54 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -98,14 +98,15 @@ void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, Q
qreal scale = 1;
qreal rotation = 0;
- if (ok && transform.type() != QTransform::TxRotate) {
+ bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
+ if (ok && !isRotate) {
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
qmlInfo(q) << QDeclarativeParentChange::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
- } else if (ok && transform.type() == QTransform::TxRotate) {
+ } else if (ok && isRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp
index fc8575f..31e7245 100644
--- a/src/gui/accessible/qaccessible_win.cpp
+++ b/src/gui/accessible/qaccessible_win.cpp
@@ -42,7 +42,7 @@
#ifndef QT_NO_ACCESSIBILITY
#include "qapplication.h"
-#include "qlibrary.h"
+#include <private/qsystemlibrary_p.h>
#include "qmessagebox.h" // ### dependency
#include "qt_windows.h"
#include "qwidget.h"
@@ -76,71 +76,71 @@ QT_END_INCLUDE_NAMESPACE
static const char *roleString(QAccessible::Role role)
{
static const char *roles[] = {
- "NoRole" /*= 0x00000000*/,
- "TitleBar" /*= 0x00000001*/,
- "MenuBar" /*= 0x00000002*/,
- "ScrollBar" /*= 0x00000003*/,
- "Grip" /*= 0x00000004*/,
- "Sound" /*= 0x00000005*/,
- "Cursor" /*= 0x00000006*/,
- "Caret" /*= 0x00000007*/,
- "AlertMessage" /*= 0x00000008*/,
- "Window" /*= 0x00000009*/,
- "Client" /*= 0x0000000A*/,
- "PopupMenu" /*= 0x0000000B*/,
- "MenuItem" /*= 0x0000000C*/,
- "ToolTip" /*= 0x0000000D*/,
- "Application" /*= 0x0000000E*/,
- "Document" /*= 0x0000000F*/,
- "Pane" /*= 0x00000010*/,
- "Chart" /*= 0x00000011*/,
- "Dialog" /*= 0x00000012*/,
- "Border" /*= 0x00000013*/,
- "Grouping" /*= 0x00000014*/,
- "Separator" /*= 0x00000015*/,
- "ToolBar" /*= 0x00000016*/,
- "StatusBar" /*= 0x00000017*/,
- "Table" /*= 0x00000018*/,
- "ColumnHeader" /*= 0x00000019*/,
- "RowHeader" /*= 0x0000001A*/,
- "Column" /*= 0x0000001B*/,
- "Row" /*= 0x0000001C*/,
- "Cell" /*= 0x0000001D*/,
- "Link" /*= 0x0000001E*/,
- "HelpBalloon" /*= 0x0000001F*/,
- "Assistant" /*= 0x00000020*/,
- "List" /*= 0x00000021*/,
- "ListItem" /*= 0x00000022*/,
- "Tree" /*= 0x00000023*/,
- "TreeItem" /*= 0x00000024*/,
- "PageTab" /*= 0x00000025*/,
- "PropertyPage" /*= 0x00000026*/,
- "Indicator" /*= 0x00000027*/,
- "Graphic" /*= 0x00000028*/,
- "StaticText" /*= 0x00000029*/,
- "EditableText" /*= 0x0000002A*/, // Editable, selectable, etc.
- "PushButton" /*= 0x0000002B*/,
- "CheckBox" /*= 0x0000002C*/,
- "RadioButton" /*= 0x0000002D*/,
- "ComboBox" /*= 0x0000002E*/,
- "DropList" /*= 0x0000002F*/, // commented out
- "ProgressBar" /*= 0x00000030*/,
- "Dial" /*= 0x00000031*/,
- "HotkeyField" /*= 0x00000032*/,
- "Slider" /*= 0x00000033*/,
- "SpinBox" /*= 0x00000034*/,
- "Canvas" /*= 0x00000035*/,
- "Animation" /*= 0x00000036*/,
- "Equation" /*= 0x00000037*/,
- "ButtonDropDown" /*= 0x00000038*/,
- "ButtonMenu" /*= 0x00000039*/,
- "ButtonDropGrid" /*= 0x0000003A*/,
- "Whitespace" /*= 0x0000003B*/,
- "PageTabList" /*= 0x0000003C*/,
- "Clock" /*= 0x0000003D*/,
- "Splitter" /*= 0x0000003E*/,
- "LayeredPane" /*= 0x0000003F*/,
- "UserRole" /*= 0x0000ffff*/
+ "NoRole" /* = 0x00000000 */,
+ "TitleBar" /* = 0x00000001 */,
+ "MenuBar" /* = 0x00000002 */,
+ "ScrollBar" /* = 0x00000003 */,
+ "Grip" /* = 0x00000004 */,
+ "Sound" /* = 0x00000005 */,
+ "Cursor" /* = 0x00000006 */,
+ "Caret" /* = 0x00000007 */,
+ "AlertMessage" /* = 0x00000008 */,
+ "Window" /* = 0x00000009 */,
+ "Client" /* = 0x0000000A */,
+ "PopupMenu" /* = 0x0000000B */,
+ "MenuItem" /* = 0x0000000C */,
+ "ToolTip" /* = 0x0000000D */,
+ "Application" /* = 0x0000000E */,
+ "Document" /* = 0x0000000F */,
+ "Pane" /* = 0x00000010 */,
+ "Chart" /* = 0x00000011 */,
+ "Dialog" /* = 0x00000012 */,
+ "Border" /* = 0x00000013 */,
+ "Grouping" /* = 0x00000014 */,
+ "Separator" /* = 0x00000015 */,
+ "ToolBar" /* = 0x00000016 */,
+ "StatusBar" /* = 0x00000017 */,
+ "Table" /* = 0x00000018 */,
+ "ColumnHeader" /* = 0x00000019 */,
+ "RowHeader" /* = 0x0000001A */,
+ "Column" /* = 0x0000001B */,
+ "Row" /* = 0x0000001C */,
+ "Cell" /* = 0x0000001D */,
+ "Link" /* = 0x0000001E */,
+ "HelpBalloon" /* = 0x0000001F */,
+ "Assistant" /* = 0x00000020 */,
+ "List" /* = 0x00000021 */,
+ "ListItem" /* = 0x00000022 */,
+ "Tree" /* = 0x00000023 */,
+ "TreeItem" /* = 0x00000024 */,
+ "PageTab" /* = 0x00000025 */,
+ "PropertyPage" /* = 0x00000026 */,
+ "Indicator" /* = 0x00000027 */,
+ "Graphic" /* = 0x00000028 */,
+ "StaticText" /* = 0x00000029 */,
+ "EditableText" /* = 0x0000002A */, // Editable, selectable, etc.
+ "PushButton" /* = 0x0000002B */,
+ "CheckBox" /* = 0x0000002C */,
+ "RadioButton" /* = 0x0000002D */,
+ "ComboBox" /* = 0x0000002E */,
+ "DropList" /* = 0x0000002F */, // commented out
+ "ProgressBar" /* = 0x00000030 */,
+ "Dial" /* = 0x00000031 */,
+ "HotkeyField" /* = 0x00000032 */,
+ "Slider" /* = 0x00000033 */,
+ "SpinBox" /* = 0x00000034 */,
+ "Canvas" /* = 0x00000035 */,
+ "Animation" /* = 0x00000036 */,
+ "Equation" /* = 0x00000037 */,
+ "ButtonDropDown" /* = 0x00000038 */,
+ "ButtonMenu" /* = 0x00000039 */,
+ "ButtonDropGrid" /* = 0x0000003A */,
+ "Whitespace" /* = 0x0000003B */,
+ "PageTabList" /* = 0x0000003C */,
+ "Clock" /* = 0x0000003D */,
+ "Splitter" /* = 0x0000003E */,
+ "LayeredPane" /* = 0x0000003F */,
+ "UserRole" /* = 0x0000ffff*/
};
if (role >=0x40)
@@ -243,7 +243,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
static bool resolvedNWE = false;
if (!resolvedNWE) {
resolvedNWE = true;
- ptrNotifyWinEvent = (PtrNotifyWinEvent)QLibrary::resolve(QLatin1String("user32"), "NotifyWinEvent");
+ ptrNotifyWinEvent = (PtrNotifyWinEvent)QSystemLibrary::resolve(QLatin1String("user32"), "NotifyWinEvent");
}
if (!ptrNotifyWinEvent)
return;
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index 258707c..5b192b4 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -52,7 +52,7 @@
#include <qbuffer.h>
#include <qdir.h>
#include <qstringlist.h>
-#include <qlibrary.h>
+#include <private/qsystemlibrary_p.h>
#include "qfiledialog_win_p.h"
#ifndef QT_NO_THREAD
@@ -100,10 +100,10 @@ static void qt_win_resolve_libs()
triedResolve = true;
#if !defined(Q_WS_WINCE)
- QLibrary lib(QLatin1String("shell32"));
- ptrSHBrowseForFolder = (PtrSHBrowseForFolder) lib.resolve("SHBrowseForFolderW");
- ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList) lib.resolve("SHGetPathFromIDListW");
- ptrSHGetMalloc = (PtrSHGetMalloc) lib.resolve("SHGetMalloc");
+ QSystemLibrary lib(L"shell32");
+ ptrSHBrowseForFolder = (PtrSHBrowseForFolder)lib.resolve("SHBrowseForFolderW");
+ ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)lib.resolve("SHGetPathFromIDListW");
+ ptrSHGetMalloc = (PtrSHGetMalloc)lib.resolve("SHGetMalloc");
#else
// CE stores them in a different lib and does not use unicode version
HINSTANCE handle = LoadLibrary(L"Ceshell");
@@ -409,7 +409,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd,
{
if (!pSHCreateItemFromParsingName) {
// This function is available only in Vista & above.
- QLibrary shellLib(QLatin1String("Shell32"));
+ QSystemLibrary shellLib(QLatin1String("Shell32"));
pSHCreateItemFromParsingName = (PtrSHCreateItemFromParsingName)
shellLib.resolve("SHCreateItemFromParsingName");
if (!pSHCreateItemFromParsingName)
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index ad8801a..5fca8f2 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -43,7 +43,7 @@
#ifndef QT_NO_STYLE_WINDOWSVISTA
#include "qwizard_win_p.h"
-#include "qlibrary.h"
+#include <private/qsystemlibrary_p.h>
#include "qwizard.h"
#include "qpaintengine.h"
#include "qapplication.h"
@@ -706,7 +706,7 @@ bool QVistaHelper::resolveSymbols()
static bool tried = false;
if (!tried) {
tried = true;
- QLibrary dwmLib(QString::fromAscii("dwmapi"));
+ QSystemLibrary dwmLib(L"dwmapi");
pDwmIsCompositionEnabled =
(PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled");
if (pDwmIsCompositionEnabled) {
@@ -714,7 +714,7 @@ bool QVistaHelper::resolveSymbols()
pDwmExtendFrameIntoClientArea =
(PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea");
}
- QLibrary themeLib(QString::fromAscii("uxtheme"));
+ QSystemLibrary themeLib(L"uxtheme");
pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed");
if (pIsAppThemed) {
pDrawThemeBackground = (PtrDrawThemeBackground)themeLib.resolve("DrawThemeBackground");
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 605b1e6..af3b79a 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -259,7 +259,7 @@ EGLConfig QEgl::defaultConfig(int devType, API api, ConfigOptions options)
// Add paint engine requirements
if (api == OpenVG) {
-#ifndef QVG_SCISSOR_CLIP
+#if !defined(QVG_SCISSOR_CLIP) && defined(EGL_ALPHA_MASK_SIZE)
configAttribs.setValue(EGL_ALPHA_MASK_SIZE, 1);
#endif
} else {
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
index c214e88..aa08934 100644
--- a/src/gui/egl/qegl_p.h
+++ b/src/gui/egl/qegl_p.h
@@ -65,6 +65,10 @@ QT_BEGIN_INCLUDE_NAMESPACE
#else
# include <EGL/egl.h>
#endif
+#if !defined(EGL_VERSION_1_2)
+typedef unsigned int EGLenum;
+typedef void *EGLClientBuffer;
+#endif
#else
//types from egltypes.h for compiling stub without EGL headers
diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h
index cae8164..5bc8f09 100644
--- a/src/gui/egl/qeglcontext_p.h
+++ b/src/gui/egl/qeglcontext_p.h
@@ -107,6 +107,9 @@ private:
static QEglContext *currentContext(QEgl::API api);
static void setCurrentContext(QEgl::API api, QEglContext *context);
+
+ friend class QMeeGoGraphicsSystem;
+ friend class QMeeGoPixmapData;
};
QT_END_NAMESPACE
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
index 3638de5..eeae06d 100644
--- a/src/gui/egl/qeglproperties.cpp
+++ b/src/gui/egl/qeglproperties.cpp
@@ -241,8 +241,10 @@ void QEglProperties::setRenderableType(QEgl::API api)
// reductions in complexity are possible.
bool QEglProperties::reduceConfiguration()
{
+#ifdef EGL_SWAP_BEHAVIOR
if (value(EGL_SWAP_BEHAVIOR) != EGL_DONT_CARE)
removeValue(EGL_SWAP_BEHAVIOR);
+#endif
#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
// For OpenVG, we sometimes try to create a surface using a pre-multiplied format. If we can't
diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp
index 3958cf0..c77c35c 100644
--- a/src/gui/embedded/qsoundqss_qws.cpp
+++ b/src/gui/embedded/qsoundqss_qws.cpp
@@ -286,7 +286,7 @@ public:
rightVolume = maxVolume>>1;
isPriority = false;
samples_due = 0;
- max1 = max2 = out = 0;//= sound_buffer_size;
+ max1 = max2 = out = 0;// = sound_buffer_size;
data = data1;
max = &max1;
sampleRunin = 0;
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index 3707591..634f68c 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -234,7 +234,7 @@ void QGraphicsLayoutItemPrivate::setSize(Qt::SizeHint which, const QSizeF &size)
if (userSizeHints) {
if (size == userSizeHints[which])
return;
- } else if (!size.isValid()) {
+ } else if (size.width() < 0 && size.height() < 0) {
return;
}
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 539685a..921e121 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4984,14 +4984,15 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
return;
}
- bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents
- && !item->d_ptr->graphicsEffect;
+ bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents;
if (!hasNoContents) {
item->d_ptr->dirty = 1;
if (fullItemUpdate)
item->d_ptr->fullUpdatePending = 1;
else if (!item->d_ptr->fullUpdatePending)
item->d_ptr->needsRepaint |= rect;
+ } else if (item->d_ptr->graphicsEffect) {
+ invalidateChildren = true;
}
if (invalidateChildren) {
@@ -5270,7 +5271,6 @@ void QGraphicsScene::drawItems(QPainter *painter,
if (!d->unpolishedItems.isEmpty())
d->_q_polishItems();
- d->updateAll = false;
QTransform viewTransform = painter->worldTransform();
Q_UNUSED(options);
@@ -5279,6 +5279,7 @@ void QGraphicsScene::drawItems(QPainter *painter,
QRegion *expose = 0;
const quint32 oldRectAdjust = d->rectAdjust;
if (view) {
+ d->updateAll = false;
expose = &view->d_func()->exposedRegion;
if (view->d_func()->optimizationFlags & QGraphicsView::DontAdjustForAntialiasing)
d->rectAdjust = 1;
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index 12885ec..42cc830 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -63,11 +63,6 @@ class CFbsBitGc;
class QSymbianBitmapDataAccess;
-class QS60PixmapData;
-void qt_symbian_register_pixmap(QS60PixmapData *pd);
-void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
-void qt_symbian_release_pixmaps();
-
class QSymbianFbsHeapLock
{
public:
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index b08b9a9..af86d77 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -382,6 +382,9 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
const bool anytextmodes = hints & (ImhUppercaseOnly | ImhLowercaseOnly | ImhEmailCharactersOnly | ImhUrlCharactersOnly);
const bool numbersOnly = anynumbermodes && !anytextmodes;
const bool noOnlys = !(hints & ImhExclusiveInputMask);
+ // if alphanumeric input, or if multiple incompatible number modes are selected;
+ // then make all symbols available in numeric mode too.
+ const bool needsCharMap= !numbersOnly || ((hints & ImhFormattedNumbersOnly) && (hints & ImhDialableCharactersOnly));
TInt flags;
Qt::InputMethodHints oldHints = hints;
@@ -481,9 +484,7 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
if (hints & ImhNoPredictiveText || hints & ImhHiddenText) {
flags |= EAknEditorFlagNoT9;
}
- // if alphanumeric input, or if multiple incompatible number modes are selected;
- // then make all symbols available in numeric mode too.
- if (!numbersOnly || ((hints & ImhFormattedNumbersOnly) && (hints & ImhDialableCharactersOnly)))
+ if (needsCharMap)
flags |= EAknEditorFlagUseSCTNumericCharmap;
m_fepState->SetFlags(flags);
ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateFlagsUpdate);
@@ -508,8 +509,10 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG);
} else if (hints & ImhEmailCharactersOnly) {
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG);
- } else {
+ } else if (needsCharMap) {
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG);
+ } else {
+ m_fepState->SetSpecialCharacterTableResourceId(0);
}
if (hints & ImhHiddenText) {
diff --git a/src/gui/itemviews/qabstractproxymodel.cpp b/src/gui/itemviews/qabstractproxymodel.cpp
index 43a1327..1c600e2 100644
--- a/src/gui/itemviews/qabstractproxymodel.cpp
+++ b/src/gui/itemviews/qabstractproxymodel.cpp
@@ -187,8 +187,12 @@ QItemSelection QAbstractProxyModel::mapSelectionToSource(const QItemSelection &p
{
QModelIndexList proxyIndexes = proxySelection.indexes();
QItemSelection sourceSelection;
- for (int i = 0; i < proxyIndexes.size(); ++i)
- sourceSelection << QItemSelectionRange(mapToSource(proxyIndexes.at(i)));
+ for (int i = 0; i < proxyIndexes.size(); ++i) {
+ const QModelIndex proxyIdx = mapToSource(proxyIndexes.at(i));
+ if (!proxyIdx.isValid())
+ continue;
+ sourceSelection << QItemSelectionRange(proxyIdx);
+ }
return sourceSelection;
}
@@ -201,8 +205,12 @@ QItemSelection QAbstractProxyModel::mapSelectionFromSource(const QItemSelection
{
QModelIndexList sourceIndexes = sourceSelection.indexes();
QItemSelection proxySelection;
- for (int i = 0; i < sourceIndexes.size(); ++i)
- proxySelection << QItemSelectionRange(mapFromSource(sourceIndexes.at(i)));
+ for (int i = 0; i < sourceIndexes.size(); ++i) {
+ const QModelIndex srcIdx = mapFromSource(sourceIndexes.at(i));
+ if (!srcIdx.isValid())
+ continue;
+ proxySelection << QItemSelectionRange(srcIdx);
+ }
return proxySelection;
}
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index a6d2594..f7e0751 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -82,8 +82,9 @@ static QString qt_strippedText(QString s)
QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false),
forceEnabledInSoftkeys(false), menuActionSoftkeys(false),
+ iconVisibleInMenu(-1),
menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::NoSoftKey),
- priority(QAction::NormalPriority), iconVisibleInMenu(-1)
+ priority(QAction::NormalPriority)
{
#ifdef QT3_SUPPORT
static int qt_static_action_id = -1;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 82dd83a..2fd2f46 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -65,6 +65,7 @@
#include "qcolormap.h"
#include "qdebug.h"
#include "private/qgraphicssystemfactory_p.h"
+#include "private/qgraphicssystem_p.h"
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
#include "qmessagebox.h"
@@ -94,6 +95,10 @@
#include <stdlib.h>
+#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
+#include <link.h>
+#endif
+
#include "qapplication_p.h"
#include "qevent_p.h"
#include "qwidget_p.h"
@@ -768,6 +773,13 @@ QApplication::QApplication(int &argc, char **argv, Type type , int _internal)
: QCoreApplication(*new QApplicationPrivate(argc, argv, type))
{ Q_D(QApplication); d->construct(); QApplicationPrivate::app_compile_version = _internal;}
+#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
+static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data)
+{
+ const char *name = static_cast<const char *>(data);
+ return strstr(info->dlpi_name, name) != 0;
+}
+#endif
/*!
\internal
@@ -785,6 +797,19 @@ void QApplicationPrivate::construct(
// the environment variable has the lowest precedence of runtime graphicssystem switches
if (graphics_system_name.isEmpty())
graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM"));
+
+#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
+ if (graphics_system_name.isEmpty()) {
+ bool linksWithMeeGoTouch = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libmeegotouchcore"));
+ bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libQtMeeGoGraphicsSystemHelper"));
+
+ if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) {
+ qWarning("Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem\n");
+ graphics_system_name = QLatin1String("native");
+ }
+ }
+#endif
+
// Must be called before initialize()
qt_init(this, qt_appType
#ifdef Q_WS_X11
@@ -1116,6 +1141,8 @@ QApplication::~QApplication()
QApplicationPrivate::app_style = 0;
delete QApplicationPrivate::app_icon;
QApplicationPrivate::app_icon = 0;
+ delete QApplicationPrivate::graphics_system;
+ QApplicationPrivate::graphics_system = 0;
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
#endif
@@ -4340,11 +4367,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
eventAccepted = ge.isAccepted();
for (int i = 0; i < gestures.size(); ++i) {
QGesture *g = gestures.at(i);
- if ((res && eventAccepted) || (!eventAccepted && ge.isAccepted(g))) {
+ // Ignore res [event return value] because handling of multiple gestures
+ // packed into a single QEvent depends on not consuming the event
+ if (eventAccepted || ge.isAccepted(g)) {
// if the gesture was accepted, mark the target widget for it
gestureEvent->d_func()->targetWidgets[g->gestureType()] = w;
gestureEvent->setAccepted(g, true);
- } else if (!eventAccepted && !ge.isAccepted(g)) {
+ } else {
// if the gesture was explicitly ignored by the application,
// put it back so a parent can get it
allGestures.append(g);
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 0c48bfd..78028eb 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -68,7 +68,6 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c
#include "qdatetime.h"
#include "qpointer.h"
#include "qhash.h"
-#include "qlibrary.h"
#include "qmetaobject.h"
#include "qmime.h"
#include "qpainter.h"
@@ -94,6 +93,7 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c
#include "qdebug.h"
#include <private/qkeymapper_p.h>
#include <private/qlocale_p.h>
+#include <private/qsystemlibrary_p.h>
#include "qevent_p.h"
//#define ALIEN_DEBUG
@@ -206,7 +206,7 @@ static void resolveAygLibs()
{
if (!aygResolved) {
aygResolved = true;
- QLibrary ayglib(QLatin1String("aygshell"));
+ QSystemLibrary ayglib(QLatin1String("aygshell"));
if (!ayglib.load())
return;
ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture");
@@ -833,10 +833,10 @@ void qt_init(QApplicationPrivate *priv, int)
#ifndef Q_OS_WINCE
ptrUpdateLayeredWindowIndirect =
- (PtrUpdateLayeredWindowIndirect) QLibrary::resolve(QLatin1String("user32"),
+ (PtrUpdateLayeredWindowIndirect) QSystemLibrary::resolve(QLatin1String("user32"),
"UpdateLayeredWindowIndirect");
ptrUpdateLayeredWindow =
- (PtrUpdateLayeredWindow) QLibrary::resolve(QLatin1String("user32"),
+ (PtrUpdateLayeredWindow) QSystemLibrary::resolve(QLatin1String("user32"),
"UpdateLayeredWindow");
if (ptrUpdateLayeredWindow && !ptrUpdateLayeredWindowIndirect)
@@ -844,7 +844,7 @@ void qt_init(QApplicationPrivate *priv, int)
// Notify Vista and Windows 7 that we support highter DPI settings
ptrSetProcessDPIAware = (PtrSetProcessDPIAware)
- QLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware");
+ QSystemLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware");
if (ptrSetProcessDPIAware)
ptrSetProcessDPIAware();
#endif
@@ -865,30 +865,28 @@ void qt_init(QApplicationPrivate *priv, int)
#elif !defined(Q_WS_WINCE)
#if !defined(QT_NO_NATIVE_GESTURES)
priv->GetGestureInfo =
- (PtrGetGestureInfo)QLibrary::resolve(QLatin1String("user32"),
+ (PtrGetGestureInfo)QSystemLibrary::resolve(QLatin1String("user32"),
"GetGestureInfo");
priv->GetGestureExtraArgs =
- (PtrGetGestureExtraArgs)QLibrary::resolve(QLatin1String("user32"),
+ (PtrGetGestureExtraArgs)QSystemLibrary::resolve(QLatin1String("user32"),
"GetGestureExtraArgs");
priv->CloseGestureInfoHandle =
- (PtrCloseGestureInfoHandle)QLibrary::resolve(QLatin1String("user32"),
+ (PtrCloseGestureInfoHandle)QSystemLibrary::resolve(QLatin1String("user32"),
"CloseGestureInfoHandle");
priv->SetGestureConfig =
- (PtrSetGestureConfig)QLibrary::resolve(QLatin1String("user32"),
+ (PtrSetGestureConfig)QSystemLibrary::resolve(QLatin1String("user32"),
"SetGestureConfig");
priv->GetGestureConfig =
- (PtrGetGestureConfig)QLibrary::resolve(QLatin1String("user32"),
+ (PtrGetGestureConfig)QSystemLibrary::resolve(QLatin1String("user32"),
"GetGestureConfig");
#endif // QT_NO_NATIVE_GESTURES
+ QSystemLibrary libTheme(QLatin1String("uxtheme"));
priv->BeginPanningFeedback =
- (PtrBeginPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"),
- "BeginPanningFeedback");
+ (PtrBeginPanningFeedback)libTheme.resolve("BeginPanningFeedback");
priv->UpdatePanningFeedback =
- (PtrUpdatePanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"),
- "UpdatePanningFeedback");
+ (PtrUpdatePanningFeedback)libTheme.resolve("UpdatePanningFeedback");
priv->EndPanningFeedback =
- (PtrEndPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"),
- "EndPanningFeedback");
+ (PtrEndPanningFeedback)libTheme.resolve("EndPanningFeedback");
#endif
#endif // QT_NO_GESTURES
}
@@ -2338,7 +2336,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
if (!oleaccChecked) {
oleaccChecked = true;
#if !defined(Q_OS_WINCE)
- ptrLresultFromObject = (PtrLresultFromObject)QLibrary::resolve(QLatin1String("oleacc.dll"), "LresultFromObject");
+ ptrLresultFromObject = (PtrLresultFromObject)QSystemLibrary::resolve(QLatin1String("oleacc"), "LresultFromObject");
#endif
}
if (ptrLresultFromObject) {
@@ -3142,7 +3140,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
if (curWin != 0) {
if (!trackMouseEventLookup) {
trackMouseEventLookup = true;
- ptrTrackMouseEvent = (PtrTrackMouseEvent)QLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent");
+ ptrTrackMouseEvent = (PtrTrackMouseEvent)QSystemLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent");
}
if (ptrTrackMouseEvent && !qApp->d_func()->inPopupMode()) {
// We always have to set the tracking, since
@@ -3677,7 +3675,7 @@ static void initWinTabFunctions()
if (!qt_is_gui_used)
return;
- QLibrary library(QLatin1String("wintab32"));
+ QSystemLibrary library(QLatin1String("wintab32"));
if (library.load()) {
ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW");
ptrWTGet = (PtrWTGet)library.resolve("WTGetW");
@@ -4100,7 +4098,7 @@ void QApplicationPrivate::initializeMultitouch_sys()
value & (QT_NID_INTEGRATED_TOUCH | QT_NID_EXTERNAL_TOUCH | QT_NID_MULTI_INPUT);
}
- QLibrary library(QLatin1String("user32"));
+ QSystemLibrary library(QLatin1String("user32"));
// MinGW (g++ 3.4.5) accepts only C casts.
RegisterTouchWindow = (PtrRegisterTouchWindow)(library.resolve("RegisterTouchWindow"));
GetTouchInputInfo = (PtrGetTouchInputInfo)(library.resolve("GetTouchInputInfo"));
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 7495f6d..e7b7ed8 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -400,11 +400,39 @@ QTabletDeviceDataList *qt_tablet_devices()
extern bool qt_tabletChokeMouse;
#endif
+typedef bool(*QX11FilterFunction)(XEvent *event);
+
+Q_GLOBAL_STATIC(QList<QX11FilterFunction>, x11Filters)
+
+Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func)
+{
+ Q_ASSERT(func);
+
+ if (QList<QX11FilterFunction> *list = x11Filters())
+ list->append(func);
+}
+
+Q_GUI_EXPORT void qt_removeX11EventFilter(QX11FilterFunction func)
+{
+ Q_ASSERT(func);
+
+ if (QList<QX11FilterFunction> *list = x11Filters())
+ list->removeOne(func);
+}
+
+
static bool qt_x11EventFilter(XEvent* ev)
{
long unused;
if (qApp->filterEvent(ev, &unused))
return true;
+ if (const QList<QX11FilterFunction> *list = x11Filters()) {
+ for (QList<QX11FilterFunction>::const_iterator it = list->constBegin(); it != list->constEnd(); ++it) {
+ if ((*it)(ev))
+ return true;
+ }
+ }
+
return qApp->x11EventFilter(ev);
}
diff --git a/src/gui/kernel/qdesktopwidget_win.cpp b/src/gui/kernel/qdesktopwidget_win.cpp
index 07dbc24..1b2dfe7 100644
--- a/src/gui/kernel/qdesktopwidget_win.cpp
+++ b/src/gui/kernel/qdesktopwidget_win.cpp
@@ -42,7 +42,7 @@
#include "qdesktopwidget.h"
#include "qt_windows.h"
#include "qapplication_p.h"
-#include "qlibrary.h"
+#include <private/qsystemlibrary_p.h>
#include <qvector.h>
#include <limits.h>
#ifdef Q_WS_WINCE
@@ -155,7 +155,7 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that)
screenCount = 0;
#ifndef Q_OS_WINCE
- QLibrary user32Lib(QLatin1String("user32"));
+ QSystemLibrary user32Lib(QLatin1String("user32"));
if (user32Lib.load()) {
enumDisplayMonitors = (EnumFunc)user32Lib.resolve("EnumDisplayMonitors");
getMonitorInfo = (InfoFunc)user32Lib.resolve("GetMonitorInfoW");
@@ -173,7 +173,7 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that)
enumDisplayMonitors = 0;
getMonitorInfo = 0;
#else
- QLibrary coreLib(QLatin1String("coredll"));
+ QSystemLibrary coreLib(QLatin1String("coredll"));
if (coreLib.load()) {
// CE >= 4.0 case
enumDisplayMonitors = (EnumFunc)coreLib.resolve("EnumDisplayMonitors");
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 13274c4..5725a22 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -775,4 +775,6 @@ int QTapAndHoldGesturePrivate::Timeout = 700; // in ms
QT_END_NAMESPACE
+#include <moc_qgesture.cpp>
+
#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index dcb0264..8416708 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -54,6 +54,7 @@
QT_BEGIN_HEADER
Q_DECLARE_METATYPE(Qt::GestureState)
+Q_DECLARE_METATYPE(Qt::GestureType)
QT_BEGIN_NAMESPACE
@@ -112,6 +113,8 @@ class Q_GUI_EXPORT QPanGesture : public QGesture
Q_PROPERTY(QPointF offset READ offset WRITE setOffset)
Q_PROPERTY(QPointF delta READ delta STORED false)
Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration)
+ Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal horizontalVelocity READ horizontalVelocity WRITE setHorizontalVelocity)
+ Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal verticalVelocity READ verticalVelocity WRITE setVerticalVelocity)
public:
QPanGesture(QObject *parent = 0);
@@ -210,6 +213,7 @@ class Q_GUI_EXPORT QSwipeGesture : public QGesture
Q_PROPERTY(SwipeDirection horizontalDirection READ horizontalDirection STORED false)
Q_PROPERTY(SwipeDirection verticalDirection READ verticalDirection STORED false)
Q_PROPERTY(qreal swipeAngle READ swipeAngle WRITE setSwipeAngle)
+ Q_PRIVATE_PROPERTY(QSwipeGesture::d_func(), qreal velocity READ velocity WRITE setVelocity)
public:
enum SwipeDirection { NoDirection, Left, Right, Up, Down };
diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h
index 29b923e..6a856ac 100644
--- a/src/gui/kernel/qgesture_p.h
+++ b/src/gui/kernel/qgesture_p.h
@@ -88,14 +88,21 @@ class QPanGesturePrivate : public QGesturePrivate
public:
QPanGesturePrivate()
- : acceleration(0)
+ : acceleration(0), xVelocity(0), yVelocity(0)
{
}
+ qreal horizontalVelocity() const { return xVelocity; }
+ void setHorizontalVelocity(qreal value) { xVelocity = value; }
+ qreal verticalVelocity() const { return yVelocity; }
+ void setVerticalVelocity(qreal value) { yVelocity = value; }
+
QPointF lastOffset;
QPointF offset;
QPoint startPosition;
qreal acceleration;
+ qreal xVelocity;
+ qreal yVelocity;
};
class QPinchGesturePrivate : public QGesturePrivate
@@ -105,7 +112,7 @@ class QPinchGesturePrivate : public QGesturePrivate
public:
QPinchGesturePrivate()
: totalChangeFlags(0), changeFlags(0),
- totalScaleFactor(0), lastScaleFactor(0), scaleFactor(0),
+ totalScaleFactor(1), lastScaleFactor(1), scaleFactor(1),
totalRotationAngle(0), lastRotationAngle(0), rotationAngle(0),
isNewSequence(true)
{
@@ -139,17 +146,20 @@ public:
: horizontalDirection(QSwipeGesture::NoDirection),
verticalDirection(QSwipeGesture::NoDirection),
swipeAngle(0),
- started(false), speed(0)
+ started(false), velocityValue(0)
{
}
+ qreal velocity() const { return velocityValue; }
+ void setVelocity(qreal value) { velocityValue = value; }
+
QSwipeGesture::SwipeDirection horizontalDirection;
QSwipeGesture::SwipeDirection verticalDirection;
qreal swipeAngle;
QPoint lastPositions[3];
bool started;
- qreal speed;
+ qreal velocityValue;
QElapsedTimer time;
};
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 5c80340..6dd8127 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -184,7 +184,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
// get or create a QGesture object that will represent the state for a given object, used by the recognizer
QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recognizer, Qt::GestureType type)
{
- // if the widget is being deleted we should be carefull and not to
+ // if the widget is being deleted we should be careful not to
// create a new state, as it will create QWeakPointer which doesnt work
// from the destructor.
if (object->isWidgetType()) {
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 6325d95..fee1580 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -401,7 +401,7 @@ bool QSoftKeyManagerPrivateS60::handleCommand(int command)
foreach(QAction *menuAction, action->menu()->actions()) {
QMenu *menu = menuAction->menu();
if(menu)
- menuBar->addMenu(action->menu());
+ menuBar->addMenu(menu);
else
menuBar->addAction(menuAction);
}
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 127e150..893ba2b 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -199,6 +199,7 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state,
d->startPosition[1] = p2.screenPos();
}
QLineF line(p1.screenPos(), p2.screenPos());
+ QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos());
QLineF tmp(line);
tmp.setLength(line.length() / 2.);
QPointF centerPoint = tmp.p2();
@@ -207,16 +208,15 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state,
d->centerPoint = centerPoint;
d->changeFlags |= QPinchGesture::CenterPointChanged;
- const qreal scaleFactor =
- QLineF(p1.screenPos(), p2.screenPos()).length()
- / QLineF(d->startPosition[0], d->startPosition[1]).length();
+ const qreal scaleFactor = line.length() / lastLine.length();
+
if (d->isNewSequence) {
d->lastScaleFactor = scaleFactor;
} else {
d->lastScaleFactor = d->scaleFactor;
}
d->scaleFactor = scaleFactor;
- d->totalScaleFactor += d->scaleFactor - d->lastScaleFactor;
+ d->totalScaleFactor = d->totalScaleFactor * scaleFactor;
d->changeFlags |= QPinchGesture::ScaleFactorChanged;
qreal angle = QLineF(p1.screenPos(), p2.screenPos()).angle();
@@ -266,7 +266,7 @@ void QPinchGestureRecognizer::reset(QGesture *state)
d->totalChangeFlags = d->changeFlags = 0;
d->startCenterPoint = d->lastCenterPoint = d->centerPoint = QPointF();
- d->totalScaleFactor = d->lastScaleFactor = d->scaleFactor = 0;
+ d->totalScaleFactor = d->lastScaleFactor = d->scaleFactor = 1;
d->totalRotationAngle = d->lastRotationAngle = d->rotationAngle = 0;
d->isNewSequence = true;
@@ -304,7 +304,7 @@ QGestureRecognizer::Result QSwipeGestureRecognizer::recognize(QGesture *state,
switch (event->type()) {
case QEvent::TouchBegin: {
- d->speed = 1;
+ d->velocityValue = 1;
d->time.start();
d->started = true;
result = QGestureRecognizer::MayBeGesture;
@@ -345,7 +345,7 @@ QGestureRecognizer::Result QSwipeGestureRecognizer::recognize(QGesture *state,
int elapsedTime = d->time.restart();
if (!elapsedTime)
elapsedTime = 1;
- d->speed = 0.9 * d->speed + distance / elapsedTime;
+ d->velocityValue = 0.9 * d->velocityValue + distance / elapsedTime;
d->swipeAngle = QLineF(p1.startScreenPos(), p1.screenPos()).angle();
static const int MoveThreshold = 50;
@@ -407,7 +407,7 @@ void QSwipeGestureRecognizer::reset(QGesture *state)
d->lastPositions[0] = d->lastPositions[1] = d->lastPositions[2] = QPoint();
d->started = false;
- d->speed = 0;
+ d->velocityValue = 0;
d->time.invalidate();
QGestureRecognizer::reset(state);
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 1979c84..159c45d 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2375,7 +2375,8 @@ void QWidgetPrivate::recreateMacWindow()
HIViewRemoveFromSuperview(myView);
determineWindowClass();
createWindow_sys();
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+
+ if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) {
mwl->updateHIToolBarStatus();
}
@@ -2912,7 +2913,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
// We do this down below for wasCreated, so avoid doing this twice
// (only for performance, it gets called a lot anyway).
if (!wasCreated) {
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+ if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) {
mwl->updateHIToolBarStatus();
}
}
@@ -2937,7 +2938,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
// If we were a unified window, We just transfered our toolbars out of the unified toolbar.
// So redo the status one more time. It apparently is not an issue with Cocoa.
if (q->isWindow()) {
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+ if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) {
mwl->updateHIToolBarStatus();
}
}
@@ -5138,7 +5139,7 @@ void QWidgetPrivate::macUpdateMetalAttribute()
return;
recreateMacWindow();
#else
- QMainWindowLayout *layout = qobject_cast<QMainWindowLayout *>(q->layout());
+ QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q));
if (q->testAttribute(Qt::WA_MacBrushedMetal)) {
if (layout)
layout->updateHIToolBarStatus();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index c98c05a..4109ed8 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -518,7 +518,7 @@ void QWidgetPrivate::show_sys()
if (q->windowState() & Qt::WindowMaximized) {
TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
id->SetExtent(r.iTl, r.Size());
- } else if (!q->testAttribute(Qt::WA_Moved)) {
+ } else if (!q->testAttribute(Qt::WA_Moved) && q->windowType() != Qt::Dialog) {
id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
}
}
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 59035b1..3d206fd 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -47,7 +47,6 @@
#include "qevent.h"
#include "qimage.h"
#include "qlayout.h"
-#include "qlibrary.h"
#include "qpainter.h"
#include "qstack.h"
#include "qt_windows.h"
@@ -65,6 +64,7 @@
#include <private/qapplication_p.h>
#include <private/qwininputcontext_p.h>
#include <private/qpaintengine_raster_p.h>
+#include <private/qsystemlibrary_p.h>
#if defined(Q_WS_WINCE)
#include "qguifunctions_wince.h"
@@ -148,7 +148,7 @@ static void init_wintab_functions()
#else
if (!qt_is_gui_used)
return;
- QLibrary library(QLatin1String("wintab32"));
+ QSystemLibrary library(QLatin1String("wintab32"));
ptrWTOpen = (PtrWTOpen)library.resolve("WTOpenW");
ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW");
ptrWTClose = (PtrWTClose)library.resolve("WTClose");
@@ -1890,7 +1890,7 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal level)
static bool function_resolved = false;
if (!function_resolved) {
ptrSetLayeredWindowAttributes =
- (PtrSetLayeredWindowAttributes) QLibrary::resolve(QLatin1String("user32"),
+ (PtrSetLayeredWindowAttributes) QSystemLibrary::resolve(QLatin1String("user32"),
"SetLayeredWindowAttributes");
function_resolved = true;
}
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 03ed597..bd5b0bd 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -659,19 +659,59 @@ const uint * QT_FASTCALL fetchTransformed(uint *buffer, const Operator *, const
interpolate 4 argb pixels with the distx and disty factor.
distx and disty bust be between 0 and 16
*/
-static inline uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, int distx, int disty, int idistx, int idisty)
-{
- uint tlrb = ((tl & 0x00ff00ff) * idistx * idisty);
- uint tlag = (((tl & 0xff00ff00) >> 8) * idistx * idisty);
- uint trrb = ((tr & 0x00ff00ff) * distx * idisty);
- uint trag = (((tr & 0xff00ff00) >> 8) * distx * idisty);
- uint blrb = ((bl & 0x00ff00ff) * idistx * disty);
- uint blag = (((bl & 0xff00ff00) >> 8) * idistx * disty);
- uint brrb = ((br & 0x00ff00ff) * distx * disty);
- uint brag = (((br & 0xff00ff00) >> 8) * distx * disty);
+static inline uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, int distx, int disty)
+{
+ uint distxy = distx * disty;
+ //idistx * disty = (16-distx) * disty = 16*disty - distxy
+ //idistx * idisty = (16-distx) * (16-disty) = 16*16 - 16*distx -16*dity + distxy
+ uint tlrb = (tl & 0x00ff00ff) * (16*16 - 16*distx - 16*disty + distxy);
+ uint tlag = ((tl & 0xff00ff00) >> 8) * (16*16 - 16*distx - 16*disty + distxy);
+ uint trrb = ((tr & 0x00ff00ff) * (distx*16 - distxy));
+ uint trag = (((tr & 0xff00ff00) >> 8) * (distx*16 - distxy));
+ uint blrb = ((bl & 0x00ff00ff) * (disty*16 - distxy));
+ uint blag = (((bl & 0xff00ff00) >> 8) * (disty*16 - distxy));
+ uint brrb = ((br & 0x00ff00ff) * (distxy));
+ uint brag = (((br & 0xff00ff00) >> 8) * (distxy));
return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);
}
+#if defined(QT_ALWAYS_HAVE_SSE2)
+#define interpolate_4_pixels_16_sse2(tl, tr, bl, br, distx, disty, colorMask, v_256, b) \
+{ \
+ const __m128i dxdy = _mm_mullo_epi16 (distx, disty); \
+ const __m128i distx_ = _mm_slli_epi16(distx, 4); \
+ const __m128i disty_ = _mm_slli_epi16(disty, 4); \
+ const __m128i idxidy = _mm_add_epi16(dxdy, _mm_sub_epi16(v_256, _mm_add_epi16(distx_, disty_))); \
+ const __m128i dxidy = _mm_sub_epi16(distx_, dxdy); \
+ const __m128i idxdy = _mm_sub_epi16(disty_, dxdy); \
+ \
+ __m128i tlAG = _mm_srli_epi16(tl, 8); \
+ __m128i tlRB = _mm_and_si128(tl, colorMask); \
+ __m128i trAG = _mm_srli_epi16(tr, 8); \
+ __m128i trRB = _mm_and_si128(tr, colorMask); \
+ __m128i blAG = _mm_srli_epi16(bl, 8); \
+ __m128i blRB = _mm_and_si128(bl, colorMask); \
+ __m128i brAG = _mm_srli_epi16(br, 8); \
+ __m128i brRB = _mm_and_si128(br, colorMask); \
+ \
+ tlAG = _mm_mullo_epi16(tlAG, idxidy); \
+ tlRB = _mm_mullo_epi16(tlRB, idxidy); \
+ trAG = _mm_mullo_epi16(trAG, dxidy); \
+ trRB = _mm_mullo_epi16(trRB, dxidy); \
+ blAG = _mm_mullo_epi16(blAG, idxdy); \
+ blRB = _mm_mullo_epi16(blRB, idxdy); \
+ brAG = _mm_mullo_epi16(brAG, dxdy); \
+ brRB = _mm_mullo_epi16(brRB, dxdy); \
+ \
+ /* Add the values, and shift to only keep 8 significant bits per colors */ \
+ __m128i rAG =_mm_add_epi16(_mm_add_epi16(tlAG, trAG), _mm_add_epi16(blAG, brAG)); \
+ __m128i rRB =_mm_add_epi16(_mm_add_epi16(tlRB, trRB), _mm_add_epi16(blRB, brRB)); \
+ rAG = _mm_andnot_si128(colorMask, rAG); \
+ rRB = _mm_srli_epi16(rRB, 8); \
+ _mm_storeu_si128((__m128i*)(b), _mm_or_si128(rAG, rRB)); \
+}
+#endif
+
template<TextureBlendType blendType>
Q_STATIC_TEMPLATE_FUNCTION inline void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2)
@@ -721,7 +761,7 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
const qreal cx = x + 0.5;
const qreal cy = y + 0.5;
- const uint *end = buffer + length;
+ uint *end = buffer + length;
uint *b = buffer;
if (data->fast_matrix) {
// The increment pr x in the scanline
@@ -879,7 +919,75 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
const uchar *s1 = data->texture.scanLine(y1);
const uchar *s2 = data->texture.scanLine(y2);
int disty = (fy & 0x0000ffff) >> 12;
- int idisty = 16 - disty;
+
+#if defined(QT_ALWAYS_HAVE_SSE2)
+ if (blendType != BlendTransformedBilinearTiled &&
+ (format == QImage::Format_ARGB32_Premultiplied || format == QImage::Format_RGB32)) {
+
+ //prolog to get into the bounds
+ while (b < end) {
+ int x1 = (fx >> 16);
+ int x2;
+ fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
+ if (x1 != x2) //break if we are insided the bounds.
+ break;
+ uint tl = fetch(s1, x1, data->texture.colorTable);
+ uint tr = fetch(s1, x2, data->texture.colorTable);
+ uint bl = fetch(s2, x1, data->texture.colorTable);
+ uint br = fetch(s2, x2, data->texture.colorTable);
+ int distx = (fx & 0x0000ffff) >> 12;
+ *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
+ fx += fdx;
+ ++b;
+ }
+ uint *boundedEnd;
+ if (fdx > 0)
+ boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11));
+ else
+ boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11));
+ boundedEnd -= 3;
+
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+ //const __m128i distShuffleMask = _mm_set_epi8(13, 12, 13, 12, 9, 8, 9, 8, 5, 4, 5, 4, 1, 0, 1, 0);
+ const __m128i v_256 = _mm_set1_epi16(256);
+ const __m128i v_disty = _mm_set1_epi16(disty);
+ __m128i v_fdx = _mm_set1_epi32(fdx*4);
+
+ ptrdiff_t secondLine = reinterpret_cast<const uint *>(s2) - reinterpret_cast<const uint *>(s1);
+
+ union Vect_buffer { __m128i vect; quint32 i[4]; };
+ Vect_buffer v_fx;
+
+ for (int i = 0; i < 4; i++) {
+ v_fx.i[i] = fx;
+ fx += fdx;
+ }
+
+ while (b < boundedEnd) {
+
+ Vect_buffer tl, tr, bl, br;
+
+ for (int i = 0; i < 4; i++) {
+ int x1 = v_fx.i[i] >> 16;
+ const uint *addr_tl = reinterpret_cast<const uint *>(s1) + x1;
+ const uint *addr_tr = addr_tl + 1;
+ tl.i[i] = *addr_tl;
+ tr.i[i] = *addr_tr;
+ bl.i[i] = *(addr_tl+secondLine);
+ br.i[i] = *(addr_tr+secondLine);
+ }
+ __m128i v_distx = _mm_srli_epi16(v_fx.vect, 12); //distx = (fx & 0x0000ffff) >> 12;
+ //v_distx = _mm_shuffle_epi8(v_disty, distShuffleMask); //distx |= distx << 16;
+ v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
+ v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
+
+ interpolate_4_pixels_16_sse2(tl.vect, tr.vect, bl.vect, br.vect, v_distx, v_disty, colorMask, v_256, b);
+ b+=4;
+ v_fx.vect = _mm_add_epi32(v_fx.vect, v_fdx);
+ }
+ fx = v_fx.i[0];
+ }
+#endif
while (b < end) {
int x1 = (fx >> 16);
int x2;
@@ -889,8 +997,7 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
uint bl = fetch(s2, x1, data->texture.colorTable);
uint br = fetch(s2, x2, data->texture.colorTable);
int distx = (fx & 0x0000ffff) >> 12;
- int idistx = 16 - distx;
- *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty, idistx, idisty);
+ *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
fx += fdx;
++b;
}
@@ -949,10 +1056,8 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
int distx = (fx & 0x0000ffff) >> 12;
int disty = (fy & 0x0000ffff) >> 12;
- int idistx = 16 - distx;
- int idisty = 16 - disty;
- *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty, idistx, idisty);
+ *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
fx += fdx;
fy += fdy;
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index ba2ba32..f97d865 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -266,10 +266,10 @@ void qt_memfill32_sse2(quint32 *dest, quint32 value, int count)
int n = (count128 + 3) / 4;
switch (count128 & 0x3) {
- case 0: do { _mm_store_si128(dst128++, value128);
- case 3: _mm_store_si128(dst128++, value128);
- case 2: _mm_store_si128(dst128++, value128);
- case 1: _mm_store_si128(dst128++, value128);
+ case 0: do { _mm_stream_si128(dst128++, value128);
+ case 3: _mm_stream_si128(dst128++, value128);
+ case 2: _mm_stream_si128(dst128++, value128);
+ case 1: _mm_stream_si128(dst128++, value128);
} while (--n > 0);
}
@@ -300,11 +300,14 @@ void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, u
const __m128i half = _mm_set1_epi16(0x80);
const __m128i minusAlphaOfColorVector = _mm_set1_epi16(minusAlphaOfColor);
+ ALIGNMENT_PROLOGUE_16BYTES(dst, x, length)
+ destPixels[x] = color + BYTE_MUL(destPixels[x], minusAlphaOfColor);
+
for (; x < length-3; x += 4) {
- __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+ __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]);
BYTE_MUL_SSE2(dstVector, dstVector, minusAlphaOfColorVector, colorMask, half);
dstVector = _mm_add_epi8(colorVector, dstVector);
- _mm_storeu_si128((__m128i *)&dst[x], dstVector);
+ _mm_store_si128((__m128i *)&dst[x], dstVector);
}
for (;x < length; ++x)
destPixels[x] = color + BYTE_MUL(destPixels[x], minusAlphaOfColor);
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
index 4cb4089..fb5602e 100644
--- a/src/gui/painting/qdrawhelper_ssse3.cpp
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -79,69 +79,6 @@ inline static void blend_pixel(quint32 &dst, const quint32 src)
}
-#define BLEND_SOURCE_OVER_ARGB32_FIRST_ROW_SSSE3(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
- int x = 0; \
-\
- /* First, get dst aligned. */ \
- const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\
- const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
-\
- for (; x < prologLength; ++x) {\
- blend_pixel(dst[x], src[x]); \
- } \
-\
- const int minusOffsetToAlignSrcOn16Bytes = (reinterpret_cast<quintptr>(&(src[x])) >> 2) & 0x3;\
-\
- if (!minusOffsetToAlignSrcOn16Bytes) {\
- /* src is aligned, usual algorithm but with aligned operations.\
- See the SSE2 version for more documentation on the algorithm itself. */\
- const __m128i alphaShuffleMask = _mm_set_epi8(0xff,15,0xff,15,0xff,11,0xff,11,0xff,7,0xff,7,0xff,3,0xff,3);\
- for (; x < length-3; x += 4) { \
- const __m128i srcVector = _mm_load_si128((__m128i *)&src[x]); \
- const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
- if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
- _mm_store_si128((__m128i *)&dst[x], srcVector); \
- } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
- __m128i alphaChannel = _mm_shuffle_epi8(srcVector, alphaShuffleMask); \
- alphaChannel = _mm_sub_epi16(one, alphaChannel); \
- const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
- __m128i destMultipliedByOneMinusAlpha; \
- BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
- const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
- _mm_store_si128((__m128i *)&dst[x], result); \
- } \
- } /* end for() */\
- } else if ((length - x) >= 8) {\
- /* We are at the first line, so "x - minusOffsetToAlignSrcOn16Bytes" could go before src, and\
- generate an invalid access. */\
-\
- /* We use two vectors to extract the src: prevLoaded for the first pixels, lastLoaded for the current pixels. */\
- __m128i srcVectorPrevLoaded;\
- if (minusOffsetToAlignSrcOn16Bytes > prologLength) {\
- /* We go forward 4 pixels to avoid reading before src. */\
- for (; x < prologLength + 4; ++x)\
- blend_pixel(dst[x], src[x]); \
- }\
- srcVectorPrevLoaded = _mm_load_si128((__m128i *)&src[x - minusOffsetToAlignSrcOn16Bytes]);\
- const int palignrOffset = minusOffsetToAlignSrcOn16Bytes << 2;\
-\
- const __m128i alphaShuffleMask = _mm_set_epi8(0xff,15,0xff,15,0xff,11,0xff,11,0xff,7,0xff,7,0xff,3,0xff,3);\
- switch (palignrOffset) {\
- case 4:\
- BLENDING_LOOP(4, length)\
- break;\
- case 8:\
- BLENDING_LOOP(8, length)\
- break;\
- case 12:\
- BLENDING_LOOP(12, length)\
- break;\
- }\
- }\
- for (; x < length; ++x) \
- blend_pixel(dst[x], src[x]); \
-}
-
// Basically blend src over dst with the const alpha defined as constAlphaVector.
// nullVector, half, one, colorMask are constant accross the whole image/texture, and should be defined as:
//const __m128i nullVector = _mm_set1_epi32(0);
@@ -153,7 +90,7 @@ inline static void blend_pixel(quint32 &dst, const quint32 src)
// The computation being done is:
// result = s + d * (1-alpha)
// with shortcuts if fully opaque or fully transparent.
-#define BLEND_SOURCE_OVER_ARGB32_MAIN_SSSE3(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
+#define BLEND_SOURCE_OVER_ARGB32_SSSE3(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
int x = 0; \
\
/* First, get dst aligned. */ \
@@ -218,14 +155,8 @@ void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
const __m128i one = _mm_set1_epi16(0xff);
const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
- // We have to unrol the first row in order to deal with the load on unaligned data
- // prior to the src pointer.
- BLEND_SOURCE_OVER_ARGB32_FIRST_ROW_SSSE3(dst, src, w, nullVector, half, one, colorMask, alphaMask);
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
-
- for (int y = 1; y < h; ++y) {
- BLEND_SOURCE_OVER_ARGB32_MAIN_SSSE3(dst, src, w, nullVector, half, one, colorMask, alphaMask);
+ for (int y = 0; y < h; ++y) {
+ BLEND_SOURCE_OVER_ARGB32_SSSE3(dst, src, w, nullVector, half, one, colorMask, alphaMask);
dst = (quint32 *)(((uchar *) dst) + dbpl);
src = (const quint32 *)(((const uchar *) src) + sbpl);
}
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 2828e9d..a9fbbee 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -94,7 +94,8 @@ QRuntimePixmapData::QRuntimePixmapData(const QRuntimeGraphicsSystem *gs, PixelTy
QRuntimePixmapData::~QRuntimePixmapData()
{
- m_graphicsSystem->removePixmapData(this);
+ if (QApplicationPrivate::graphics_system)
+ m_graphicsSystem->removePixmapData(this);
delete m_data;
}
@@ -258,7 +259,8 @@ QRuntimeWindowSurface::QRuntimeWindowSurface(const QRuntimeGraphicsSystem *gs, Q
QRuntimeWindowSurface::~QRuntimeWindowSurface()
{
- m_graphicsSystem->removeWindowSurface(this);
+ if (QApplicationPrivate::graphics_system)
+ m_graphicsSystem->removeWindowSurface(this);
}
QPaintDevice *QRuntimeWindowSurface::paintDevice()
diff --git a/src/gui/painting/qgraphicssystem_runtime_p.h b/src/gui/painting/qgraphicssystem_runtime_p.h
index 0232241..421fbeb 100644
--- a/src/gui/painting/qgraphicssystem_runtime_p.h
+++ b/src/gui/painting/qgraphicssystem_runtime_p.h
@@ -177,6 +177,7 @@ private:
friend class QRuntimePixmapData;
friend class QRuntimeWindowSurface;
+ friend class QMeeGoGraphicsSystem;
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 881bd6e..1e857e4 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -768,7 +768,7 @@ void QPaintEngineEx::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yR
x1, y2 - (1 - KAPPA) * yRadius,
x1, y2 - yRadius,
x1, y1 + yRadius, // LineTo
- x1, y1 + KAPPA * yRadius, // CurveTo
+ x1, y1 + (1 - KAPPA) * yRadius, // CurveTo
x1 + (1 - KAPPA) * xRadius, y1,
x1 + xRadius, y1
};
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index eabbd8a..9cff339 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -609,7 +609,7 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine
}
QLineF miterLine(QPointF(qt_fixed_to_real(focal_x),
qt_fixed_to_real(focal_y)), isect);
- if (miterLine.length() > qt_fixed_to_real(m_strokeWidth * m_miterLimit) / 2) {
+ if (type == QLineF::NoIntersection || miterLine.length() > qt_fixed_to_real(m_strokeWidth * m_miterLimit) / 2) {
emitLineTo(qt_real_to_fixed(nextLine.x1()),
qt_real_to_fixed(nextLine.y1()));
} else {
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 212a582..11f2673 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -64,7 +64,6 @@ class QVariant;
class Q_GUI_EXPORT QTransform
{
- Q_ENUMS(TransformationType)
public:
enum TransformationType {
TxNone = 0x00,
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index 579dd0b..720dd6d 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -44,7 +44,7 @@
#if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN)
-#include "qlibrary.h"
+#include <private/qsystemlibrary_p.h>
#include "qapplication.h"
#include "qbitmap.h"
#include "qdrawutil.h" // for now
@@ -126,7 +126,7 @@ QWindowsStylePrivate::QWindowsStylePrivate()
#if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)
if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
&& QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) {
- QLibrary shellLib(QLatin1String("shell32"));
+ QSystemLibrary shellLib(QLatin1String("shell32"));
pSHGetStockIconInfo = (PtrSHGetStockIconInfo)shellLib.resolve("SHGetStockIconInfo");
}
#endif
@@ -921,9 +921,9 @@ static const char *const question_xpm[] = {
static QPixmap loadIconFromShell32( int resourceId, int size )
{
#ifdef Q_OS_WINCE
- HMODULE hmod = LoadLibrary(L"ceshell.dll");
+ HMODULE hmod = LoadLibrary(L"ceshell");
#else
- HMODULE hmod = LoadLibrary(L"shell32.dll");
+ HMODULE hmod = QSystemLibrary::load(L"shell32");
#endif
if( hmod ) {
HICON iconHandle = (HICON)LoadImage(hmod, MAKEINTRESOURCE(resourceId), IMAGE_ICON, size, size, 0);
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 8511592..58542e5 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -42,6 +42,7 @@
#include "qwindowsvistastyle.h"
#include "qwindowsvistastyle_p.h"
#include <private/qstylehelper_p.h>
+#include <private/qsystemlibrary_p.h>
#if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN)
@@ -2574,7 +2575,7 @@ bool QWindowsVistaStylePrivate::resolveSymbols()
static bool tried = false;
if (!tried) {
tried = true;
- QLibrary themeLib(QLatin1String("uxtheme"));
+ QSystemLibrary themeLib(QLatin1String("uxtheme"));
pSetWindowTheme = (PtrSetWindowTheme )themeLib.resolve("SetWindowTheme");
pIsThemePartDefined = (PtrIsThemePartDefined )themeLib.resolve("IsThemePartDefined");
pGetThemePartSize = (PtrGetThemePartSize )themeLib.resolve("GetThemePartSize");
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 8743807..d36011c 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -48,7 +48,7 @@
#include <private/qapplication_p.h>
#include <private/qstylehelper_p.h>
#include <private/qwidget_p.h>
-#include <qlibrary.h>
+#include <private/qsystemlibrary_p.h>
#include <qpainter.h>
#include <qpaintengine.h>
#include <qwidget.h>
@@ -344,7 +344,7 @@ bool QWindowsXPStylePrivate::resolveSymbols()
static bool tried = false;
if (!tried) {
tried = true;
- QLibrary themeLib(QLatin1String("uxtheme"));
+ QSystemLibrary themeLib(QLatin1String("uxtheme"));
pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed");
if (pIsAppThemed) {
pIsThemeActive = (PtrIsThemeActive )themeLib.resolve("IsThemeActive");
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index 2d547a9..d39f30a 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -49,16 +49,11 @@ QT_BEGIN_NAMESPACE
#ifdef QT_NO_FREETYPE
Q_GLOBAL_STATIC(QMutex, lastResortFamilyMutex);
+extern QStringList qt_symbian_fontFamiliesOnFontServer(); // qfontdatabase_s60.cpp
Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, {
- QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
- const int numTypeFaces = S60->screenDevice()->NumTypefaces();
- for (int i = 0; i < numTypeFaces; i++) {
- TTypefaceSupport typefaceSupport;
- S60->screenDevice()->TypefaceSupport(typefaceSupport, i);
- const QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
- x->append(familyName);
- }
- lock.relock();
+ // We are only interested in the initial font families. No Application fonts.
+ // Therefore, we are allowed to cache the list.
+ x->append(qt_symbian_fontFamiliesOnFontServer());
});
#endif // QT_NO_FREETYPE
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 0b38aab..ec252cd 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -58,6 +58,21 @@
QT_BEGIN_NAMESPACE
+QStringList qt_symbian_fontFamiliesOnFontServer() // Also used in qfont_s60.cpp
+{
+ QStringList result;
+ QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
+ const int numTypeFaces = S60->screenDevice()->NumTypefaces();
+ for (int i = 0; i < numTypeFaces; i++) {
+ TTypefaceSupport typefaceSupport;
+ S60->screenDevice()->TypefaceSupport(typefaceSupport, i);
+ const QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
+ result.append(familyName);
+ }
+ lock.relock();
+ return result;
+}
+
QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameFilters,
QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort,
bool uniqueFileNames = true)
@@ -99,6 +114,7 @@ public:
~QSymbianFontDatabaseExtrasImplementation();
const QSymbianTypeFaceExtras *extras(const QString &typeface, bool bold, bool italic) const;
+ void addFontFileToFontStore(const QFileInfo &fontFileInfo);
#ifndef Q_SYMBIAN_HAS_FONTTABLE_API
struct CFontFromFontStoreReleaser {
@@ -150,11 +166,8 @@ QSymbianFontDatabaseExtrasImplementation::QSymbianFontDatabaseExtrasImplementati
m_store->InstallRasterizerL(m_rasterizer);
CleanupStack::Pop(m_rasterizer););
- foreach (const QFileInfo &fontFileInfo, fontFiles) {
- const QString fontFile = QDir::toNativeSeparators(fontFileInfo.absoluteFilePath());
- TPtrC fontFilePtr(qt_QString2TPtrC(fontFile));
- QT_TRAP_THROWING(m_store->AddFileL(fontFilePtr));
- }
+ foreach (const QFileInfo &fontFileInfo, fontFiles)
+ addFontFileToFontStore(fontFileInfo);
#endif // !Q_SYMBIAN_HAS_FONTTABLE_API
}
@@ -250,6 +263,14 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c
}
return m_extrasHash.value(searchKey);
}
+
+void QSymbianFontDatabaseExtrasImplementation::addFontFileToFontStore(const QFileInfo &fontFileInfo)
+{
+ const QString fontFile = QDir::toNativeSeparators(fontFileInfo.absoluteFilePath());
+ TPtrC fontFilePtr(qt_QString2TPtrC(fontFile));
+ QT_TRAP_THROWING(m_store->AddFileL(fontFilePtr));
+}
+
#else // QT_NO_FREETYPE
class QFontEngineFTS60 : public QFontEngineFT
{
@@ -310,6 +331,57 @@ void QFontEngineMultiS60::loadEngine(int at)
Q_ASSERT(engines[at]);
}
+static bool addFontToScreenDevice(int screenDeviceFontIndex,
+ const QSymbianFontDatabaseExtrasImplementation *dbExtras)
+{
+ TTypefaceSupport typefaceSupport;
+ S60->screenDevice()->TypefaceSupport(typefaceSupport, screenDeviceFontIndex);
+ CFont *font; // We have to get a font instance in order to know all the details
+ TFontSpec fontSpec(typefaceSupport.iTypeface.iName, 11);
+ if (S60->screenDevice()->GetNearestFontInPixels(font, fontSpec) != KErrNone)
+ return false;
+ QScopedPointer<CFont, QSymbianFontDatabaseExtrasImplementation::CFontFromScreenDeviceReleaser> sFont(font);
+ if (font->TypeUid() != KCFbsFontUid)
+ return false;
+ TOpenFontFaceAttrib faceAttrib;
+ const CFbsFont *cfbsFont = static_cast<const CFbsFont *>(font);
+ cfbsFont->GetFaceAttrib(faceAttrib);
+
+ QtFontStyle::Key styleKey;
+ styleKey.style = faceAttrib.IsItalic()?QFont::StyleItalic:QFont::StyleNormal;
+ styleKey.weight = faceAttrib.IsBold()?QFont::Bold:QFont::Normal;
+
+ QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
+ QtFontFamily *family = privateDb()->family(familyName, true);
+ family->fixedPitch = faceAttrib.IsMonoWidth();
+ QtFontFoundry *foundry = family->foundry(QString(), true);
+ QtFontStyle *style = foundry->style(styleKey, true);
+ style->smoothScalable = typefaceSupport.iIsScalable;
+ style->pixelSize(0, true);
+
+ const QSymbianTypeFaceExtras *typeFaceExtras =
+ dbExtras->extras(familyName, faceAttrib.IsBold(), faceAttrib.IsItalic());
+ const QByteArray os2Table = typeFaceExtras->getSfntTable(MAKE_TAG('O', 'S', '/', '2'));
+ const unsigned char* data = reinterpret_cast<const unsigned char*>(os2Table.constData());
+ const unsigned char* ulUnicodeRange = data + 42;
+ quint32 unicodeRange[4] = {
+ qFromBigEndian<quint32>(ulUnicodeRange),
+ qFromBigEndian<quint32>(ulUnicodeRange + 4),
+ qFromBigEndian<quint32>(ulUnicodeRange + 8),
+ qFromBigEndian<quint32>(ulUnicodeRange + 12)
+ };
+ const unsigned char* ulCodePageRange = data + 78;
+ quint32 codePageRange[2] = {
+ qFromBigEndian<quint32>(ulCodePageRange),
+ qFromBigEndian<quint32>(ulCodePageRange + 4)
+ };
+ const QList<QFontDatabase::WritingSystem> writingSystems =
+ determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
+ foreach (const QFontDatabase::WritingSystem system, writingSystems)
+ family->writingSystems[system] = QtFontFamily::Supported;
+ return true;
+}
+
static void initializeDb()
{
QFontDatabasePrivate *db = privateDb();
@@ -325,59 +397,9 @@ static void initializeDb()
const int numTypeFaces = S60->screenDevice()->NumTypefaces();
const QSymbianFontDatabaseExtrasImplementation *dbExtras =
static_cast<const QSymbianFontDatabaseExtrasImplementation*>(db->symbianExtras);
- bool fontAdded = false;
- for (int i = 0; i < numTypeFaces; i++) {
- TTypefaceSupport typefaceSupport;
- S60->screenDevice()->TypefaceSupport(typefaceSupport, i);
- CFont *font; // We have to get a font instance in order to know all the details
- TFontSpec fontSpec(typefaceSupport.iTypeface.iName, 11);
- if (S60->screenDevice()->GetNearestFontInPixels(font, fontSpec) != KErrNone)
- continue;
- QScopedPointer<CFont, QSymbianFontDatabaseExtrasImplementation::CFontFromScreenDeviceReleaser> sFont(font);
- if (font->TypeUid() == KCFbsFontUid) {
- TOpenFontFaceAttrib faceAttrib;
- const CFbsFont *cfbsFont = static_cast<const CFbsFont *>(font);
- cfbsFont->GetFaceAttrib(faceAttrib);
-
- QtFontStyle::Key styleKey;
- styleKey.style = faceAttrib.IsItalic()?QFont::StyleItalic:QFont::StyleNormal;
- styleKey.weight = faceAttrib.IsBold()?QFont::Bold:QFont::Normal;
-
- QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
- QtFontFamily *family = db->family(familyName, true);
- family->fixedPitch = faceAttrib.IsMonoWidth();
- QtFontFoundry *foundry = family->foundry(QString(), true);
- QtFontStyle *style = foundry->style(styleKey, true);
- style->smoothScalable = typefaceSupport.iIsScalable;
- style->pixelSize(0, true);
-
- const QSymbianTypeFaceExtras *typeFaceExtras =
- dbExtras->extras(familyName, faceAttrib.IsBold(), faceAttrib.IsItalic());
- const QByteArray os2Table = typeFaceExtras->getSfntTable(MAKE_TAG('O', 'S', '/', '2'));
- const unsigned char* data = reinterpret_cast<const unsigned char*>(os2Table.constData());
- const unsigned char* ulUnicodeRange = data + 42;
- quint32 unicodeRange[4] = {
- qFromBigEndian<quint32>(ulUnicodeRange),
- qFromBigEndian<quint32>(ulUnicodeRange + 4),
- qFromBigEndian<quint32>(ulUnicodeRange + 8),
- qFromBigEndian<quint32>(ulUnicodeRange + 12)
- };
- const unsigned char* ulCodePageRange = data + 78;
- quint32 codePageRange[2] = {
- qFromBigEndian<quint32>(ulCodePageRange),
- qFromBigEndian<quint32>(ulCodePageRange + 4)
- };
- const QList<QFontDatabase::WritingSystem> writingSystems =
- determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
- foreach (const QFontDatabase::WritingSystem system, writingSystems)
- family->writingSystems[system] = QtFontFamily::Supported;
-
- fontAdded = true;
- }
- }
+ for (int i = 0; i < numTypeFaces; i++)
+ addFontToScreenDevice(i, dbExtras);
- Q_ASSERT(fontAdded);
-
lock.relock();
#else // QT_NO_FREETYPE
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp