aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/settingsaccessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Write Key/Store to settingshjk2023-08-291-2/+2
| | | | | | | We claim that we still store QVariantMap to keep the format unchanged. Change-Id: Ie7b0a83febfeb2cb3cfc9ee42b8423453cf3b1c4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Utils: Introduce variantFromStore and storeFromVarianthjk2023-08-281-5/+5
| | | | | | | | | | | | | | These are functional replacements for QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and QVariant::toMap() (or QVariant::toValue<Store>()) We will have a few code paths in the end that need to explicitly operarate on both QVariantMap and Store (e.g. actual reading/writing to keep format compatibility etc), so these can't in the end be simple to/fromValue(OneType) but need an internal 'if' or such. Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Utils etc: More use of Key and Storehjk2023-08-241-7/+8
| | | | | Change-Id: Idd2d70617f775d783aee93a2fe82544ad335a739 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Utils/TextEditor: More use of Store and Keyhjk2023-08-241-43/+43
| | | | | Change-Id: I2feb47b2e6af7a299912b0c73a0c5d8a0e18a8aa Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Utils: Simplify SettingsAccessor constructorshjk2023-04-261-26/+19
| | | | | | | Use setters instead. Change-Id: I912234fa832eeb80519740ca011921f1e71d70b4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Collapse the two SettingsAccessor constructor hierarchieshjk2023-04-261-19/+12
| | | | | | Change-Id: I7b659c9e3c66700cfc92f9cfbd9df0535a1ca655 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Remove displayName from SettingsAccessorshjk2023-04-261-17/+7
| | | | | | | It was not used. Change-Id: I7c0927698bf31548ec076c39881561d72e8495e6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Tr::trAlessandro Portale2023-02-011-42/+35
| | | | | | Change-Id: Ic03e20993f05fb5b49a12c891d86afb2c8e18e08 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Utils: Use multi-arg for stringsJarek Kobus2023-01-111-5/+5
| | | | | | Change-Id: I57d87b8f0435c7b304c484ad4d728b59780f212d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Fix clazy "Mixing iterators with const_iterators" warningsJarek Kobus2022-11-301-2/+2
| | | | | | | Change-Id: Iab29d57459713e107d7e74908df347955b9f50a0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Utils: Remove Utils::optionalEike Ziller2022-09-011-18/+24
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: More forward declarations / drop unused headers [S]Jarek Kobus2022-05-251-2/+5
| | | | | | | | | | | | Round 1 - focus on headers. For classes with initial in range [S]. Try to keep the same separators between different kind of headers. SmallString[xxx] classes skipped for now. Change-Id: Ie5c8edcb028e33eb8f9619e646afc462b91dca73 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Utils lib: Remove unneeded includes from cpp filesJarek Kobus2022-05-191-1/+0
| | | | | | | | It's a result of a team work consisting of yellow triangle and me. Change-Id: I8b4812766da70e0785ae71bf0cb71357379e2514 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Wrap various file system iteration flags and filtershjk2022-01-261-1/+1
| | | | | | | | | | | ... into a single class. This makes passing them around as a whole easier, and opens a path to have "generic" filters in form of a lambda or such. Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: read remote persistent settingsDavid Schulz2021-09-091-5/+3
| | | | | | | Used to read project.user files from devices Change-Id: I151155e7f83501f49ce1d72b3c4bff92f2c05d4b Reviewed-by: hjk <hjk@qt.io>
* ClangFormat: Spread FilePathhjk2021-08-191-4/+2
| | | | | Change-Id: Iedddd78b183b2290f98411e7c70807c1828f1c25 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Don't allocate unneeded temporary containersJarek Kobus2020-12-141-2/+2
| | | | | | | | | | Fix clazy warnings: allocating an unneeded temporary container [clazy-container-anti-pattern] Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Aggregation/Utils/ExtensionSystem: Make member functions const/staticAlessandro Portale2020-11-271-2/+2
| | | | | | | | | | | | | | | | | | readability-make-member-function-const finds lots of member functions that could be made const. This change just picks getter functions that really should be const. readability-convert-member-functions-to-static finds non-static member functions which do not access this. This change turns most of them into static ones, but leaves some non static to keep the class API consistent. readability-static-accessed-through-instance fixes the places where the originally non-static, now static functions were called through instance. Change-Id: I8cf16c01f7988a7c9d073b5f8ede6a9706b94fb0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Replace some QRegExp to QRegularExpressionChristian Stenger2020-06-191-1/+0
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: I7d12992506bbe33306c0ab750f73c7db1626abc3 Reviewed-by: hjk <hjk@qt.io>
* Utils: Replace foreach with range-based forOrgad Shaneh2020-06-161-1/+1
| | | | | Change-Id: I9aeea9c029ffc56cbadc04edd20e9b35b154f986 Reviewed-by: hjk <hjk@qt.io>
* Utils: Rename FilePathList to simply FilePathshjk2019-12-181-5/+5
| | | | | | | The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Avoid warning on empty expressionshjk2019-07-231-5/+5
| | | | | | | | For some reason, Q_UNUSED includes already a semicolon, adding one on the user side creates an additional empty statement. Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Give some possible reasons for not using a .user fileChristian Kandeler2019-07-091-1/+4
| | | | | | | | | In particular, explain that using a different settings path prevents Qt Creator from using the .user file. Task-number: QTCREATORBUG-18294 Change-Id: Iabd4bc0f3819ce458a4777d2cd554d1afe6013c6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-24/+24
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Replace mutating FileName::appendStringhjk2019-05-151-6/+5
| | | | | | | ... by a non-mutating .stringAppended, doing the same. Change-Id: I7adb6cae3415942cc9a80088bd75cda9d577d4a5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* SettingsAccessor: Avoid soft assertion for inexistent fileOrgad Shaneh2018-11-191-1/+1
| | | | | | | | abi.xml is optional, but if it is not found, some assertions are triggered. Change-Id: I5255d6070028605cf860eb38ff63d00743a476d9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* SettingsAccessor: Relax old version validation for shared filesOrgad Shaneh2018-11-161-1/+8
| | | | | | | | | | | | Settings with older versions will not necessarily fail on upgrade. Let the upgrader assume they're using the oldest supported version, and continue from there. The logic with an appropriate message was already there, but it was never reached due to several bugs. Change-Id: Ie4d840a29d9aec7be7763111269f7bed81a8cbe3 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Utils: Remove superfluous qualificationsOrgad Shaneh2018-07-191-9/+9
| | | | | Change-Id: I36e17dac0cff87f82f0ddaf97bc613389110f218 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* SettingsAccessor: Fix placeholderRobert Loehning2018-07-131-1/+1
| | | | | Change-Id: I3bb6a2646f2c424feb0123ea0aeef07c4c16421a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectExplorer: Do not overwrite shared project settingsOrgad Shaneh2018-05-081-2/+2
| | | | | Change-Id: Iecf684677599975e6f44df0d354ce7cd8c7aeeb9 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ToolChain: Use SettingsAccessor to access XML settingsTobias Hunger2018-04-201-5/+12
| | | | | | | | | This allows for use of the new SettingsAccessor infrastructure for upgrading, backups, etc. Task-number: QTCREATORBUG-20148 Change-Id: I5419c86c0fd576a59ec91c212097c8f987e01da2 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-04-131-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/settingsaccessor.cpp src/plugins/autotest/autotestplugin.cpp src/plugins/git/gitclient.cpp src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp src/plugins/qbsprojectmanager/qbsrunconfiguration.h Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
| * SettingsAccessor: Support user file without EnvironmentIdOrgad Shaneh2018-04-091-1/+1
| | | | | | | | | | | | | | | | Let the users forge a user file without injecting their environment. Task-number: QTCREATORBUG-20097 Change-Id: Ia481f0f6d7c704d26b5f7d0f985f38dd39027f95 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | SettingsAccessor: Remember last saved stateTobias Hunger2018-04-101-1/+10
| | | | | | | | | | | | | | | | | | Remember last saved data and do not save it again if nothing had changed. Change-Id: I093859ff5edc8d1d6e7b17ecd97985ca6fb0e579 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Utils: Purge asConstOrgad Shaneh2018-04-091-1/+0
| | | | | | | | | | | | | | | | Replace by qAsConst. Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | SettingsAccessor: Fix logic to decide when to do a backupTobias Hunger2018-03-051-3/+3
| | | | | | | | | | | | | | This fixes spurious *.user.-1 files from popping up. Change-Id: Ia78b99e7c535c085d85673cb310f0806ec4b4fee Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | SettingsAccessor: Rename BasicSettingsAccessor to SettingsAccessorTobias Hunger2018-02-151-50/+49
| | | | | | | | | | | | | | | | Rename BasicSettingsAccessor to SettingsAccessor, now that the name is available again. Change-Id: I49473f0c701976f992209f06d48decf047ab19de Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | SettingsAccessor: Extract functionality to merge settingsTobias Hunger2018-02-141-254/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move functionality related to merging settings into MergingSettingsAccessor, move code specific to the .user-files into UserFileAccessor. Remove SettingsAccessor class, now that all code has been moved out of it. This patch changes the merge mechanism a bit: It used to upgrade the user and tha shared file to the higher version of these two, merge, and then upgrade the merged result to the newest version. Now it upgrades both the user as well as the shared file to the newest version and only merges afterwards. Change-Id: I2a1605cbe9b9fb1404fcfa9954a9f3410da0abb1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | SettingsAccessor: Extract upgrading functionalityTobias Hunger2018-02-141-271/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract upgrading functionality from SettingsAccessor into UpgradingSettingsAccessor. Fixes surprising behavior in test ProjectExplorerPlugin::testUserFileAccessor_prepareToReadSettingsObsoleteVersionNewVersion where the Version was thrown away. Also adds a error/warning distinction to BasicSettingsAccessor::Issue, so that the non-critical ones can be ignored later. Change-Id: Ia38d074f91cd8d8f820f9bec96d3330d748564c7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | SettingsAccessor: Use optional for return value of BackUpStrategy::backupNameTobias Hunger2018-02-131-13/+18
| | | | | | | | | | Change-Id: I70aacd5804b10ee51c81c3e3d877f7c142d618b4 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | SettingsAccessor: Extract handling of backupsTobias Hunger2018-02-131-231/+203
| | | | | | | | | | | | | | | | | | | | | | Extract the code that handles backups from the SettingsAccessor into a BackingUpSettingsAccessor. Move code up from SettingsAccessor into UserFileAccessor where it belongs. This became possible due to the extraction. Change-Id: Icacaa4e7231b3c0c520154c76f9338227f96a614 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-02-071-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/coreplugin/locator/locator.cpp src/plugins/imageviewer/imageviewerplugin.cpp src/plugins/remotelinux/remotelinuxplugin.cpp src/tools/clangbackend/source/tokeninfo.cpp tests/unit/unittest/data/highlightingmarks.cpp Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
| * Utils: Fix UI textLeena Miettinen2018-02-061-1/+1
| | | | | | | | | | Change-Id: Iae4302f2866abde5a9771ca4c7fc25dedb6dc0b9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Utils: Fix compile with Qt lesser than 5.10Christian Stenger2018-02-071-3/+6
| | | | | | | | | | | | | | Broke with 79a43b4d86e0c21a0dfebf4a9baaa5ef03760d33. Change-Id: I9e7c9dc02c917b0ec3672b296e673212b16e835d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | SettingsAccessor: Unify handling of different file locationsTobias Hunger2018-02-061-32/+47
|/ | | | | | | | Unify the code calculating the different file locations used by the SettingsAccessor. Change-Id: I85283f99618143ce1fbdd309bce12529cec442ca Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Settingsaccessor: Extract file access and error reportingTobias Hunger2018-01-151-245/+267
| | | | | | | | Move file access and error reporting out of SettingsAccessor and into BasicSettingsAccessor. Change-Id: If6cc9157c1a532f117c48b929c05f55d89a339eb Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* SettingsAccessor: Remove SettingsAccessorPrivate::Settings::isValidTobias Hunger2017-11-301-11/+0
| | | | | | | It is unused. Change-Id: I9cace756479a2af2a1b96a3e4bde790f31b319ae Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* SettingsAccessor: Move code aroundTobias Hunger2017-11-301-104/+96
| | | | | | | | No change is intended but the moving of entire classes, methods or functions. Change-Id: I18d3462bb97c203aee1b81f3c0d7a429a9aa3e86 Reviewed-by: Marco Bubke <marco.bubke@qt.io>