| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
When using QResource directly, the loader should respect the locale that the
user asked to use for the resource.
Reviewed-by: João Abecasis
|
|
|
|
|
|
|
|
| |
Using QLocale::operator== is faster than comparing languages, because when
getting a language from a default constructed QLocale object, it initializes
the system locale and quieries the system which languge it supports.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
|
| |
Also add an extensive autotest suite for QProcessEnvironment
Task-number: QTBUG-6701
Reviewed-by: Markus Goetz
|
|
|
|
|
|
|
|
|
|
| |
We use realpath(X,0) extension that is defined by the latest POSIX standard and
not many systems support it at the moment. For now we limit it to Linux and
Symbian. Mac supports it starting with 10.6, and we'll implement it properly
for Mac in 4.7. We know that neither *BSD systems nor Solaris do not support
it.
Reviewed-by: Markus Goetz
|
|
|
|
|
|
|
| |
Dnotify doesn't work on dup'ed file descriptors apparently, so we need
to closedir() before using fcntl() to set the watches.
Reviewed-by: TrustMe
|
|\ |
|
| |
| |
| |
| |
| |
| | |
That was disabled by accident when we were disabling it for Mac.
Reviewed-by: Prasanth
|
| |
| |
| |
| |
| |
| |
| | |
The realpath() extension we use in this function is only available from
10.6 onwards. For the time being this optimization is turned off on Mac.
Reviewed-by: Markus Goetz
|
|/
|
|
|
|
|
|
|
|
|
| |
QFileSystemWatcher
Commit 71c3227ba260b964b0c9516f05ad4f2e6fa72f69 fixed a memory leak by
calling closedir(), which would also close the file descriptor we were
wanting to watch. Fix this by duplicating the file descriptor that we
store.
Reviewed-by: TrustMe
|
|
|
|
|
|
|
|
|
|
| |
realpath() crashes on mac if the input file path is the root ("/") - on 10.6
calling a free on the returned value shows a warning saying the memory was not
allocated. To workaround that just added a special case - if the input string
is '/', we don't need to use realpath as we already know that the path is
canonical.
Reviewed-by: Prasanth
|
|
|
|
|
|
|
|
|
| |
The open() syscall can open directories for reading, which we
in QFile and file engines don't support. However, there is no need
for stat() to find out if it is a directory if we open() with a write
flag because then the syscall will fail anyway.
Reviewed-by: joao
|
|
|
|
|
|
|
| |
Make sure that all calls to opendir() are paired with a call closedir().
Reviewed-by: Marius Storm-Olsen
Task-number: QTBUG-4840
|
|
|
|
| |
Reviewed-by: TrustMe
|
|
|
|
|
|
|
|
| |
The temporary object goes away before the next line is executed, so the
pointer to the const data is invalid. Just put it all on one line, and
we're ok.
Reviewed-by: Brad
|
|
|
|
|
|
|
|
| |
In our benchmark, this makes QFileInfo.canonical*Path() up
to 50% faster. This should also improve application startup time.
Let's see if it works on all Unices and Symbian.
Reviewed-by: mariusSO
|
|
|
|
|
|
|
|
| |
On 64bit, qint64(size_t(-1)) = -1
Reviewed-by: Joao
Reviewed-by: Thiago
(cherry picked from commit 829d9e10ad3d26fb2fddef01c8e36352018c3fec)
|
|
|
|
|
|
|
|
|
|
|
|
| |
When processing the result of QIODevice::readLine, forgot to take into
account that a '\0' is appended to the array. The terminating character
is not accounted for in the number of bytes returned.
By pre-allocating a byte for the terminating null character, we make
sure we'll actually read 16k bytes on each and every iteration.
Task-number: QTBUG-6019
Reviewed-by: Thiago Macieira
|
|
|
|
|
|
|
|
|
|
|
|
| |
The check, introduced in c66de8a19b558e14097c402480eeabf0b5ec2351,
changes behavior and it is not clear whether we should prevent
mmaping beyond EOF. FWIW, python prevents it.
Leaving a warning in there for now so as not to break applications that
depend on the feature.
Task-number: QTBUG-6008
Reviewed-by: Thiago Macieira
|
|\ |
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
configure.exe
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Some network tests were set up to ignore a qWarning that was removed.
Fixed those tests.
Made warning from QIODevice::getChar have the right function name.
Reviewed-by: Thiago Macieira
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Over src/ tools/ examples/ and demos/
|
|\ \ \ \
| | |/ /
| |/| /
| |_|/
|/| | |
Conflicts:
configure.exe
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Chunk size increased to QIODEVICE_BUFFERSIZE (currently 16k) where
chunking is still needed. Namely, on sequential devices and when
QByteArray is unable to allocate a large enough buffer. This is
necessary for backward compatibility
Improved validation and prevention of overflow in maxSize argument.
Updated autotest that relied on a null QByteArray when no data was
available and no errors were found. The only guarantee we should be
providing in this case is an empty result -- even though that behavior
is preserved for the time being.
Affected functions:
* QIODevice::read(qint64 maxSize)
Chunking will still happen for large maxSize (i.e., QByteArray
resize fails), where it could be used as a synonym for
QIODevice::readAll().
No stat'ing performed. Read from device continues for as long as it
is successful. Stops if an error occurs or if we get less data than
requested.
* QIODevice::readAll()
Chunking is performed for sequential devices where total size
wouldn't be known beforehand. For sequential devices, reading
continues as long as data is returned, even if less than requested.
Non-sequential devices will be stat'ed once. If QIODevice::size
returns 0, this is taken to mean unknown size and chunking is
performed.
Otherwise, a single read request is made for the specified size. On
failure to resize QByteArray, nothing is returned.
* QIODevice::readLine(qint64 maxSize)
Chunking is performed for maxSize == 0, or if we can't allocate a
large enough buffer.
No stat'ing performed at this level. Read from device continues
until EOL is found, as long as we get all requested data.
Task-number: QT-2347
Reviewed-by: Thiago Macieira
Reviewed-by: Miikka Heikkinen
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When writing nothing to a file, not actually writing anything is not an
error.
Also, from a change introduced in the same commit, there is no point in
checking for EOF when writing.
Task-number: QTBUG-5847
Reviewed-by: Olivier Goffart
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In Text mode there would be a huge penalty on each '\r' found even if
the internal buffer was not exhausted, because we would repeatedly
remove the '\r' from the buffer and put it back it. Before following
through to the unoptimized code, anyway.
Instead, we now loop over the internal buffer until we find a suitable
character.
Reduced code duplication by having QIODevice::getChar directly call
QIODevice::read and letting compilers do their job.
Reviewed-by: Markus Goetz
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Either the buffer has more data than is being skipped and it can be
cleared or it doesn't and we must skip it.
If the total size of QRingBuffer exceeds INT_MAX there'll be bigger
problems (e.g., QRingBuffer::size() will overflow) that can only be
handled there and there's no point trying to work around them here.
Reviewed-by: Markus Goetz
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To be sure, we should explicitly use the size of that buffer and not the
whole QRingBuffer when flushing the data.
With this change, we make violations of the one-buffer-rule explicitly
fail on flush(), but we avoid corrupting data and reading past the
buffer's end.
Reviewed-by: Markus Goetz
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
browser use it.
- Handle windows files names by looking for paths first (and don't check
that it exists first)
- Handle host names without dots (it was not handled because of
difficulties with the case host:port)
- Return the parsed url only if the host or the path is not empty
instead of returning a url that looks like "http:"
Reviewed-by: Thiago Macieira
|
|\ \
| |/
| |
| |
| | |
Conflicts:
tools/configure/configureapp.cpp
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
src/corelib/tools/qscopedpointer.h
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
configure.exe
src/corelib/io/qfsfileengine.cpp
tests/auto/qfile/tst_qfile.cpp
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This was a serious performance issue on Symbian and not necessarily
optimal on other platforms. For the time being, we'll allow the OS to
read/write as much as it can.
Otherwise cleaned up the code, adding checks for invalid len arguments.
Task-number: QT-2347
Reviewed-by: Peter Hartmann
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
needed for build-time qm generation in qt itself.
the downsides are a) that the other bootstrapped tools grow by ~12kB
(on x86) due to qdatastream being pulled in by qbytearray and qstring
and b) that lrelease isn't l10n'd itself anymore (the latter could be
fixed by building a non-qobject qtranslator).
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
The API is internal, so it should live in its private header. The class
was introduced during the lifetime of 4.6 (not in 4.5), so the move is
binary compatible.
Task-number: QTBUG-5617
Reviewed-by: João Abecasis <joao@abecasis.name>
|
| | |
|
|\ \ |
|
| |\ \
| | |/ |
|
| | |\ |
|
| | | |
| | | |
| | | |
| | | | |
Reviewed-by: João Abecasis
|
| |\ \ \
| | |_|/
| |/| | |
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Each read requires costly IPC call to Symbian file server, so reading
and writing large files has lot of unnecessary overhead when using 4k
block size. Increased the block size to 16k, which is what QIODevice
will request at maximum. This speeds up reading large files up to 10%.
Also included are some unnecessary whitespace removals.
Task-number: QT-2347
Reviewed-by: axis
|
| | |
| | |
| | |
| | |
| | |
| | | |
Imported from http://github.com/icefox/guessurlfromstring
Licensed under the 3-clause BSD license by the copyright holder.
|
| |/
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
| |
| |
| |
| |
| |
| |
| | |
QFile::seek is supposed to work on Windows CE with FILE* streams. size()
returns 0 on errors and sequential files. Probably on empty files as
well ;-)
Reviewed-by: Olivier Goffart
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
filelength is not available on Windows CE instead, we must fallback to
fseek/ftell as was being done previously. Still on Windows CE, we still
don't report the file size for file descriptors, but we also won't set a
random error string.
Changed qt_error_string calls to use errno when errors come from CRT
functions.
Also, if we're using filelength on FILE* streams, there's no reason not
to use it for file descriptors, instead of requesting a native handle.
Reviewed-by: Olivier Goffart
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On Mac OS, mmap would succeed, returning a valid pointer, but trying to
read from it would result in a SIGBUS.
By adding this check we commit to a safe cross-platform behavior users
can depend on.
Reviewed-by: Thiago Macieira
|
| |
| |
| |
| |
| |
| |
| | |
That's what I get for not having the brain on when accepting
suggestions...
Reviewed-by: Thiago Macieira
|