summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fixed compile with MinGW.Rohan McGovern2009-05-291-3/+3
| | | | | MinGW 3.4.5 can't figure out the automatic QLatin1Char -> QString conversion in this code.
* Export symbol needed by the declarative module.Michael Brasser2009-05-281-1/+2
| | | | Reviewed-by: Leo
* Introduce a new class QStringBuilder to speed up the creation ofhjk2009-05-285-3/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Compile fix with namespaces.hjk2009-05-281-2/+0
|
* QStateMachine: better way to get the sender signalIndexOlivier Goffart2009-05-281-18/+7
| | | | | | | | | | | | 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
* improved string operations all over the placeThierry Bastian2009-05-289-15/+15
| | | | | used character operations whenever possible better usage of QLatin1String
* Use Qt::UniqueConnection instead of disconnect/connectOlivier Goffart2009-05-281-2/+1
| | | | | | | Also fix an issue in QTreeView where a signal could be connected several times Reviewed-by: Thierry
* Compile qstatemachine autotestOlivier Goffart2009-05-281-1/+1
|
* Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-05-278-37/+135
|\ | | | | | | | | Conflicts: tests/auto/qtreeview/tst_qtreeview.cpp
| * Fixed aliasing pointer corruption in QDataStream.Trond Kjernaasen2009-05-271-15/+77
| | | | | | | | | | | | | | | | | | | | | | 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
| * qdoc: Indicate what iterator_categor means for container classes.Martin Smith2009-05-262-4/+8
| | | | | | | | Task-number: 245501
| * Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5Martin Smith2009-05-263-5/+12
| |\
| | * Doc: Miscellaneous documentation fixes for Qt 4.5.x and later.David Boddie2009-05-251-2/+0
| | | | | | | | | | | | Reviewed-by: Trust Me
| | * Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5David Boddie2009-05-251-2/+11
| | |\
| | | * Adding details to QSettings functionsMorten Engvoldsen2009-05-251-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding details to the documentation of custom storage format and related functions. Task-number: 207865 Rev-by: David Boddie Rev-by: Marius Storm-Olsen
| | * | Doc: Fixed terminology.David Boddie2009-05-251-1/+1
| | |/ | | | | | | | | | Reviewed-by: Trust Me
| * | qdoc: Indicate that qAbs(T& v) compares v to a 0 of type T.Martin Smith2009-05-261-12/+37
| |/ | | | | | | Task-number: 246789
| * qdoc: Added some missing qdoc comments.Martin Smith2009-05-251-1/+1
| | | | | | | | Task-number: 252491
* | small refactor to change the interpolator at the same time as theThierry Bastian2009-05-274-34/+40
| | | | | | | | current interval in the variant animations
* | Add a flag that ensure that a connection is made only oneOlivier Goffart2009-05-272-10/+29
| | | | | | | | | | | | | | | | | | | | 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
* | Fix WinCE compile error not fixed by c666b88Jason McDonald2009-05-271-1/+1
| | | | | | | | | | | | | | | | | | 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
* | Mac: Prefix sat in qt.conf is ignored on MacRichard Moe Gustavsen2009-05-261-8/+8
| | | | | | | | | | | | | | Fix: Make sure to add the prefix to the value we return in QLibraryInfo Task-number: 254545 Reviewed-by: Trenton Schulz
* | Windows CE compile fixJoerg Bornemann2009-05-261-1/+1
| | | | | | | | | | | | | | QFileInfo doesn't have a constructor for QLatin1Char and implicit conversion didn't work. Reviewed-by: Thierry
* | Fixed a bug in animation when you set a start value that doesn't haveThierry Bastian2009-05-261-3/+7
| | | | | | | | | | | | | | | | | | 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
* | Fixed keywords signals and slots to Q_SIGNALS and Q_SLOTSThierry Bastian2009-05-264-4/+4
| |
* | Fixed docs warnings for Animation APIThierry Bastian2009-05-263-6/+15
| |
* | Protect dump function by ifdef.Ian Walters2009-05-252-1/+11
| | | | | | | | | | Use the same pattern for protecting the dump function as qmap.h and qhash.h employ.
* | Some refactoring of windows specific code + a private class of animationsThierry Bastian2009-05-256-50/+44
| |
* | Removed some export to symbols that don't need itThierry Bastian2009-05-257-27/+11
| | | | | | | | ...hopefully
* | Added QT_NO_ANIMATION to qfeaturesThierry Bastian2009-05-252-4/+17
| | | | | | | | | | Now you can opt it out to save disk space (for embedded). Also tested it and fixed code in state machine.
* | Warnings fixed on MSVCThierry Bastian2009-05-251-1/+3
| | | | | | | | simply added Q_UNUSED for parameters that weren't used in a function
* | Fixed 'crazy' warnings about using a string instead of a characterThierry Bastian2009-05-2522-82/+80
| | | | | | | | | | | | | | Wherever I found that we were using a string instead of a single char I fixed the code. Reviewed-by: olivier
* | Merge branch '4.5'Thiago Macieira2009-05-228-129/+223
|\ \ | |/ | | | | | | Conflicts: src/corelib/kernel/qsharedmemory_unix.cpp
| * Fix syntax of the fcntl system call: this is not setsockoptThiago Macieira2009-05-221-6/+3
| | | | | | | | Reviewed-By: Oswald Buddenhagen
| * Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5Martin Smith2009-05-228-61/+114
| |\
| | * Fixed compilation with -qtnamespaceMarkus Goetz2009-05-224-7/+9
| | | | | | | | | | | | | | | Task-number: 254333 Reviewed-by: Andy Shaw <qt-info@nokia.com>
| | * Reset openMode to NotOpen when returning false from QFile::open()João Abecasis2009-05-221-0/+9
| | | | | | | | | | | | | | | | | | | | | When connecting to an open file descriptor, set the openMode in the file system engine, as is done for file handles. Reviewed-by: Thiago
| | * QTemporaryFile: really close files before renamingJoão Abecasis2009-05-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * QTemporaryFileEngine now tracks if a fileName has been generatedJoão Abecasis2009-05-221-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * QTemporaryFile: there's no need to keep another pointer to the engine hereJoão Abecasis2009-05-221-4/+1
| | | | | | | | | | | | | | | | | | Lifetime of the engine is already handled by the native engine. Reviewed-by: Thiago
| | * QTemporaryFile: really (re)open file if it has been really closed...João Abecasis2009-05-221-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Unconditionally open temporary files in ReadWrite modeJoão Abecasis2009-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * QTemporaryFile: handle failures from QFSFileEngine::open(mode, fd)João Abecasis2009-05-221-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Documentation fixJoão Abecasis2009-05-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
| | * QTemporaryFile would forget fileName while file was "closed"João Abecasis2009-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | | Note: this showed even if the file descriptor was kept open. Reviewed-by: Peter Hartmann Reviewed-by: Thiago
| | * QTemporaryFile: don't clear filePath if remove failsJoão Abecasis2009-05-221-3/+5
| | | | | | | | | | | | | | | | | | Reviewed-by: MariusSO Reviewed-by: Peter Hartmann Reviewed-by: Thiago
| | * QFile::rename fallback: reset permissions and error state on successJoão Abecasis2009-05-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * QFile::copy: close source file when using fallback mechanismJoão Abecasis2009-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | Also added check in test case for rename fallback. Task-number: 165920 Reviewed-by: Thiago
| | * Allow renaming QTemporaryFiles on windowsJoão Abecasis2009-05-221-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Don't block copy sequential files in QFile::renameJoão Abecasis2009-05-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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