summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-19 13:31:25 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-19 13:31:25 (GMT)
commit78dcac759d500c1744751955623b1d0babcd37a4 (patch)
tree59d7a2540c2fcffe0b274afbf85db9a1f53242f4 /src/corelib
parentf1c79b3c90c1e14d8bee0228e3e416fa5337cf6e (diff)
parentde0858687898f6e0e54cce3f986779c7aa1a350e (diff)
downloadQt-78dcac759d500c1744751955623b1d0babcd37a4.zip
Qt-78dcac759d500c1744751955623b1d0babcd37a4.tar.gz
Qt-78dcac759d500c1744751955623b1d0babcd37a4.tar.bz2
Merge remote branch 'origin/4.7' into HEAD
Conflicts: src/corelib/tools/qlocale_symbian.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.h8
-rw-r--r--src/corelib/io/qurl.cpp19
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp10
-rw-r--r--src/corelib/kernel/qfunctions_wince.cpp10
4 files changed, 29 insertions, 18 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 8359637..3118f8f 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1243,11 +1243,6 @@ class QDataStream;
# else
# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
# endif
-# if defined(QT_BUILD_MEDIASERVICES_LIB)
-# define Q_MEDIASERVICES_EXPORT Q_DECL_EXPORT
-# else
-# define Q_MEDIASERVICES_EXPORT Q_DECL_IMPORT
-# endif
# if defined(QT_BUILD_OPENVG_LIB)
# define Q_OPENVG_EXPORT Q_DECL_EXPORT
# else
@@ -1294,7 +1289,6 @@ class QDataStream;
# define Q_CANVAS_EXPORT Q_DECL_IMPORT
# define Q_OPENGL_EXPORT Q_DECL_IMPORT
# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT
-# define Q_MEDIASERVICES_EXPORT Q_DECL_IMPORT
# define Q_OPENVG_EXPORT Q_DECL_IMPORT
# define Q_XML_EXPORT Q_DECL_IMPORT
# define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT
@@ -1323,7 +1317,6 @@ class QDataStream;
# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT
# define Q_OPENGL_EXPORT Q_DECL_EXPORT
# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT
-# define Q_MEDIASERVICES_EXPORT Q_DECL_EXPORT
# define Q_OPENVG_EXPORT Q_DECL_EXPORT
# define Q_XML_EXPORT Q_DECL_EXPORT
# define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT
@@ -1339,7 +1332,6 @@ class QDataStream;
# define Q_DECLARATIVE_EXPORT
# define Q_OPENGL_EXPORT
# define Q_MULTIMEDIA_EXPORT
-# define Q_MEDIASERVICES_EXPORT
# define Q_XML_EXPORT
# define Q_XMLPATTERNS_EXPORT
# define Q_SCRIPT_EXPORT
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index d4b8b5f..79a8ce4 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -345,6 +345,7 @@ public:
bool hasQuery;
bool hasFragment;
bool isValid;
+ bool isHostValid;
char valueDelimiter;
char pairDelimiter;
@@ -3138,10 +3139,11 @@ static void toPunycodeHelper(const QChar *s, int ucLength, QString *output)
static const char * const idn_whitelist[] = {
- "ac", "at",
- "br",
+ "ac", "ar", "at",
+ "biz", "br",
"cat", "ch", "cl", "cn",
"de", "dk",
+ "es",
"fi",
"gr",
"hu",
@@ -3155,6 +3157,9 @@ static const char * const idn_whitelist[] = {
"se", "sh",
"th", "tm", "tw",
"vn",
+ "xn--mgbaam7a8h", // UAE
+ "xn--mgberp4a5d4ar", // Saudi Arabia
+ "xn--wgbh1c" // Egypt
};
static QStringList *user_idn_whitelist = 0;
@@ -3313,6 +3318,7 @@ static QString qt_ACE_do(const QString &domain, AceOperation op)
qt_nameprep(&result, prevLen);
labelLength = result.length() - prevLen;
register int toReserve = labelLength + 4 + 6; // "xn--" plus some extra bytes
+ aceForm.resize(0);
if (toReserve > aceForm.capacity())
aceForm.reserve(toReserve);
toPunycodeHelper(result.constData() + prevLen, result.size() - prevLen, &aceForm);
@@ -3349,6 +3355,7 @@ QUrlPrivate::QUrlPrivate()
ref = 1;
port = -1;
isValid = false;
+ isHostValid = true;
parsingMode = QUrl::TolerantMode;
valueDelimiter = '=';
pairDelimiter = '&';
@@ -3375,6 +3382,7 @@ QUrlPrivate::QUrlPrivate(const QUrlPrivate &copy)
hasQuery(copy.hasQuery),
hasFragment(copy.hasFragment),
isValid(copy.isValid),
+ isHostValid(copy.isHostValid),
valueDelimiter(copy.valueDelimiter),
pairDelimiter(copy.pairDelimiter),
stateFlags(copy.stateFlags),
@@ -3405,6 +3413,8 @@ QString QUrlPrivate::canonicalHost() const
that->host = host.toLower();
} else {
that->host = qt_ACE_do(host, NormalizeAce);
+ if (that->host.isNull())
+ that->isHostValid = false;
}
return that->host;
}
@@ -3481,6 +3491,7 @@ QString QUrlPrivate::authority(QUrl::FormattingOptions options) const
void QUrlPrivate::setAuthority(const QString &auth)
{
+ isHostValid = true;
if (auth.isEmpty()) {
setUserInfo(QString());
host.clear();
@@ -4175,7 +4186,7 @@ bool QUrl::isValid() const
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Validated)) d->validate();
- return d->isValid;
+ return d->isValid && d->isHostValid;
}
/*!
@@ -4427,7 +4438,6 @@ void QUrl::setAuthority(const QString &authority)
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
detach();
QURL_UNSETFLAG(d->stateFlags, QUrlPrivate::Validated | QUrlPrivate::Normalized);
-
d->setAuthority(authority);
}
@@ -4648,6 +4658,7 @@ void QUrl::setHost(const QString &host)
if (!d) d = new QUrlPrivate;
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
detach();
+ d->isHostValid = true;
QURL_UNSETFLAG(d->stateFlags, QUrlPrivate::Validated | QUrlPrivate::Normalized | QUrlPrivate::HostCanonicalized);
d->host = host;
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 687a6d9..33775d2 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -47,6 +47,8 @@
#include <unistd.h>
#include <errno.h>
+#include <net/if.h>
+
QT_BEGIN_NAMESPACE
#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
@@ -569,13 +571,17 @@ void QSelectThread::updateActivatedNotifiers(QSocketNotifier::Type type, fd_set
* check if socket is in exception set
* then signal RequestComplete for it
*/
- qWarning("exception on %d [will close the socket handle - hack]", i.key()->socket());
+ qWarning("exception on %d [will do setdefaultif(0) - hack]", i.key()->socket());
// quick fix; there is a bug
// when doing read on socket
// errors not preoperly mapped
// after offline-ing the device
// on some devices we do get exception
- ::close(i.key()->socket());
+ // close all exiting sockets
+ // and reset default IAP
+ if(::setdefaultif(0) != KErrNone) // well we can't do much about it
+ qWarning("setdefaultif(0) failed");
+
toRemove.append(i.key());
TRequestStatus *status = i.value();
QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
diff --git a/src/corelib/kernel/qfunctions_wince.cpp b/src/corelib/kernel/qfunctions_wince.cpp
index 8ad6126..e58feb3 100644
--- a/src/corelib/kernel/qfunctions_wince.cpp
+++ b/src/corelib/kernel/qfunctions_wince.cpp
@@ -352,16 +352,18 @@ void *qt_wince_bsearch(const void *key,
size_t low = 0;
size_t high = num - 1;
while (low <= high) {
- unsigned int mid = ((unsigned) (low + high)) >> 1;
+ size_t mid = (low + high) >> 1;
int c = compare(key, (char*)base + mid * size);
- if (c < 0)
+ if (c < 0) {
+ if (!mid)
+ break;
high = mid - 1;
- else if (c > 0)
+ } else if (c > 0)
low = mid + 1;
else
return (char*) base + mid * size;
}
- return (NULL);
+ return 0;
}
void *lfind(const void* key, const void* base, size_t* elements, size_t size,