summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate QDesktopServices::storageLocation/displayNameDavid Faure2011-10-235-68/+28
| | | | | | | Which required porting the related unittests to qstandardpaths Change-Id: I6eb63c46845f05cd29cc42b59872707526277c90 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Make some qtestlib headers private.Jason McDonald2011-10-2313-35/+92
| | | | | | | | | These headers should have been private from Day One. Make them private now so that nobody will be tempted to use them outside testlib in the future. Change-Id: I5361777ade124d8187176f9af3cc79cd1a8ecb4f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "duplicate objective-c class" warning.Morten Sorvig2011-10-231-0/+5
| | | | | | | | | | | Qt would dlopen both libqcocoa.dylib and libqcocoa_debug.dylib, causing duplicate implementations if the classes in the cocoa plugin (QNSView etc) Fix this by building the release version only. Change-Id: I1244a83c49999ce28edd97400e792fa2a0665fec Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: clean up compiler warnings.Morten Sorvig2011-10-237-35/+19
| | | | | Change-Id: I2cb65bb455b79b218a317b21e5a3b0d9792e0e22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add the missing unittestDavid Faure2011-10-232-0/+294
| | | | | Change-Id: I2384d9de7b9ef409db521087670070bd5afc85ff Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Rename storageLocation() to writableLocation().David Faure2011-10-236-15/+15
| | | | | Change-Id: I8f6522a70950f78ddd6141360d36d104bd697e28 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Add QStandardPaths::RuntimeLocation, for sockets ($XDG_RUNTIME_DIR)David Faure2011-10-235-7/+42
| | | | | Change-Id: I19c36a04a9deae49ffc20fdec6a2a7eb05155cb4 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Add QStandardPaths::findExecutable.David Faure2011-10-233-14/+92
| | | | | Change-Id: If30a83622e2ac5af48e47a38b8f70fce73044d74 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Check QFileInfo::isExecutable for symlinks, works as intended.David Faure2011-10-231-1/+18
| | | | | Change-Id: I35acce7ba0e111f651864b9d16abf1bac1923f22 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* QStandardPaths: add Config and GenericData, add methodsDavid Faure2011-10-236-74/+298
| | | | | | | New methods: standardLocations, locate, locateAll. Change-Id: I60bc90f8df53727a72c4b1839ea4d1d88a204e29 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Move path information from QDesktopServices (gui) to QStandardPaths (core)David Faure2011-10-2312-435/+701
| | | | | Change-Id: Ic596c21894d83b4dab0c3f5b1aed916ddd590f2f Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* QWindow: Re-create platform window only if screen actually changes.Friedemann Kleint2011-10-221-6/+10
| | | | | Change-Id: I3b7dd8b1307aa3cc9357dca861ea407644c5a2e9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add virtual QWindow::focusObject() methodLars Knoll2011-10-224-5/+23
| | | | | | | | | | The method allows to retrieve the object that currently has the input focus inside the Window. This is e.g. required to correctly determine the context for keyboard shortcuts. Change-Id: I9e05ef62717973bac275ce34cc70fb86aa2d1e5b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix two typos: docu for "deprecated since" and Q_DEPR... -> QT_DEPR...David Faure2011-10-222-2/+2
| | | | | | | | Shows that there should be an automated build with QT_DISABLE_DEPRECATED_BEFORE set to 0, too... Change-Id: If154786ea26bcbfab41efcd7001c222cc258a8af Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Compile with clangBradley T. Hughes2011-10-221-2/+2
| | | | | | | | | | When using methods from a template base class, the lookup needs to be qualified. See http://clang.llvm.org/compatibility.html#dep_lookup_bases Change-Id: I5b7cd71e0d45414ac0eff97fe9ba5d3ccd5bd9e6 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Add Q_DECL_CONSTEXPR to a QChar, QLatin1Char and QLatin1String constructorsThiago Macieira2011-10-222-26/+19
| | | | | | | | These types now technically are trivially-constructible and standard-layout in C++0x. Change-Id: I455bd905fd6e237a1dff517b86dcbe59d571266f Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Make the default install path point to /usr/local/Qt-$VERSIONLars Knoll2011-10-211-15/+1
| | | | | | | | | | | Remove Trolltech from the default install path. Since QPA is the default now, so we don't need to treat it specially from regular Qt versions. It is the regular Qt version. Change-Id: I0bde75c90d2d5944be192e1249bc1a9371c70fcb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Off-by-one error in assert condition...João Abecasis2011-10-211-1/+1
| | | | | | | | | | | While this was safe, it was also over-zealous, disallowing the path from ending with the placeholder... Incidentally, the default. Laughed-at-by: w00t_ (cherry picked from commit 7b693627ee2a17718cb6d8bee5e3deb5a97b307f) Change-Id: I61a1511bca5cafe2edde20ef38c23154200dfcab Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Leftovers from 401722ef9e6fe79bd41f9d5f79668f5c4997c8e6João Abecasis2011-10-211-14/+0
| | | | | | | | | | | This no longer necessary template specialization went unnoticed inside the Windows/Symbian #ifdef. It breaks compilation on those platforms, now that qstringbuilder.h is not included and QConcatenable is unknown to the compiler. (cherry picked from commit 9e656ce0f7bda4bca4ae55a7aefe1617bc2805ac) Change-Id: Ie7145c25bca01b808fa6a3fd99e34baa8375d304 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fix QTemporaryFile regressions and new found issuesJoão Abecasis2011-10-212-50/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, the file template is always processed in original QString format. Trying to generate native paths before adding a missing placeholder mask could change the meaning of templates, such as "." and "..", which are now tested to mean "..XXXXXX" and "...XXXXXX", respectively. After ensuring the template includes a placeholder mask, the path is converted to a native *absolute* file path and the mask is sought for again. On Windows, native paths were already absolute. On Symbian, we'd need at least a clean path, as "." and ",," are not natively understood. There is a requirement that the placeholder mask /XXXXXX+/ makes it through this conversion unaltered, which relaxes prior requirements on *nix platforms. On Windows and Symbian the conversion is under Qt's control and not user-configurable. Reviewed-by: Shane Kearns (cherry picked from commit 401722ef9e6fe79bd41f9d5f79668f5c4997c8e6) Conflicts: tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp Change-Id: Iac823881c865adf0931dc4f429c6c1ef135eeb56 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Use "native paths" on POSIX platforms as wellJoão Abecasis2011-10-211-27/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | And don't rely solely on "local8Bit" conversions. QFile defines an API for overriding how encoding conversions are done for filenames. In generating unique names, QTemporaryFile ignored that API and hardcoded the use of local 8-bit, implicitly assuming that that was appropriate. With this change, we switch that assumption to one where user supplied encoding function keeps the byte value of 'X' and '/', also assuming that encoded 'X' takes up a single-byte (i.e., the byte sequence for "XXXXXX" remains unchanged). There was also, and there still is an assumption in name generation that byte values for ASCII alpha-numeric characters are valid in the "native" encoding. In practice this change is compatible with UTF-8, Latin-1 and other ISO/IEC 8859 encodings. At any rate, it's very likely that only UTF-8 is relevant here. Reviewed-by: Denis Dzyubenko (cherry picked from commit 0de701d01cb221464eed773fd3751aff73fe4d60) Change-Id: I9ee0fe8e3cad48694d5ec9a2bedd5412cfc0d172 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Cleanup #includesJoão Abecasis2011-10-211-2/+0
| | | | | | | | These are already required and included by qfsfileengine_p.h. (cherry picked from commit a153d50eea2dea0925695a90af2c12f1887a9020) Change-Id: I9efb635373239f6e6778eb4a3ee85c396cfeeeb5 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Atomic implementation of create file and obtain handle for Win/SymbianJoão Abecasis2011-10-212-60/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides generating a unique name, createFileFromTemplate now also acquires a file handle on all platforms. The file engine's native handle is passed by reference and modified in place. This fixes a long standing security issue on Windows. On Windows and Symbian platforms we directly use the "native" file path when processing the template and generating the unique name. Since the native encoding is known, conversions at this point are safe. Errors other than "file exists" are propagated to Q(Temporary)File, and result in a failure in open(). The changes also unify error handling and should give consistent behaviour across all platforms. Worthy of note, there's a change in behaviour on Windows and Symbian: fileNames returned by QTemporaryFile on Windows and Symbian are always absolute after open has been called. This has to do with how QFileSystemEntry::nativeFilePath works on these platforms. (Test was updated to reflect change in behaviour.) Reviewed-by: Gareth Stockwell Reviewed-by: Shane Kearns (cherry picked from commit ff9b69838ec146aeb43d4af8a03043f9c5f0454d) Conflicts: tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp Change-Id: Ibc9affb321ea4f4b193efc1f7336c9770b43d8df Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Minimize encoding conversions when generating unique file nameJoão Abecasis2011-10-211-15/+54
| | | | | | | | | | | | | | | | With minor adjustments, createFileFromTemplate is made to work directly on (UTF-16) QString data, which is already in the native encoding for Windows and Symbian. This is possible because the function only fills out the placeholder sub-string, without touching adjacent characters. This eliminates unnecessary conversions on those platforms. Reviewed-by: Gareth Stockwell Reviewed-by: Shane Kearns (cherry picked from commit 9a76587363a2f37312326286e08cce502f7fe27e) Change-Id: I8732b88ece5e2befb2da2e717758954c9aa7e5b0 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Use QStringBuilder when copying template for modificationJoão Abecasis2011-10-211-15/+47
| | | | | | | | | | | | | | | | | This avoids modifying the original string in the case where a placeholder marker is not found. By marking the variable const we further avoid checks on the reference count and detaches, also allowing us to safely reuse it later in the function. The new approach also fixes an issue where suffix wasn't empty, but the toLocal8Bit conversion would be. This resulted in a buffer overflow inside createFileFromTemplate. Reviewed-by: Shane Kearns (cherry picked from commit d71d3b1ce31ffc585258330d825ff8ea535254ef) Change-Id: I6cb3fbc6c653d8a881426fddbc433826365d4816 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Make Symbian follow Windows code in temporary path generationJoão Abecasis2011-10-211-8/+5
| | | | | | | | | | | | | | | | | On the one hand, we stop using OpenC here. On the other, we no longer use an atomic create and obtain file handle API -- just as we don't on Windows yet. This is a stepping stone to removing back and forth conversions of path names when generating unique names and also towards the use of native APIs for creating and obtaining a file handle atomically. Reviewed-by: Gareth Stockwell Reviewed-by: Shane Kearns (cherry picked from commit 63bb67d3107b03f399cddf4c9cca9c7eb347b62d) Change-Id: I97b3b6179dff053807acc8d4469fdf57f57f68a6 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Encapsulate pointer manipulations to createFileTemplate functionJoão Abecasis2011-10-211-15/+18
| | | | | | | | | , where we actually control how we use the pointers. Reduce some code duplication in #ifdefs. (cherry picked from commit d69788728ccd843e3d4a372680185fdf5e711c86) Change-Id: I50aafbcac520837f9dc751e85f59a482a2f5225f Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Widgets: Remove Q_WS_QPA and qpa-sections from .pro files.Friedemann Kleint2011-10-2129-763/+60
| | | | | | | | | | | | Enable compilation without -qpa. - Remove conditionals from Q_WS_QPA sections. - Rename precompiled header. - Remove gui-related Q_OS_SYMBIAN-#ifdef sections. - Leave other Q_WS code in for reference. Change-Id: I16326b631fff483aec8edd2f7a2e7a1822eab814 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* [directfb] Implement grab/ungrab of keyboard/pointerHolger Hans Peter Freyther2011-10-212-0/+26
| | | | | Change-Id: Ie2b99bb659e324c63bfd23e96d6c89c13a8df3b4 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Remove grabbing of the pointer on inputHolger Hans Peter Freyther2011-10-211-5/+0
| | | | | | | | This should not be done on the input level but we should handle the requests on the QWindow to grab/ungrab the pointer Change-Id: Ibc61b300bf8de20f576fb8972fadf18de4a142c1 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Implement QPixmap::fromFile using DirectFB routinesHolger Hans Peter Freyther2011-10-212-0/+114
| | | | | | | | | | The code is based on Qt 4.8 DirectFB support, it was reduced in size (cosmetic changes, by using the outPtr()) and it has a bugfix to pass loadAsBitmapOrPixmap that assumes the loadFromFile routine will add '.png' and other extensions to the file. Change-Id: I25b11206053c02be5c04730fba5bb42bd07426d1 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Prepare to select the alpha/opaque pixel formatsHolger Hans Peter Freyther2011-10-212-2/+21
| | | | | | | | | Right now we assume to use 32bpp but depending on the hardware this might not be optimal at all. Begin to prepare the code for not having a 32bpp surfaces. Change-Id: Iedfa49c568559e074dfaeae2a216c9eb93721d2c Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Manage the font database with a QScopedPointerHolger Hans Peter Freyther2011-10-212-2/+2
| | | | | | | Attempt to fix a memory leak on exit by deleting the font database. Change-Id: I07b0865c97bb8ef26950bf231b5239ca01e95c56 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Remove some duplication in the QDirectFbBlitter c'tor.Holger Hans Peter Freyther2011-10-211-8/+11
| | | | | | | | Introduce dfb_blitter_capabilities that returns the QBlittable::Capabilities of the DirectFB blitter. Change-Id: Ifb803ff4f07376d5333ad2d05ff72d9a63d17fff Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* directfb: Initialize m_dfb after DirectFBInit has been calledHolger Hans Peter Freyther2011-10-211-2/+4
| | | | | | | | | | The QDirectFBIntegration is responsibe for deleting the DirectFB instance but it can only initialize the DirectFB instance after the DirectFBInit has been called. Change the order. This issue got introduced by myself in 3faa89f4. Change-Id: Ia67d439152d895e2e0a47f35eed57348c629f79f Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Introduce the QDirectFBPointer from QWS/gfxdriversHolger Hans Peter Freyther2011-10-2114-93/+126
| | | | | | | | | | Introduce QDirectFBPointer and use it throughout the code to fix various resource leaks in the DirectFB backend. Fix the surface ownership of the IDirectFBSurface in the Blittable/BackingStore code. Change-Id: I0d4572eaab80b3558e644f26d76222461bf37bbb Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Make QDirectFBInput a QThread to allow proper exitsHolger Hans Peter Freyther2011-10-213-29/+18
| | | | | | | | | | | | | | | | Without this patch the application will get stuck waiting for the IDFBEventBuffer to report an event. We will use the IDFBEventBuffer::WakeUp function to interrupt the waiting but this produces the below error on exit: QEventLoop: Cannot be used without QApplication QThread: Destroyed while thread is still running This is solved by making the QDirectFBInput a QThread, reimplement the run() method to handle the events. It should work as this is only posting events to the QApplication event loop. Change-Id: I24adf2b080f96c72ede6a5499f484ac33fdd44fc Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Use QScopedPointer to manage heap allocated objectsHolger Hans Peter Freyther2011-10-217-33/+16
| | | | | | | | | | | Use QScopedPointer to avoid trying to manually delete objects. For some of the cases the leak would only be viewable when things are getting shut down. Leave in some more warnings for cleaning it up, e.g. the m_eventBuffer of the Input is leaked and the input task will only stop after another key event. Change-Id: Ic54568343605b4ab7094a7dece40e22250184a37 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Fix memory leak when passing arguments to directFBHolger Hans Peter Freyther2011-10-211-0/+3
| | | | | | | We need to delete the array but also the elements inside it. Change-Id: Ib61beeca569802638b9ff3b94ede79c0beebb399 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Do not call a pure virtual functionHolger Hans Peter Freyther2011-10-211-2/+0
| | | | | | | | | In 688d9f6ec0a0da5539a3d11fa1dc6e1ae0558cda the base class was changed from QWindowSurface to QPlatformBackingStore but QPlatformBackingStore::resize is pure virtual now. Change-Id: Ib36f177d80e9458e7e8e34f587e4554c0462e35c Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [directfb] Rename class from WindowSurface to BackingStoreHolger Hans Peter Freyther2011-10-215-17/+17
| | | | | | | | Catch up with the naming by renaming the file from windowsurface to backingstore, update the class names and include files. Change-Id: I1b16826b60c19490946a77f61518e18f8099adce Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* [blitter] Work on tst_QPixmap::clear()Holger Hans Peter Freyther2011-10-214-16/+45
| | | | | | | | | | | | | | | | | | | By default QPixmap may not hasAlphaChannel(), only if setMask() or fill() with a transparent color is called a QPixmap will hasAlphaChannel(). Make the QBlittablePlatformPixmap remember if there is an alpha channel, pass this as parameter in createBlittable to make it clear that this is required and not optional. Update the DirectFB plugin to handle this parameter to create a RGB32 or ARGB Surface depending on the alpha value, also only use PreMultiplied alpha when using ARGB. Separate the two constructors for the QDirectFbBlitter to either adopt a DirectFB Surface or to create one. Change-Id: I8abf82408ecd2d075fc6f241ace8be2a34ac56e7 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Fix compilation on HarmattanSimon Hausmann2011-10-211-9/+3
| | | | | | | | Commit 87274e272d2a854563066489e20d019b4e6320de removed the maemo "specific" bearer monitory example .ui file, but the .pro file wasn't updated. Change-Id: I9daa000fe3e4b69789519f53541c106d01748ffd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* [blitter] Generate a new serial number when resizing the pixmapHolger Hans Peter Freyther2011-10-211-0/+1
| | | | | | | | The raster pixmap is generating a new serial number when the pixmap is resized, do the same for the blitter code. Change-Id: I05c74df7ea0f3a99ec9c24dacb41562da21c2d6d Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Testlib: Fixed compilation with MSVC.Friedemann Kleint2011-10-211-0/+9
| | | | | | | MSVC does not like VA_ARGS tricks. Change-Id: I947dcb89e519c18a482a504725213a3f4d9670ff Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix compiler warnings when using QT_DEPRECATEDSergio Ahumada2011-10-211-0/+2
| | | | | Change-Id: If62cff5d1cbd1c8051d709db8747777606797056 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove mtdev dependency from the touchscreen QPA plugin.Laszlo Agocs2011-10-216-142/+145
| | | | | | | | | | There is no reason to enforce the usage of the mtdev library. As long as ABS_MT_TRACKING_ID is provided protocol type A is perfectly enough. This makes the plugin more suitable for embedded systems. Change-Id: I73ce4a1056a6dc27daacb69dc4761bca393a7e43 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* qmake: Replace Q_WS_WIN by Q_OS_WINFriedemann Kleint2011-10-212-2/+2
| | | | | Change-Id: I6c63cda81a15759294321696feffa1150bd2a315 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Use QBasicAtomicInt as a static variableShane Kearns2011-10-211-4/+4
| | | | | | | | | | | | QAtomicInt has a constructor, so QBasicAtomicInt needs to be used instead to allow compile time initialisation. Task-Number: QTBUG-20343 Reviewed-By: Olivier Goffart (cherry picked from commit 29495592d27505feff024d574e1333809794c304) Change-Id: Ia531c74f47daa86ba24a1b01bee36ddb1101af11 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Expand QT_TR_NOOP("str") to "str", not ("str").Jan-Arve Saether2011-10-211-4/+4
| | | | | | | | | | | | | | This enables us to write code like : QStringLiteral(QT_TR_NOOP("Press")) or just: QT_UNICODE_LITERAL(QT_TR_NOOP("Press")) It also makes it consistent with the QT_TRANSLATE_NOOP3, QT_TRANSLATE_NOOP3_UTF8 and QT_TRID_NOOP macros, as they don't surround the string literals with parenthesis. Change-Id: I67c30bcd88609f897bd22afb44266affa4dcfc8f Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>