summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Prevent clang from warning about unused variablesKai Koehne2013-11-081-0/+3
| | | | | | | | Fixes a compiler warning introduced by 79b975756a100cc46182 Change-Id: Ie9bc677d061f0bb0530eae88715069042b2ab440 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Revert "Add tracing to logging framework"Kai Koehne2013-11-073-394/+8
| | | | | | | | | | | | | | | | | | | The tracing API still misses some real-world exposure. Let's re-do this in dev to have more time. This reverts parts of following commits: 466e0dff4bb686e51d0ab3f905631fcb7dd8bfef 7a47aebe9ed41d6cd9c9bcd45758d4d553668e99 a652bab6a7ebf78b029fea95c2801deb6f4f524a 8f0654ceb878b6c8a08c7f5b790027c26e007c13 4162522edd9d31bd2798ab37f083adff818d886e 32f27b4367c4e042a3f0cda671579494e31c1d69 9ff81bdc1ab4e3d14914192cd63ae625a507fe90 Change-Id: If97340c37b8b3363f597683336a8390d5ff386f1 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QUrlTwoFlag: add two missing constexprMarc Mutz2013-11-071-2/+2
| | | | | | | | | The other member functions that can be constexpr already are, only these were missing. Change-Id: I717c74b210b45cfb8af9168d61e27e3ff2f6a9c9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q(UrlTwo)Flags: avoid undefined behaviorMarc Mutz2013-11-071-13/+13
| | | | | | | | | | | | | | Loading an enum with a value that isn't in the enum is undefined, according to Clang's usan. So when doing logical operations on QFlags<E>, don't go through the QFlags(E) constructor, but via QFlags(QFlag) (=int) instead. Apply the same change to QUrlTwoFlags. Change-Id: I5f27e22c4d831482fcbba88b97cb124fb005e3fd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Add a little more information about current dirsThiago Macieira2013-11-061-2/+5
| | | | | | Task-number: QTBUG-34300 Change-Id: Ib71d6ace77b525942ca40645299cdfd87b753d70 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* QStandardPaths: add GenericConfigLocationDavid Faure2013-11-057-6/+20
| | | | | | | | | | | | | | | | This is what ConfigLocation was meant to be. A directory shared by all applications. Unfortunately when I wrote the fallback on Windows, I picked DataLocation (which is app-specific) instead of GenericDataLocation (which is shared between apps). This makes it impossible to have config files shared between apps, e.g. for libraries. It also makes ConfigLocation quite inconsistent (on Windows one cannot use it to load another app's config file, while it works everywhere else). All this is fixed by GenericConfigLocation, which is shared between apps. Change-Id: I23a755131061d4fea01e13dd1038fbd8ef333a5d Reviewed-by: Alex Richardson <arichardson.kde@googlemail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Declare Cocoa conversion funcs in objc-mode only.Morten Johan Sørvig2013-11-051-1/+5
| | | | | | | | | | | | | | | | | In practice, there are several ways to forward-declare objective-c classes. Qt uses "struct objc_object", other projects may use a plain "class". Mismatched forward declarations will lead to compile errors, and this is a form of header pollution. dd5e40d9 added a workaround where Q_FORWARD_DECLARE_OBJC_CLASS can be predefined in order to sync up the declarations. Make forward declaration clashes less likely by forward-declaring in objc-mode only. Change-Id: I9f7a399d64dc88bfe05d5385b3d46b5302112aef Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Clarify use of Q_INIT_RESOURCETor Arne Vestbø2013-11-051-4/+4
| | | | | | | | | | | | | | | | | | | The Q_INIT_RESOURCE macro is needed if a library itself uses resources, in which case the Q_INIT_RESOURCE can and should happen in the library (like we do for eg. widget styles), or if a library exposes resources that are supposed to be used by the library clients, in which case the macro needs to be put in the application code. The distinction between the two, and the fact that resources built as part of the main executable do not need the explicit initialization, were not all that clear. This was evident by the lack of Q_INIT_RESOURCE in our own Qt libraries, and the various Q_INIT_RESOURCE calls in our examples where they are not needed. Change-Id: I40258458e9fdf9ee5502c212971fb3d90b4fc388 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Silence compiler warningMarcel Krems2013-11-041-1/+1
| | | | | | | | | | warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] Change-Id: I15e283023918cd4ebc27e91812eadf95ba156d71 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* fix warnings about unused variables & parametersOswald Buddenhagen2013-11-041-1/+3
| | | | | Change-Id: Ia5816671267ea21dae0d90560b239c4498f9156c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Include unistd.h in the unix implementation source of QLockFileLaszlo Papp2013-10-311-0/+1
| | | | | | | | | | This is necessary to avoid hidden dependencies for int gethostname(char *name, size_t namelen); This was revelead while backporting the class to Qt 4 for QtSerialPort. Change-Id: I1c477d295eeae90b3136fc6aae5d45982d5b1d73 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* iOS: Add standard paths implementation for iOSIan Dean2013-10-302-0/+137
| | | | | | | | | | | A standard paths implementation for iOS. The APIs used on iOS require that the source file be "Objective-C++" (with a .MM extension), as there are no APIs available in C++ for this. The implementation complies with the latest documentation on standard paths. Change-Id: I349d3c5d4ddb6fb1297a45dc9ae26b56ac528abb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Use Q_UNLIKELY in qCDebug, qCTraceKai Koehne2013-10-301-2/+2
| | | | | | | | By default debug, trace is disabled, so this can be marked as unlikely. Change-Id: I221a688c953c1ff1fdfda65d2d99457785d3ff47 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix miscellaneous typosSze Howe Koh2013-10-301-1/+1
| | | | | | Change-Id: Iaf0dd8974c3ad78beffa995c596a76fb3e4cceab Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Make the localHostName() copy function return QByteArrayThiago Macieira2013-10-291-8/+8
| | | | | | | | | | This avoids one extra memory allocation when creating the lock file. The number of memory allocations when checking the file are still the same. Change-Id: I16a2fdb7a5458bdc66f8ad1c602582b5698a5b5c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Reserve some space for future use in QLoggingCategoryKai Koehne2013-10-242-1/+8
| | | | | | | | | Currently Qt offers only debug, warning, critical message types for general use. Most logging frameworks offer more ... let's save some space for future message types. Change-Id: Icb4333da5c8f5277fd10d8a01b06d95369662bdc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Initialize variable to fix build [-Werror=uninitialized].Sergio Martins2013-10-191-2/+1
| | | | | | | | The complaining compiler is: gcc version 4.6.3 (crosstool-NG hg+default-ddc327ebaef2) Change-Id: Iae488a89d75492e76a39a326b2db36548f8894d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Link from QLoggingCategory documentation to QTracer/QTraceGuardKai Koehne2013-10-181-5/+6
| | | | | | Change-Id: I331966f6137a31f089425a639afe8f9f4088c0b6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Add missing \since 5.2 tag to static QFileInfo::exists()hjk2013-10-171-0/+2
| | | | | | Change-Id: I11e136eaede2a5dffeb10b5fe31023b9aef709cb Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Windows: Capture last error right after CreateDirectory() in QFileSystemEngine.Friedemann Kleint2013-10-171-4/+10
| | | | | | | | | | | Custom allocators invoked by freeing the QString contents might change it. Task-number: QTBUG-34046 Task-number: QTBUG-32314 Change-Id: Ied5305c21fcce228448fe565899163997536ea7a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Clarify that the URL scheme does not include the ':'Kurt Pattyn2013-10-171-4/+13
| | | | | | | | | | From the documentation of setScheme it was not clear if the scheme should be terminated by a ':' or not. Documentation has been updated to clarify the expected syntax for the scheme. Change-Id: Ied8533beef7daa12e1d5e7da0649c184efb84522 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow non-character codes in utf8 stringsKurt Pattyn2013-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Changed the processing of non-character code handling in the UTF8 codec. Non-character codes are now accepted in QStrings, QUrls and QJson strings. Unit tests were adapted accordingly. For more info about non-character codes, see: http://www.unicode.org/versions/corrigendum9.html [ChangeLog][QtCore][QUtf8] UTF-8 now accepts non-character unicode points; these are not replaced by the replacement character anymore [ChangeLog][QtCore][QUrl] QUrl now fully accepts non-character unicode points; they are encoded as percent characters; they can also be pretty decoded [ChangeLog][QtCore][QJson] The Writer and the Parser now fully accept non-character unicode points. Change-Id: I77cf4f0e6210741eac8082912a0b6118eced4f77 Task-number: QTBUG-33229 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Give an example how to configure categorized loggingKai Koehne2013-10-161-21/+35
| | | | | | Change-Id: I178bb6e75fba246932b318c2c0c5afd243575a92 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Use the fast operator+ (in the form of operator%)Thiago Macieira2013-10-151-7/+4
| | | | | | | | | | QStringBuilder will precalculate the size of the string for us, which avoids extra realloc() and moving data around. Change-Id: I4e31964bb9bfffbe2083b3cb8c120e602160dfd8 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Add qWarning when trying to read or write a closed deviceLaszlo Papp2013-10-151-2/+6
| | | | | | | | Change-Id: Ifda057d122a30d88749c6401185457f1900a913b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix memory leak in QFileInfo::exists()Jian Liang2013-10-122-1/+16
| | | | | | | | | | Use the the legacy file engine object created in static function QFileInfo::exists() as the engine of the QFileInfo object to prevent memory leak. This can also boost a little performance. Change-Id: I06317d158d487be5ef15fe3244a917a371563ac9 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Let QLoggingCategory::defaultCategory return a pointerhjk2013-10-112-5/+12
| | | | | | | | The pointer can be null. Going trough the reference invokes undefined behavior here. Change-Id: Ia84e4e732cdcbbaee0f5f0679765d18069ea8b2d Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Reduce risks of lock file corruptionKevin Ottens2013-10-111-10/+10
| | | | | | | | | | | | Trying to do as few operations as possible once the file got opened. That includes generating the data which will go in the file. Indeed if we crashed at that point the lock file is already emptied. Could happen because of the qAppName call. It's then safer to prepare the data upfront, and just open/write/close if possible. Change-Id: Iad32fa822c6a5958ae89d84a2fe02ed5366ea278 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix "Empty or null file name(s)" warning textKai Koehne2013-10-081-4/+4
| | | | | | | | Remove '(s)' for methods taking only one path argument. The '(s)' has been dropped in other places already ... Change-Id: I9dc0d1cfa1e02f60bce901a309835f4bbfadde6d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0824-248/+248
| | | | | | | | | | | | | | | | | 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>
* Allow to use short names for Windows Registry root keysSebastian Schuberth2013-10-071-0/+12
| | | | | | Change-Id: I58b7681bb49e93b7577bc559d754c81d3c6f007b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Remove default label for QtMsgTypeKai Koehne2013-10-071-3/+1
| | | | | | | | Adding another category will most likely require a dedicated handling anyway, so better let the compiler warn about it. Change-Id: I323ca1250d82e33c086f1930e1df0a6337d6f16f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Improve QLoggingCategory documentationKai Koehne2013-10-071-42/+21
| | | | | Change-Id: I142e954cc3622643d80b8efd3b1d659c11d4e239 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Replace QLoggingCategory::isEnabled by non-template functionshjk2013-10-062-58/+78
| | | | | | | | | This yields the same results as previously and is more in line with existing interfaces. Change-Id: I0bf0372bf18f3bfde579385cddbe594bf71e3c52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Improve the QWinSettingsPrivate constructor's performanceSebastian Schuberth2013-10-061-21/+26
| | | | | | | | This is mainly achieved by modifying the program flow to require fewer string comparisons and conversions. Change-Id: I9887623b9c05fe76460fc725d6534d16bd9f9e59 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Refactor OS X bundle detection for QFileInfoSamuel Gaist2013-10-041-11/+72
| | | | | | | | | | | | | CFBundleGetPackageInfoInDirectory originally used tests for the presence of information that are not mandatory in a bundle. The new implementation uses known bundle extensions as well as Launch Services to try to find if the bundle is known to the system. Last thing it checks whether the package bit is set. Task-number: QTBUG-31884 Change-Id: Ib58996c6ac65194c21238f5f86f78d797e310608 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* QTemporaryDir: Output warnings on removal failure.Friedemann Kleint2013-10-031-1/+7
| | | | | Change-Id: I38d0a07c355f73899cc5f6eac60bd8cbedc73cb2 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove a duplicate conversion to QLatin1StringSebastian Schuberth2013-10-021-1/+1
| | | | | Change-Id: I9641090406be2d4bad2b703594e404b4934cbc0b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* QProcess/Win: fix crash in drainOutputPipesJoerg Bornemann2013-10-021-2/+2
| | | | | | | | | | | | | stdoutReader->waitForReadyRead() can synchronously trigger the deletion of stdoutreader (via signal readyRead(), _q_canReadStandardOutput(), destroyChannel()). Analoguous for stderrReader. Task-number: QTBUG-33730 Change-Id: I8badac53e92a979c437838b2959b4c0445c8de81 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* QProcess: remove now superfluous calls to setEnabled(false)Joerg Bornemann2013-10-021-11/+2
| | | | | | | This amends 48061944ef358bbb1e5fd7b582376868f9788c5e. Change-Id: Ie5b56c1499a10594b4a4b3c02d5704226ef971ba Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* remove usage of qDeleteInEventHandler from QProcessJoerg Bornemann2013-10-011-9/+8
| | | | | | | qDeleteInEventHandler is a mere wrapper for delete these days. Change-Id: I0828edf3ca17642b5abf97aab66672490c35f177 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-274-0/+41
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use a pimpl in QLoggingCategoryhjk2013-09-272-9/+26
| | | | | | | | With the usual pros/cons. Cleans up the publicly visible interface and gives some headroom for further extensions. Change-Id: I7237b1fd2a22c66574d1b7e532d99137bb56ce1d Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Win: Fixed namespaced build with QT_NO_FILESYSTEMWATCHEROliver Wolff2013-09-271-2/+2
| | | | | | Change-Id: I70049b90d2071c7a23a8a2804842d70d0f583f19 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Allow QDir::mkpath() to work on QNX QNet pathsMatt Hoosier2013-09-251-1/+8
| | | | | | | | | | | | | | | | Due to a quirk in the way that QNX's mkdir() implementation reports return values when the requested pathname is the mountpoint of a QNet filesystem, the usual recursive directory creation algorithm used by QDir fails if the destination directory happens to exist inside QNet. This is an artificial failure; the desired directory can still be created with the normal mkdir() algorithm. There just needs to error handling in place to allow the recursive creation of parents to recognize this situation. Change-Id: I350fd9cb39858570032f9146c1154a9287701569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tracing to logging frameworkhjk2013-09-253-5/+370
| | | | | | | | | Change-Id: I4d5b9a24a214785019ff1238c1790ead79205b15 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix WinCE/MSVC2008 build errors related to std::lower_bound patches.Sérgio Martins2013-09-251-0/+5
| | | | | | | See QTBUG-33473 for more information about this compiler bug. Change-Id: I13b945350fdc38165c1515f0cdd75a53cf37cd6c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix a crash in QProcess signal handling on Mac.Friedemann Kleint2013-09-251-1/+2
| | | | | | | | On Mac, SA_SIGINFO can be set while the handler is SIG_DFL. Change-Id: Ibaeaa1612e27217826841d7400309c45b5a101ea Initial-patch-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove qBinaryFind usages from QtCoreGiuseppe D'Angelo2013-09-231-4/+5
| | | | | | | | This is done per the mailing list discussion at http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I6207982c08c92f3e01fb236d2e7546a1c9acd287 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge "Merge branch 'stable' into dev" into refs/staging/devSergio Ahumada2013-09-213-14/+52
|\