summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qtemporaryfile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-111-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/gui/image/qpixmap.cpp src/widgets/kernel/qformlayout.cpp Change-Id: I8a8391a202adf7f18464a22ddf0a6c4974eab692
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-081-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttpnetworkconnection.cpp src/network/access/qhttpnetworkconnection_p.h Change-Id: I11f8641ef482efa8cee1b79977d19cc3182814b4
| | * QTemporaryFile's setFileTemplate operates not only on XXXXXX in the endSune Vuorela2016-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Is even covered by unit tests. Change-Id: I7b22da2a338868fdb99c6238925f944bfea88190 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Simplify constructor code of QTemporaryFile.Friedemann Kleint2016-06-021-17/+10
|/ / | | | | | | | | | | | | | | Pass the name as parameter to the constructor of QTemporaryFilePrivate and use delegation in the convenience constructors. Change-Id: I4087600b804fe22910b4985a59a02547f54a6acd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* / Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-07-171-4/+21
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
| * Set the state of QTemporaryFileEngine properly prior to reopeningThiago Macieira2015-07-151-4/+21
| | | | | | | | | | | | | | | | | | | | | | QTemporaryFileEngine does not store the pattern, so it needs to get it again from QTemporaryFilePrivate prior to reopening the file. It's possible to lose the pattern when remove() is called on the object. Task-number: QTBUG-46156 Change-Id: I66a35ce5f88941f29aa6ffff13dfc7f83d4fa3a2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | Mark two member functions constSérgio Martins2015-05-291-2/+2
|/ | | | | Change-Id: I42266689ccac2d0234eb0b047d2dc949e6f59196 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSaveFile: Fix permissions on creationKai Koehne2015-04-081-5/+8
| | | | | | | | | | | | | | | | | | | | QSaveFile is intended to be a replacement for QFile, and should use the same permissions for newly created files. QTemporaryFile however creates new files with 0600 mask by default. Fix this by making the mode_t argument QTemporaryFileEngine uses configurable, and using 0666 for QSaveFile (like we do in QFile). [ChangeLog][Important behavior changes] Files created by QSaveFile do now have the same rights as files created by QFile. This also fixes a regression in QSettings: In the Qt 5.4 series, new files created by QSettings were only readable by the current user. Task-number: QTBUG-44086 Change-Id: Ie1cc20e9f25c6e72e1bc9176490c419c27c5fc82 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Make the empty Q_ASSERT still check its argument for validityThiago Macieira2014-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | With the side-effect that variables and functions in the argument are now "used". This means we don't need to #ifndef functions only used in assertions: the compiler will eliminate them by dead code elimination. Due to the mandatory short-circuiting of the condition, no functions will ever be called and this expands to no more code than before. On the negative side, because we won't get warnings for unused variables initialized outside the Q_ASSERT, non-inlineable calls will not be elminated by dead code elimination, so they will remain in release code without warnings. Because of the expanded code now in Q_ASSERT, the Intel compiler's optimizer gets thrown: it complains that the non-void function is failing to return anything, so I had to add two return statements. Change-Id: I1bb79c9637a2771ef1ec093f901b8d2443788bd6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-4/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * Doc: corrected autolink errors corelib ioNico Vertriest2014-08-271-4/+6
| | | | | | | | | | | | Task-number: QTBUG-40362 Change-Id: If11700d57db75ad7605bd8d53681002639c2e785 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Ensure that QTemporaryFile clears all file mappings.Friedemann Kleint2014-07-031-0/+3
|/ | | | | | | | | | | Factor out code to clear all mappings into QFSFileEnginePrivate::unmapAll() and call that from QTemporaryFile. Task-number: QTBUG-39976 Change-Id: Ic1ceeba0ba4451866f1081fee430e5c458c0819d Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-1/+1
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-10-141-1/+1
|\ | | | | | | refs/staging/dev
| * Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Added initial file system support for winrtOliver Wolff2013-10-111-3/+12
|/ | | | | | | | | | | | | | While some functionality is not available for winphone (QFileSystemEngine::tempPath), some functionality can be fully supported. Other cases like checking for stale processes which is needed by QLockFile cannot be covered that easily as obtaining information about other processes is limited due to sandboxing. Change-Id: I9ea80ae2b421eea1ddfd4c5bc2f4b6f8adaee85f Done-with: Kamil Trzcinski Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Ensure QTemporaryFile can create files when an identical dir exists.Mitch Curtis2013-03-231-1/+8
| | | | | | | | | | | | | | | | | | When QTemporaryFile attempts to create a new file in createFileFromTemplate, it fails if the filename exists and is a directory. Windows returns error code 5 (ERROR_ACCESS_DENIED) in this case - rather than ERROR_FILE_EXISTS - which is not handled. This patch handles ERROR_ACCESS_DENIED in addition to the already handled ERROR_FILE_EXISTS, meaning that QTemporaryFile will continue to look for unique names when a directory with the same name exists. Task-number: QTBUG-30058 Change-Id: I42339887d7f5483e3dc6a03a9da15111c350da8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Move QTemporaryFileEngine to private headerDavid Faure2013-01-141-50/+5
| | | | | | | | | | | | | | | | | | This is needed by QSaveFile. Move QTemporaryFilePrivate to that header too, to avoid any confusion. Change-Id: I8dce8a4fb853a9823c49ec565867432331e748cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add renameOverwrite() to QAbstractFileEngine.David Faure2013-01-141-0/+7
|/ | | | | | | | | | | | | QFSFileEngine::rename() on Windows doesn't overwrite the existing destination. Keep that unchanged (it's the desired behavior in QFile::rename), and provide cross-platform rename-overwrite behavior in the new method. This is needed by QSaveFile. Change-Id: I5e753d289d8a53692530a48a1783d62e26169cdc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename createLocalFile to createNativeFile & deprecate createLocalFileAndy Shaw2012-10-021-6/+32
| | | | | | | | | | | | | | | | | | As it was confusing to use the term local file when referring to a file that was accessible using native APIs and not just a file that was on a hard disk somewhere already the function name has been changed. By renaming it to createNativeFile we keep it consistant with QFileInfo which has an isNativeFile() function too. Test also added. Task-number: QTBUG-3169 Change-Id: I410e7ed28133d68fd312c6c0faf3f7191460d7ce Reviewed-by: João Abecasis <joao@abecasis.name> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+1
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix QTemporaryFile::open() failing after remove().Mitch Curtis2012-06-051-1/+9
| | | | | | | | | | | | | If a QTemporaryFile is constructed using a template file path, the path is generated in QTemporaryFileEngine::open() and then filePathIsTemplate is set to false. If remove() and then open() are called on the same QTemporaryFile, the path is not regenerated. This change ensures that if the file path was generated, it will be generated again in the scenario above. Task-number: QTBUG-2557 Change-Id: I718ceb89daa9a9d46fdbe811fecc3d57d6dc08c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-191-1/+1
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Drop QFile::fileEngineJoão Abecasis2012-02-161-19/+16
| | | | | | | | | | | | | | | The function was already marked as internal. By moving access to the underlying file engine to private API this supports the effort to completely drop file engines from public API. In the future, the goal is to completely drop the file-engine abstraction as it exists today. Change-Id: I332fa56e70c87e83c1e08bb9f75e04df7c93fec7 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove Symbian specific code from QtCore.Xizhi Zhu2012-01-301-34/+2
| | | | | Change-Id: I131303e28a12dccb96de3de4ca0073b389a9bbae Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QTemporaryDir/File: cleanups (static internal function, QScopedPointer)David Faure2011-12-081-6/+4
| | | | | Change-Id: I61311d151e2ae94a22df58297bbfb7a636a01c4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.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-211-50/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-211-49/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use fromLocal8Bit for reversing toLocal8BitJoão Abecasis2011-10-201-1/+1
| | | | | | | | | path is converted to 8-bit encoding using toLocal8Bit in QTemporaryFileEngine::open. The reverse operation should be used here. (cherry picked from commit 023976f9dd48a3deb947905d32d5fc0692da7318) Change-Id: Idb4c1ca3415300367c46a09d68df640e17b7bfdc Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Don't convert template's path separators againJoão Abecasis2011-10-201-1/+1
| | | | | | | (cherry picked from commit 19880c1bdf75455b645fb8d5ee12bcb6e37e5aff) Change-Id: Iec201da5c09d76711d994bc1da6d15a70a66b0c8 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Changed if/if/else/if/eleven chain to switchJoão Abecasis2011-10-201-15/+22
| | | | | | | | | | | Inlined isdigit in switch statement. Removed unused #includes. Documented unreachable segment with code (Q_ASSERT). Reviewed-by: Denis Dzyubenko (cherry picked from commit 3596db6c9bb8db42476d0c7b52fa2043dc67135b) Change-Id: I98c33801fd8794e95ba8fc0b5c4efe9b1910682b Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Modulus of negative dividends is undefined or negativeJoão Abecasis2011-10-201-1/+1
| | | | | | | | | | | | ... depending on who you ask. Since it is possible for applicationPid to return negative values this means we would introduce garbage ['()*+,-./] in the generated filenames. Reviewed-by: Denis Dzyubenko (cherry picked from commit cb7cb1d3884ae8a032f3ad2ed3a6d8e3ffc06206) Change-Id: Ie4f74b961397f97508ea67a0c835e45773d1cc0e Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* QTemporaryFile: use QCoreApplication::applicationName() as base filenameDavid Faure2011-09-281-13/+31
| | | | | | | | | | Merge-request: 57 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Change-Id: I2a29b2ba925ea92a5299272b80164658775e9c0e Reviewed-on: http://codereview.qt-project.org/5713 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>