Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev

This commit is contained in:
Frederik Gladhorn 2013-12-01 00:53:53 +01:00 committed by The Qt Project
commit ded6a7081b
43 changed files with 252 additions and 165 deletions

View File

@ -44,6 +44,7 @@
int main(int, char **) int main(int, char **)
{ {
//We require glxfbconfig, ie. glx 1.3
GLXFBConfig config; GLXFBConfig config;
config = 0; config = 0;

View File

@ -1,4 +1,4 @@
SOURCES = glxfbconfig.cpp SOURCES = glx.cpp
CONFIG += x11 CONFIG += x11
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL INCLUDEPATH += $$QMAKE_INCDIR_OPENGL

85
configure vendored
View File

@ -611,6 +611,7 @@ CFG_OPENVG_LC_INCLUDES=no
CFG_OPENVG_SHIVA=auto CFG_OPENVG_SHIVA=auto
CFG_OPENVG_ON_OPENGL=auto CFG_OPENVG_ON_OPENGL=auto
CFG_EGL=auto CFG_EGL=auto
CFG_GLX=auto
CFG_SSE=auto CFG_SSE=auto
CFG_FONTCONFIG=auto CFG_FONTCONFIG=auto
CFG_FREETYPE=auto CFG_FREETYPE=auto
@ -648,6 +649,7 @@ CFG_XINPUT=runtime
CFG_XKB=auto CFG_XKB=auto
CFG_XKBCOMMON=auto CFG_XKBCOMMON=auto
CFG_XCB=auto CFG_XCB=auto
CFG_XCB_XLIB=auto
CFG_XCB_GLX=no CFG_XCB_GLX=no
CFG_EGLFS=auto CFG_EGLFS=auto
CFG_DIRECTFB=auto CFG_DIRECTFB=auto
@ -1480,6 +1482,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes UNKNOWN_OPT=yes
fi fi
;; ;;
glx)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_GLX="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
pch) pch)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PRECOMPILE="$VAL" CFG_PRECOMPILE="$VAL"
@ -1691,6 +1700,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes UNKNOWN_OPT=yes
fi fi
;; ;;
xcb-xlib)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_XCB_XLIB="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
wayland) wayland)
CFG_OBSOLETE_WAYLAND=yes CFG_OBSOLETE_WAYLAND=yes
;; ;;
@ -2343,6 +2359,9 @@ Third Party Libraries:
-no-xinput2 ........ Do not compile XInput2 support. -no-xinput2 ........ Do not compile XInput2 support.
* -xinput2 ........... Compile XInput2 support. * -xinput2 ........... Compile XInput2 support.
-no-xcb-xlib........ Do not compile Xcb-Xlib support.
* -xcb-xlib........... Compile Xcb-Xlib support.
-no-glib ........... Do not compile Glib support. -no-glib ........... Do not compile Glib support.
+ -glib .............. Compile Glib support. + -glib .............. Compile Glib support.
@ -4908,19 +4927,6 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
fi fi
CFG_OPENGL=no CFG_OPENGL=no
fi fi
case "$PLATFORM" in
hpux*)
# HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
if [ "$CFG_OPENGL" = "desktop" ]; then
compileTest x11/glxfbconfig "OpenGL"
if [ $? != "0" ]; then
QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
fi
fi
;;
*)
;;
esac
elif [ "$CFG_OPENGL" = "es2" ]; then elif [ "$CFG_OPENGL" = "es2" ]; then
#OpenGL ES 2.x #OpenGL ES 2.x
compileTest unix/opengles2 "OpenGL ES 2.x" compileTest unix/opengles2 "OpenGL ES 2.x"
@ -4941,17 +4947,6 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
echo " ${XQMAKESPEC}." echo " ${XQMAKESPEC}."
exit 1 exit 1
fi fi
case "$PLATFORM" in
hpux*)
# HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
compileTest x11/glxfbconfig "OpenGL"
if [ $? != "0" ]; then
QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
fi
;;
*)
;;
esac
fi fi
fi # X11/MINGW OpenGL fi # X11/MINGW OpenGL
@ -5145,8 +5140,10 @@ if [ "$CFG_XCB" != "no" ]; then
exit 1 exit 1
fi fi
if compileTest qpa/xcb-xlib "xcb-xlib" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then if [ "$CFG_XCB_XLIB" != "no" ]; then
QT_CONFIG="$QT_CONFIG xcb-xlib" if compileTest qpa/xcb-xlib "xcb-xlib" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
QT_CONFIG="$QT_CONFIG xcb-xlib"
fi
fi fi
if [ "$CFG_SM" != "no" ] && [ -n "$PKG_CONFIG" ]; then if [ "$CFG_SM" != "no" ] && [ -n "$PKG_CONFIG" ]; then
@ -5284,11 +5281,13 @@ elif [ "$CFG_XKBCOMMON" = "no" ]; then
fi fi
# EGL Support # EGL Support
if [ "$CFG_EGL" = "yes" ] && [ "$CFG_OPENGL" = "no" ]; then if [ "$CFG_EGL" != "no" ]; then
if [ "$CFG_EGL" = "yes" ] && [ "$CFG_OPENGL" = "no" ]; then
echo "EGL support was requested but OpenGL support is disabled." echo "EGL support was requested but OpenGL support is disabled."
echo "Either disable EGL support or enable OpenGL ES support." echo "Either disable EGL support or enable OpenGL support."
exit 101 exit 101
elif [ "$CFG_EGL" != "no" ]; then fi
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists egl 2>/dev/null; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists egl 2>/dev/null; then
QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'` QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null` QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null`
@ -5309,6 +5308,24 @@ elif [ "$CFG_EGL" != "no" ]; then
fi fi
fi fi
# GLX Support
if [ "$CFG_GLX" != "no" ]; then
if [ "$CFG_GLX" = "yes" ] && [ "$CFG_OPENGL" = "no" ]; then
echo "GLX support was requested but OpenGL support is disabled."
echo "Either disable GLX support or enable OpenGL support."
exit 101
fi
if compileTest qpa/glx "GLX"; then
CFG_GLX=yes
elif [ "$CFG_GLX" = "yes" ]; then
echo " The GLX functionality test failed; GLX is required by the xcb plugin to manage contexts & surfaces."
exit 1
else
CFG_GLX=no
fi
fi
if [ "$CFG_EGLFS" != "no" ]; then if [ "$CFG_EGLFS" != "no" ]; then
if [ "$XPLATFORM_QNX" = "no" ]; then if [ "$XPLATFORM_QNX" = "no" ]; then
CFG_EGLFS="$CFG_EGL" CFG_EGLFS="$CFG_EGL"
@ -5670,6 +5687,13 @@ else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL" QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL"
fi fi
# enable glx
if [ "$CFG_GLX" = "yes" ]; then
QT_CONFIG="$QT_CONFIG glx"
else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLX"
fi
# enable eglfs # enable eglfs
if [ "$CFG_EGLFS" = "yes" ]; then if [ "$CFG_EGLFS" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs" QT_CONFIG="$QT_CONFIG eglfs"
@ -6701,6 +6725,8 @@ else
report_support " pkg-config ............. no" report_support " pkg-config ............. no"
fi fi
report_support " PulseAudio ............." "$CFG_PULSEAUDIO" report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
report_support " EGL ...................." "$CFG_EGL"
report_support " GLX ...................." "$CFG_GLX"
report_support " QPA backends:" report_support " QPA backends:"
report_support " DirectFB ............." "$CFG_DIRECTFB" report_support " DirectFB ............." "$CFG_DIRECTFB"
report_support " EGLFS ................" "$CFG_EGLFS" report_support " EGLFS ................" "$CFG_EGLFS"
@ -6709,6 +6735,7 @@ report_support " LinuxFB .............." "$CFG_LINUXFB"
report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy" report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy"
if [ "$CFG_XCB" != "no" ]; then if [ "$CFG_XCB" != "no" ]; then
report_support " MIT-SHM ............" "$CFG_MITSHM" report_support " MIT-SHM ............" "$CFG_MITSHM"
report_support " Xcb-Xlib ..........." "$CFG_XCB_XLIB"
report_support " Xcursor ............" "$CFG_XCURSOR" runtime "loaded at runtime" report_support " Xcursor ............" "$CFG_XCURSOR" runtime "loaded at runtime"
report_support " Xfixes ............." "$CFG_XFIXES" runtime "loaded at runtime" report_support " Xfixes ............." "$CFG_XFIXES" runtime "loaded at runtime"
report_support " Xi ................." "$CFG_XINPUT" runtime "loaded at runtime" report_support " Xi ................." "$CFG_XINPUT" runtime "loaded at runtime"

View File

@ -142,7 +142,7 @@ void Renderer::render()
m_initialized = true; m_initialized = true;
} }
glViewport(0, 0, viewSize.width(), viewSize.height()); glViewport(0, 0, viewSize.width() * surface->devicePixelRatio(), viewSize.height() * surface->devicePixelRatio());
glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glClearColor(0.1f, 0.1f, 0.2f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

View File

@ -175,9 +175,9 @@ void PaintedWindow::paint()
{ {
m_context->makeCurrent(this); m_context->makeCurrent(this);
QRect rect(0, 0, width(), height()); QRect rect(0, 0, width() * devicePixelRatio(), height() * devicePixelRatio());
QOpenGLPaintDevice device(size()); QOpenGLPaintDevice device(size() * devicePixelRatio());
QPainter painter(&device); QPainter painter(&device);
QPainterPath path; QPainterPath path;

View File

@ -198,7 +198,7 @@ void GLWidget::orthographicProjection()
void GLWidget::resizeGL(int width, int height) void GLWidget::resizeGL(int width, int height)
{ {
glViewport(0, 0, width, height); glViewport(0, 0, width * devicePixelRatio(), height * devicePixelRatio());
aspect = (qreal)width / (qreal)(height ? height : 1); aspect = (qreal)width / (qreal)(height ? height : 1);
perspectiveProjection(); perspectiveProjection();
} }

View File

@ -156,7 +156,7 @@ void GLWidget::draw()
glTranslatef(0.0f, 0.0f, -15.0f); glTranslatef(0.0f, 0.0f, -15.0f);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
glViewport(0, 0, width(), height()); glViewport(0, 0, width() * devicePixelRatio(), height() * devicePixelRatio());
glBindTexture(GL_TEXTURE_2D, dynamicTexture); glBindTexture(GL_TEXTURE_2D, dynamicTexture);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);

View File

@ -27,9 +27,9 @@ defineReplace(cmakeModuleList) {
defineReplace(cmakeTargetPath) { defineReplace(cmakeTargetPath) {
SYSR = $$[QT_SYSROOT] SYSR = $$[QT_SYSROOT]
!isEmpty(SYSR): path = $$relative_path($$1, $$[QT_SYSROOT]) !isEmpty(SYSR): path = /$$relative_path($$1, $$[QT_SYSROOT])
else: path = $$1 else: path = $$1
return($$clean_path(/$$path)) return($$clean_path($$path))
} }
defineReplace(cmakeTargetPaths) { defineReplace(cmakeTargetPaths) {

View File

@ -1,10 +1,11 @@
win32 { win32 {
CMAKE_VERSION = $$system(cmake --version 2>NUL) CMAKE_VERSION = $$system(cmake --version 2>NUL, lines)
} else { } else {
CMAKE_VERSION = $$system(cmake --version 2>/dev/null) CMAKE_VERSION = $$system(cmake --version 2>/dev/null, lines)
} }
CMAKE_VERSION = $$member(CMAKE_VERSION, 0, 0)
check.commands = check.commands =
QMAKE_EXTRA_TARGETS *= check QMAKE_EXTRA_TARGETS *= check

View File

@ -858,10 +858,8 @@ public class QtActivityDelegate
public void onContextMenuClosed(Menu menu) public void onContextMenuClosed(Menu menu)
{ {
if (!m_contextMenuVisible) { if (!m_contextMenuVisible)
Log.e(QtNative.QtTAG, "invalid onContextMenuClosed call");
return; return;
}
m_contextMenuVisible = false; m_contextMenuVisible = false;
QtNative.onContextMenuClosed(menu); QtNative.onContextMenuClosed(menu);
} }

View File

@ -748,7 +748,7 @@ Name: QPdf
Feature: PRINTER Feature: PRINTER
Description: Supports printing Description: Supports printing
Section: Painting Section: Painting
Requires: PICTURE TEMPORARYFILE Requires: PICTURE TEMPORARYFILE PDF
Name: QPrinter Name: QPrinter
Feature: CUPS Feature: CUPS

View File

@ -229,8 +229,7 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
{ {
if (key == d->key && mode == Open) if (key == d->key && mode == Open)
return; return;
d->error = NoError; d->clearError();
d->errorString = QString();
#if !defined(Q_OS_WIN) #if !defined(Q_OS_WIN)
// optimization to not destroy/create the file & semaphore // optimization to not destroy/create the file & semaphore
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) { if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {

View File

@ -75,6 +75,11 @@ public:
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_")); return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
} }
inline void setError(QSystemSemaphore::SystemSemaphoreError e, const QString &message)
{ error = e; errorString = message; }
inline void clearError()
{ setError(QSystemSemaphore::NoError, QString()); }
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
Qt::HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open); Qt::HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function); void setErrorString(const QString &function);

View File

@ -229,6 +229,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return false; return false;
} }
clearError();
return true; return true;
} }

View File

@ -136,6 +136,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
} }
} }
clearError();
return true; return true;
} }

View File

@ -360,10 +360,10 @@ inline char QLocalePrivate::digitToCLocale(QChar in) const
if (in.unicode() >= '0' && in.unicode() <= '9') if (in.unicode() >= '0' && in.unicode() <= '9')
return in.toLatin1(); return in.toLatin1();
if (in == plus()) if (in == plus() || in == QLatin1Char('+'))
return '+'; return '+';
if (in == minus()) if (in == minus() || in == QLatin1Char('-') || in == QChar(0x2212))
return '-'; return '-';
if (in == decimal()) if (in == decimal())

View File

@ -160,6 +160,8 @@ void QOffscreenSurface::create()
d->platformOffscreenSurface = QGuiApplicationPrivate::platformIntegration()->createPlatformOffscreenSurface(this); d->platformOffscreenSurface = QGuiApplicationPrivate::platformIntegration()->createPlatformOffscreenSurface(this);
// No platform offscreen surface, fallback to an invisible window // No platform offscreen surface, fallback to an invisible window
if (!d->platformOffscreenSurface) { if (!d->platformOffscreenSurface) {
if (QThread::currentThread() != qGuiApp->thread())
qWarning("Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures.");
d->offscreenWindow = new QWindow(d->screen); d->offscreenWindow = new QWindow(d->screen);
d->offscreenWindow->setSurfaceType(QWindow::OpenGLSurface); d->offscreenWindow->setSurfaceType(QWindow::OpenGLSurface);
d->offscreenWindow->setFormat(d->requestedFormat); d->offscreenWindow->setFormat(d->requestedFormat);

View File

@ -499,6 +499,8 @@ static const int scriptForWritingSystem[] = {
QChar::Script_Nko // Nko QChar::Script_Nko // Nko
}; };
Q_STATIC_ASSERT(sizeof(scriptForWritingSystem) / sizeof(scriptForWritingSystem[0]) == QFontDatabase::WritingSystemsCount);
int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem) int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
{ {
return scriptForWritingSystem[writingSystem]; return scriptForWritingSystem[writingSystem];
@ -562,9 +564,9 @@ struct QtFontDesc
int familyIndex; int familyIndex;
}; };
static void match(int script, const QFontDef &request, static int match(int script, const QFontDef &request,
const QString &family_name, const QString &foundry_name, int force_encoding_id, const QString &family_name, const QString &foundry_name, int force_encoding_id,
QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>()); QtFontDesc *desc, const QList<int> &blacklisted);
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi) static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
{ {
@ -846,11 +848,12 @@ static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
Tries to find the best match for a given request and family/foundry Tries to find the best match for a given request and family/foundry
*/ */
static void match(int script, const QFontDef &request, static int match(int script, const QFontDef &request,
const QString &family_name, const QString &foundry_name, int force_encoding_id, const QString &family_name, const QString &foundry_name, int force_encoding_id,
QtFontDesc *desc, const QList<int> &blacklistedFamilies) QtFontDesc *desc, const QList<int> &blacklistedFamilies)
{ {
Q_UNUSED(force_encoding_id); Q_UNUSED(force_encoding_id);
int result = -1;
QtFontStyle::Key styleKey; QtFontStyle::Key styleKey;
styleKey.style = request.style; styleKey.style = request.style;
@ -881,6 +884,8 @@ static void match(int script, const QFontDef &request,
load(family_name, script); load(family_name, script);
const size_t writingSystem = std::find(scriptForWritingSystem, scriptForWritingSystem + QFontDatabase::WritingSystemsCount, script) - scriptForWritingSystem;
QFontDatabasePrivate *db = privateDb(); QFontDatabasePrivate *db = privateDb();
for (int x = 0; x < db->count; ++x) { for (int x = 0; x < db->count; ++x) {
if (blacklistedFamilies.contains(x)) if (blacklistedFamilies.contains(x))
@ -895,19 +900,9 @@ static void match(int script, const QFontDef &request,
if (family_name.isEmpty()) if (family_name.isEmpty())
load(test.family->name, script); load(test.family->name, script);
uint score_adjust = 0; // Check if family is supported in the script we want
if (script != QChar::Script_Common && !(test.family->writingSystems[writingSystem] & QtFontFamily::Supported))
bool supported = (script == QChar::Script_Common);
for (int ws = 1; !supported && ws < QFontDatabase::WritingSystemsCount; ++ws) {
if (scriptForWritingSystem[ws] != script)
continue;
if (test.family->writingSystems[ws] & QtFontFamily::Supported)
supported = true;
}
if (!supported) {
// family not supported in the script we want
continue; continue;
}
// as we know the script is supported, we can be sure // as we know the script is supported, we can be sure
// to find a matching font here. // to find a matching font here.
@ -922,15 +917,16 @@ static void match(int script, const QFontDef &request,
QString(), styleKey, request.pixelSize, QString(), styleKey, request.pixelSize,
pitch, &test, force_encoding_id); pitch, &test, force_encoding_id);
} }
newscore += score_adjust;
if (newscore < score) { if (newscore < score) {
result = x;
score = newscore; score = newscore;
*desc = test; *desc = test;
} }
if (newscore < 10) // xlfd instead of FT... just accept it if (newscore < 10) // xlfd instead of FT... just accept it
break; break;
} }
return result;
} }
static QString styleStringHelper(int weight, QFont::Style style) static QString styleStringHelper(int weight, QFont::Style style)

View File

@ -184,7 +184,6 @@ QFontEngine *loadSingleEngine(int script,
if (!engine) { if (!engine) {
engine = pfdb->fontEngine(def, QChar::Script(script), size->handle); engine = pfdb->fontEngine(def, QChar::Script(script), size->handle);
if (engine) { if (engine) {
engine->smoothScalable = style->smoothScalable;
QFontCache::Key key(def,script); QFontCache::Key key(def,script);
QFontCache::instance()->instance()->insertEngine(key,engine); QFontCache::instance()->instance()->insertEngine(key,engine);
} }
@ -306,9 +305,12 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
} }
QtFontDesc desc; QtFontDesc desc;
match(script, request, family_name, foundry_name, force_encoding_id, &desc); QList<int> blackListed;
if (desc.family != 0 && desc.foundry != 0 && desc.style != 0) { int index = match(script, request, family_name, foundry_name, force_encoding_id, &desc, blackListed);
if (index >= 0) {
engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size); engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size);
if (!engine)
blackListed.append(index);
} else { } else {
FM_DEBUG(" NO MATCH FOUND\n"); FM_DEBUG(" NO MATCH FOUND\n");
} }
@ -332,6 +334,8 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
QFont::Style(request.style), QFont::Style(request.style),
QFont::StyleHint(request.styleHint), QFont::StyleHint(request.styleHint),
QChar::Script(script)); QChar::Script(script));
if (script > QChar::Script_Common)
fallbacks += QString(); // Find the first font matching the specified script.
for (int i = 0; !engine && i < fallbacks.size(); i++) { for (int i = 0; !engine && i < fallbacks.size(); i++) {
QFontDef def = request; QFontDef def = request;
@ -340,14 +344,19 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
engine = QFontCache::instance()->findEngine(key); engine = QFontCache::instance()->findEngine(key);
if (!engine) { if (!engine) {
QtFontDesc desc; QtFontDesc desc;
match(script, def, def.family, QLatin1String(""), 0, &desc); do {
if (desc.family == 0 && desc.foundry == 0 && desc.style == 0) { index = match(script, def, def.family, QLatin1String(""), 0, &desc, blackListed);
continue; if (index >= 0) {
} QFontDef loadDef = def;
engine = loadEngine(script, def, desc.family, desc.foundry, desc.style, desc.size); if (loadDef.family.isEmpty())
if (engine) { loadDef.family = desc.family->name;
initFontDef(desc, def, &engine->fontDef, engine->type() == QFontEngine::Multi); engine = loadEngine(script, loadDef, desc.family, desc.foundry, desc.style, desc.size);
} if (engine)
initFontDef(desc, loadDef, &engine->fontDef, engine->type() == QFontEngine::Multi);
else
blackListed.append(index);
}
} while (index >= 0 && !engine);
} }
} }
} }

View File

@ -208,8 +208,7 @@ Q_AUTOTEST_EXPORT QList<QFontEngine *> QFontEngine_stopCollectingEngines()
QFontEngine::QFontEngine() QFontEngine::QFontEngine()
: ref(0), : ref(0),
font_(0), font_destroy_func(0), font_(0), font_destroy_func(0),
face_(0), face_destroy_func(0), face_(0), face_destroy_func(0)
smoothScalable(false)
{ {
cache_cost = 0; cache_cost = 0;
fsType = 0; fsType = 0;

View File

@ -302,8 +302,6 @@ public:
inline QVariant userData() const { return m_userData; } inline QVariant userData() const { return m_userData; }
bool smoothScalable;
protected: protected:
QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false); QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false);

View File

@ -277,18 +277,18 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
} }
} }
// Get the interface netmask
if (qt_safe_ioctl(socket, SIOCGIFNETMASK, &req) >= 0) {
sockaddr *sa = &req.ifr_addr;
entry.setNetmask(addressFromSockaddr(sa));
}
// Get the address of the interface // Get the address of the interface
if (qt_safe_ioctl(socket, SIOCGIFADDR, &req) >= 0) { if (qt_safe_ioctl(socket, SIOCGIFADDR, &req) >= 0) {
sockaddr *sa = &req.ifr_addr; sockaddr *sa = &req.ifr_addr;
entry.setIp(addressFromSockaddr(sa)); entry.setIp(addressFromSockaddr(sa));
} }
// Get the interface netmask
if (qt_safe_ioctl(socket, SIOCGIFNETMASK, &req) >= 0) {
sockaddr *sa = &req.ifr_addr;
entry.setNetmask(addressFromSockaddr(sa));
}
iface->addressEntries << entry; iface->addressEntries << entry;
} }

View File

@ -71,7 +71,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
QCoreWlanEngine *engine; QCoreWlanEngine *engine;
NSLock *locker; NSLock *locker;
} }
- (void)notificationHandler;//:(NSNotification *)notification; - (void)notificationHandler:(NSNotification *)notification;
- (void)remove; - (void)remove;
- (void)setEngine:(QCoreWlanEngine *)coreEngine; - (void)setEngine:(QCoreWlanEngine *)coreEngine;
- (QCoreWlanEngine *)engine; - (QCoreWlanEngine *)engine;
@ -120,8 +120,9 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
[locker unlock]; [locker unlock];
} }
- (void)notificationHandler//:(NSNotification *)notification - (void)notificationHandler:(NSNotification *)notification
{ {
Q_UNUSED(notification);
engine->requestUpdate(); engine->requestUpdate();
} }
@end @end

View File

@ -48,7 +48,7 @@
QCoreWlanEngine *engine; QCoreWlanEngine *engine;
NSLock *locker; NSLock *locker;
} }
- (void)notificationHandler;//:(NSNotification *)notification; - (void)notificationHandler:(NSNotification *)notification;
- (void)remove; - (void)remove;
- (void)setEngine:(QCoreWlanEngine *)coreEngine; - (void)setEngine:(QCoreWlanEngine *)coreEngine;
- (QCoreWlanEngine *)engine; - (QCoreWlanEngine *)engine;
@ -97,8 +97,9 @@
[locker unlock]; [locker unlock];
} }
- (void)notificationHandler//:(NSNotification *)notification - (void)notificationHandler:(NSNotification *)notification
{ {
Q_UNUSED(notification);
engine->requestUpdate(); engine->requestUpdate();
} }
@end @end

View File

@ -55,6 +55,7 @@ class QCocoaDrag : public QPlatformDrag
{ {
public: public:
QCocoaDrag(); QCocoaDrag();
virtual ~QCocoaDrag();
virtual QMimeData *platformDropData(); virtual QMimeData *platformDropData();
virtual Qt::DropAction drag(QDrag *m_drag); virtual Qt::DropAction drag(QDrag *m_drag);

View File

@ -53,9 +53,15 @@ QCocoaDrag::QCocoaDrag() :
m_lastView = 0; m_lastView = 0;
} }
QCocoaDrag::~QCocoaDrag()
{
[m_lastEvent release];
}
void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view) void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view)
{ {
m_lastEvent = event; [m_lastEvent release];
m_lastEvent = [event copy];
m_lastView = view; m_lastView = view;
} }

View File

@ -82,6 +82,7 @@ public:
private: private:
void *mDelegate; void *mDelegate;
QUrl mDir;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -610,6 +610,8 @@ void QCocoaFileDialogHelper::setDirectory(const QUrl &directory)
QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate); QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
if (delegate) if (delegate)
[delegate->mSavePanel setDirectoryURL:[NSURL fileURLWithPath:QCFString::toNSString(directory.toLocalFile())]]; [delegate->mSavePanel setDirectoryURL:[NSURL fileURLWithPath:QCFString::toNSString(directory.toLocalFile())]];
else
mDir = directory;
} }
QUrl QCocoaFileDialogHelper::directory() const QUrl QCocoaFileDialogHelper::directory() const
@ -619,7 +621,7 @@ QUrl QCocoaFileDialogHelper::directory() const
QString path = QCFString::toQString([[delegate->mSavePanel directoryURL] path]).normalized(QString::NormalizationForm_C); QString path = QCFString::toQString([[delegate->mSavePanel directoryURL] path]).normalized(QString::NormalizationForm_C);
return QUrl::fromLocalFile(path); return QUrl::fromLocalFile(path);
} }
return QUrl(); return mDir;
} }
void QCocoaFileDialogHelper::selectFile(const QUrl &filename) void QCocoaFileDialogHelper::selectFile(const QUrl &filename)
@ -707,7 +709,7 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate()
QCocoaAutoReleasePool pool; QCocoaAutoReleasePool pool;
const SharedPointerFileDialogOptions &opts = options(); const SharedPointerFileDialogOptions &opts = options();
const QList<QUrl> selectedFiles = opts->initiallySelectedFiles(); const QList<QUrl> selectedFiles = opts->initiallySelectedFiles();
const QUrl directory = opts->initialDirectory(); const QUrl directory = mDir.isEmpty() ? opts->initialDirectory() : mDir;
const bool selectDir = selectedFiles.isEmpty(); const bool selectDir = selectedFiles.isEmpty();
QString selection(selectDir ? directory.toLocalFile() : selectedFiles.front().toLocalFile()); QString selection(selectDir ? directory.toLocalFile() : selectedFiles.front().toLocalFile());
QNSOpenSavePanelDelegate *delegate = [[QNSOpenSavePanelDelegate alloc] QNSOpenSavePanelDelegate *delegate = [[QNSOpenSavePanelDelegate alloc]

View File

@ -522,6 +522,20 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
if (!(styleMask & NSBorderlessWindowMask)) { if (!(styleMask & NSBorderlessWindowMask)) {
setWindowTitle(window()->title()); setWindowTitle(window()->title());
} }
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
Qt::WindowType type = window()->type();
if ((type & Qt::Popup) != Qt::Popup && (type & Qt::Dialog) != Qt::Dialog) {
NSWindowCollectionBehavior behavior = [m_nsWindow collectionBehavior];
if (flags & Qt::WindowFullscreenButtonHint)
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
else
behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
[m_nsWindow setCollectionBehavior:behavior];
}
}
#endif
} }
m_windowFlags = flags; m_windowFlags = flags;
@ -871,8 +885,6 @@ NSWindow * QCocoaWindow::createNSWindow()
// before the window is shown and needs a proper window.). // before the window is shown and needs a proper window.).
if ((type & Qt::Popup) == Qt::Popup) if ((type & Qt::Popup) == Qt::Popup)
[window setHasShadow:YES]; [window setHasShadow:YES];
else
setWindowShadow(flags);
[window setHidesOnDeactivate: NO]; [window setHidesOnDeactivate: NO];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
@ -894,14 +906,6 @@ NSWindow * QCocoaWindow::createNSWindow()
defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up
// before the window is shown and needs a proper window.). // before the window is shown and needs a proper window.).
window->m_cocoaPlatformWindow = this; window->m_cocoaPlatformWindow = this;
setWindowShadow(flags);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
if (flags & Qt::WindowFullscreenButtonHint)
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
#endif
createdWindow = window; createdWindow = window;
} }

View File

@ -54,11 +54,13 @@ QT_BEGIN_NAMESPACE
void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window) void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{ {
if (resource == "windowGroup" && window && window->screen()) { if (resource == "windowGroup" && window && window->screen()) {
const QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle()); QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
if (screen) { if (screen) {
screen_window_t screenWindow = reinterpret_cast<screen_window_t>(window->winId());
QQnxWindow *qnxWindow = screen->findWindow(screenWindow);
// We can't just call data() instead of constData() here, since that would detach // We can't just call data() instead of constData() here, since that would detach
// and the lifetime of the char * would not be long enough. Therefore the const_cast. // and the lifetime of the char * would not be long enough. Therefore the const_cast.
return const_cast<char *>(screen->rootWindow()->groupName().constData()); return qnxWindow ? const_cast<char *>(qnxWindow->groupName().constData()) : 0;
} }
} }

View File

@ -276,7 +276,7 @@ bool QWindowsFontEngineDirectWrite::getSfntTableData(uint tag, uchar *buffer, ui
UINT32 tableSize; UINT32 tableSize;
void *tableContext = 0; void *tableContext = 0;
BOOL exists; BOOL exists;
HRESULT hr = m_directWriteFontFace->TryGetFontTable(qbswap<quint32>(tag) HRESULT hr = m_directWriteFontFace->TryGetFontTable(qbswap<quint32>(tag),
&tableData, &tableSize, &tableData, &tableSize,
&tableContext, &exists); &tableContext, &exists);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {

View File

@ -589,7 +589,7 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext,
if (requestedVersion >= 0x0300) { if (requestedVersion >= 0x0300) {
attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB;
attributes[attribIndex] = 0; attributes[attribIndex] = 0;
if (format.testOption(QSurfaceFormat::DeprecatedFunctions)) if (!format.testOption(QSurfaceFormat::DeprecatedFunctions))
attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
if (format.testOption(QSurfaceFormat::DebugContext)) if (format.testOption(QSurfaceFormat::DebugContext))
attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB; attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB;

View File

@ -76,7 +76,7 @@ static int resourceType(const QByteArray &key)
static const QByteArray names[] = { // match QXcbNativeInterface::ResourceType static const QByteArray names[] = { // match QXcbNativeInterface::ResourceType
QByteArrayLiteral("display"), QByteArrayLiteral("egldisplay"), QByteArrayLiteral("display"), QByteArrayLiteral("egldisplay"),
QByteArrayLiteral("connection"), QByteArrayLiteral("screen"), QByteArrayLiteral("connection"), QByteArrayLiteral("screen"),
QByteArrayLiteral("graphicsdevice"), QByteArrayLiteral("eglcontext"), QByteArrayLiteral("eglcontext"),
QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"), QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"),
QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"), QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"),
QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"), QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"),
@ -212,7 +212,7 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr
result = connectionForWindow(window); result = connectionForWindow(window);
break; break;
case Screen: case Screen:
result = qPlatformScreenForWindow(window); result = screenForWindow(window);
break; break;
default: default:
break; break;

View File

@ -62,7 +62,6 @@ public:
EglDisplay, EglDisplay,
Connection, Connection,
Screen, Screen,
GraphicsDevice,
EglContext, EglContext,
GLXContext, GLXContext,
AppTime, AppTime,
@ -90,7 +89,6 @@ public:
void *eglDisplayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window);
void *connectionForWindow(QWindow *window); void *connectionForWindow(QWindow *window);
void *screenForWindow(QWindow *window); void *screenForWindow(QWindow *window);
void *graphicsDeviceForWindow(QWindow *window);
void *appTime(const QXcbScreen *screen); void *appTime(const QXcbScreen *screen);
void *appUserTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen);
void *getTimestamp(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen);

View File

@ -81,15 +81,7 @@ contains(QT_CONFIG, xcb-sm) {
} }
contains(QT_CONFIG, opengl) { contains(QT_CONFIG, opengl) {
contains(QT_CONFIG, opengles2) { contains(QT_CONFIG, xcb-xlib):contains(QT_CONFIG, glx) {
DEFINES += XCB_USE_EGL
CONFIG += egl
HEADERS += qxcbeglsurface.h
# EGL on MeeGo 1.2 Harmattan needs this macro to map EGLNativeDisplayType
# and other types to the correct X11 types
DEFINES += SUPPORT_X11
} else:contains(QT_CONFIG, xcb-xlib) {
DEFINES += XCB_USE_GLX DEFINES += XCB_USE_GLX
HEADERS += qglxintegration.h HEADERS += qglxintegration.h
SOURCES += qglxintegration.cpp SOURCES += qglxintegration.cpp
@ -98,6 +90,14 @@ contains(QT_CONFIG, opengl) {
DEFINES += XCB_HAS_XCB_GLX DEFINES += XCB_HAS_XCB_GLX
LIBS += -lxcb-glx LIBS += -lxcb-glx
} }
} else:contains(QT_CONFIG, egl) {
DEFINES += XCB_USE_EGL
CONFIG += egl
HEADERS += qxcbeglsurface.h
# EGL on MeeGo 1.2 Harmattan needs this macro to map EGLNativeDisplayType
# and other types to the correct X11 types
DEFINES += SUPPORT_X11
} }
} }

View File

@ -55,10 +55,7 @@
#include <private/qpagedpaintdevice_p.h> #include <private/qpagedpaintdevice_p.h>
#ifndef QT_NO_PDF
#include "qprintengine_pdf_p.h" #include "qprintengine_pdf_p.h"
#endif
#include <qpicture.h> #include <qpicture.h>
#include <private/qpaintengine_preview_p.h> #include <private/qpaintengine_preview_p.h>
@ -618,8 +615,6 @@ QPrinter::~QPrinter()
*/ */
void QPrinter::setOutputFormat(OutputFormat format) void QPrinter::setOutputFormat(OutputFormat format)
{ {
#ifndef QT_NO_PDF
Q_D(QPrinter); Q_D(QPrinter);
if (d->validPrinter && d->outputFormat == format) if (d->validPrinter && d->outputFormat == format)
return; return;
@ -651,9 +646,6 @@ void QPrinter::setOutputFormat(OutputFormat format)
if (d->outputFormat == QPrinter::PdfFormat) if (d->outputFormat == QPrinter::PdfFormat)
d->validPrinter = true; d->validPrinter = true;
#else
Q_UNUSED(format);
#endif
} }
/*! /*!

View File

@ -857,7 +857,7 @@ static MYSQL_TIME *toMySqlDate(QDate date, QTime time, QVariant::Type type)
myTime->hour = time.hour(); myTime->hour = time.hour();
myTime->minute = time.minute(); myTime->minute = time.minute();
myTime->second = time.second(); myTime->second = time.second();
myTime->second_part = time.msec(); myTime->second_part = time.msec() * 1000;
} }
if (type == QVariant::Date || type == QVariant::DateTime) { if (type == QVariant::Date || type == QVariant::DateTime) {
myTime->year = date.year(); myTime->year = date.year();

View File

@ -42,6 +42,7 @@
#include "qsql_sqlite_p.h" #include "qsql_sqlite_p.h"
#include <qcoreapplication.h> #include <qcoreapplication.h>
#include <qdatetime.h>
#include <qvariant.h> #include <qvariant.h>
#include <qsqlerror.h> #include <qsqlerror.h>
#include <qsqlfield.h> #include <qsqlfield.h>
@ -447,6 +448,20 @@ bool QSQLiteResult::exec()
case QVariant::LongLong: case QVariant::LongLong:
res = sqlite3_bind_int64(d->stmt, i + 1, value.toLongLong()); res = sqlite3_bind_int64(d->stmt, i + 1, value.toLongLong());
break; break;
case QVariant::DateTime: {
const QDateTime dateTime = value.toDateTime();
const QString str = dateTime.toString(QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz"));
res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
str.size() * sizeof(ushort), SQLITE_TRANSIENT);
break;
}
case QVariant::Time: {
const QTime time = value.toTime();
const QString str = time.toString(QStringLiteral("hh:mm:ss.zzz"));
res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
str.size() * sizeof(ushort), SQLITE_TRANSIENT);
break;
}
case QVariant::String: { case QVariant::String: {
// lifetime of string == lifetime of its qvariant // lifetime of string == lifetime of its qvariant
const QString *str = static_cast<const QString*>(value.constData()); const QString *str = static_cast<const QString*>(value.constData());

View File

@ -47,18 +47,18 @@ label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
//! [1] //! [1]
QLineEdit* phoneEdit = new QLineEdit(this); QLineEdit *phoneEdit = new QLineEdit(this);
QLabel* phoneLabel = new QLabel("&Phone:", this); QLabel *phoneLabel = new QLabel("&Phone:", this);
phoneLabel->setBuddy(phoneEdit); phoneLabel->setBuddy(phoneEdit);
//! [1] //! [1]
//! [2] //! [2]
QLineEdit *nameEd = new QLineEdit(this); QLineEdit *nameEdit = new QLineEdit(this);
QLabel *nameLb = new QLabel("&Name:", this); QLabel *nameLabel = new QLabel("&Name:", this);
nameLb->setBuddy(nameEd); nameLabel->setBuddy(nameEdit);
QLineEdit *phoneEd = new QLineEdit(this); QLineEdit *phoneEdit = new QLineEdit(this);
QLabel *phoneLb = new QLabel("&Phone:", this); QLabel *phoneLabel = new QLabel("&Phone:", this);
phoneLb->setBuddy(phoneEd); phoneLabel->setBuddy(phoneEdit);
// (layout setup not shown) // (layout setup not shown)
//! [2] //! [2]

View File

@ -1414,7 +1414,10 @@ QGraphicsItem::~QGraphicsItem()
QObjectPrivate *p = QObjectPrivate::get(o); QObjectPrivate *p = QObjectPrivate::get(o);
p->wasDeleted = true; p->wasDeleted = true;
if (p->declarativeData) { if (p->declarativeData) {
QAbstractDeclarativeData::destroyed(p->declarativeData, o); if (QAbstractDeclarativeData::destroyed)
QAbstractDeclarativeData::destroyed(p->declarativeData, o);
if (QAbstractDeclarativeData::destroyed_qml1)
QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o);
p->declarativeData = 0; p->declarativeData = 0;
} }
} }

View File

@ -1464,7 +1464,10 @@ QWidget::~QWidget()
} }
if (d->declarativeData) { if (d->declarativeData) {
QAbstractDeclarativeData::destroyed(d->declarativeData, this); if (QAbstractDeclarativeData::destroyed)
QAbstractDeclarativeData::destroyed(d->declarativeData, this);
if (QAbstractDeclarativeData::destroyed_qml1)
QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this);
d->declarativeData = 0; // don't activate again in ~QObject d->declarativeData = 0; // don't activate again in ~QObject
} }

View File

@ -507,32 +507,26 @@ void tst_QSettings::ctor()
QCOMPARE(settings1.value("%General/%General").toInt(), 11); QCOMPARE(settings1.value("%General/%General").toInt(), 11);
/* /*
Test that the organization and product parameters is Test that the organization and product parameters are
case-insensitive on Windows and Mac, case-sensitive on case-insensitive on case-insensitive file systems.
Unix.
*/ */
QSettings settings5(format, QSettings::UserScope, "SoftWare.ORG", "killerApp"); QSettings settings5(format, QSettings::UserScope, "SoftWare.ORG", "killerApp");
bool caseSensitive = true;
#if defined(Q_OS_MAC)
if (format == QSettings::NativeFormat) { if (format == QSettings::NativeFormat) {
#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) // more details in QMacSettingsPrivate::QMacSettingsPrivate(), organization was comify()-ed
# ifdef Q_OS_OSX caseSensitive = settings5.fileName().contains("SoftWare.ORG");;
if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_8)
QEXPECT_FAIL("native", "See QTBUG-32655", Continue);
# endif // Q_OS_OSX
QCOMPARE(settings5.value("key 1").toString(), QString("gurgle"));
#else
QVERIFY(!settings5.contains("key 1"));
#endif
} else { } else {
#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) caseSensitive = pathconf(QDir::currentPath().toLatin1().constData(), _PC_CASE_SENSITIVE);
# ifdef Q_OS_OSX
if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_8)
QEXPECT_FAIL("", "See QTBUG-32655", Continue);
# endif // Q_OS_OSX
QCOMPARE(settings5.value("key 1").toString(), QString("gurgle"));
#else
QVERIFY(!settings5.contains("key 1"));
#endif
} }
#elif defined(Q_OS_WIN32)
caseSensitive = false;
#endif
if (caseSensitive)
QVERIFY(!settings5.contains("key 1"));
else
QVERIFY(settings5.contains("key 1"));
} }
{ {
@ -3168,6 +3162,11 @@ void tst_QSettings::rainersSyncBugOnMac()
{ {
QFETCH(QSettings::Format, format); QFETCH(QSettings::Format, format);
#ifdef Q_OS_OSX
if (format == QSettings::NativeFormat)
QSKIP("OSX does not support direct reads from and writes to .plist files, due to caching and background syncing. See QTBUG-34899.");
#endif
QString fileName; QString fileName;
{ {
@ -3183,10 +3182,6 @@ void tst_QSettings::rainersSyncBugOnMac()
{ {
QSettings s3(format, QSettings::UserScope, "software.org", "KillerAPP"); QSettings s3(format, QSettings::UserScope, "software.org", "KillerAPP");
#ifdef Q_OS_OSX
if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_8)
QEXPECT_FAIL("native", "See QTBUG-32655", Continue);
#endif
QCOMPARE(s3.value("key1", 30).toInt(), 25); QCOMPARE(s3.value("key1", 30).toInt(), 25);
} }
} }

View File

@ -65,6 +65,7 @@ private slots:
void basicacquire(); void basicacquire();
void complexacquire(); void complexacquire();
void release();
#ifndef QT_NO_PROCESS #ifndef QT_NO_PROCESS
void basicProcesses(); void basicProcesses();
@ -145,12 +146,37 @@ void tst_QSystemSemaphore::complexacquire()
{ {
QSystemSemaphore sem("QSystemSemaphore_complexacquire", 2, QSystemSemaphore::Create); QSystemSemaphore sem("QSystemSemaphore_complexacquire", 2, QSystemSemaphore::Create);
QVERIFY(sem.acquire()); QVERIFY(sem.acquire());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release()); QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.acquire()); QVERIFY(sem.acquire());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release()); QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.acquire()); QVERIFY(sem.acquire());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.acquire()); QVERIFY(sem.acquire());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release()); QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QCOMPARE(sem.errorString(), QString());
}
void tst_QSystemSemaphore::release()
{
QSystemSemaphore sem("QSystemSemaphore_release", 0, QSystemSemaphore::Create);
QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.acquire());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.acquire());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QVERIFY(sem.release()); QVERIFY(sem.release());
QCOMPARE(sem.error(), QSystemSemaphore::NoError); QCOMPARE(sem.error(), QSystemSemaphore::NoError);
QCOMPARE(sem.errorString(), QString()); QCOMPARE(sem.errorString(), QString());