summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add locations AppDataLocation, AppLocalDataLocation to QStandardPaths.Friedemann Kleint2014-04-291-3/+5
| | | | | | | | | | | | | | | | | | | On Windows, DataLocation currently returns the value obtained by passing CSIDL_COMMON_APPDATA to SHGetSpecialFolderPath(). This is the local non-roaming path. For actually storing settings, the roaming path should be used (CSIDL_APPDATA). Introduce new AppDataLocation to return that path and AppLocalDataLocation for the local path and deprecate DataLocation. [ChangeLog][QtCore][QStandardPaths] QStandardPaths now has new enumeration values AppDataLocation, AppLocalDataLocation to be able to differentiate between roaming and local paths on the Windows operating system. DataLocation is deprecated in favor of AppDataLocation. Task-number: QTBUG-38483 Change-Id: Ib1de8c7031a863ed5eac10c747de6f7ff1a090c7 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QStandardPaths: fix empty path in XDG_DATA_DIRS being treated as '/'.David Faure2014-02-101-4/+11
| | | | | | | | | | | The basedir xdg spec says: "All paths set in these environment variables must be absolute. If an implementation encounters a relative path in any of these variables it should consider the path invalid and ignore it." Therefore we ignore relative paths including the empty string. Change-Id: I8f779b78981018051b16de23b2514f2e62b7ab39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths: remove trailing slash when reading from user-dirs.dirsDavid Faure2014-02-081-0/+2
| | | | | | | | | For consistency with all other sources of paths, which do not return a trailing slash, as tested by the unittest. This avoids double slashes in paths, after apps append something to the path. Change-Id: Iabcde11eee27df0b185780e2b655fbbb02ed63b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths: add GenericConfigLocationDavid Faure2013-11-051-0/+2
| | | | | | | | | | | | | | | | 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>
* Normalise and deduplicate paths for XDG_DATA_DIRSMartin Klapetek2013-09-091-0/+11
| | | | | | | | | | | | | | | | | | This removes the trailing slashes from the path and then removes dirs set twice in XDG_DATA_DIRS (always removes those from the right side). There's no use for duplicit dirs in XDG_DATA_DIRS because if whatever is being looked up is not found in the duplicated dir the first time, it won't be there the second time. Currently it causes troubles for example in mime types, where it returns duplicated mime types as the same dir is searched multiple times. For obtaining the original value of XDG_DATA_DIRS, one can use qgetenv("XDG_DATA_DIRS"). Change-Id: Ic4f8ef6c6fe096555948e318899207e9d4ca8289 Reviewed-by: David Faure KDE (deprecated, use kdab instead) <faure@kde.org>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Warn when XDG_RUNTIME_DIR isn't set, as per XDG Base Dir SpecDavid Faure2012-12-061-0/+1
| | | | | | | | | | | | http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html says: "If $XDG_RUNTIME_DIR is not set applications should fall back to a replacement directory with similar capabilities and print a warning message." Better warn that not all the guarantees of XDG_RUNTIME_DIR are available, and push unixes who haven't done so yet, to set things up correctly. Change-Id: Ie3998e8c1d14e4fdf8d58dfb2932f0ad708fba50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow QStandardPaths (Mac, Windows, Unix) to be bootstrappedThiago Macieira2012-11-021-1/+10
| | | | | | | | | | | | | This allows using QStandardPaths in one of the bootstrapped tools, if required for a future need. The Blackberry version appears to be usable in bootstrapped mode already. Change-Id: Ia4e9b9564395d2e151f8ac229ac2a2aa2982e92f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.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>
* Remove code duplication in QStandardPaths implementationsDavid Faure2012-08-091-16/+4
| | | | | | | | Using the new getter to access the "test mode" setting. Change-Id: Id26a350cd3fab4bf2e5f58ba67bc7323f99c9cc3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add bool QStandardPaths::isTestModeEnabled()David Faure2012-08-091-0/+5
| | | | | | | | | Library code might need to know this, e.g. when calling an external process, to give it the right configuration. (For instance when ksycoca code calls kbuildsycoca to recreate the DB at the right place). Change-Id: I343ddefff816586f9d391973c08ff1e1ad86bf0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QtCore instead of QtGui for the standardpaths comments to be correctLaszlo Papp2012-08-011-1/+1
| | | | | | | Change-Id: I98004fed565ac9653947ec70a3197b0372abcf2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* Allow auto tests to stay away from the user's configuration.David Faure2012-03-281-1/+14
| | | | | | | | | | | | | | | QStandardPaths now knows a "test mode" which changes writable locations to point to test directories, in order to prevent auto tests from reading from or writing to the current user's configuration. This affects the locations into which test programs might write files: GenericDataLocation, DataLocation, ConfigLocation, GenericCacheLocation, CacheLocation. Other locations are not affected. Change-Id: I29606c2e74714360edd871a8c387a5c1ef7d1f54 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* QStandardPaths: implement displayName() on all platforms.David Faure2012-03-221-6/+0
| | | | | | | | It was only implemented on Mac OSX until now (all this came from the QDesktopServices code). Change-Id: I7fd81d80ca77cf0ca6c213f59813a6163abe7dc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Return all expected paths in QStandardPaths::standardLocationsDavid Faure2012-03-221-22/+49
| | | | | | | | ApplicationsLocation and DataLocation were returning only the local path, rather than system paths + local path. Change-Id: I653d14e5bbe1e08c5fa1ecd5a6106336d1cd0369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make qlocale.h not depend on qvariant.h.Stephen Kelly2012-02-291-0/+1
| | | | | | | As a consequence, we have to add more explicit includes. Change-Id: Ib3137031f0554b846c7bbd08f1f7df10dfeb8e61 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* No need to stat with QFile::exists before QFile::open, for reading.David Faure2012-02-171-1/+1
| | | | | | Change-Id: I14ca7f8a377bca39004defc96d69d62c151181f5 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jeremy Katz <jeremy.katz@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>
* QStandardPaths: remove unused includes (leftovers from qdesktopservices)David Faure2012-01-261-2/+0
| | | | | Change-Id: I6fe23ecd04adc7dd68573dd0d6d01888c0cf71b6 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* 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>
* QStandardPaths: add GenericCacheLocation.David Faure2012-01-031-4/+7
| | | | | | | | | | | Much like DataLocation = GenericDataLocation + domain + appname, this makes CacheLocation = GenericCacheLocation + domain + appname. This way a framework library can have an application-independent cache (like ksycoca). Change-Id: I6a8c47ff85b7d5c68b594cc8b071a752d96b029d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths: add DownloadLocation.David Faure2011-11-041-1/+6
| | | | | | | | | Only properly implemented on unix (XDG), falls back to Document location on Mac and Windows, because not easily available with the current API being used by either one. Change-Id: Id269f0e3c4e3a68e19205de96c0b39980fde80ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths: fix encoding of XDG_CONFIG_HOME env varDavid Faure2011-11-021-1/+1
| | | | | Change-Id: Ibb89f204fc93aed5a669f8f9efc7859845e6d493 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename storageLocation() to writableLocation().David Faure2011-10-231-3/+3
| | | | | Change-Id: I8f6522a70950f78ddd6141360d36d104bd697e28 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Add QStandardPaths::RuntimeLocation, for sockets ($XDG_RUNTIME_DIR)David Faure2011-10-231-0/+34
| | | | | Change-Id: I19c36a04a9deae49ffc20fdec6a2a7eb05155cb4 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* QStandardPaths: add Config and GenericData, add methodsDavid Faure2011-10-231-28/+85
| | | | | | | 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-231-0/+166
Change-Id: Ic596c21894d83b4dab0c3f5b1aed916ddd590f2f Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>