summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix build with MSVC2003: apparently the code path I thought was Unix was ↵Thiago Macieira2009-07-021-3/+3
| | | | also older MSVC
* Revert "Add support for creating the object alongside the Data structure in ↵Thiago Macieira2009-07-021-47/+0
| | | | | | | | | | | | | | | | QSharedPointer" This reverts commit fb51a10ee0451274a430227566ae26efb2ac4474. Sorry, it didn't work. I can fix the MSVC error, but the problem is that older GCC versions (4.2) fail with the following code: template<typename T> struct Buffer { char buffer[128] __attribute__((aligned(__alignof__(T)))); }; The same works fine in GCC 4.4.
* Experimental: allow QSharedPointer to be used with forward declarations that ↵Thiago Macieira2009-07-021-1/+1
| | | | | | | | | | | | | are declared in this file. The one-definition rule allows the forward declaration appearing below to apply to code that was earlier. Therefore, if the compiler finds out how to delete the object, we can allow a QSharedPointer of a forward- declared-type. This means the actual problem is just a warning with g++. To catch the error, we need a separate .cpp file and I'd rather run this as an external test.
* Add support for creating the object alongside the Data structure inThiago Macieira2009-07-021-0/+47
| | | | | | | | | one go. This avoids one memory allocation. Currently, we only support calling the default constructors. I will *NOT* implement argument passing for C++03. I will implement it with rvalue references for C++0x-capable compilers.
* Add qobject_cast for QSharedPointer.Thiago Macieira2009-07-023-0/+110
| | | | | | | | | This obviously only works for classes that derive from QObject. And you must remember that QSharedPointer controls the QObject's lifetime, not the QObject parent-child relationship. Reviewed-by: dt Reviewed-by: Bradley T. Hughes
* Use the safe versions of the network system calls I have just added.Thiago Macieira2009-07-022-1/+75
| | | | Reviewed-By: ossi
* Add a properly-safe version of select(2).Thiago Macieira2009-07-023-43/+159
| | | | | | | | Do the timeout handling the right and cross-platform way. The code that was in QProcess worked only on Linux, where the kernel sets the remainder in the returned timeval structure. Reviewed-By: ossi
* Port QProcess to use the EINTR-safe and thread-safe functionsThiago Macieira2009-07-021-148/+65
| | | | Reviewed-By: ossi
* Use the safe versions in these system calls I've just introduced.Thiago Macieira2009-07-024-16/+21
| | | | Reviewed-By: ossi
* Make the inotify_init call also use FD_CLOEXEC-safe version of theThiago Macieira2009-07-021-3/+37
| | | | | | system call Reviewed-By: ossi
* Port most uses of ::open and QT_OPEN to the safe version.Thiago Macieira2009-07-026-25/+24
| | | | | | | This ensures that we're calling the open64 version of this function as well as handling the O_CLOEXEC flag and EINTR errors. Reviewed-By: João Abecasis
* Add qcore_unix_p.h containing mostly safe versions of Unix functions.Thiago Macieira2009-07-022-0/+247
| | | | | | | | | | | | | | | Most of these functions are from unistd.h and need to have a loop around the actual call because the calls can be interrupted by a signal delivery. Some special calls (open, dup2, pipe) require an extra flag to support thread-safe execution: the file descriptor must be created from the operating system with the FD_CLOEXEC flag already set. The O_CLOEXEC flag is specified in POSIX.1-2008, but the rest is Linux-specific. Reviewed-By: João Abecasis
* Merge branch 'research/qdbus-improvements'Thiago Macieira2009-07-021-5/+18
|\
| * Use an "int status" extra parameter in property reading/writing.Thiago Macieira2009-07-021-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling qt_metacall with the ReadProperty or WriteProperty, the data is on argv[0] like it was before, but now the QVariant itself is on argv[1] and there's an extra parameter in argv[2] which the meta code can use to indicate result. This allows QtDBus to process properties much more easily. In the case of property reading, we need to be able to modify the variant itself, because copying types when we don't have the data isn't very easy. As for setting, we need to be able to tell setProperty to return true or false depending on whether we succeeded in setting the property or not. Reviewed-By: Kent Hansen Reviewed-By: Marius Bugge Monsen
* | add support for attaching meta data to translatable messagesOswald Buddenhagen2009-07-021-0/+28
| | | | | | | | Requirement: QT-457
* | Merge branch '4.5'Thiago Macieira2009-07-022-6693/+6694
|\ \ | |/
| * Fixed the build on Windows after regenerating the unicode tables.Denis Dzyubenko2009-07-011-2/+2
| | | | | | | | Reviewed-by: trustme
| * Regenerated unicode tables after the fix in the generator.Denis Dzyubenko2009-07-012-6693/+6694
| | | | | | | | | | | | | | This is related to the following fix: 70137e0601549af1056082cdfbb4f141c70befab Reviewed-by: trustme
* | QAnimation: fix a jump in values when restarting an animationThierry Bastian2009-07-011-26/+21
| |
* | Animation: fixed a NOTIFY signal name that was wrongThierry Bastian2009-07-011-1/+1
| | | | | | | | Also slightly updated a demo
* | QNAM: Direct transfer of HTTP buffer to the QNetworkReply bufferMarkus Goetz2009-07-011-1/+46
| | | | | | | | | | | | | | Directly put a QRingBuffer from one QRingBuffer to another QRingBuffer. Reviewed-by: Thiago Macieira
* | Make the macros QT_WA & QT_WA_INLINE only use the unicode partMarius Storm-Olsen2009-07-011-10/+2
| | | | | | | | | | Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | src/qt3support: Remove QT_WA and non-Unicode code paths, dropping Win9x and ↵miniak2009-07-011-0/+9
| | | | | | | | | | | | | | NT support Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | src/gui: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT supportminiak2009-07-012-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Also - Make winPeekMessage() & winPostMessage() obsolete - FlashWindowEx, IsValidLanguageGroup functions no longer resolved dynamically (available on >= Windows 2000) - LoadIcon/LoadCursor -> LoadImage w/LR_SHARED for system icons/cursors - qsystemtrayicon_win: use Shell_NotifyIconGetRect if available (Windows 7) Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | Handle application paths larger than MAX_PATH, and fix potential buffer overflowMarius Storm-Olsen2009-07-012-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | These days we can easily get very long paths, so we should support application paths as long as needed. There was also a potention exploit in that if the path was MAX_PATH or larger, the string would not be \0 terminated (see MSDN docs for GetModuleFileName), and thus cause problems in QString::fromWCharArray(). Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | src/corelib: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT ↵miniak2009-07-0128-1340/+554
| | | | | | | | | | | | | | | | | | | | | | | | support Also: QString::fromUtf16() -> QString::fromWCharArray() WCHAR & TCHAR -> wchar_t LPTSTR/LPCTSTR -> LPWSTR/LPCWSTR Documentation update Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
* | Merge branch '4.5'Marius Storm-Olsen2009-06-301-1/+2
|\ \ | |/
| * QTemporaryFile: Report the user-provided openModeJoão Abecasis2009-06-291-1/+2
| | | | | | | | Reviewed-by: Thiago
* | Initialize the time structure in QTime::currentTime()Benjamin Poulain2009-06-291-2/+1
| | | | | | | | | | | | | | | | In QTime::currentTime(), the pointer to the tm structure was used without being initialized. Task-number: 256889 Reviewed-by: Markus Goetz
* | Merge branch '4.5'Thiago Macieira2009-06-282-5/+9
|\ \ | |/
| * Fix detection of the ELF interpreter on Linux.Thiago Macieira2009-06-282-5/+9
| | | | | | | | | | | | The path /lib/ld-linux.so.2 is correct for i386 only, possibly some other archs. But on x86-64, it's usually ld-linux-x86-64.so and it can be in either /lib or /lib64.
* | Fixed a gcc 4.4 warning on switching a value outside the enum.Thiago Macieira2009-06-262-8/+13
| | | | | | | | | | These four enum values are used in variables of type Section, but aren't in it. With gcc 4.4, it displays a warning that the value is lower than the lowest value
* | De-export the ThreadEngineBarrier class and de-inline the call to acquire.Morten Sørvig2009-06-262-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (ThreadEngineBarrier was implemented in the header as ThreadEngineSemaphore in Qt 4.4 and Qt 4.5, and exported for a brief time in the Qt master branch. ) Unfortunately the inline call to acquire means that applications compiled with Qt 4.4. and Qt 4.5 will contain a copy of the old implementation. This is BC as long as the memory layout of the ThreadEngineBarrier class stays the same, which means that we keep the QMutex member variable. The old version of acquire will no longer be thread-safe since the new version doesn't lock the mutex, but this is fortunately not a problem; the only place it's called is in startAsynchronously() before the worker threads are started.
* | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-261-57/+19
|\ \
| * | Clean up QSharedPointer cast implementations.Thiago Macieira2009-06-261-57/+19
| | | | | | | | | | | | | | | | | | | | | There's no need to have separate cast-checker functions, plus the cast- and centralise the function to create the object. Reviewed-by: TrustMe
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-262-2/+31
|\ \ \ | |/ /
| * | Add some macro expressions to qglobal.h for typeof, alignof and aligned().Thiago Macieira2009-06-261-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | These expressions aren't used anywhere yet, but I am sure we will find use for them very soon now. I checked the compiler manuals for the three commercial Unix compilers to verify which versions support these macros. Reviewed-by: Bradley T. Hughes
| * | QVariant::setValue had a bug when changing its typeThierry Bastian2009-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | If it was shared and you then set it back to an int type, it is still marked as shared,. This might even lead to crashes. The patch was sent through gitorious by Jürgen Starek. Note: autotest added as well
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-261-1/+7
|\ \ \ | |/ /
| * | Merge branch '4.5'Thiago Macieira2009-06-261-1/+7
| |\ \ | | |/ | | | | | | | | | | | | | | | Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/network/access/qnetworkreplyimpl.cpp
| | * make invokable constructors work with classes in namespaceKent Hansen2009-06-251-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the fully qualified classname at relevant places in the moc-generated code. Also, QMetaObject::newInstance() needs to strip the namespace part, since the constructor signatures don't contain the fully qualified name. Task-number: 246064 Reviewed-by: Simon Hausmann
| | * Bump Qt version number.Jason McDonald2009-06-251-2/+2
| | | | | | | | | | | | Reviewed-by: Trust Me
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-263-3/+7
|\ \ \ | |/ /
| * | Merge branch '4.5'Thiago Macieira2009-06-252-2/+6
| |\ \ | | |/ | | | | | | | | | | | | Conflicts: src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
| | * Change QSharedPointer to track (or not) pointers when the #define isThiago Macieira2009-06-252-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | enabled. This allows mixing of debug and non-debug code (possible on Unix systems) without causing assertion failures. Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
| * | don't crash when QTextCodec::codecForUtfText() is passed -1 bytesKent Hansen2009-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible that the function gets called with a bytearray of size -1 (for example, by QTextStreamPrivate::fillReadBuffer()). Since the size was erroneously cast to a uint, the subsequent comparison (arraySize > 3) succeeded and caused a crash. Reviewed-by: Denis Dzyubenko
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-253-6/+5
|\ \ \ | |/ /
| * | Add Q_CORE_EXPORT to ThreadEngineBarrierRhys Weatherley2009-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The ThreadEngine template uses functions from ThreadEngineBarrier, so ThreadEngineBarrier must be exported to other libraries/programs that instantiate the template. Reviewed-by: trustme
| * | Merge branch '4.5'Thiago Macieira2009-06-242-5/+4
| |\ \ | | |/ | | | | | | | | | Conflicts: tests/auto/qsqldatabase/tst_databases.h
| | * Fix comparison of different-sized QStringRefs.Thiago Macieira2009-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | Two strings are only equal if they have the same size. Task-number: 256763 Reviewed-by: TrustMe