Merge remote-tracking branch 'origin/5.8' into dev

Conflicts:
	qmake/library/qmakeevaluator.cpp
	(cherry picked from commit 1af6dc2c8fb4d91400fddc5050166f972ae57c9a in qttools)
	src/corelib/kernel/qcore_mac_objc.mm
	src/gui/painting/qcolor.h
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: I5b3ec468a5a9a73911b528d3d24ff8e19f339f31
This commit is contained in:
Liang Qi 2016-10-13 09:49:38 +02:00
commit dfc177e3a9
329 changed files with 193133 additions and 2601 deletions

2
.gitignore vendored
View File

@ -202,7 +202,7 @@ src/3rdparty/webkit/includes2.txt
# generated files in configure.exe bootstrapping # generated files in configure.exe bootstrapping
tools/configure/configure.intermediate.manifest tools/configure/configure.intermediate.manifest
tools/configure/configure_pch.pch tools/configure/configure_pch.pch
/configure.exe /configureapp.exe
# Symlinks generated by configure # Symlinks generated by configure
tools/qvfb/qvfbhdr.h tools/qvfb/qvfbhdr.h

View File

@ -1,3 +1,2 @@
SOURCES = fontconfig.cpp SOURCES = fontconfig.cpp
CONFIG -= qt CONFIG -= qt
include(../../unix/freetype/freetype.pri)

View File

@ -1,15 +0,0 @@
!cross_compile {
TRY_INCLUDEPATHS = /include /usr/include $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
# LSB doesn't allow using headers from /include or /usr/include
linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
haiku:TRY_INCLUDEPATHS += /system/develop/headers
for(p, TRY_INCLUDEPATHS) {
p = $$join(p, "", "", "/freetype2")
exists($$p):INCLUDEPATH *= $$p
}
} else {
# If we are cross-compiling, then there is still a remote possibility that
# configure detected font-config & freetype, stored in these variables.
QMAKE_CFLAGS += $$QMAKE_CFLAGS_FONTCONFIG
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_FONTCONFIG
}

View File

@ -1,3 +1,2 @@
SOURCES = freetype.cpp SOURCES = freetype.cpp
CONFIG -= qt CONFIG -= qt
include(freetype.pri)

View File

@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <libinput.h>
int main()
{
libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
return 0;
}

View File

@ -0,0 +1,2 @@
SOURCES = libinput_axis_api.cpp
CONFIG -= qt

View File

@ -46,7 +46,7 @@ Conventions for the remaining options: When an option's description is
followed by a list of values in brackets, the interpretation is as follows: followed by a list of values in brackets, the interpretation is as follows:
'yes' represents the bare option; all other values are possible prefixes to 'yes' represents the bare option; all other values are possible prefixes to
the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g., the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g.,
-gui=yes. Values are listed in the order they are tried if not specified; --gui=yes. Values are listed in the order they are tried if not specified;
'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary 'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary
options without auto-detection. options without auto-detection.

View File

@ -130,7 +130,7 @@ if errorlevel 1 (cd ..\.. & exit /b 1)
cd ..\.. cd ..\..
:conf :conf
configure.exe -srcdir %QTSRC% %ARGS% configureapp.exe -srcdir %QTSRC% %ARGS%
goto exit goto exit
:help :help

7
doc/doc.pro Normal file
View File

@ -0,0 +1,7 @@
TEMPLATE = aux
global_docs.files = $$PWD/global
global_docs.path = $$[QT_INSTALL_DOCS]
INSTALLS += global_docs
!prefix_build:!equals(OUT_PWD, $$PWD): \
COPIES += global_docs

View File

@ -110,12 +110,13 @@ void Client::readFortune()
in.setVersion(QDataStream::Qt_4_0); in.setVersion(QDataStream::Qt_4_0);
if (blockSize == 0) { if (blockSize == 0) {
if (socket->bytesAvailable() < (int)sizeof(quint16)) // Relies on the fact that QDataStream format streams a quint32 into sizeof(quint32) bytes
if (socket->bytesAvailable() < (int)sizeof(quint32))
return; return;
in >> blockSize; in >> blockSize;
} }
if (in.atEnd()) if (socket->bytesAvailable() < blockSize || in.atEnd())
return; return;
QString nextFortune; QString nextFortune;

View File

@ -86,7 +86,7 @@ private:
QLocalSocket *socket; QLocalSocket *socket;
QString currentFortune; QString currentFortune;
quint16 blockSize; quint32 blockSize;
}; };
#endif #endif

View File

@ -106,10 +106,10 @@ void Server::sendFortune()
QByteArray block; QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly); QDataStream out(&block, QIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_4_0); out.setVersion(QDataStream::Qt_4_0);
out << (quint16)0; out << (quint32)0;
out << fortunes.at(qrand() % fortunes.size()); out << fortunes.at(qrand() % fortunes.size());
out.device()->seek(0); out.device()->seek(0);
out << (quint16)(block.size() - sizeof(quint16)); out << (quint32)(block.size() - sizeof(quint32));
QLocalSocket *clientConnection = server->nextPendingConnection(); QLocalSocket *clientConnection = server->nextPendingConnection();
connect(clientConnection, SIGNAL(disconnected()), connect(clientConnection, SIGNAL(disconnected()),

View File

@ -15,7 +15,7 @@ SUBDIRS = \
widgets \ widgets \
xml xml
qtConfig(opengl): SUBDIRS += opengl qtHaveModule(gui):qtConfig(opengl): SUBDIRS += opengl
aggregate.files = aggregate/examples.pro aggregate.files = aggregate/examples.pro
aggregate.path = $$[QT_INSTALL_EXAMPLES] aggregate.path = $$[QT_INSTALL_EXAMPLES]

View File

@ -3,7 +3,7 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = android QMAKE_PLATFORM = android
QMAKE_COMPILER = gcc clang llvm QMAKE_COMPILER = gcc clang llvm
CONFIG += android_install unversioned_soname unversioned_libname android_deployment_settings CONFIG += android_install unversioned_soname unversioned_libname plugin_with_soname android_deployment_settings
include(../common/linux.conf) include(../common/linux.conf)
include(../common/clang.conf) include(../common/clang.conf)

View File

@ -34,8 +34,6 @@
#ifndef QPLATFORMDEFS_H #ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H #define QPLATFORMDEFS_H
#define QT_QPA_DEFAULT_PLATFORM_NAME "android"
// Get Qt defines/settings // Get Qt defines/settings
#include "qglobal.h" #include "qglobal.h"

View File

@ -3,7 +3,7 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = android QMAKE_PLATFORM = android
QMAKE_COMPILER = gcc QMAKE_COMPILER = gcc
CONFIG += android_install unversioned_soname unversioned_libname android_deployment_settings CONFIG += android_install unversioned_soname unversioned_libname plugin_with_soname android_deployment_settings
include(../common/linux.conf) include(../common/linux.conf)
include(../common/gcc-base-unix.conf) include(../common/gcc-base-unix.conf)

View File

@ -40,8 +40,6 @@
#ifndef QPLATFORMDEFS_H #ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H #define QPLATFORMDEFS_H
#define QT_QPA_DEFAULT_PLATFORM_NAME "android"
// Get Qt defines/settings // Get Qt defines/settings
#include "qglobal.h" #include "qglobal.h"

View File

@ -36,7 +36,6 @@ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_OPENVG = -lOpenVG
QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_THREAD = -lpthread
QMAKE_CFLAGS_WAYLAND =
QMAKE_INCDIR_WAYLAND = QMAKE_INCDIR_WAYLAND =
QMAKE_LIBS_WAYLAND_CLIENT = -lwayland-client QMAKE_LIBS_WAYLAND_CLIENT = -lwayland-client
QMAKE_LIBS_WAYLAND_SERVER = -lwayland-server QMAKE_LIBS_WAYLAND_SERVER = -lwayland-server

View File

@ -33,6 +33,8 @@ QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL
QMAKE_LIBS_THREAD = QMAKE_LIBS_THREAD =
QMAKE_ACTOOL = actool
QMAKE_DSYMUTIL = dsymutil QMAKE_DSYMUTIL = dsymutil
QMAKE_STRIP = strip QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += -S -x QMAKE_STRIPFLAGS_LIB += -S -x

View File

@ -6,9 +6,6 @@ include(qcc-base.conf)
QMAKE_PLATFORM = qnx $$QMAKE_PLATFORM QMAKE_PLATFORM = qnx $$QMAKE_PLATFORM
#Choose qnx QPA Plugin as default
QT_QPA_DEFAULT_PLATFORM = qnx
QMAKE_LFLAGS_SHLIB += -shared QMAKE_LFLAGS_SHLIB += -shared
QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME += -Wl,-soname, QMAKE_LFLAGS_SONAME += -Wl,-soname,

View File

@ -2,8 +2,6 @@
# Common build settings for all iOS/tvOS/watchOS configurations # Common build settings for all iOS/tvOS/watchOS configurations
# #
QT_QPA_DEFAULT_PLATFORM = ios
QMAKE_XCODE_CODE_SIGN_IDENTITY = "iPhone Developer" QMAKE_XCODE_CODE_SIGN_IDENTITY = "iPhone Developer"
# iOS build tools # iOS build tools

View File

@ -1,5 +1,5 @@
<?xml version=\"1.0\" encoding=\"utf-8\"?> <?xml version=\"1.0\" encoding=\"utf-8\"?>
<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"> <Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">
<Identity <Identity
Name=\"$${WINRT_MANIFEST.identity}\" Name=\"$${WINRT_MANIFEST.identity}\"
ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\" ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\"

View File

@ -116,29 +116,6 @@ c++11|c++14|c++1z {
unset(cxxstd) unset(cxxstd)
} }
suffix =
for(ever) {
QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix})
for(name, QMAKE_USE$${suffix}) {
nu = $$upper($$name)
CONFIG(debug, debug|release): \
libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG)
else: \
libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
libs += $$eval(QMAKE_LIBS_$$nu)
cflags = $$eval(QMAKE_CFLAGS_$${nu})
isEmpty(libs):isEmpty(cflags): \
error("Library '$$name' is not defined.")
LIBS$${suffix} += $$libs
QMAKE_CFLAGS += $$cflags
QMAKE_CXXFLAGS += $$cflags
}
!isEmpty(suffix): break()
suffix = "_PRIVATE"
}
!precompile_header: SOURCES += $$NO_PCH_SOURCES !precompile_header: SOURCES += $$NO_PCH_SOURCES
QMAKE_INCDIR += $$QMAKE_INCDIR_POST QMAKE_INCDIR += $$QMAKE_INCDIR_POST

View File

@ -0,0 +1,109 @@
# QMAKE_ASSET_CATALOGS
# Paths to xcassets directories to be compiled
#
# QMAKE_ASSET_CATALOGS_BUILD_PATH
# Location which asset catalogs will be compiled to.
# If the current target is an app bundle, defaults to its Resources directory.
# Otherwise, this value must be set manually.
#
# QMAKE_ASSET_CATALOGS_APP_ICON
# Name of the icon resource in the asset catalogs that will be used as the app icon.
# Defaults to AppIcon.
#
# QMAKE_ASSET_CATALOGS_INSTALL_PATH
# Base path to install files to. Falls back to a path relative to the target install path,
# based on QMAKE_ASSET_CATALOGS_BUILD_PATH.
!have_target|if(!build_pass:!isEmpty(BUILDS)): \
return()
!isEmpty(QMAKE_ASSET_CATALOGS) {
load(resolve_target)
isEmpty(QMAKE_ASSET_CATALOGS_BUILD_PATH) {
!isEmpty(QMAKE_RESOLVED_BUNDLE):equals(TEMPLATE, app):app_bundle {
macos: \
QMAKE_ASSET_CATALOGS_BUILD_PATH = $$QMAKE_RESOLVED_BUNDLE/Contents/Resources
else: \
QMAKE_ASSET_CATALOGS_BUILD_PATH = $$QMAKE_RESOLVED_BUNDLE
} else {
error("QMAKE_ASSET_CATALOGS_BUILD_PATH must be set when using QMAKE_ASSET_CATALOGS.")
}
}
QMAKE_ASSET_CATALOGS_BUILD_PATH = $$clean_path($$QMAKE_ASSET_CATALOGS_BUILD_PATH)
macx-xcode {
!isEmpty(QMAKE_ASSET_CATALOGS_APP_ICON) {
asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME"
asset_catalog_appicon.value = $$QMAKE_ASSET_CATALOGS_APP_ICON
QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon
}
asset_catalog_compiler.files = $$QMAKE_ASSET_CATALOGS
macos: asset_catalog_compiler.path = Contents/Resources
QMAKE_BUNDLE_DATA += asset_catalog_compiler
} else {
!isEmpty(QMAKE_ASSET_CATALOGS_APP_ICON) {
asset_catalog_app_icon_arg = \
--app-icon $$shell_quote($$QMAKE_ASSET_CATALOGS_APP_ICON)
}
asset_catalog_compiler.target = $$OUT_PWD/asset_catalog_compiler.Info.plist
asset_catalog_compiler.commands = $$shell_quote($$QMAKE_ACTOOL) \
$$asset_catalog_app_icon_arg \
--output-partial-info-plist $$shell_quote($$asset_catalog_compiler.target) \
--platform $${version_identifier} \
--minimum-deployment-target $${deployment_target} \
--compile $$shell_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH)
for (catalog, QMAKE_ASSET_CATALOGS) {
asset_catalog_compiler.commands += $${catalog}
asset_catalog_compiler.depends += $$files($$catalog/*, true)
}
actool_output_files = $$system(\
mkdir -p $$system_quote($$QMAKE_ASSET_CATALOGS_BUILD_PATH) && \
/usr/libexec/PlistBuddy -c \'Print :com.apple.actool.compilation-results:output-files\' \
/dev/stdin <<< $($${asset_catalog_compiler.commands} 2>/dev/null) | grep \'^ .*$\', lines)
for (output_file, actool_output_files) {
!equals(output_file, $$asset_catalog_compiler.target): \
actool_output_files_rel += $$relative_path($$output_file, $$QMAKE_ASSET_CATALOGS_BUILD_PATH)
}
QMAKE_EXTRA_TARGETS += asset_catalog_compiler
PRE_TARGETDEPS += $$asset_catalog_compiler.target
isEmpty(QMAKE_ASSET_CATALOGS_INSTALL_PATH) {
!isEmpty(target.path): \
QMAKE_ASSET_CATALOGS_INSTALL_PATH = $${target.path}/
QMAKE_ASSET_CATALOGS_INSTALL_PATH = $${QMAKE_ASSET_CATALOGS_INSTALL_PATH}$$relative_path(\
$$QMAKE_ASSET_CATALOGS_BUILD_PATH, $$absolute_path($$DESTDIR, $$OUT_PWD))
}
for (ac_install_file, actool_output_files_rel) {
asset_catalogs_files.files += \
$$QMAKE_ASSET_CATALOGS_BUILD_PATH/$$ac_install_file
}
contains(INSTALLS, target): asset_catalogs_files.depends += install_target
asset_catalogs_files.path = $$QMAKE_ASSET_CATALOGS_INSTALL_PATH
asset_catalogs_files.CONFIG += no_check_exist
INSTALLS += asset_catalogs_files
}
} else: macx-xcode {
# Backwards compatibility
for (bundle_data, QMAKE_BUNDLE_DATA) {
for (bundle_file, $${bundle_data}.files) {
!contains(bundle_file, .*\.xcassets$): next()
warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.")
!exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next()
asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME"
asset_catalog_appicon.value = "AppIcon"
QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon
break()
}
!isEmpty(asset_catalog_appicon.name): break()
}
}

View File

@ -1,4 +1,4 @@
CONFIG = sdk rez $$CONFIG CONFIG = asset_catalogs sdk rez $$CONFIG
load(default_pre) load(default_pre)
isEmpty(QMAKE_XCODE_DEVELOPER_PATH) { isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
@ -33,6 +33,8 @@ isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
cache(QMAKE_TARGET_BUNDLE_PREFIX) cache(QMAKE_TARGET_BUNDLE_PREFIX)
} }
QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
# Make the default debug info format for static debug builds # Make the default debug info format for static debug builds
# DWARF instead of DWARF with dSYM. This cuts down build times # DWARF instead of DWARF with dSYM. This cuts down build times
# for application debug builds significantly, as Xcode doesn't # for application debug builds significantly, as Xcode doesn't

View File

@ -31,7 +31,7 @@ QMAKE_INCDIR_OPENGL = $$sysrootified
QMAKESPEC_NAME = $$basename(QMAKESPEC) QMAKESPEC_NAME = $$basename(QMAKESPEC)
# Resolve SDK version of various tools # Resolve SDK version of various tools
for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB)) { for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL)) {
tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool} tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
!isEmpty($$tool_variable) { !isEmpty($$tool_variable) {
$$tool = $$eval($$tool_variable) $$tool = $$eval($$tool_variable)

View File

@ -32,7 +32,7 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:if(!macos|count(QMAKE_APPLE_DEVICE_ARCHS,
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:msvc { else:msvc {
moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_path($$[QT_INSTALL_BINS/get]/qmake) $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT} moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$[QT_INSTALL_BINS/get]/qmake)) $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
} else: error("Oops, I messed up") } else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE moc_predefs.input = MOC_PREDEF_FILE

View File

@ -0,0 +1,28 @@
suffix =
for(ever) {
QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix})
for (use, QMAKE_USE$${suffix}) {
use = $$split(use, /)
name = $$take_first(use)
nu = $$upper($$name)
debug: \
libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG)
else: \
libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
libs += $$eval(QMAKE_LIBS_$$nu)
defines = $$eval(QMAKE_DEFINES_$${nu})
includes = $$eval(QMAKE_INCDIR_$${nu})
isEmpty(libs):isEmpty(defines):isEmpty(includes): \
error("Library '$$name' is not defined.")
!contains(use, nolink): \
LIBS$${suffix} += $$libs
!contains(use, linkonly) {
DEFINES += $$defines
INCLUDEPATH += $$includes
}
}
!isEmpty(suffix): break()
suffix = "_PRIVATE"
}

View File

@ -1,3 +1,3 @@
qtConfig(system-freetype) { qtConfig(system-freetype) {
LIBS_PRIVATE += -lfreetype QMAKE_USE_PRIVATE += freetype/linkonly
} }

View File

@ -1,10 +1,6 @@
CONFIG += qpa/basicunixfontdatabase CONFIG += qpa/basicunixfontdatabase
qtConfig(fontconfig) { qtConfig(fontconfig) {
DEFINES += Q_FONTCONFIGDATABASE DEFINES += Q_FONTCONFIGDATABASE
LIBS_PRIVATE += -lfontconfig QMAKE_USE_PRIVATE += fontconfig/linkonly
} else:!android {
fonts.path = $$[QT_INSTALL_LIBS]/fonts
fonts.files = $$QT_SOURCE_TREE/lib/fonts/*
INSTALLS += fonts
} }

View File

@ -245,18 +245,25 @@ defineTest(qtConfParseCommandLine) {
} else: contains(c, "^--?(disable|no)-(.*)") { } else: contains(c, "^--?(disable|no)-(.*)") {
opt = $$replace(c, "^--?(disable|no)-(.*)", "\\2") opt = $$replace(c, "^--?(disable|no)-(.*)", "\\2")
val = no val = no
} else: contains(c, "^--?qt-(.*)") { } else: contains(c, "^--([^=]+)=(.*)") {
opt = $$replace(c, "^--?qt-(.*)", "\\1") opt = $$replace(c, "^--?([^=]+)=(.*)", "\\1")
val = qt val = $$replace(c, "^--?([^=]+)=(.*)", "\\2")
} else: contains(c, "^--?system-(.*)") { } else: contains(c, "^--(.*)") {
opt = $$replace(c, "^--?system-(.*)", "\\1") opt = $$replace(c, "^--(.*)", "\\1")
val = system val = yes
} else: contains(c, "^--?([^-].*)=(.*)") { } else: contains(c, "^-(.*)") {
opt = $$replace(c, "^--?([^-].*)=(.*)", "\\1") opt = $$replace(c, "^-(.*)", "\\1")
val = $$replace(c, "^--?([^-].*)=(.*)", "\\2")
} else: contains(c, "^--?([^-].*)") {
opt = $$replace(c, "^--?([^-].*)", "\\1")
val = val =
for (cc, allConfigs) {
type = $$eval($${cc}.commandline.options.$${opt})
!isEmpty(type): break()
type = $$eval($${cc}.commandline.options.$${opt}.type)
!isEmpty(type): break()
}
isEmpty(type):contains(opt, "(qt|system)-.*") {
val = $$replace(opt, "(qt|system)-(.*)", "\\1")
opt = $$replace(opt, "(qt|system)-(.*)", "\\2")
}
} else { } else {
qtConfAddError("Invalid command line parameter '$$c'.") qtConfAddError("Invalid command line parameter '$$c'.")
return() return()
@ -468,8 +475,6 @@ defineTest(qtConfLibrary_inline) {
!isEmpty(prefix) { !isEmpty(prefix) {
$${1}.includedir = $$prefix/include $${1}.includedir = $$prefix/include
export($${1}.includedir) export($${1}.includedir)
$${1}.cflags = -I$$prefix/include
export($${1}.cflags)
$${1}.libs = "-L$$prefix/lib $$eval($${1}.libs)" $${1}.libs = "-L$$prefix/lib $$eval($${1}.libs)"
export($${1}.libs) export($${1}.libs)
} }
@ -486,8 +491,6 @@ defineTest(qtConfLibrary_makeSpec) {
$${1}.includedir = "$$val_escape(QMAKE_INCDIR_$$spec)" $${1}.includedir = "$$val_escape(QMAKE_INCDIR_$$spec)"
export($${1}.includedir) export($${1}.includedir)
$${1}.cflags = "$$val_escape(QMAKE_CFLAGS_$$spec)"
export($${1}.cflags)
libs = libs =
for (l, QMAKE_LIBDIR_$$spec): \ for (l, QMAKE_LIBDIR_$$spec): \
libs += -L$$l libs += -L$$l
@ -515,15 +518,8 @@ defineTest(qtConfLibrary_pkgConfig) {
qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false) qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false)
qtRunLoggedCommand("$$pkg_config --libs-only-L --libs-only-l $$args", $${1}.libs)|return(false) qtRunLoggedCommand("$$pkg_config --libs-only-L --libs-only-l $$args", $${1}.libs)|return(false)
qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false) qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false)
qtRunLoggedCommand("$$pkg_config --cflags-only-I $$args", includes)|return(false)
eval(includes = $$includes)
includes ~= s/^-I//g
$${1}.includedir = "$$val_escape(includes)"
version ~= s/[^0-9.].*$// version ~= s/[^0-9.].*$//
$${1}.version = $$first(version) $${1}.version = $$first(version)
export($${1}.libs)
export($${1}.cflags)
export($${1}.includedir)
export($${1}.version) export($${1}.version)
return(true) return(true)
} }
@ -555,6 +551,9 @@ defineReplace(qtConfLibraryArgs) {
includedir = $$eval($${1}.includedir) includedir = $$eval($${1}.includedir)
!isEmpty(includedir): \ !isEmpty(includedir): \
qmake_args += $$system_quote(INCLUDEPATH *= $$includedir) qmake_args += $$system_quote(INCLUDEPATH *= $$includedir)
cflags = $$eval($${1}.cflags)
!isEmpty(cflags): \
qmake_args += $$system_quote(QMAKE_CFLAGS += $$cflags) $$system_quote(QMAKE_CXXFLAGS += $$cflags)
return($$qmake_args) return($$qmake_args)
} }
@ -581,12 +580,31 @@ defineTest(qtConfExportLibrary) {
eval(includes = $$eval($${1}.includedir)) eval(includes = $$eval($${1}.includedir))
version = $$eval($${1}.version) version = $$eval($${1}.version)
# Split $$cflags into stuff that goes into DEFINES, INCLUDEPATH, and other stuff.
defines =
ignored =
for (i, cflags) {
contains(i, "-I.*") {
i ~= s/^-I//
includes += $$i
} else: contains(i, "-D.*") {
i ~= s/^-D//
defines += $$i
} else {
# Sometimes, pkg-config files or *-config scripts include other flags
# we really don't need and shouldn't add (pg_config is really bad).
ignored += $$i
}
}
!isEmpty(ignored): \
qtConfAddNote("Dropped compiler flags '$$ignored' when detecting library '$$2'.")
NAME = $$upper($$2) NAME = $$upper($$2)
!isEmpty(libs): qtConfOutputVar(assign, $$output, QMAKE_LIBS_$$NAME, $$libs) !isEmpty(libs): qtConfOutputVar(assign, $$output, QMAKE_LIBS_$$NAME, $$libs)
for (b, $${1}.builds._KEYS_): \ for (b, $${1}.builds._KEYS_): \
qtConfOutputVar(assign, $$output, QMAKE_LIBS_$${NAME}_$$upper($$b), \ qtConfOutputVar(assign, $$output, QMAKE_LIBS_$${NAME}_$$upper($$b), \
$$eval($${1}.builds.$${b})) $$eval($${1}.builds.$${b}))
!isEmpty(cflags): qtConfOutputVar(assign, $$output, QMAKE_CFLAGS_$$NAME, $$cflags) !isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines)
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes) !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
!isEmpty(version) { !isEmpty(version) {
qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION, $$version) qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION, $$version)
@ -992,7 +1010,7 @@ defineReplace(qtConfEvaluateSingleExpression) {
error("Unknown library object $${lib} in expression '$${1}'.") error("Unknown library object $${lib} in expression '$${1}'.")
qtConfHandleLibrary($$lib) qtConfHandleLibrary($$lib)
!defined($${currentConfig}.libraries.$${lib}.$${var}, var): \ !defined($${currentConfig}.libraries.$${lib}.$${var}, var): \
var = sources.$$eval($${currentConfig}.libraries.$${lib}.$${source}).$$var var = sources.$$eval($${currentConfig}.libraries.$${lib}.source).$$var
result = $$eval($${currentConfig}.libraries.$${lib}.$${var}) result = $$eval($${currentConfig}.libraries.$${lib}.$${var})
} else: contains(e, "^features\..*") { } else: contains(e, "^features\..*") {
feature = $$section(e, ".", 1, 1) feature = $$section(e, ".", 1, 1)

View File

@ -9,16 +9,6 @@
# We mean it. # We mean it.
# #
!no_qt_module_warning:!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
QMAKE_ACTUAL_PRO_FILE = $$basename(_PRO_FILE_)
isEmpty(QMAKE_ACTUAL_PRO_FILE): QMAKE_ACTUAL_PRO_FILE=.pro
warning("You should probably load(qt_build_config) first in $$QMAKE_ACTUAL_PRO_FILE for $$TARGET, as the latter also load()s qt_module.")
message("Not doing so may lead to qt_module.prf overriding compiler/linker options in your .pro file.")
message("Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.")
unset(QMAKE_ACTUAL_PRO_FILE)
}
load(qt_build_config) # loads qmodule.pri if hasn't been loaded already
isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0) isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
isEmpty(VERSION): VERSION = $$MODULE_VERSION isEmpty(VERSION): VERSION = $$MODULE_VERSION
isEmpty(VERSION): error("Module does not define version.") isEmpty(VERSION): error("Module does not define version.")

View File

@ -51,5 +51,5 @@ equals(QMAKE_HOST.os, Windows) {
QMAKE_SH = sh QMAKE_SH = sh
} }
CONFIG = file_copies qt warn_on release link_prl CONFIG = file_copies qmake_use qt warn_on release link_prl
QT = core gui QT = core gui

View File

@ -29,21 +29,6 @@ macx-xcode {
QMAKE_MAC_XCODE_SETTINGS += device_family QMAKE_MAC_XCODE_SETTINGS += device_family
ios { ios {
# If QMAKE_BUNDLE_DATA contains an asset catalog that includes an
# AppIcon.appiconset, we configure Xcode to use it for app icons.
for(bundle_data, QMAKE_BUNDLE_DATA) {
for(bundle_file, $${bundle_data}.files) {
!contains(bundle_file, .*\.xcassets$): next()
!exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next()
asset_catalog_appicon.name = "ASSETCATALOG_COMPILER_APPICON_NAME"
asset_catalog_appicon.value = "AppIcon"
QMAKE_MAC_XCODE_SETTINGS += asset_catalog_appicon
break()
}
!isEmpty(asset_catalog_appicon.name): break()
}
# Set up default 4-inch iPhone/iPod launch image so that our apps # Set up default 4-inch iPhone/iPod launch image so that our apps
# support the full screen resolution of those devices. # support the full screen resolution of those devices.
qmake_launch_image = Default-568h@2x.png qmake_launch_image = Default-568h@2x.png

View File

@ -8,4 +8,10 @@ xcodebuild {
load(resolve_config) load(resolve_config)
!macx-xcode:xcodebuild: addExclusiveBuilds(simulator, device) !macx-xcode:xcodebuild {
# Switch the order to make sure that the first Makefile target is the right one
!qtConfig(simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
addExclusiveBuilds(simulator, device)
else: \
addExclusiveBuilds(device, simulator)
}

View File

@ -18,10 +18,14 @@ QMAKE_EXTRA_COMPILERS =
error("Failed to create $$OUT_PWD") error("Failed to create $$OUT_PWD")
args = args =
for(arg, QMAKE_ARGS): \ prev_arg =
for(arg, QMAKE_ARGS) {
!equals(arg, "-spec"):!equals(prev_arg, "-spec"): \
args += $$system_quote($$arg) args += $$system_quote($$arg)
prev_arg = $$arg
}
cmd = "$$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode" cmd = "$$QMAKE_QMAKE $$system_quote($$_PRO_FILE_) -spec macx-xcode $$args"
debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'") debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'")
system("cd $$system_quote($$OUT_PWD) && $$cmd") system("cd $$system_quote($$OUT_PWD) && $$cmd")

View File

@ -87,8 +87,9 @@ have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) {
QMAKE_POST_LINK = $$mkdir_debug_info && $$copy_debug_info && $$strip_debug_info $$QMAKE_POST_LINK QMAKE_POST_LINK = $$mkdir_debug_info && $$copy_debug_info && $$strip_debug_info $$QMAKE_POST_LINK
} else { } else {
link_debug_info = $$QMAKE_OBJCOPY --add-gnu-debuglink=$$shell_target_debug_info $$shell_target link_debug_info = $$QMAKE_OBJCOPY --add-gnu-debuglink=$$shell_target_debug_info $$shell_target
chmod_debug_info = chmod -x $$shell_target_debug_info !contains(QMAKE_HOST.os, Windows): \
QMAKE_POST_LINK = $$copy_debug_info && $$strip_debug_info && $$link_debug_info && $$chmod_debug_info $$QMAKE_POST_LINK QMAKE_POST_LINK = && chmod -x $$shell_target_debug_info $$QMAKE_POST_LINK
QMAKE_POST_LINK = $$copy_debug_info && $$strip_debug_info && $$link_debug_info $$QMAKE_POST_LINK
} }
silent:QMAKE_POST_LINK = @echo creating $@.$$debug_info_suffix && $$QMAKE_POST_LINK silent:QMAKE_POST_LINK = @echo creating $@.$$debug_info_suffix && $$QMAKE_POST_LINK

View File

@ -55,6 +55,7 @@
else: \ else: \
manifest_file.output = $$BUILD_DIR/AppxManifest.xml manifest_file.output = $$BUILD_DIR/AppxManifest.xml
!contains(WINRT_MANIFEST.CONFIG, "verbatim") {
# Provide the C-runtime dependency # Provide the C-runtime dependency
equals(TEMPLATE, "app") { equals(TEMPLATE, "app") {
VCLIBS = Microsoft.VCLibs.$$replace(MSVC_VER, \\., ).00 VCLIBS = Microsoft.VCLibs.$$replace(MSVC_VER, \\., ).00
@ -191,6 +192,9 @@
winrt_assets_install.path = $$target.path/assets winrt_assets_install.path = $$target.path/assets
INSTALLS += winrt_manifest_install winrt_assets_install INSTALLS += winrt_manifest_install winrt_assets_install
} }
} else {
manifest_file.CONFIG += verbatim
}
QMAKE_SUBSTITUTES += manifest_file QMAKE_SUBSTITUTES += manifest_file
} }

View File

@ -7,9 +7,6 @@ QMAKE_PLATFORM = haiku
include(../common/unix.conf) include(../common/unix.conf)
# Choose haiku QPA Plugin as default
QT_QPA_DEFAULT_PLATFORM = haiku
QMAKE_LIBS = QMAKE_LIBS =
QMAKE_INCDIR = QMAKE_INCDIR =
QMAKE_LIBDIR = QMAKE_LIBDIR =

View File

@ -50,6 +50,7 @@ QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD

View File

@ -99,15 +99,12 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \ -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
-I$(INC_PATH) -I$(INC_PATH)/QtCore \ -I$(INC_PATH) -I$(INC_PATH)/QtCore \
-I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \ -I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \
-I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \ -I$(BUILD_PATH)/src/corelib/global \
-I$(QMAKESPEC) \ -I$(QMAKESPEC) \
-I$(SOURCE_PATH)/tools/shared \ -I$(SOURCE_PATH)/tools/shared \
-DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ -DQT_NO_FOREACH
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
-DQT_NO_FOREACH \
-DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS
CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS) CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS)

View File

@ -40,15 +40,12 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
$(CFLAGS_EXTRA) \ $(CFLAGS_EXTRA) \
-I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
-I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \
-I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \ -I$(BUILD_PATH)\src\corelib\global \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
-I$(SOURCE_PATH)\tools\shared \ -I$(SOURCE_PATH)\tools\shared \
-DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \ -DQT_VERSION_STR=\"$(QT_VERSION)\" -DQT_VERSION_MAJOR=$(QT_MAJOR_VERSION) -DQT_VERSION_MINOR=$(QT_MINOR_VERSION) -DQT_VERSION_PATCH=$(QT_PATCH_VERSION) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ -DQT_NO_FOREACH -DUNICODE
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
-DQT_NO_FOREACH \
-DUNICODE -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS
CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS) CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS)
CXXFLAGS_BARE = $(CFLAGS_BARE) CXXFLAGS_BARE = $(CFLAGS_BARE)

View File

@ -1915,7 +1915,7 @@ ProjectBuilderMakefileGenerator::pbuilderVersion() const
CFStringRef str = CFStringRef(CFBundleGetValueForInfoDictionaryKey(bundle, CFStringRef str = CFStringRef(CFBundleGetValueForInfoDictionaryKey(bundle,
CFSTR("CFBundleShortVersionString"))); CFSTR("CFBundleShortVersionString")));
if (str) { if (str) {
QStringList versions = QCFString::toQString(str).split(QLatin1Char('.')); QStringList versions = QString::fromCFString(str).split(QLatin1Char('.'));
int versionMajor = versions.at(0).toInt(); int versionMajor = versions.at(0).toInt();
int versionMinor = versions.at(1).toInt(); int versionMinor = versions.at(1).toInt();
if (versionMajor >= 3) { if (versionMajor >= 3) {

View File

@ -208,9 +208,9 @@ inline QString operator+(const QString &one, const ProString &two)
{ return ProString(one) + two; } { return ProString(one) + two; }
inline QString operator+(const ProString &one, const char *two) inline QString operator+(const ProString &one, const char *two)
{ QString ret = one.toQStringRef() + two; ret.detach(); return ret; } { QString ret = one.toQStringRef() + QLatin1String(two); ret.detach(); return ret; }
inline QString operator+(const char *one, const ProString &two) inline QString operator+(const char *one, const ProString &two)
{ QString ret = one + two.toQStringRef(); ret.detach(); return ret; } { QString ret = QLatin1String(one) + two.toQStringRef(); ret.detach(); return ret; }
inline QString operator+(const ProString &one, QChar two) inline QString operator+(const ProString &one, QChar two)
{ return one.toQStringRef() + two; } { return one.toQStringRef() + two; }
inline QString operator+(QChar one, const ProString &two) inline QString operator+(QChar one, const ProString &two)

View File

@ -468,7 +468,9 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args, int *exitCode)
if (!errout.isEmpty()) { if (!errout.isEmpty()) {
if (errout.endsWith('\n')) if (errout.endsWith('\n'))
errout.chop(1); errout.chop(1);
m_handler->message(QMakeHandler::EvalError, QString::fromLocal8Bit(errout)); m_handler->message(
QMakeHandler::EvalError | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0),
QString::fromLocal8Bit(errout));
} }
# endif # endif
out = proc.readAllStandardOutput(); out = proc.readAllStandardOutput();

View File

@ -1024,21 +1024,8 @@ void QMakeEvaluator::loadDefaults()
if (GetComputerName(name, &name_length)) if (GetComputerName(name, &name_length))
vars[ProKey("QMAKE_HOST.name")] << ProString(QString::fromWCharArray(name)); vars[ProKey("QMAKE_HOST.name")] << ProString(QString::fromWCharArray(name));
QSysInfo::WinVersion ver = QSysInfo::WindowsVersion; vars[ProKey("QMAKE_HOST.version")] << ProString(QSysInfo::kernelVersion());
vars[ProKey("QMAKE_HOST.version")] << ProString(QString::number(ver)); vars[ProKey("QMAKE_HOST.version_string")] << ProString(QSysInfo::productVersion());
ProString verStr;
switch (ver) {
case QSysInfo::WV_Me: verStr = ProString("WinMe"); break;
case QSysInfo::WV_95: verStr = ProString("Win95"); break;
case QSysInfo::WV_98: verStr = ProString("Win98"); break;
case QSysInfo::WV_NT: verStr = ProString("WinNT"); break;
case QSysInfo::WV_2000: verStr = ProString("Win2000"); break;
case QSysInfo::WV_2003: verStr = ProString("Win2003"); break;
case QSysInfo::WV_XP: verStr = ProString("WinXP"); break;
case QSysInfo::WV_VISTA: verStr = ProString("WinVista"); break;
default: verStr = ProString("Unknown"); break;
}
vars[ProKey("QMAKE_HOST.version_string")] << verStr;
SYSTEM_INFO info; SYSTEM_INFO info;
GetSystemInfo(&info); GetSystemInfo(&info);
@ -2037,7 +2024,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFileInto(
void QMakeEvaluator::message(int type, const QString &msg) const void QMakeEvaluator::message(int type, const QString &msg) const
{ {
if (!m_skipLevel) if (!m_skipLevel)
m_handler->message(type, msg, m_handler->message(type | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0), msg,
m_current.line ? m_current.pro->fileName() : QString(), m_current.line ? m_current.pro->fileName() : QString(),
m_current.line != 0xffff ? m_current.line : -1); m_current.line != 0xffff ? m_current.line : -1);
} }

View File

@ -60,6 +60,7 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe,
else else
*cont = contents; *cont = contents;
Q_UNUSED(errStr) Q_UNUSED(errStr)
Q_UNUSED(exe)
return true; return true;
#else #else
QFileInfo qfi(fn); QFileInfo qfi(fn);

View File

@ -151,11 +151,7 @@ bootstrap { #Qt code
LFLAGS += -lcpp LFLAGS += -lcpp
} }
DEFINES += \ DEFINES += QT_BOOTSTRAPPED
QT_BOOTSTRAPPED \
QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_NO_COMPONENT QT_NO_COMPRESS \
QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT QT_NO_DATASTREAM \
QT_CRYPTOGRAPHICHASH_ONLY_SHA1 QT_JSON_READONLY QT_NO_STANDARDPATHS
INCLUDEPATH += \ INCLUDEPATH += \
$$QT.core.includes $$QT.core_private.includes \ $$QT.core.includes $$QT.core_private.includes \

View File

@ -4,7 +4,7 @@
load(qt_parts) load(qt_parts)
SUBDIRS += qmake/qmake-aux.pro SUBDIRS += qmake/qmake-aux.pro doc
cross_compile: CONFIG += nostrip cross_compile: CONFIG += nostrip
@ -84,10 +84,6 @@ mkspecs.files = \
mkspecs.files -= $$PWD/mkspecs/modules $$PWD/mkspecs/modules-inst mkspecs.files -= $$PWD/mkspecs/modules $$PWD/mkspecs/modules-inst
INSTALLS += mkspecs INSTALLS += mkspecs
global_docs.files = $$PWD/doc/global
global_docs.path = $$[QT_INSTALL_DOCS]
INSTALLS += global_docs
OTHER_FILES += \ OTHER_FILES += \
configure \ configure \
header.BSD \ header.BSD \

View File

@ -9,12 +9,12 @@
<signal name="AddAccessible"> <signal name="AddAccessible">
<arg name="nodeAdded" type="((so)(so)a(so)assusau)"/> <arg name="nodeAdded" type="((so)(so)a(so)assusau)"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QSpiAccessibleCacheItem"/> <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QSpiAccessibleCacheItem"/>
</signal> </signal>
<signal name="RemoveAccessible"> <signal name="RemoveAccessible">
<arg name="nodeRemoved" type="(so)"/> <arg name="nodeRemoved" type="(so)"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QSpiObjectReference"/> <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QSpiObjectReference"/>
</signal> </signal>
</interface> </interface>

View File

@ -1,6 +1,5 @@
qtConfig(system-freetype) { qtConfig(system-freetype) {
# pull in the proper freetype2 include directory QMAKE_USE_PRIVATE += freetype/nolink
include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
} else: qtConfig(freetype) { } else: qtConfig(freetype) {
INCLUDEPATH += $$PWD/freetype/include INCLUDEPATH += $$PWD/freetype/include
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtfreetype$$qtPlatformTargetSuffix() LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtfreetype$$qtPlatformTargetSuffix()

View File

@ -14,7 +14,11 @@ http://creativecommons.org/publicdomain/zero/1.0/
#ifndef _KeccakPermutationInterface_h_ #ifndef _KeccakPermutationInterface_h_
#define _KeccakPermutationInterface_h_ #define _KeccakPermutationInterface_h_
#include <private/qglobal_p.h>
#if QT_CONFIG(sha3_fast)
#include "KeccakF-1600-int-set.h" #include "KeccakF-1600-int-set.h"
#endif
static void KeccakInitialize( void ); static void KeccakInitialize( void );
static void KeccakInitializeState(unsigned char *state); static void KeccakInitializeState(unsigned char *state);

View File

@ -4,6 +4,8 @@ INCLUDEPATH += $$PWD/xkbcommon \
$$PWD/xkbcommon/src \ $$PWD/xkbcommon/src \
$$PWD/xkbcommon/src/xkbcomp $$PWD/xkbcommon/src/xkbcomp
include($$shadowed($$PWD/../gui/qtgui-config.pri))
DEFINES += DFLT_XKB_CONFIG_ROOT='\\"$$QMAKE_XKB_CONFIG_ROOT\\"' DEFINES += DFLT_XKB_CONFIG_ROOT='\\"$$QMAKE_XKB_CONFIG_ROOT\\"'
### RMLVO names can be overwritten with environmental variables (see libxkbcommon documentation) ### RMLVO names can be overwritten with environmental variables (see libxkbcommon documentation)

View File

@ -258,16 +258,20 @@ public class QtActivity extends Activity
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@Override protected void onCreateHook(Bundle savedInstanceState) {
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
m_loader.APPLICATION_PARAMETERS = APPLICATION_PARAMETERS; m_loader.APPLICATION_PARAMETERS = APPLICATION_PARAMETERS;
m_loader.ENVIRONMENT_VARIABLES = ENVIRONMENT_VARIABLES; m_loader.ENVIRONMENT_VARIABLES = ENVIRONMENT_VARIABLES;
m_loader.QT_ANDROID_THEMES = QT_ANDROID_THEMES; m_loader.QT_ANDROID_THEMES = QT_ANDROID_THEMES;
m_loader.QT_ANDROID_DEFAULT_THEME = QT_ANDROID_DEFAULT_THEME; m_loader.QT_ANDROID_DEFAULT_THEME = QT_ANDROID_DEFAULT_THEME;
m_loader.onCreate(savedInstanceState); m_loader.onCreate(savedInstanceState);
} }
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
onCreateHook(savedInstanceState);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@Override @Override

View File

@ -50,11 +50,14 @@ public class QtService extends Service
/////////////////////////// Super class calls //////////////////////////////////// /////////////////////////// Super class calls ////////////////////////////////////
/////////////// PLEASE DO NOT CHANGE THE FOLLOWING CODE ////////////////////////// /////////////// PLEASE DO NOT CHANGE THE FOLLOWING CODE //////////////////////////
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
protected void onCreateHook() {
m_loader.onCreate();
}
@Override @Override
public void onCreate() public void onCreate()
{ {
super.onCreate(); super.onCreate();
m_loader.onCreate(); onCreateHook();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@ -353,6 +353,7 @@
}, },
"qeventtransition": { "qeventtransition": {
"label": "QEventTransition class", "label": "QEventTransition class",
"condition": "features.statemachine",
"output": [ "publicFeature" ] "output": [ "publicFeature" ]
}, },
"sharedmemory": { "sharedmemory": {
@ -557,6 +558,30 @@
"purpose": "Provides a framework for gestures.", "purpose": "Provides a framework for gestures.",
"section": "Utilities", "section": "Utilities",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
},
"sha3-fast": {
"label": "Speed optimized SHA3",
"purpose": "Optimizes SHA3 for speed instead of size.",
"section": "Utilities",
"output": [ "privateFeature" ]
},
"timezone": {
"label": "QTimeZone",
"purpose": "Provides support for timezone handling.",
"section": "Utilities",
"output": [ "publicFeature" ]
},
"commandlineparser": {
"label": "QCommandlineParser",
"purpose": "Provides support for command line parsing.",
"section": "Utilities",
"output": [ "publicFeature" ]
},
"topleveldomain": {
"label": "QUrl::topLevelDomain()",
"description": "Provides support for extracting the top level domain from URLs.",
"section": "Utilities",
"output": [ "publicFeature" ]
} }
}, },

View File

@ -1351,11 +1351,17 @@
/* Clang can not parse namespaced attributes in C mode, but defines __has_cpp_attribute */ /* Clang can not parse namespaced attributes in C mode, but defines __has_cpp_attribute */
# if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough) # if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
# define Q_FALLTHROUGH() [[clang::fallthrough]] # define Q_FALLTHROUGH() [[clang::fallthrough]]
# elif QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
# define Q_FALLTHROUGH() [[gnu::fallthrough]]
# endif # endif
#endif #endif
#ifndef Q_FALLTHROUGH #ifndef Q_FALLTHROUGH
# if defined(Q_CC_GNU) && Q_CC_GNU >= 700
# define Q_FALLTHROUGH() __attribute__((fallthrough))
# else
# define Q_FALLTHROUGH() (void)0 # define Q_FALLTHROUGH() (void)0
#endif #endif
#endif
/* /*

View File

@ -0,0 +1,99 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
// Despite its file name, this really is not a public header.
// It is an implementation detail of the private bootstrap library.
//
#if 0
// silence syncqt warnings
#pragma qt_sync_skip_header_check
#pragma qt_sync_stop_processing
#endif
#ifdef QT_BOOTSTRAPPED
#ifndef QT_NO_EXCEPTIONS
#define QT_NO_EXCEPTIONS
#endif
#define QT_NO_USING_NAMESPACE
#define QT_NO_DEPRECATED
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_NO_DATASTREAM
#define QT_NO_LIBRARY
#define QT_FEATURE_library -1
#define QT_NO_QOBJECT
#define QT_NO_SYSTEMLOCALE
#define QT_NO_THREAD
#define QT_FEATURE_timezone -1
#define QT_FEATURE_topleveldomain -1
#define QT_NO_TRANSLATION
#define QT_FEATURE_translation -1
#define QT_NO_GEOM_VARIANT
#if defined(QT_BUILD_QMAKE) || defined(QT_BUILD_CONFIGURE)
#define QT_FEATURE_commandlineparser -1
#define QT_NO_COMPRESS
#define QT_JSON_READONLY
#define QT_NO_TEXTCODEC
#define QT_FEATURE_textcodec -1
#else
#define QT_NO_CODECS
#define QT_FEATURE_codecs -1
#define QT_FEATURE_commandlineparser 1
#define QT_FEATURE_textcodec 1
#endif
#if defined(QT_BUILD_QMAKE)
#define QT_NO_STANDARDPATHS
#endif
#endif // QT_BOOTSTRAPPED

View File

@ -3381,7 +3381,7 @@ Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
pseudo random integers to be returned by qrand(). pseudo random integers to be returned by qrand().
The sequence of random numbers generated is deterministic per thread. For example, The sequence of random numbers generated is deterministic per thread. For example,
if two threads call qsrand(1) and subsequently calls qrand(), the threads will get if two threads call qsrand(1) and subsequently call qrand(), the threads will get
the same random number sequence. the same random number sequence.
\sa qrand() \sa qrand()

View File

@ -56,7 +56,9 @@
*/ */
#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
#ifndef QT_BOOTSTRAPPED #ifdef QT_BOOTSTRAPPED
#include <QtCore/qconfig-bootstrapped.h>
#else
#include <QtCore/qconfig.h> #include <QtCore/qconfig.h>
#include <QtCore/qtcore-config.h> #include <QtCore/qtcore-config.h>
#endif #endif

View File

@ -558,7 +558,7 @@ public:
Key_Insert = 0x01000006, Key_Insert = 0x01000006,
Key_Delete = 0x01000007, Key_Delete = 0x01000007,
Key_Pause = 0x01000008, Key_Pause = 0x01000008,
Key_Print = 0x01000009, Key_Print = 0x01000009, // print screen
Key_SysReq = 0x0100000a, Key_SysReq = 0x0100000a,
Key_Clear = 0x0100000b, Key_Clear = 0x0100000b,
Key_Home = 0x01000010, // cursor movement Key_Home = 0x01000010, // cursor movement

View File

@ -1761,17 +1761,6 @@
\value Key_Zoom \value Key_Zoom
\value Key_Exit \value Key_Exit
\value Key_Cancel \value Key_Cancel
\value Key_MicVolumeUp
\value Key_Find
\value Key_Open
\value Key_MicVolumeDown
\value Key_New
\value Key_Settings
\value Key_Redo
\value Key_Exit
\value Key_Info
\value Key_Undo
\value Key_Guide
\sa QKeyEvent::key() \sa QKeyEvent::key()
*/ */
@ -2300,7 +2289,7 @@
\enum Qt::ItemSelectionMode \enum Qt::ItemSelectionMode
This enum is used in QGraphicsItem, QGraphicsScene and QGraphicsView to This enum is used in QGraphicsItem, QGraphicsScene and QGraphicsView to
specify how items are selected, or how to determine if a shapes and items specify how items are selected, or how to determine if shapes and items
collide. collide.
\value ContainsItemShape The output list contains only items whose \value ContainsItemShape The output list contains only items whose

View File

@ -101,13 +101,13 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
if (suffix.length() > 0) { if (suffix.length() > 0) {
// First step: is the extension known ? // First step: is the extension known ?
QCFType<CFStringRef> extensionRef = QCFString::toCFStringRef(suffix); QCFType<CFStringRef> extensionRef = suffix.toCFString();
QCFType<CFStringRef> uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL); QCFType<CFStringRef> uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL);
if (UTTypeConformsTo(uniformTypeIdentifier, kUTTypeBundle)) if (UTTypeConformsTo(uniformTypeIdentifier, kUTTypeBundle))
return true; return true;
// Second step: check if an application knows the package type // Second step: check if an application knows the package type
QCFType<CFStringRef> path = QCFString::toCFStringRef(entry.filePath()); QCFType<CFStringRef> path = entry.filePath().toCFString();
QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle, true); QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle, true);
UInt32 type, creator; UInt32 type, creator;
@ -126,7 +126,7 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
if (application) { if (application) {
QCFType<CFBundleRef> bundle = CFBundleCreate(kCFAllocatorDefault, application); QCFType<CFBundleRef> bundle = CFBundleCreate(kCFAllocatorDefault, application);
CFStringRef identifier = CFBundleGetIdentifier(bundle); CFStringRef identifier = CFBundleGetIdentifier(bundle);
QString applicationId = QCFString::toQString(identifier); QString applicationId = QString::fromCFString(identifier);
if (applicationId != QLatin1String("com.apple.finder")) if (applicationId != QLatin1String("com.apple.finder"))
return true; return true;
} }
@ -222,7 +222,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
if (!cfstr) if (!cfstr)
return QFileSystemEntry(); return QFileSystemEntry();
return QFileSystemEntry(QCFString::toQString(cfstr)); return QFileSystemEntry(QString::fromCFString(cfstr));
} }
#endif #endif
return QFileSystemEntry(); return QFileSystemEntry();
@ -412,7 +412,7 @@ QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
if (QCFType<CFDictionaryRef> dict = CFBundleCopyInfoDictionaryForURL(url)) { if (QCFType<CFDictionaryRef> dict = CFBundleCopyInfoDictionaryForURL(url)) {
if (CFTypeRef name = (CFTypeRef)CFDictionaryGetValue(dict, kCFBundleNameKey)) { if (CFTypeRef name = (CFTypeRef)CFDictionaryGetValue(dict, kCFBundleNameKey)) {
if (CFGetTypeID(name) == CFStringGetTypeID()) if (CFGetTypeID(name) == CFStringGetTypeID())
return QCFString::toQString((CFStringRef)name); return QString::fromCFString((CFStringRef)name);
} }
} }
return QString(); return QString();

View File

@ -87,7 +87,7 @@ bool QFseventsFileSystemWatcherEngine::checkDir(DirsByName::iterator &it)
if (res == -1) { if (res == -1) {
needsRestart |= derefPath(info.watchedPath); needsRestart |= derefPath(info.watchedPath);
emit emitDirectoryChanged(info.origPath, true); emit emitDirectoryChanged(info.origPath, true);
it = watchedDirectories.erase(it); it = watchingState.watchedDirectories.erase(it);
} else if (st.st_ctimespec != info.ctime || st.st_mode != info.mode) { } else if (st.st_ctimespec != info.ctime || st.st_mode != info.mode) {
info.ctime = st.st_ctimespec; info.ctime = st.st_ctimespec;
info.mode = st.st_mode; info.mode = st.st_mode;
@ -138,7 +138,8 @@ bool QFseventsFileSystemWatcherEngine::rescanDirs(const QString &path)
{ {
bool needsRestart = false; bool needsRestart = false;
for (DirsByName::iterator it = watchedDirectories.begin(); it != watchedDirectories.end(); ) { for (DirsByName::iterator it = watchingState.watchedDirectories.begin();
it != watchingState.watchedDirectories.end(); ) {
if (it.key().startsWith(path)) if (it.key().startsWith(path))
needsRestart |= checkDir(it); needsRestart |= checkDir(it);
else else
@ -177,11 +178,12 @@ bool QFseventsFileSystemWatcherEngine::rescanFiles(const QString &path)
{ {
bool needsRestart = false; bool needsRestart = false;
for (FilesByPath::iterator i = watchedFiles.begin(); i != watchedFiles.end(); ) { for (FilesByPath::iterator i = watchingState.watchedFiles.begin();
i != watchingState.watchedFiles.end(); ) {
if (i.key().startsWith(path)) { if (i.key().startsWith(path)) {
needsRestart |= rescanFiles(i.value()); needsRestart |= rescanFiles(i.value());
if (i.value().isEmpty()) { if (i.value().isEmpty()) {
i = watchedFiles.erase(i); i = watchingState.watchedFiles.erase(i);
continue; continue;
} }
} }
@ -232,8 +234,8 @@ void QFseventsFileSystemWatcherEngine::processEvent(ConstFSEventStreamRef stream
if (eFlags & kFSEventStreamEventFlagRootChanged) { if (eFlags & kFSEventStreamEventFlagRootChanged) {
// re-check everything: // re-check everything:
DirsByName::iterator dirIt = watchedDirectories.find(path); DirsByName::iterator dirIt = watchingState.watchedDirectories.find(path);
if (dirIt != watchedDirectories.end()) if (dirIt != watchingState.watchedDirectories.end())
needsRestart |= checkDir(dirIt); needsRestart |= checkDir(dirIt);
needsRestart |= rescanFiles(path); needsRestart |= rescanFiles(path);
continue; continue;
@ -243,13 +245,13 @@ void QFseventsFileSystemWatcherEngine::processEvent(ConstFSEventStreamRef stream
needsRestart |= rescanDirs(path); needsRestart |= rescanDirs(path);
// check watched directories: // check watched directories:
DirsByName::iterator dirIt = watchedDirectories.find(path); DirsByName::iterator dirIt = watchingState.watchedDirectories.find(path);
if (dirIt != watchedDirectories.end()) if (dirIt != watchingState.watchedDirectories.end())
needsRestart |= checkDir(dirIt); needsRestart |= checkDir(dirIt);
// check watched files: // check watched files:
FilesByPath::iterator pIt = watchedFiles.find(path); FilesByPath::iterator pIt = watchingState.watchedFiles.find(path);
if (pIt != watchedFiles.end()) if (pIt != watchingState.watchedFiles.end())
needsRestart |= rescanFiles(pIt.value()); needsRestart |= rescanFiles(pIt.value());
} }
@ -276,12 +278,11 @@ void QFseventsFileSystemWatcherEngine::doEmitDirectoryChanged(const QString &pat
emit directoryChanged(path, removed); emit directoryChanged(path, removed);
} }
void QFseventsFileSystemWatcherEngine::restartStream() bool QFseventsFileSystemWatcherEngine::restartStream()
{ {
QMacAutoReleasePool pool;
QMutexLocker locker(&lock); QMutexLocker locker(&lock);
stopStream(); stopStream();
startStream(); return startStream();
} }
QFseventsFileSystemWatcherEngine *QFseventsFileSystemWatcherEngine::create(QObject *parent) QFseventsFileSystemWatcherEngine *QFseventsFileSystemWatcherEngine::create(QObject *parent)
@ -311,6 +312,7 @@ QFseventsFileSystemWatcherEngine::~QFseventsFileSystemWatcherEngine()
{ {
QMacAutoReleasePool pool; QMacAutoReleasePool pool;
// Stop the stream in case we have to wait for the lock below to be acquired.
if (stream) if (stream)
FSEventStreamStop(stream); FSEventStreamStop(stream);
@ -334,8 +336,10 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QMutexLocker locker(&lock); QMutexLocker locker(&lock);
bool wasRunning = stream != Q_NULLPTR;
bool needsRestart = false; bool needsRestart = false;
WatchingState oldState = watchingState;
QStringList p = paths; QStringList p = paths;
QMutableListIterator<QString> it(p); QMutableListIterator<QString> it(p);
while (it.hasNext()) { while (it.hasNext()) {
@ -356,7 +360,7 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
const bool isDir = S_ISDIR(st.st_mode); const bool isDir = S_ISDIR(st.st_mode);
if (isDir) { if (isDir) {
if (watchedDirectories.contains(realPath)) if (watchingState.watchedDirectories.contains(realPath))
continue; continue;
directories->append(origPath); directories->append(origPath);
watchedPath = realPath; watchedPath = realPath;
@ -371,17 +375,18 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
parentPath = watchedPath; parentPath = watchedPath;
} }
for (PathRefCounts::const_iterator i = watchedPaths.begin(), ei = watchedPaths.end(); i != ei; ++i) { for (PathRefCounts::const_iterator i = watchingState.watchedPaths.begin(),
ei = watchingState.watchedPaths.end(); i != ei; ++i) {
if (watchedPath.startsWith(i.key())) { if (watchedPath.startsWith(i.key())) {
watchedPath = i.key(); watchedPath = i.key();
break; break;
} }
} }
PathRefCounts::iterator it = watchedPaths.find(watchedPath); PathRefCounts::iterator it = watchingState.watchedPaths.find(watchedPath);
if (it == watchedPaths.end()) { if (it == watchingState.watchedPaths.end()) {
needsRestart = true; needsRestart = true;
watchedPaths.insert(watchedPath, 1); watchingState.watchedPaths.insert(watchedPath, 1);
DEBUG("Adding '%s' to watchedPaths", qPrintable(watchedPath)); DEBUG("Adding '%s' to watchedPaths", qPrintable(watchedPath));
} else { } else {
++it.value(); ++it.value();
@ -392,18 +397,25 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
DirInfo dirInfo; DirInfo dirInfo;
dirInfo.dirInfo = info; dirInfo.dirInfo = info;
dirInfo.entries = scanForDirEntries(realPath); dirInfo.entries = scanForDirEntries(realPath);
watchedDirectories.insert(realPath, dirInfo); watchingState.watchedDirectories.insert(realPath, dirInfo);
DEBUG("-- Also adding '%s' to watchedDirectories", qPrintable(realPath)); DEBUG("-- Also adding '%s' to watchedDirectories", qPrintable(realPath));
} else { } else {
watchedFiles[parentPath].insert(realPath, info); watchingState.watchedFiles[parentPath].insert(realPath, info);
DEBUG("-- Also adding '%s' to watchedFiles", qPrintable(realPath)); DEBUG("-- Also adding '%s' to watchedFiles", qPrintable(realPath));
} }
} }
if (needsRestart) { if (needsRestart) {
stopStream(); stopStream();
if (!startStream()) if (!startStream()) {
// ok, something went wrong, let's try to restore the previous state
watchingState = qMove(oldState);
// and because we don't know which path caused the issue (if any), fail on all of them
p = paths; p = paths;
if (wasRunning)
startStream();
}
} }
return p; return p;
@ -419,6 +431,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
bool needsRestart = false; bool needsRestart = false;
WatchingState oldState = watchingState;
QStringList p = paths; QStringList p = paths;
QMutableListIterator<QString> it(p); QMutableListIterator<QString> it(p);
while (it.hasNext()) { while (it.hasNext()) {
@ -431,10 +444,10 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
realPath = fi.canonicalFilePath(); realPath = fi.canonicalFilePath();
if (fi.isDir()) { if (fi.isDir()) {
DirsByName::iterator dirIt = watchedDirectories.find(realPath); DirsByName::iterator dirIt = watchingState.watchedDirectories.find(realPath);
if (dirIt != watchedDirectories.end()) { if (dirIt != watchingState.watchedDirectories.end()) {
needsRestart |= derefPath(dirIt->dirInfo.watchedPath); needsRestart |= derefPath(dirIt->dirInfo.watchedPath);
watchedDirectories.erase(dirIt); watchingState.watchedDirectories.erase(dirIt);
directories->removeAll(origPath); directories->removeAll(origPath);
it.remove(); it.remove();
DEBUG("Removed directory '%s'", qPrintable(realPath)); DEBUG("Removed directory '%s'", qPrintable(realPath));
@ -442,15 +455,15 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
} else { } else {
QFileInfo fi(realPath); QFileInfo fi(realPath);
QString parentPath = fi.path(); QString parentPath = fi.path();
FilesByPath::iterator pIt = watchedFiles.find(parentPath); FilesByPath::iterator pIt = watchingState.watchedFiles.find(parentPath);
if (pIt != watchedFiles.end()) { if (pIt != watchingState.watchedFiles.end()) {
InfoByName &filesInDir = pIt.value(); InfoByName &filesInDir = pIt.value();
InfoByName::iterator fIt = filesInDir.find(realPath); InfoByName::iterator fIt = filesInDir.find(realPath);
if (fIt != filesInDir.end()) { if (fIt != filesInDir.end()) {
needsRestart |= derefPath(fIt->watchedPath); needsRestart |= derefPath(fIt->watchedPath);
filesInDir.erase(fIt); filesInDir.erase(fIt);
if (filesInDir.isEmpty()) if (filesInDir.isEmpty())
watchedFiles.erase(pIt); watchingState.watchedFiles.erase(pIt);
files->removeAll(origPath); files->removeAll(origPath);
it.remove(); it.remove();
DEBUG("Removed file '%s'", qPrintable(realPath)); DEBUG("Removed file '%s'", qPrintable(realPath));
@ -461,26 +474,33 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
locker.unlock(); locker.unlock();
if (needsRestart) if (needsRestart) {
restartStream(); if (!restartStream()) {
watchingState = qMove(oldState);
startStream();
}
}
return p; return p;
} }
// Returns false if FSEventStream* calls failed for some mysterious reason, true if things got a
// thumbs-up.
bool QFseventsFileSystemWatcherEngine::startStream() bool QFseventsFileSystemWatcherEngine::startStream()
{ {
Q_ASSERT(stream == 0); Q_ASSERT(stream == 0);
QMacAutoReleasePool pool; if (stream) // Ok, this really shouldn't happen, esp. not after the assert. But let's be nice in release mode and still handle it.
if (stream) // This shouldn't happen, but let's be nice and handle it.
stopStream(); stopStream();
if (watchedPaths.isEmpty()) QMacAutoReleasePool pool;
return false;
DEBUG() << "Starting stream with paths" << watchedPaths.keys(); if (watchingState.watchedPaths.isEmpty())
return true; // we succeeded in doing nothing
NSMutableArray *pathsToWatch = [NSMutableArray arrayWithCapacity:watchedPaths.size()]; DEBUG() << "Starting stream with paths" << watchingState.watchedPaths.keys();
for (PathRefCounts::const_iterator i = watchedPaths.begin(), ei = watchedPaths.end(); i != ei; ++i)
NSMutableArray *pathsToWatch = [NSMutableArray arrayWithCapacity:watchingState.watchedPaths.size()];
for (PathRefCounts::const_iterator i = watchingState.watchedPaths.begin(), ei = watchingState.watchedPaths.end(); i != ei; ++i)
[pathsToWatch addObject:i.key().toNSString()]; [pathsToWatch addObject:i.key().toNSString()];
struct FSEventStreamContext callBackInfo = { struct FSEventStreamContext callBackInfo = {
@ -504,7 +524,7 @@ bool QFseventsFileSystemWatcherEngine::startStream()
latency, latency,
FSEventStreamCreateFlags(0)); FSEventStreamCreateFlags(0));
if (!stream) { if (!stream) { // nope, no way to know what went wrong, so just fail
DEBUG() << "Failed to create stream!"; DEBUG() << "Failed to create stream!";
return false; return false;
} }
@ -514,7 +534,7 @@ bool QFseventsFileSystemWatcherEngine::startStream()
if (FSEventStreamStart(stream)) { if (FSEventStreamStart(stream)) {
DEBUG() << "Stream started successfully with sinceWhen =" << lastReceivedEvent; DEBUG() << "Stream started successfully with sinceWhen =" << lastReceivedEvent;
return true; return true;
} else { } else { // again, no way to know what went wrong, so just clean up and fail
DEBUG() << "Stream failed to start!"; DEBUG() << "Stream failed to start!";
FSEventStreamInvalidate(stream); FSEventStreamInvalidate(stream);
FSEventStreamRelease(stream); FSEventStreamRelease(stream);
@ -525,6 +545,7 @@ bool QFseventsFileSystemWatcherEngine::startStream()
void QFseventsFileSystemWatcherEngine::stopStream(bool isStopped) void QFseventsFileSystemWatcherEngine::stopStream(bool isStopped)
{ {
QMacAutoReleasePool pool;
if (stream) { if (stream) {
if (!isStopped) if (!isStopped)
FSEventStreamStop(stream); FSEventStreamStop(stream);
@ -554,9 +575,9 @@ QFseventsFileSystemWatcherEngine::InfoByName QFseventsFileSystemWatcherEngine::s
bool QFseventsFileSystemWatcherEngine::derefPath(const QString &watchedPath) bool QFseventsFileSystemWatcherEngine::derefPath(const QString &watchedPath)
{ {
PathRefCounts::iterator it = watchedPaths.find(watchedPath); PathRefCounts::iterator it = watchingState.watchedPaths.find(watchedPath);
if (it != watchedPaths.end() && --it.value() < 1) { if (it != watchingState.watchedPaths.end() && --it.value() < 1) {
watchedPaths.erase(it); watchingState.watchedPaths.erase(it);
DEBUG("Removing '%s' from watchedPaths.", qPrintable(watchedPath)); DEBUG("Removing '%s' from watchedPaths.", qPrintable(watchedPath));
return true; return true;
} }

View File

@ -87,7 +87,7 @@ Q_SIGNALS:
private slots: private slots:
void doEmitFileChanged(const QString &path, bool removed); void doEmitFileChanged(const QString &path, bool removed);
void doEmitDirectoryChanged(const QString &path, bool removed); void doEmitDirectoryChanged(const QString &path, bool removed);
void restartStream(); bool restartStream();
private: private:
struct Info { struct Info {
@ -118,6 +118,19 @@ private:
typedef QHash<QString, DirInfo> DirsByName; typedef QHash<QString, DirInfo> DirsByName;
typedef QHash<QString, qint64> PathRefCounts; typedef QHash<QString, qint64> PathRefCounts;
struct WatchingState {
// These fields go hand-in-hand. FSEvents watches paths, and there is no use in watching
// the same path multiple times. So, the "refcount" on a path is the number of watched
// files that have the same path, plus the number of directories that have the same path.
//
// If the stream fails to start after adding files/directories, the watcher will try to
// keep watching files/directories that it was already watching. It does that by restoring
// the previous WatchingState and restarting the stream.
FilesByPath watchedFiles;
DirsByName watchedDirectories;
PathRefCounts watchedPaths;
};
QFseventsFileSystemWatcherEngine(QObject *parent); QFseventsFileSystemWatcherEngine(QObject *parent);
bool startStream(); bool startStream();
void stopStream(bool isStopped = false); void stopStream(bool isStopped = false);
@ -131,10 +144,8 @@ private:
QMutex lock; QMutex lock;
dispatch_queue_t queue; dispatch_queue_t queue;
FSEventStreamRef stream; FSEventStreamRef stream;
FilesByPath watchedFiles;
DirsByName watchedDirectories;
PathRefCounts watchedPaths;
FSEventStreamEventId lastReceivedEvent; FSEventStreamEventId lastReceivedEvent;
WatchingState watchingState;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -120,6 +120,14 @@ static void checkWarnMessage(const QIODevice *device, const char *function, cons
} \ } \
} while (0) } while (0)
#define CHECK_MAXBYTEARRAYSIZE(function) \
do { \
if (maxSize >= MaxByteArraySize) { \
checkWarnMessage(this, #function, "maxSize argument exceeds QByteArray size limit"); \
maxSize = MaxByteArraySize - 1; \
} \
} while (0)
#define CHECK_WRITABLE(function, returnType) \ #define CHECK_WRITABLE(function, returnType) \
do { \ do { \
if ((d->openMode & WriteOnly) == 0) { \ if ((d->openMode & WriteOnly) == 0) { \
@ -1178,10 +1186,7 @@ QByteArray QIODevice::read(qint64 maxSize)
} }
CHECK_MAXLEN(read, result); CHECK_MAXLEN(read, result);
if (maxSize >= MaxByteArraySize) { CHECK_MAXBYTEARRAYSIZE(read);
checkWarnMessage(this, "read", "maxSize argument exceeds QByteArray size limit");
maxSize = MaxByteArraySize - 1;
}
result.resize(int(maxSize)); result.resize(int(maxSize));
qint64 readBytes = read(result.data(), result.size()); qint64 readBytes = read(result.data(), result.size());
@ -1402,17 +1407,13 @@ QByteArray QIODevice::readLine(qint64 maxSize)
QByteArray result; QByteArray result;
CHECK_MAXLEN(readLine, result); CHECK_MAXLEN(readLine, result);
CHECK_MAXBYTEARRAYSIZE(readLine);
#if defined QIODEVICE_DEBUG #if defined QIODEVICE_DEBUG
printf("%p QIODevice::readLine(%lld), d->pos = %lld, d->buffer.size() = %lld\n", printf("%p QIODevice::readLine(%lld), d->pos = %lld, d->buffer.size() = %lld\n",
this, maxSize, d->pos, d->buffer.size()); this, maxSize, d->pos, d->buffer.size());
#endif #endif
if (maxSize >= MaxByteArraySize) {
qWarning("QIODevice::read: maxSize argument exceeds QByteArray size limit");
maxSize = MaxByteArraySize - 1;
}
result.resize(int(maxSize)); result.resize(int(maxSize));
qint64 readBytes = 0; qint64 readBytes = 0;
if (!result.size()) { if (!result.size()) {

View File

@ -418,7 +418,7 @@ void QProcessPrivate::startProcess()
} }
if (url) { if (url) {
const QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); const QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
encodedProgramName += (QDir::separator() + QDir(program).relativeFilePath(QCFString::toQString(str))).toUtf8(); encodedProgramName += (QDir::separator() + QDir(program).relativeFilePath(QString::fromCFString(str))).toUtf8();
} }
} }
#endif #endif

View File

@ -427,7 +427,9 @@ QString QSettingsPrivate::variantToString(const QVariant &v)
case QVariant::Double: case QVariant::Double:
case QVariant::KeySequence: { case QVariant::KeySequence: {
result = v.toString(); result = v.toString();
if (result.startsWith(QLatin1Char('@'))) if (result.contains(QChar::Null))
result = QLatin1String("@String(") + result + QLatin1Char(')');
else if (result.startsWith(QLatin1Char('@')))
result.prepend(QLatin1Char('@')); result.prepend(QLatin1Char('@'));
break; break;
} }
@ -487,6 +489,8 @@ QVariant QSettingsPrivate::stringToVariant(const QString &s)
if (s.endsWith(QLatin1Char(')'))) { if (s.endsWith(QLatin1Char(')'))) {
if (s.startsWith(QLatin1String("@ByteArray("))) { if (s.startsWith(QLatin1String("@ByteArray("))) {
return QVariant(s.midRef(11, s.size() - 12).toLatin1()); return QVariant(s.midRef(11, s.size() - 12).toLatin1());
} else if (s.startsWith(QLatin1String("@String("))) {
return QVariant(s.midRef(8, s.size() - 9).toString());
} else if (s.startsWith(QLatin1String("@Variant(")) } else if (s.startsWith(QLatin1String("@Variant("))
|| s.startsWith(QLatin1String("@DateTime("))) { || s.startsWith(QLatin1String("@DateTime("))) {
#ifndef QT_NO_DATASTREAM #ifndef QT_NO_DATASTREAM

View File

@ -80,6 +80,9 @@ public:
AccessError, AccessError,
FormatError FormatError
}; };
#ifndef QT_NO_QOBJECT
Q_ENUM(Status)
#endif
enum Format { enum Format {
NativeFormat, NativeFormat,
@ -108,11 +111,17 @@ public:
CustomFormat15, CustomFormat15,
CustomFormat16 CustomFormat16
}; };
#ifndef QT_NO_QOBJECT
Q_ENUM(Format)
#endif
enum Scope { enum Scope {
UserScope, UserScope,
SystemScope SystemScope
}; };
#ifndef QT_NO_QOBJECT
Q_ENUM(Scope)
#endif
#ifndef QT_NO_QOBJECT #ifndef QT_NO_QOBJECT
explicit QSettings(const QString &organization, explicit QSettings(const QString &organization,

View File

@ -83,12 +83,12 @@ static QString rotateSlashesDotsAndMiddots(const QString &key, int shift)
static QCFType<CFStringRef> macKey(const QString &key) static QCFType<CFStringRef> macKey(const QString &key)
{ {
return QCFString::toCFStringRef(rotateSlashesDotsAndMiddots(key, Macify)); return rotateSlashesDotsAndMiddots(key, Macify).toCFString();
} }
static QString qtKey(CFStringRef cfkey) static QString qtKey(CFStringRef cfkey)
{ {
return rotateSlashesDotsAndMiddots(QCFString::toQString(cfkey), Qtify); return rotateSlashesDotsAndMiddots(QString::fromCFString(cfkey), Qtify);
} }
static QCFType<CFPropertyListRef> macValue(const QVariant &value); static QCFType<CFPropertyListRef> macValue(const QVariant &value);
@ -160,7 +160,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
} }
} }
cfkeys[numUniqueKeys] = QCFString::toCFStringRef(key); cfkeys[numUniqueKeys] = key.toCFString();
cfvalues[numUniqueKeys] = singleton ? macValue(values.constFirst()) : macList(values); cfvalues[numUniqueKeys] = singleton ? macValue(values.constFirst()) : macList(values);
++numUniqueKeys; ++numUniqueKeys;
} }
@ -175,18 +175,13 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
break; break;
case QVariant::DateTime: case QVariant::DateTime:
{ {
/* QDateTime dateTime = value.toDateTime();
CFDate, unlike QDateTime, doesn't store timezone information. // CFDate, unlike QDateTime, doesn't store timezone information
*/ if (dateTime.timeSpec() == Qt::LocalTime)
QDateTime dt = value.toDateTime(); result = dateTime.toCFDate();
if (dt.timeSpec() == Qt::LocalTime) { else
QDateTime reference;
reference.setSecsSinceEpoch(qint64(kCFAbsoluteTimeIntervalSince1970));
result = CFDateCreate(kCFAllocatorDefault, CFAbsoluteTime(reference.secsTo(dt)));
} else {
goto string_case; goto string_case;
} }
}
break; break;
case QVariant::Bool: case QVariant::Bool:
result = value.toBool() ? kCFBooleanTrue : kCFBooleanFalse; result = value.toBool() ? kCFBooleanTrue : kCFBooleanFalse;
@ -214,7 +209,11 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
case QVariant::String: case QVariant::String:
string_case: string_case:
default: default:
result = QCFString::toCFStringRef(QSettingsPrivate::variantToString(value)); QString string = QSettingsPrivate::variantToString(value);
if (string.contains(QChar::Null))
result = string.toUtf8().toCFData();
else
result = string.toCFString();
} }
return result; return result;
} }
@ -230,7 +229,7 @@ static QVariant qtValue(CFPropertyListRef cfvalue)
Sorted grossly from most to least frequent type. Sorted grossly from most to least frequent type.
*/ */
if (typeId == CFStringGetTypeID()) { if (typeId == CFStringGetTypeID()) {
return QSettingsPrivate::stringToVariant(QCFString::toQString(static_cast<CFStringRef>(cfvalue))); return QSettingsPrivate::stringToVariant(QString::fromCFString(static_cast<CFStringRef>(cfvalue)));
} else if (typeId == CFNumberGetTypeID()) { } else if (typeId == CFNumberGetTypeID()) {
CFNumberRef cfnumber = static_cast<CFNumberRef>(cfvalue); CFNumberRef cfnumber = static_cast<CFNumberRef>(cfvalue);
if (CFNumberIsFloatType(cfnumber)) { if (CFNumberIsFloatType(cfnumber)) {
@ -266,9 +265,16 @@ static QVariant qtValue(CFPropertyListRef cfvalue)
} else if (typeId == CFBooleanGetTypeID()) { } else if (typeId == CFBooleanGetTypeID()) {
return (bool)CFBooleanGetValue(static_cast<CFBooleanRef>(cfvalue)); return (bool)CFBooleanGetValue(static_cast<CFBooleanRef>(cfvalue));
} else if (typeId == CFDataGetTypeID()) { } else if (typeId == CFDataGetTypeID()) {
CFDataRef cfdata = static_cast<CFDataRef>(cfvalue); QByteArray byteArray = QByteArray::fromRawCFData(static_cast<CFDataRef>(cfvalue));
return QByteArray(reinterpret_cast<const char *>(CFDataGetBytePtr(cfdata)),
CFDataGetLength(cfdata)); // Fast-path for QByteArray, so that we don't have to go
// though the expensive and lossy conversion via UTF-8.
if (!byteArray.startsWith('@'))
return byteArray;
const QString str = QString::fromUtf8(byteArray.constData(), byteArray.size());
return QSettingsPrivate::stringToVariant(str);
} else if (typeId == CFDictionaryGetTypeID()) { } else if (typeId == CFDictionaryGetTypeID()) {
CFDictionaryRef cfdict = static_cast<CFDictionaryRef>(cfvalue); CFDictionaryRef cfdict = static_cast<CFDictionaryRef>(cfvalue);
CFTypeID arrayTypeId = CFArrayGetTypeID(); CFTypeID arrayTypeId = CFArrayGetTypeID();
@ -279,7 +285,7 @@ static QVariant qtValue(CFPropertyListRef cfvalue)
QMultiMap<QString, QVariant> map; QMultiMap<QString, QVariant> map;
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
QString key = QCFString::toQString(static_cast<CFStringRef>(keys[i])); QString key = QString::fromCFString(static_cast<CFStringRef>(keys[i]));
if (CFGetTypeID(values[i]) == arrayTypeId) { if (CFGetTypeID(values[i]) == arrayTypeId) {
CFArrayRef cfarray = static_cast<CFArrayRef>(values[i]); CFArrayRef cfarray = static_cast<CFArrayRef>(values[i]);
@ -292,9 +298,7 @@ static QVariant qtValue(CFPropertyListRef cfvalue)
} }
return map; return map;
} else if (typeId == CFDateGetTypeID()) { } else if (typeId == CFDateGetTypeID()) {
QDateTime dt; return QDateTime::fromCFDate(static_cast<CFDateRef>(cfvalue));
dt.setSecsSinceEpoch(qint64(kCFAbsoluteTimeIntervalSince1970));
return dt.addSecs((int)CFDateGetAbsoluteTime(static_cast<CFDateRef>(cfvalue)));
} }
return QVariant(); return QVariant();
} }
@ -571,7 +575,7 @@ QString QMacSettingsPrivate::fileName() const
if (scope == QSettings::UserScope) if (scope == QSettings::UserScope)
result = QDir::homePath(); result = QDir::homePath();
result += QLatin1String("/Library/Preferences/"); result += QLatin1String("/Library/Preferences/");
result += QCFString::toQString(domains[0].applicationOrSuiteId); result += QString::fromCFString(domains[0].applicationOrSuiteId);
result += QLatin1String(".plist"); result += QLatin1String(".plist");
return result; return result;
} }

View File

@ -667,15 +667,6 @@ void QWinSettingsPrivate::remove(const QString &uKey)
} }
} }
static bool stringContainsNullChar(const QString &s)
{
for (int i = 0; i < s.length(); ++i) {
if (s.at(i).unicode() == 0)
return true;
}
return false;
}
void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value) void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
{ {
if (writeHandle() == 0) { if (writeHandle() == 0) {
@ -704,7 +695,7 @@ void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
QStringList l = variantListToStringList(value.toList()); QStringList l = variantListToStringList(value.toList());
QStringList::const_iterator it = l.constBegin(); QStringList::const_iterator it = l.constBegin();
for (; it != l.constEnd(); ++it) { for (; it != l.constEnd(); ++it) {
if ((*it).length() == 0 || stringContainsNullChar(*it)) { if ((*it).length() == 0 || it->contains(QChar::Null)) {
type = REG_BINARY; type = REG_BINARY;
break; break;
} }
@ -748,7 +739,7 @@ void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
// If the string does not contain '\0', we can use REG_SZ, the native registry // If the string does not contain '\0', we can use REG_SZ, the native registry
// string type. Otherwise we use REG_BINARY. // string type. Otherwise we use REG_BINARY.
QString s = variantToString(value); QString s = variantToString(value);
type = stringContainsNullChar(s) ? REG_BINARY : REG_SZ; type = s.contains(QChar::Null) ? REG_BINARY : REG_SZ;
if (type == REG_BINARY) { if (type == REG_BINARY) {
regValueBuff = QByteArray((const char*)s.utf16(), s.length() * 2); regValueBuff = QByteArray((const char*)s.utf16(), s.length() * 2);
} else { } else {

View File

@ -402,7 +402,7 @@ void QWinRTSettingsPrivate::set(const QString &uKey, const QVariant &value)
QStringList::const_iterator it = l.constBegin(); QStringList::const_iterator it = l.constBegin();
bool containsNull = false; bool containsNull = false;
for (; it != l.constEnd(); ++it) { for (; it != l.constEnd(); ++it) {
if ((*it).length() == 0 || it->indexOf(QChar::Null) != -1) { if ((*it).length() == 0 || it->contains(QChar::Null)) {
// We can only store as binary // We can only store as binary
containsNull = true; containsNull = true;
break; break;
@ -445,7 +445,7 @@ void QWinRTSettingsPrivate::set(const QString &uKey, const QVariant &value)
break; break;
default: { default: {
const QString s = variantToString(value); const QString s = variantToString(value);
if (s.indexOf(QChar::Null) != -1) { if (s.contains(QChar::Null)) {
hr = valueStatics->CreateUInt8Array(s.length() * 2, (BYTE*) s.utf16(), &val); hr = valueStatics->CreateUInt8Array(s.length() * 2, (BYTE*) s.utf16(), &val);
} else { } else {
HStringReference ref((const wchar_t*)s.utf16(), s.size()); HStringReference ref((const wchar_t*)s.utf16(), s.size());

View File

@ -168,36 +168,11 @@ static QString baseWritableLocation(QStandardPaths::StandardLocation type,
QString QStandardPaths::writableLocation(StandardLocation type) QString QStandardPaths::writableLocation(StandardLocation type)
{ {
if (isTestModeEnabled()) { QString location = baseWritableLocation(type, NSUserDomainMask, true);
const QString qttestDir = QDir::homePath() + QLatin1String("/.qttest"); if (isTestModeEnabled())
QString path; location = location.replace(QDir::homePath(), QDir::homePath() + QLatin1String("/.qttest"));
switch (type) {
case GenericDataLocation:
case AppDataLocation:
case AppLocalDataLocation:
path = qttestDir + QLatin1String("/Application Support");
if (type != GenericDataLocation)
appendOrganizationAndApp(path);
return path;
case GenericCacheLocation:
case CacheLocation:
path = qttestDir + QLatin1String("/Cache");
if (type == CacheLocation)
appendOrganizationAndApp(path);
return path;
case GenericConfigLocation:
case ConfigLocation:
case AppConfigLocation:
path = qttestDir + QLatin1String("/Preferences");
if (type == AppConfigLocation)
appendOrganizationAndApp(path);
return path;
default:
break;
}
}
return baseWritableLocation(type, NSUserDomainMask, true); return location;
} }
QStringList QStandardPaths::standardLocations(StandardLocation type) QStringList QStandardPaths::standardLocations(StandardLocation type)
@ -230,13 +205,13 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
if (mainBundle) { if (mainBundle) {
CFURLRef bundleUrl = CFBundleCopyBundleURL(mainBundle); CFURLRef bundleUrl = CFBundleCopyBundleURL(mainBundle);
CFStringRef cfBundlePath = CFURLCopyPath(bundleUrl); CFStringRef cfBundlePath = CFURLCopyPath(bundleUrl);
QString bundlePath = QCFString::toQString(cfBundlePath); QString bundlePath = QString::fromCFString(cfBundlePath);
CFRelease(cfBundlePath); CFRelease(cfBundlePath);
CFRelease(bundleUrl); CFRelease(bundleUrl);
CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle); CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle);
CFStringRef cfResourcesPath = CFURLCopyPath(resourcesUrl); CFStringRef cfResourcesPath = CFURLCopyPath(resourcesUrl);
QString resourcesPath = QCFString::toQString(cfResourcesPath); QString resourcesPath = QString::fromCFString(cfResourcesPath);
CFRelease(cfResourcesPath); CFRelease(cfResourcesPath);
CFRelease(resourcesUrl); CFRelease(resourcesUrl);

View File

@ -665,7 +665,7 @@ QString QTemporaryFile::fileTemplate() const
/*! /*!
Sets the static portion of the file name to \a name. If the file Sets the static portion of the file name to \a name. If the file
template ends in XXXXXX that will automatically be replaced with template contains XXXXXX that will automatically be replaced with
the unique part of the filename, otherwise a filename will be the unique part of the filename, otherwise a filename will be
determined automatically based on the static portion specified. determined automatically based on the static portion specified.

View File

@ -37,6 +37,10 @@
** **
****************************************************************************/ ****************************************************************************/
#include <qglobal.h>
#if QT_CONFIG(topleveldomain)
#include "qplatformdefs.h" #include "qplatformdefs.h"
#include "qurl.h" #include "qurl.h"
#include "private/qurltlds_p.h" #include "private/qurltlds_p.h"
@ -125,3 +129,5 @@ Q_CORE_EXPORT bool qIsEffectiveTLD(const QStringRef &domain)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif

View File

@ -55,6 +55,8 @@
#include "QtCore/qurl.h" #include "QtCore/qurl.h"
#include "QtCore/qstring.h" #include "QtCore/qstring.h"
QT_REQUIRE_CONFIG(topleveldomain);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
Q_CORE_EXPORT QString qTopLevelDomain(const QString &domain); Q_CORE_EXPORT QString qTopLevelDomain(const QString &domain);

View File

@ -3117,6 +3117,7 @@ bool QUrl::hasFragment() const
return d->hasFragment(); return d->hasFragment();
} }
#if QT_CONFIG(topleveldomain)
/*! /*!
\since 4.8 \since 4.8
@ -3151,6 +3152,7 @@ QString QUrl::topLevelDomain(ComponentFormattingOptions options) const
} }
return tld; return tld;
} }
#endif
/*! /*!
Returns the result of the merge of this URL with \a relative. This Returns the result of the merge of this URL with \a relative. This

View File

@ -235,7 +235,9 @@ public:
void setHost(const QString &host, ParsingMode mode = DecodedMode); void setHost(const QString &host, ParsingMode mode = DecodedMode);
QString host(ComponentFormattingOptions = FullyDecoded) const; QString host(ComponentFormattingOptions = FullyDecoded) const;
#if QT_CONFIG(topleveldomain)
QString topLevelDomain(ComponentFormattingOptions options = FullyDecoded) const; QString topLevelDomain(ComponentFormattingOptions options = FullyDecoded) const;
#endif
void setPort(int port); void setPort(int port);
int port(int defaultPort = -1) const; int port(int defaultPort = -1) const;

View File

@ -375,8 +375,8 @@ QDateTime QDateTime::fromCFDate(CFDateRef date)
{ {
if (!date) if (!date)
return QDateTime(); return QDateTime();
return QDateTime::fromMSecsSinceEpoch(static_cast<qint64>((CFDateGetAbsoluteTime(date) CFAbsoluteTime sSinceEpoch = kCFAbsoluteTimeIntervalSince1970 + CFDateGetAbsoluteTime(date);
+ kCFAbsoluteTimeIntervalSince1970) * 1000)); return QDateTime::fromMSecsSinceEpoch(qRound64(sSinceEpoch * 1000));
} }
/*! /*!
@ -404,7 +404,7 @@ QDateTime QDateTime::fromNSDate(const NSDate *date)
{ {
if (!date) if (!date)
return QDateTime(); return QDateTime();
return QDateTime::fromMSecsSinceEpoch(static_cast<qint64>([date timeIntervalSince1970] * 1000)); return QDateTime::fromMSecsSinceEpoch(qRound64([date timeIntervalSince1970] * 1000));
} }
/*! /*!

View File

@ -43,37 +43,17 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
QString QCFString::toQString(CFStringRef str)
{
if(!str)
return QString();
CFIndex length = CFStringGetLength(str);
const UniChar *chars = CFStringGetCharactersPtr(str);
if (chars)
return QString(reinterpret_cast<const QChar *>(chars), length);
QVarLengthArray<UniChar> buffer(length);
CFStringGetCharacters(str, CFRangeMake(0, length), buffer.data());
return QString(reinterpret_cast<const QChar *>(buffer.constData()), length);
}
QCFString::operator QString() const QCFString::operator QString() const
{ {
if (string.isEmpty() && type) if (string.isEmpty() && type)
const_cast<QCFString*>(this)->string = toQString(type); const_cast<QCFString*>(this)->string = QString::fromCFString(type);
return string; return string;
} }
CFStringRef QCFString::toCFStringRef(const QString &string)
{
return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(string.unicode()),
string.length());
}
QCFString::operator CFStringRef() const QCFString::operator CFStringRef() const
{ {
if (!type) if (!type)
const_cast<QCFString*>(this)->type = toCFStringRef(string); const_cast<QCFString*>(this)->type = string.toCFString();
return type; return type;
} }

View File

@ -49,17 +49,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
NSString *QCFString::toNSString(const QString &string)
{
// The const cast below is safe: CfStringRef is immutable and so is NSString.
return [const_cast<NSString *>(reinterpret_cast<const NSString *>(toCFStringRef(string))) autorelease];
}
QString QCFString::toQString(const NSString *nsstr)
{
return toQString(reinterpret_cast<CFStringRef>(nsstr));
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
QDebug operator<<(QDebug dbg, const NSObject *nsObject) QDebug operator<<(QDebug dbg, const NSObject *nsObject)

View File

@ -126,12 +126,6 @@ public:
inline QCFString(const QCFType<CFStringRef> &other) : QCFType<CFStringRef>(other) {} inline QCFString(const QCFType<CFStringRef> &other) : QCFType<CFStringRef>(other) {}
operator QString() const; operator QString() const;
operator CFStringRef() const; operator CFStringRef() const;
static QString toQString(CFStringRef cfstr);
static CFStringRef toCFStringRef(const QString &str);
#ifdef __OBJC__
static QString toQString(const NSString *nsstr);
static NSString *toNSString(const QString &string);
#endif
private: private:
QString string; QString string;

View File

@ -150,7 +150,7 @@ QString QCoreApplicationPrivate::macMenuBarName()
QString bundleName; QString bundleName;
CFTypeRef string = CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), CFSTR("CFBundleName")); CFTypeRef string = CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), CFSTR("CFBundleName"));
if (string) if (string)
bundleName = QCFString::toQString(static_cast<CFStringRef>(string)); bundleName = QString::fromCFString(static_cast<CFStringRef>(string));
return bundleName; return bundleName;
} }
#endif #endif
@ -1260,18 +1260,30 @@ int QCoreApplication::exec()
self->d_func()->aboutToQuitEmitted = false; self->d_func()->aboutToQuitEmitted = false;
int returnCode = eventLoop.exec(); int returnCode = eventLoop.exec();
threadData->quitNow = false; threadData->quitNow = false;
if (self) {
self->d_func()->in_exec = false; if (self)
if (!self->d_func()->aboutToQuitEmitted) self->d_func()->execCleanup();
emit self->aboutToQuit(QPrivateSignal());
self->d_func()->aboutToQuitEmitted = true;
sendPostedEvents(0, QEvent::DeferredDelete);
}
return returnCode; return returnCode;
} }
// Cleanup after eventLoop is done executing in QCoreApplication::exec().
// This is for use cases in which QCoreApplication is instantiated by a
// library and not by an application executable, for example, Active X
// servers.
void QCoreApplicationPrivate::execCleanup()
{
threadData->quitNow = false;
in_exec = false;
if (!aboutToQuitEmitted)
emit q_func()->aboutToQuit(QCoreApplication::QPrivateSignal());
aboutToQuitEmitted = true;
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
}
/*! /*!
Tells the application to exit with a return code. Tells the application to exit with a return code.

View File

@ -145,6 +145,8 @@ public:
static inline void clearApplicationFilePath() { delete cachedApplicationFilePath; cachedApplicationFilePath = 0; } static inline void clearApplicationFilePath() { delete cachedApplicationFilePath; cachedApplicationFilePath = 0; }
#ifndef QT_NO_QOBJECT #ifndef QT_NO_QOBJECT
void execCleanup();
bool in_exec; bool in_exec;
bool aboutToQuitEmitted; bool aboutToQuitEmitted;
bool threadData_clean; bool threadData_clean;

View File

@ -45,15 +45,19 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QCoreGlobalData, globalInstance) Q_GLOBAL_STATIC(QCoreGlobalData, globalInstance)
QCoreGlobalData::QCoreGlobalData() QCoreGlobalData::QCoreGlobalData()
#if QT_CONFIG(textcodec)
: codecForLocale(0) : codecForLocale(0)
#endif
{ {
} }
QCoreGlobalData::~QCoreGlobalData() QCoreGlobalData::~QCoreGlobalData()
{ {
#if QT_CONFIG(textcodec)
codecForLocale = 0; codecForLocale = 0;
for (QList<QTextCodec *>::const_iterator it = allCodecs.constBegin(); it != allCodecs.constEnd(); ++it) for (QList<QTextCodec *>::const_iterator it = allCodecs.constBegin(); it != allCodecs.constEnd(); ++it)
delete *it; delete *it;
#endif
} }
QCoreGlobalData *QCoreGlobalData::instance() QCoreGlobalData *QCoreGlobalData::instance()

View File

@ -71,9 +71,11 @@ struct QCoreGlobalData {
QMap<QString, QStringList> dirSearchPaths; QMap<QString, QStringList> dirSearchPaths;
QReadWriteLock dirSearchPathsLock; QReadWriteLock dirSearchPathsLock;
#if QT_CONFIG(textcodec)
QList<QTextCodec*> allCodecs; QList<QTextCodec*> allCodecs;
QAtomicPointer<QTextCodec> codecForLocale; QAtomicPointer<QTextCodec> codecForLocale;
QTextCodecCache codecCache; QTextCodecCache codecCache;
#endif
static QCoreGlobalData *instance(); static QCoreGlobalData *instance();
}; };

View File

@ -117,7 +117,7 @@ static CFStringRef runLoopMode(NSDictionary *dictionary)
if (CFStringCompare(mode, [self currentMode], 0) == kCFCompareEqualTo) if (CFStringCompare(mode, [self currentMode], 0) == kCFCompareEqualTo)
m_runLoopModes.pop(); m_runLoopModes.pop();
else else
qWarning("Tried to pop run loop mode '%s' that was never pushed!", qPrintable(QCFString::toQString(mode))); qWarning("Tried to pop run loop mode '%s' that was never pushed!", qPrintable(QString::fromCFString(mode)));
Q_ASSERT(m_runLoopModes.size() >= 1); Q_ASSERT(m_runLoopModes.size() >= 1);
} }
@ -285,7 +285,7 @@ bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlag
CFTimeInterval duration = (m_processEvents.flags & QEventLoop::WaitForMoreEvents) ? CFTimeInterval duration = (m_processEvents.flags & QEventLoop::WaitForMoreEvents) ?
kCFTimeIntervalDistantFuture : kCFTimeIntervalMinimum; kCFTimeIntervalDistantFuture : kCFTimeIntervalMinimum;
qEventDispatcherDebug() << "Calling CFRunLoopRunInMode = " << qPrintable(QCFString::toQString(mode)) qEventDispatcherDebug() << "Calling CFRunLoopRunInMode = " << qPrintable(QString::fromCFString(mode))
<< " for " << duration << " ms, processing single source = " << returnAfterSingleSourceHandled; qIndent(); << " for " << duration << " ms, processing single source = " << returnAfterSingleSourceHandled; qIndent();
SInt32 result = CFRunLoopRunInMode(mode, duration, returnAfterSingleSourceHandled); SInt32 result = CFRunLoopRunInMode(mode, duration, returnAfterSingleSourceHandled);

View File

@ -180,7 +180,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
t.start(); t.start();
switch (awaitStyle) { switch (awaitStyle) {
case ProcessMainThreadEvents: case ProcessMainThreadEvents:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) { while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) {
QCoreApplication::processEvents(); QCoreApplication::processEvents();
if (timeout && t.hasExpired(timeout)) if (timeout && t.hasExpired(timeout))
return ERROR_TIMEOUT; return ERROR_TIMEOUT;
@ -188,7 +188,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
break; break;
case ProcessThreadEvents: case ProcessThreadEvents:
if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) { if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) {
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) { while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) {
dispatcher->processEvents(QEventLoop::AllEvents); dispatcher->processEvents(QEventLoop::AllEvents);
if (timeout && t.hasExpired(timeout)) if (timeout && t.hasExpired(timeout))
return ERROR_TIMEOUT; return ERROR_TIMEOUT;
@ -198,7 +198,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
// fall through // fall through
default: default:
case YieldThread: case YieldThread:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) { while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == AsyncStatus::Started) {
QThread::yieldCurrentThread(); QThread::yieldCurrentThread();
if (timeout && t.hasExpired(timeout)) if (timeout && t.hasExpired(timeout))
return ERROR_TIMEOUT; return ERROR_TIMEOUT;
@ -206,7 +206,7 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
break; break;
} }
if (FAILED(hr) || status != Completed) { if (FAILED(hr) || status != AsyncStatus::Completed) {
HRESULT ec; HRESULT ec;
hr = asyncInfo->get_ErrorCode(&ec); hr = asyncInfo->get_ErrorCode(&ec);
if (FAILED(hr)) if (FAILED(hr))

View File

@ -611,6 +611,8 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
A single-shot timer fires only once, non-single-shot timers fire A single-shot timer fires only once, non-single-shot timers fire
every \l interval milliseconds. every \l interval milliseconds.
The default value for this property is \c false.
\sa interval, singleShot() \sa interval, singleShot()
*/ */

View File

@ -38,9 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include "qabstractstate.h" #include "qabstractstate.h"
#ifndef QT_NO_STATEMACHINE
#include "qabstractstate_p.h" #include "qabstractstate_p.h"
#include "qstate.h" #include "qstate.h"
#include "qstate_p.h" #include "qstate_p.h"
@ -237,5 +234,3 @@ bool QAbstractState::event(QEvent *e)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE

View File

@ -42,11 +42,10 @@
#include <QtCore/qobject.h> #include <QtCore/qobject.h>
QT_REQUIRE_CONFIG(statemachine);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_STATEMACHINE
class QState; class QState;
class QStateMachine; class QStateMachine;
@ -84,8 +83,6 @@ private:
Q_DECLARE_PRIVATE(QAbstractState) Q_DECLARE_PRIVATE(QAbstractState)
}; };
#endif //QT_NO_STATEMACHINE
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif

View File

@ -51,13 +51,11 @@
// We mean it. // We mean it.
// //
#include <QtCore/qglobal.h>
#ifndef QT_NO_STATEMACHINE
#include <private/qobject_p.h> #include <private/qobject_p.h>
#include <QtCore/qabstractstate.h> #include <QtCore/qabstractstate.h>
QT_REQUIRE_CONFIG(statemachine);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QStateMachine; class QStateMachine;
@ -98,6 +96,4 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_STATEMACHINE
#endif // QABSTRACTSTATE_P_H #endif // QABSTRACTSTATE_P_H

View File

@ -38,9 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include "qabstracttransition.h" #include "qabstracttransition.h"
#ifndef QT_NO_STATEMACHINE
#include "qabstracttransition_p.h" #include "qabstracttransition_p.h"
#include "qabstractstate.h" #include "qabstractstate.h"
#include "qhistorystate.h" #include "qhistorystate.h"
@ -434,5 +431,3 @@ bool QAbstractTransition::event(QEvent *e)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE

View File

@ -44,11 +44,10 @@
#include <QtCore/qlist.h> #include <QtCore/qlist.h>
QT_REQUIRE_CONFIG(statemachine);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_STATEMACHINE
class QEvent; class QEvent;
class QAbstractState; class QAbstractState;
class QState; class QState;
@ -113,8 +112,6 @@ private:
Q_DECLARE_PRIVATE(QAbstractTransition) Q_DECLARE_PRIVATE(QAbstractTransition)
}; };
#endif //QT_NO_STATEMACHINE
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif

View File

@ -57,6 +57,8 @@
#include <QtCore/qvector.h> #include <QtCore/qvector.h>
#include <QtCore/qsharedpointer.h> #include <QtCore/qsharedpointer.h>
QT_REQUIRE_CONFIG(statemachine);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QAbstractState; class QAbstractState;

View File

@ -38,9 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include "qeventtransition.h" #include "qeventtransition.h"
#ifndef QT_NO_STATEMACHINE
#include "qeventtransition_p.h" #include "qeventtransition_p.h"
#include "qstate.h" #include "qstate.h"
#include "qstate_p.h" #include "qstate_p.h"
@ -255,5 +252,3 @@ bool QEventTransition::event(QEvent *e)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE

View File

@ -43,11 +43,10 @@
#include <QtCore/qabstracttransition.h> #include <QtCore/qabstracttransition.h>
#include <QtCore/qcoreevent.h> #include <QtCore/qcoreevent.h>
QT_REQUIRE_CONFIG(qeventtransition);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_STATEMACHINE
class QEventTransitionPrivate; class QEventTransitionPrivate;
class Q_CORE_EXPORT QEventTransition : public QAbstractTransition class Q_CORE_EXPORT QEventTransition : public QAbstractTransition
{ {
@ -81,8 +80,6 @@ private:
Q_DECLARE_PRIVATE(QEventTransition) Q_DECLARE_PRIVATE(QEventTransition)
}; };
#endif //QT_NO_STATEMACHINE
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif

View File

@ -53,6 +53,8 @@
#include "private/qabstracttransition_p.h" #include "private/qabstracttransition_p.h"
QT_REQUIRE_CONFIG(qeventtransition);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QEventTransition; class QEventTransition;

View File

@ -39,8 +39,6 @@
#include "qfinalstate_p.h" #include "qfinalstate_p.h"
#ifndef QT_NO_STATEMACHINE
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
/*! /*!
@ -139,5 +137,3 @@ bool QFinalState::event(QEvent *e)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE

View File

@ -42,9 +42,9 @@
#include <QtCore/qabstractstate.h> #include <QtCore/qabstractstate.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(statemachine);
#ifndef QT_NO_STATEMACHINE QT_BEGIN_NAMESPACE
class QFinalStatePrivate; class QFinalStatePrivate;
class Q_CORE_EXPORT QFinalState : public QAbstractState class Q_CORE_EXPORT QFinalState : public QAbstractState
@ -68,8 +68,6 @@ private:
Q_DECLARE_PRIVATE(QFinalState) Q_DECLARE_PRIVATE(QFinalState)
}; };
#endif //QT_NO_STATEMACHINE
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif

Some files were not shown because too many files have changed in this diff Show More