Skip to content

Commit

Permalink
Merge remote-tracking branch 'earth-team/master' into earth-staging-m…
Browse files Browse the repository at this point in the history
…aster
  • Loading branch information
ogoffart committed Apr 20, 2011
2 parents 8485052 + 7a9ed6a commit 40a2129
Show file tree
Hide file tree
Showing 137 changed files with 7,068 additions and 1,082 deletions.
54 changes: 54 additions & 0 deletions config.tests/unix/icu/icu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include <unicode/utypes.h>
#include <unicode/ucol.h>
#include <unicode/ustring.h>

int main(int, char **)
{
UErrorCode status = U_ZERO_ERROR;
UCollator *collator = ucol_open("ru_RU", &status);
if (U_FAILURE(status))
return 0;
ucol_close(collator);
return 0;
}
4 changes: 4 additions & 0 deletions config.tests/unix/icu/icu.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SOURCES = icu.cpp
CONFIG -= qt dylib app_bundle
unix:LIBS += -licuuc -licui18n
win32:LIBS += -licuin
42 changes: 35 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ CFG_PULSEAUDIO=auto
CFG_COREWLAN=auto
CFG_ICD=auto
CFG_NOPROCESS=no
CFG_ICU=auto

# initalize variables used for installation
QT_INSTALL_PREFIX=
Expand Down Expand Up @@ -1040,7 +1041,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#Qt style yes options
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles)
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL=yes
;;
Expand Down Expand Up @@ -2376,6 +2377,13 @@ while [ "$#" -gt 0 ]; do
QT_CFLAGS_FPU=$VAL
fi
;;
icu)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_ICU="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
*)
UNKNOWN_OPT=yes
;;
Expand Down Expand Up @@ -5694,6 +5702,25 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "ye
CFG_ICD=no
fi

# auto-detect libicu support
if [ "$CFG_ICU" != "no" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icu "ICU" $L_FLAGS $I_FLAGS $l_FLAGS; then
[ "$CFG_ICU" = "auto" ] && CFG_ICU=yes
else
if [ "$CFG_ICU" = "auto" ]; then
CFG_ICU=no
elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
# CFG_ICU is "yes"

echo "The ICU library support cannot be enabled."
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
exit 101
fi
fi
fi

# Auto-detect PulseAudio support
if [ "$CFG_PULSEAUDIO" != "no" ]; then
if [ -n "$PKG_CONFIG" ]; then
Expand Down Expand Up @@ -6549,13 +6576,9 @@ fi

# find if the platform supports IPv6
if [ "$CFG_IPV6" != "no" ]; then
#
# We accidently enabled IPv6 for Qt Symbian in 4.6.x. However the underlying OpenC does not fully support IPV6.
# Therefore for 4.7.1 and following we disable it until OpenC either supports it or we have the native Qt
# symbian socket engine.
#
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
CFG_IPV6=no
#IPV6 should always be enabled for Symbian release
CFG_IPV6=yes
elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
CFG_IPV6=yes
else
Expand Down Expand Up @@ -7359,6 +7382,10 @@ if [ "$CFG_ICD" = "yes" ]; then
QT_CONFIG="$QT_CONFIG icd"
fi

if [ "$CFG_ICU" = "yes" ]; then
QT_CONFIG="$QT_CONFIG icu"
fi

#
# Some Qt modules are too advanced in C++ for some old compilers
# Detect here the platforms where they are known to work.
Expand Down Expand Up @@ -8754,6 +8781,7 @@ if [ "$PLATFORM_MAC" = "yes" ]; then
echo "CoreWlan support ....... $CFG_COREWLAN"
fi
echo "ICD support ............ $CFG_ICD"
echo "libICU support ......... $CFG_ICU"
echo

[ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........... $CFG_PTMALLOC"
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/io/io.pri
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ win32 {
SOURCES += io/qfilesystemwatcher_symbian.cpp
HEADERS += io/qfilesystemwatcher_symbian_p.h
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
LIBS += -lplatformenv
LIBS += -lplatformenv -lesock
}
}
integrity {
Expand Down
2 changes: 0 additions & 2 deletions src/corelib/io/qfilesystemiterator_symbian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &path, QDir::Fil
else if (symbianMask == 0) {
if ((filters & QDir::PermissionMask) == QDir::Writable)
symbianMask = KEntryAttMatchExclude | KEntryAttReadOnly;
else if ((filters & QDir::PermissionMask) == QDir::Readable)
symbianMask = KEntryAttMatchExclusive | KEntryAttReadOnly;
}

lastError = dirHandle.Open(fs, qt_QString2TPtrC(absPath), symbianMask);
Expand Down
104 changes: 104 additions & 0 deletions src/corelib/kernel/qcore_symbian_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <e32uid.h>
#include "qcore_symbian_p.h"
#include <string>
#include <in_sock.h>

QT_BEGIN_NAMESPACE

Expand Down Expand Up @@ -203,11 +204,114 @@ class QS60RFsSession
RFs iFs;
};

uint qHash(const RSubSessionBase& key)
{
return qHash(key.SubSessionHandle());
}

Q_GLOBAL_STATIC(QS60RFsSession, qt_s60_RFsSession);

Q_CORE_EXPORT RFs& qt_s60GetRFs()
{
return qt_s60_RFsSession()->GetRFs();
}

QSymbianSocketManager::QSymbianSocketManager() :
iNextSocket(0), iDefaultConnection(0)
{
TSessionPref preferences;
// ### In future this could be changed to KAfInet6 when that is more common than IPv4
preferences.iAddrFamily = KAfInet;
preferences.iProtocol = KProtocolInetIp;
//use global message pool, as we do not know how many sockets app will use
//TODO: is this the right choice?
qt_symbian_throwIfError(iSocketServ.Connect(preferences, -1));
qt_symbian_throwIfError(iSocketServ.ShareAuto());
}

QSymbianSocketManager::~QSymbianSocketManager()
{
iSocketServ.Close();
if(!socketMap.isEmpty()) {
qWarning("leaked %d sockets on exit", socketMap.count());
}
}

RSocketServ& QSymbianSocketManager::getSocketServer() {
return iSocketServ;
}

int QSymbianSocketManager::addSocket(const RSocket& socket) {
QHashableSocket sock(static_cast<const QHashableSocket &>(socket));
QMutexLocker l(&iMutex);
Q_ASSERT(!socketMap.contains(sock));
if(socketMap.contains(sock))
return socketMap.value(sock);
// allocate socket number
int guard = 0;
while(reverseSocketMap.contains(iNextSocket)) {
iNextSocket++;
iNextSocket %= max_sockets;
guard++;
if(guard > max_sockets)
return -1;
}
int id = iNextSocket;

socketMap[sock] = id;
reverseSocketMap[id] = sock;
return id + socket_offset;
}

bool QSymbianSocketManager::removeSocket(const RSocket &socket) {
QHashableSocket sock(static_cast<const QHashableSocket &>(socket));
QMutexLocker l(&iMutex);
if(!socketMap.contains(sock))
return false;
int id = socketMap.value(sock);
socketMap.remove(sock);
reverseSocketMap.remove(id);
return true;
}

int QSymbianSocketManager::lookupSocket(const RSocket& socket) const {
QHashableSocket sock(static_cast<const QHashableSocket &>(socket));
QMutexLocker l(&iMutex);
if(!socketMap.contains(sock))
return -1;
int id = socketMap.value(sock);
return id + socket_offset;
}

bool QSymbianSocketManager::lookupSocket(int fd, RSocket& socket) const {
QMutexLocker l(&iMutex);
int id = fd - socket_offset;
if(!reverseSocketMap.contains(id))
return false;
socket = reverseSocketMap.value(id);
return true;
}

void QSymbianSocketManager::setDefaultConnection(RConnection* con)
{
iDefaultConnection = con;
}

RConnection* QSymbianSocketManager::defaultConnection() const
{
return iDefaultConnection;
}

Q_GLOBAL_STATIC(QSymbianSocketManager, qt_symbianSocketManager);

QSymbianSocketManager& QSymbianSocketManager::instance()
{
return *(qt_symbianSocketManager());
}

Q_CORE_EXPORT RSocketServ& qt_symbianGetSocketServer()
{
return QSymbianSocketManager::instance().getSocketServer();
}

QT_END_NAMESPACE
Loading

0 comments on commit 40a2129

Please sign in to comment.