summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-17 18:00:03 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-17 18:00:03 (GMT)
commit91a1f7a1c408052b1d284d6b901819964e338fe5 (patch)
treedf7103f0ea0cb9d98f4b641d72c0f8b0ebdf2498 /src/corelib
parent94a3356d5eb7b255d439efe2699bf3a9b025e8eb (diff)
parent509ef11ab4ba6165c16d9d311c4a1bf7cdfd2528 (diff)
downloadQt-91a1f7a1c408052b1d284d6b901819964e338fe5.zip
Qt-91a1f7a1c408052b1d284d6b901819964e338fe5.tar.gz
Qt-91a1f7a1c408052b1d284d6b901819964e338fe5.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: demos/demos.pro mkspecs/features/resources.prf mkspecs/features/uic.prf src/corelib/io/qurl.cpp src/corelib/tools/qlocale_symbian.cpp src/gui/graphicsview/qgraphicsscene.cpp src/gui/graphicsview/qgraphicswidget_p.cpp src/gui/graphicsview/qgraphicswidget_p.h src/gui/util/qsystemtrayicon_win.cpp src/multimedia/audio/qaudioinput.cpp tests/auto/qhostinfo/qhostinfo.pro
Diffstat (limited to 'src/corelib')
-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
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp2
4 files changed, 30 insertions, 11 deletions
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,
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 6e36dcd..1777ba9 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -140,7 +140,7 @@ static const symbianToISO symbian_to_iso_list[] = {
{ ELangBrazilianPortuguese, "pt_BR" },
{ ELangRomanian, "ro_RO" },
{ ELangSerbian, "sr_RS" },
- { ELangLatinAmericanSpanish, "es" },
+ { ELangLatinAmericanSpanish,"es_MX" }, // TODO: should be es_419
{ ELangUkrainian, "uk_UA" },
{ ELangUrdu, "ur_PK" }, // India/Pakistan
{ ELangVietnamese, "vi_VN" },