| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
MinGW 3.4.5 can't figure out the automatic QLatin1Char -> QString
conversion in this code.
|
|
|
|
| |
Reviewed-by: Leo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QString objects from smaller chunks.
The QStringBuilder class:
QStringBuilder uses expression templates (using the '%' operator)
to postpone any actual concatenation until it is assigned to an
actual QString. At that time it knows the exact sizes of all chunks,
can compute the required space, allocates once a QString of
appriopriate size and then copies over the chunk data one-by-one.
In addition, QLatin1Literal is a drop-in replacement for QLatin1String
(which we can't change for compatibility reasons) that knows its
size, therefore saving a few cycles when computing the size of the
resulting string.
Some further saved cycles stem from inlining and reduced reference
counting logic (the QString created from a QStringBuilder has typically
ref count equal to 1, while QString::append() needs an extra test)
Minor changes to the existing QString class:
- Introduce QString constructor to create an uninitialized QString of a given size.
This particular constructor is used by QStringBuilder class.
- Introduce a QT_USE_FAST_CONCATENATION macro to disable the existing
overloads of operator+() and helps finding the places where they are used in code.
- Introduce QT_USE_FAST_OPERATOR_PLUS. This also disables the existing
overloads of operator+() and creates a new templated operator+() with
identical implementation of operator%(). This allows code that is compilable
QT_CAST_{TO,FROM}_ASCII to use QStringBuilder almost transparently. The only
case that is not covered is creating objects like QUrl that are implicitly
constructible from a QString from a QStringBuilder result. This needs to be
converted explicitly to a QString first, e.g. by using QUrl
url(QString(QLatin1String("http://") + hostName));
Reviewed-by: MariusSO
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The QObject internals have changed, and the mutex that need to be locked
to access the senders list is not the same anymore, and not accessible
form qstatemachine.cpp
But we do not need to loop over the senders list anyway because this is
done in sender()
We also do not need to lock in order to access the currentSender
Reviewed-by: Eskil
|
|
|
|
|
| |
used character operations whenever possible
better usage of QLatin1String
|
|
|
|
|
|
|
| |
Also fix an issue in QTreeView where a signal could be connected
several times
Reviewed-by: Thierry
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
tests/auto/qtreeview/tst_qtreeview.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use a union instead of an unsafe cast when swapping the bytes in
the QDataStream streaming operators. The old seems to cause problems
with Link Time Code Generation optimizations with the MSVC compilers.
Task-number: 247708
Reviewed-by: Samuel
Reviewed-by: Thiago
BT: yes
|
| |
| |
| |
| | |
Task-number: 245501
|
| |\ |
|
| | |
| | |
| | |
| | | |
Reviewed-by: Trust Me
|
| | |\ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Adding details to the documentation of custom storage format and related functions.
Task-number: 207865
Rev-by: David Boddie
Rev-by: Marius Storm-Olsen
|
| | |/
| | |
| | |
| | | |
Reviewed-by: Trust Me
|
| |/
| |
| |
| | |
Task-number: 246789
|
| |
| |
| |
| | |
Task-number: 252491
|
| |
| |
| |
| | |
current interval in the variant animations
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It is often desirable, when doing connection, to ensure that the same
connection is only made once. This can be done with the
Qt::UniqueConnection 'flag'
Also documented the order the slot are called
Reviewed-by: Brad
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
You can't implicitly convert QLatin1Char to QString and thus neither to
QFileInfo. Instead do the conversion the correct way, as illustrated by
the code five lines above the line that broke.
Reviewed-by: Lincoln Ramsay
Reviewed-by: Andy Shaw
|
| |
| |
| |
| |
| |
| |
| | |
Fix: Make sure to add the prefix to the value we return in QLibraryInfo
Task-number: 254545
Reviewed-by: Trenton Schulz
|
| |
| |
| |
| |
| |
| |
| | |
QFileInfo doesn't have a constructor for QLatin1Char and implicit
conversion didn't work.
Reviewed-by: Thierry
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
the same type as the property
For example, if you set a start value of 0 (integer) for a qreal
animation, it would not work.
Reviewed-by: janarve
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Use the same pattern for protecting the dump function as
qmap.h and qhash.h employ.
|
| | |
|
| |
| |
| |
| | |
...hopefully
|
| |
| |
| |
| |
| | |
Now you can opt it out to save disk space (for embedded).
Also tested it and fixed code in state machine.
|
| |
| |
| |
| | |
simply added Q_UNUSED for parameters that weren't used in a function
|
| |
| |
| |
| |
| |
| |
| | |
Wherever I found that we were using a string instead of a single char
I fixed the code.
Reviewed-by: olivier
|
|\ \
| |/
| |
| |
| | |
Conflicts:
src/corelib/kernel/qsharedmemory_unix.cpp
|
| |
| |
| |
| | |
Reviewed-By: Oswald Buddenhagen
|
| |\ |
|
| | |
| | |
| | |
| | |
| | | |
Task-number: 254333
Reviewed-by: Andy Shaw <qt-info@nokia.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When connecting to an open file descriptor, set the openMode in the file
system engine, as is done for file handles.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This gets temporary file renaming working on Windows, without requiring
block-copying.
While we could #ifdef this behavior for Windows, it's preferrable to
maintain consistency in the exposed interface.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With recent changes to QTemporaryFile, allowing the file to be closed,
the engine has to keep track of whether a fileName has already been
generated, so we don't generate new files after the first one.
If the file is closed but we already have a name for it, then just
forward the call to the base file engine.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | | |
Lifetime of the engine is already handled by the native engine.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In some circumstances, the file descriptor in QTemporaryFile is actually
closed and setOpenMode alone won't give us reOpen semantics.
Added function to QTemporaryFileEngine that checks if we have open file
handles. On open, if we currently hold no handles, re-open the file.
Trying to open a new file while we hold open handles would lead to
leaks, so added an assert there, to be on the safe side.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Although QTemporaryFile hides QFile::open(OpenMode), this function is
still available when accessing instance methods through the base class.
Unconditionally setting ReadWrite allows the temporary file to be
re-opened with different flags.
Task-number: 248223
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For now, this only happens if Append mode is requested and we're unable
to seek to the end of the file. Theoretically, this could change in the
future so it's better to err on the safe side.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We souldn't be returning an empty string for the fileName, just because
the file is closed. E.g., after a rename, the file will be closed, but
should still have a name.
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Note: this showed even if the file descriptor was kept open.
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | | |
Reviewed-by: MariusSO
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fallback implementation for rename operation should try to copy
permissions from the original file to the destination file. Note that
failures at this point are not treated as errors.
Errors previously set by the native fileEngine are also reset before
returning.
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Also added check in test case for rename fallback.
Task-number: 165920
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Changed the fallback implementation to use 'this' instead of a new
QFile. This allows a QTemporaryFile to be block-copied to the
destination and the source to be removed (QTemporaryFile is special
because it isn't really closed).
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Block copying a sequential file is potentially a destructive operation,
because there is no guarantee copy+remove will succeed. In these cases
the fallback should not be tried.
The user is better equipped to decide how to handle such failures and to
ensure no data losses occur, e.g., copy without removing the original
file.
Reviewed-by: MariusSO
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago
|