summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix code style - add missing trailing commaJonathan Ketchker2024-01-231-1/+1
| | | | | | | | | | | | For better consistency and git changes tracking add trailing comma at the end of the last value of an enum. See also code-review at: https://codereview.qt-project.org /c/qt/qtbase/+/528392/comment/663ba25a_51ed514b/ Pick-to: 6.7 Change-Id: Ibcfcfb1ba1a8ba4b59297bf17103181a0ee6eafc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add StateLocation & GenericStateLocation to StandardLocationJonathan Ketchker2023-09-071-1/+3
| | | | | | | | | | | | | | | | | | | | | The latest XDG spec (0.8) defines XDG_STATE_HOME that does not exist in QStandardPaths::StandardLocation. Some Linux distributions clean XDG_CACHE_HOME on restart which makes XDG_STATE_HOME useful as a path for saving application state. This commit adds StateLocation and GenericStateLocation to serve as a StandardLocation for XDG_STATE_HOME for all platforms. This commit also updates docs and tests to fit the new changes. [ChangeLog][QStandardPaths] Added StateLocation & GenericStateLocation to StandardLocation Change-Id: I470602466c37f085062cc64d15ea243711728fa5 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add PublicShare and Templates QStandardPathsBjörn Feber2022-01-011-1/+3
| | | | | | | | | | | | | | | | | These directories are common on desktop operating systems. "Public" is used for sharing files with other users and "Templates" lets you add new files to the file creation desktop menu (for example in a file manager). An example use in a Qt application would be KDE's KIO having default icons for both directories. This is where they point to: Windows: C:/Users/Public, C:/Users/<USER>/AppData/Roaming/Microsoft/Windows/Templates macOS: ~/Public, ~/Templates Unix: ~/Public, ~/Templates Task-number: QTBUG-86106 Task-number: QTBUG-78092 Change-Id: Ifca60c7d2a6dc2109ec290e8fb109ee2d5ca4d38 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove usage of deprecated QStandardPaths::DataLocationKarsten Heimrich2020-10-231-4/+2
| | | | | | | | | * Rearrange the documention to match the enumeration order. Fixes: QTBUG-87037 Change-Id: Iad001351e0f309e694b8bbd503813017e6586a21 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QStandardPaths: purge deprecated APIEdward Welbourne2020-08-071-4/+1
| | | | | | | Since 5.2: enableTestMode(bool) Change-Id: Ibfd5958b6383491d9297d3f0e815ad4679fb57f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add Q_DECLARE_OPERATORS_FOR_FLAGS(QStandardPaths::LocateOptions)J-P Nurmi2016-08-141-0/+2
| | | | | | | | QStandardPaths::LocateOptions was declared with Q_DECLARE_FLAGS(), but missing Q_DECLARE_OPERATORS_FOR_FLAGS(). Change-Id: Id4ab1b1c86cdc9e79fb324d9b9d4d8deb659f718 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Register QStandardPaths enums & flagsJ-P Nurmi2016-08-141-0/+5
| | | | | | | | | This allows QML StandardPaths to use the same enums without having to duplicate them. Change-Id: Ibfc63a97a8ba31e5c4dc11e3e8fee9d753087c54 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* 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>
* 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>
* QStandardPaths: add AppConfigLocation.David Faure2015-01-091-0/+1
| | | | | | | | | | | | | | | | | | | ConfigLocation was erroneously inconsistent, by adding the org name and app name on Windows (unintentionally) and not on Unix (while having subdirs in ~/.config is actually common practice for some XDG desktops) Therefore this adds AppConfigLocation, which always has the org name and app name (while GenericConfigLocation never does). [ChangeLog][QtCore][QStandardPaths] Added QStandardPaths::AppConfigLocation, for application-specific configuration directory. ConfigLocation was inconsistent. Task-number: QTBUG-38872 Task-number: QTBUG-38845 Change-Id: I80fb98f296436261f3996c9df87571c29b06ab35 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Add locations AppDataLocation, AppLocalDataLocation to QStandardPaths.Friedemann Kleint2014-04-291-1/+3
| | | | | | | | | | | | | | | | | | | 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: add GenericConfigLocationDavid Faure2013-11-051-1/+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>
* Add a Qt-API style QStandardPaths::setTestModeEnabledThiago Macieira2013-08-091-1/+4
| | | | | | | | | | | | | | | QStandardPaths::enableTestMode has a verb in the imperative ("enable") as the core word in the name. That indicates an action. The function should not have had a parameter. Instead, add a Qt-style setXXXEnabled function. [ChangeLog][QtCore][QStandardPaths] QStandardPaths::enableTestMode is deprecated and is replaced by QStandardPaths::setTestModeEnabled. Change-Id: Ib26ad72d7c635890d2cb22ae9d44cbda08a6f17c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* QStandardPaths::displayName() is unavailable when bootstrappedOswald Buddenhagen2013-03-131-0/+2
| | | | | | | reflect that in the class definition Change-Id: I1224ed851b220abae38c62a4d3dbea8ddbd40b83 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Removed an unnecessary forward declarationThorbjørn Lindeijer2012-12-281-2/+0
| | | | | | | qstringlist.h is already being included. Change-Id: I1790cd560b934b6697702bd11f78f39cddc3389f Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
* 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>
* Add bool QStandardPaths::isTestModeEnabled()David Faure2012-08-091-0/+1
| | | | | | | | | 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-0/+2
| | | | | | | | | | | | | | | 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>
* 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>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@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>
* QStandardPaths: add GenericCacheLocation.David Faure2012-01-031-1/+2
| | | | | | | | | | | 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/+2
| | | | | | | | | 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>
* Rename storageLocation() to writableLocation().David Faure2011-10-231-1/+1
| | | | | 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/+1
| | | | | Change-Id: I19c36a04a9deae49ffc20fdec6a2a7eb05155cb4 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Add QStandardPaths::findExecutable.David Faure2011-10-231-1/+3
| | | | | Change-Id: If30a83622e2ac5af48e47a38b8f70fce73044d74 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* QStandardPaths: add Config and GenericData, add methodsDavid Faure2011-10-231-1/+18
| | | | | | | 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/+85
Change-Id: Ic596c21894d83b4dab0c3f5b1aed916ddd590f2f Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>