diff options
author | axis <qt-info@nokia.com> | 2010-03-01 14:06:02 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-03-01 14:06:02 (GMT) |
commit | 88a36e9e7e0e0bc09788c41ab6b968031dbc9154 (patch) | |
tree | 947663f695f54a0deb2724116f82d89fde761576 /src/corelib/io | |
parent | 4be1e01c6faebe11bfe205c1b910049747b5c335 (diff) | |
parent | ca82ee4ee55e52c75326949148455af1095df014 (diff) | |
download | Qt-88a36e9e7e0e0bc09788c41ab6b968031dbc9154.zip Qt-88a36e9e7e0e0bc09788c41ab6b968031dbc9154.tar.gz Qt-88a36e9e7e0e0bc09788c41ab6b968031dbc9154.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts:
configure
mkspecs/common/symbian/symbian.conf
qmake/generators/symbian/initprojectdeploy_symbian.cpp
qmake/generators/symbian/symmake_abld.cpp
qmake/generators/symbian/symmake_sbsv2.cpp
src/plugins/plugins.pro
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdatastream.cpp | 5 | ||||
-rw-r--r-- | src/corelib/io/qdir.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qfsfileengine_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qiodevice.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qresource.cpp | 9 | ||||
-rw-r--r-- | src/corelib/io/qurl.cpp | 27 |
6 files changed, 37 insertions, 17 deletions
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index fc35bfa..2731ae1 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -159,10 +159,9 @@ QT_BEGIN_NAMESPACE \section1 Reading and writing Qt collection classes - The Qt collection classes can also be serialized to a QDataStream. + The Qt container classes can also be serialized to a QDataStream. These include QList, QLinkedList, QVector, QSet, QHash, and QMap. - These classes have have stream operators declared as non-member of - the class. + The stream operators are declared as non-members of the classes. \target Serializing Qt Classes \section1 Reading and writing other Qt classes. diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 7cfdddf..505889e 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -960,13 +960,14 @@ void QDir::setNameFilters(const QStringList &nameFilters) /*! \obsolete + + Use QDir::addSearchPath() with a prefix instead. + Adds \a path to the search paths searched in to find resources that are not specified with an absolute path. The default search path is to search only in the root (\c{:/}). - Use QDir::addSearchPath() with a prefix instead. - - \sa {The Qt Resource System}, QResource::addSearchPath() + \sa {The Qt Resource System} */ void QDir::addResourceSearchPath(const QString &path) { diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 606941e..dced3e7 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -1270,7 +1270,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla int pageSize = getpagesize(); int extra = offset % pageSize; - if (size + extra > (size_t)-1) { + if (quint64(size + extra) > quint64((size_t)-1)) { q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL))); return 0; } diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 4e14ba8..662100a 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1003,8 +1003,8 @@ QByteArray QIODevice::readAll() to a maximum of \a maxSize - 1 bytes, stores the characters in \a data, and returns the number of bytes read. If a line could not be read but no error ocurred, this function returns 0. If an error - occurs, this function returns what it could the length of what - could be read, or -1 if nothing was read. + occurs, this function returns the length of what could be read, or + -1 if nothing was read. A terminating '\0' byte is always appended to \a data, so \a maxSize must be larger than 1. diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index adfbb15..6d33c8b 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -555,16 +555,15 @@ QStringList QResource::children() const /*! \obsolete + Use QDir::addSearchPath() with a prefix instead. + Adds \a path to the search paths searched in to find resources that are not specified with an absolute path. The \a path must be an absolute path (start with \c{/}). The default search path is to search only in the root (\c{:/}). The last path added will be consulted first upon next QResource creation. - - Use QDir::addSearchPath() with a prefix instead. */ - void QResource::addSearchPath(const QString &path) { @@ -578,6 +577,10 @@ QResource::addSearchPath(const QString &path) } /*! + \obsolete + + Use QDir::searchPaths() instead. + Returns the current search path list. This list is consulted when creating a relative resource. diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 076cc33..acb73fd 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -437,17 +437,19 @@ static bool QT_FASTCALL _unreserved(const char **ptr) } // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) -static void QT_FASTCALL _scheme(const char **ptr, QUrlParseData *parseData) +static bool QT_FASTCALL _scheme(const char **ptr, QUrlParseData *parseData) { bool first = true; + bool isSchemeValid = true; parseData->scheme = *ptr; for (;;) { char ch = **ptr; if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { ; - } else if (!first && ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.')) { - ; + } else if ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.') { + if (first) + isSchemeValid = false; } else { break; } @@ -457,11 +459,14 @@ static void QT_FASTCALL _scheme(const char **ptr, QUrlParseData *parseData) } if (**ptr != ':') { + isSchemeValid = true; *ptr = parseData->scheme; } else { parseData->schemeLength = *ptr - parseData->scheme; ++(*ptr); // skip ':' } + + return isSchemeValid; } // IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) @@ -3743,7 +3748,19 @@ void QUrlPrivate::parse(ParseOptions parseOptions) const #endif // optional scheme - _scheme(ptr, &parseData); + bool isSchemeValid = _scheme(ptr, &parseData); + + if (isSchemeValid == false) { + that->isValid = false; + char ch = *((*ptr)++); + that->errorInfo.setParams(*ptr, QT_TRANSLATE_NOOP(QUrl, "unexpected URL scheme"), + 0, ch); + QURL_SETFLAG(that->stateFlags, Validated | Parsed); +#if defined (QURL_DEBUG) + qDebug("QUrlPrivate::parse(), unrecognized: %c%s", ch, *ptr); +#endif + return; + } // hierpart _hierPart(ptr, &parseData); @@ -6348,7 +6365,7 @@ QUrl QUrl::fromUserInput(const QString &userInput) return QUrl::fromLocalFile(trimmedString); QUrl url = QUrl::fromEncoded(trimmedString.toUtf8(), QUrl::TolerantMode); - QUrl urlPrepended = QUrl::fromEncoded((QLatin1String("http://") + trimmedString).toUtf8(), QUrl::TolerantMode); + QUrl urlPrepended = QUrl::fromEncoded("http://" + trimmedString.toUtf8(), QUrl::TolerantMode); // Check the most common case of a valid url with scheme and host // We check if the port would be valid by adding the scheme to handle the case host:port |