Commit Graph

2176 Commits

Author SHA1 Message Date
Tobias Hunger
4786c5928a SettingsAccessor: Rename BasicSettingsAccessor to SettingsAccessor
Rename BasicSettingsAccessor to SettingsAccessor, now that the name
is available again.

Change-Id: I49473f0c701976f992209f06d48decf047ab19de
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-15 13:14:32 +00:00
Tobias Hunger
6445fb19bb Settings: Add test to pick right file if several exist
Test picking the expected file when several exist in
BackingUpSettingsAccessor.

Change-Id: I09d346a98a8df13d6cf3ee53ee20ce34e45e8d28
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 13:24:26 +00:00
Tobias Hunger
97cf4bb278 SettingsAccessor: Improve test by mocking out read/write operations
Change-Id: I4d4cf6ff0be3d4b8278a7613c26f2b1752304ad4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 13:24:11 +00:00
Tobias Hunger
b95bbe1d57 SettingsAccessor: Extract functionality to merge settings
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>
2018-02-14 13:23:33 +00:00
Tobias Hunger
9ffd52f9c5 SettingsAccessor: Extract upgrading functionality
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>
2018-02-14 13:23:25 +00:00
Eike Ziller
43936b1e86 Merge "Merge remote-tracking branch 'origin/4.6'" 2018-02-13 12:38:29 +00:00
Eike Ziller
c7fdb93865 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I2445882a270731b866b04f28ff87d161224c539a
2018-02-13 13:37:37 +01:00
Tobias Hunger
23bb717101 SettingsAccessor: Extract handling of backups
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>
2018-02-13 12:21:33 +00:00
Christian Stenger
cafb0760f6 Tests: Fix compile with Qt5.11
Function to convert char[] into QString has been deleted.

Change-Id: Iedf5db322b907d4ea1a20cc5c70394388d54f214
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-02-13 08:47:45 +00:00
Colin Duquesnoy
2a016d05b2 Add support for nested namespaces (C++17)
Task-number: QTCREATORBUG-16774
Change-Id: I3de3ac65810213e21c9a3bafef2474d252e191f7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-09 17:54:30 +00:00
Christian Stenger
0c50d54da7 Tests: Fix compile for Qt5.6
Unfortunately fixed on master instead of 4.6.

Change-Id: Ie1e91135899353d81857b75d4e461a5a8cd240d4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 962023648c)
2018-02-01 12:21:19 +00:00
Christian Stenger
962023648c Tests: Fix compile for Qt5.6
Change-Id: Ie1e91135899353d81857b75d4e461a5a8cd240d4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 11:15:10 +00:00
Nikita Baryshnikov
66d02773e7 Environment.constFind added test
Change-Id: I6213650b811960fa67545df4b6531aafcca05c81
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 08:12:57 +00:00
hjk
a42ae9e6f5 Debugger: Add the ability to auto-test expression evaluation
... and use it for the hidden "sequence" feature.

Change-Id: I3430a24774264a573687ee818064314a8bca7212
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-31 14:19:23 +00:00
Ulf Hermann
77e28efad6 Timeline: Use some better number types
The scale parameters are converted to single precision float anyway as
soon as we do something with them. We might as well change all the
methods to be single precision, too.

The min/max row values should really be 64bit as 32bit values are not
enough to express memory usage.

Change-Id: I2b058b112286eabb1c077f7e746c48b6b99cb416
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-16 09:02:57 +00:00
Tobias Hunger
21e7e9ea3b Settingsaccessor: Extract file access and error reporting
Move file access and error reporting out of SettingsAccessor and into
BasicSettingsAccessor.

Change-Id: If6cc9157c1a532f117c48b929c05f55d89a339eb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-15 14:28:01 +00:00
hjk
0cce7a82fe Debugger: Add some simple dumper for std::function
Linux/gdb only, pretty print the cases of default constructed objects
and real function pointers.

Task-number: QTCREATORBUG-19410
Change-Id: I08332af649bda861d9f53c0e0feb1f37db72b875
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-05 07:20:26 +00:00
Oswald Buddenhagen
777ca8e655 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
2017-12-21 13:20:24 +01:00
Eike Ziller
8944ba0391 Utils::transform: Add support for various map types as result
Add support for output as std::map/unordered_map/set and QMap and QHash,
when giving the full result type as template argument. For std::
(unordered_)map, the function must return a std::pair<Key,Value>, for
QMap and QHash it can also be QPair<Key,Value>.

Change-Id: If3dff17ab6aa5d1b11abc244813fd885d10c75a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-20 09:58:50 +00:00
Eike Ziller
f62b24c475 Utils::transform: Support containers without reserve()
Support containers without reserve() as result container, for example
std::set/deque/list

Change-Id: Ia96b834c67d5ee74bfb9de2cf6b86639f6b3d5d7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-20 09:58:27 +00:00
Marco Bubke
91e40e12db Utils: Converter to raw pointer and references
Sometimes you want to get raw pointer container from smart pointer
container and reference container from value container.

Change-Id: Ia018d572ac0a7bf742f3937dc38ee30670a3ca73
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-20 09:58:17 +00:00
Christian Stenger
0fcbe60cd6 Tests: Fix qml import check
Change-Id: I7fcf4a3b718c3b2124171187cdb06493c84ff7b8
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-12-19 13:51:35 +00:00
Eike Ziller
e0a23664aa Utils::transform: Allow usage with non-const source containers
Makes it possible to e.g. transform to list of reference_wrappers.

Change-Id: Ib608034fc3f296824c289edd27563bc7a196ac6d
Reviewed-by: hjk <hjk@qt.io>
2017-12-19 07:35:38 +00:00
David Schulz
800aa7466f Debugger: improve symbol lookup times for cdb
Task-number: QTCREATORBUG-18613
Change-Id: If8dac096fa4d0d8afc6fb8f7bbffd090a5dc6e19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-13 13:59:01 +00:00
Christian Stenger
299d0f0e4f Tests: Fix compile with MSVC2015
Change-Id: Ic9a1839325febeb6bde0b656dce88342f3955c53
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-13 13:44:03 +00:00
Eike Ziller
6b48beeeb0 Support specifying complete result type in Utils::transform
Can come in handy when the function or member does not directly return
the right value type for the result list, but is implicitly convertable
to it. For example from pointer to class to pointer to superclass, or
from int to double.

const auto result
    = Utils::transform<QVector<double>>(v, &ValueType::intMember)

Change-Id: I0e1914d70bb2580b91098dd37e85a31ca14b0ae6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-12-12 14:44:15 +00:00
Eike Ziller
fb4f7e7420 Simplify transform and add support for more input container types
Change-Id: Ib75cfcc7741be686c0117fbb27df869e14db4f69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-07 09:55:42 +00:00
hjk
2b18af321a Debugger: Add test for new Debian gdb version string
Change-Id: I006fb9ae57610d2be65c1d6b83fa38660a5326aa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-06 10:48:46 +00:00
Tobias Hunger
2c09424c13 Utils: Clean up Utils::findOr and Utils::findOrDefault
Change-Id: I638e68480d3985b6df9a18aa96a067ee68484b12
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-01 14:41:15 +00:00
Tobias Hunger
b81d788793 Utils: Support more containers with Utils::transform
Support std::vector and similar classes as input and output.

Change-Id: I1d202d54c18e868ce0e71e4c2b6288565710baa8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-01 14:11:28 +00:00
Tobias Hunger
33fc20ab51 Utils: Improve Utils::contains
* Consistently use anyOf to implement contains.
* Support contains over an container of std::unique_ptr matching a pointer.

Change-Id: I0180f3ec3d5935d8afeeac67a745d4b38a01674d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-01 13:16:43 +00:00
Tobias Hunger
9b832f670d Utils: Implement more Utils::anyOf variations
Change-Id: I0cba5b58dde6003f5c5cb399142f985cbe83f0a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-01 13:16:37 +00:00
Tobias Hunger
ee834b7e2f SettingsAccessor: Add setters to VersionUpgrader
Add setters to VersionUpgrader and use them. This shortens the
implementation classes a bit.

Change-Id: I5ffe6f085752bf39bbcb08c286844cc1088eeea5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-30 10:40:53 +00:00
Christian Stenger
e5fae9b914 Tests: Fix compile on Windows and Linux
Template code inside utils/algorithm.h is not correctly instantiated when
respective containers that shall use these functions are included after
the algorithm file.
Additionally there had been issues using nullptr as comparison inside
QCOMPARE().

Change-Id: I2bd6baf3890090c5f5bbbd6229afb9aeeb7617ef
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-30 09:21:51 +00:00
Eike Ziller
c1aa745813 Add missing include to algorithm test
Change-Id: Ia7302723a0ec41456ca99704b7f8c680f6893c5d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:09:49 +00:00
Eike Ziller
c90e5b50dc Algorithm: Support std::vector<std::unique_ptr> with contains and findOr
Change-Id: I01cb71c06b405f071498ed8752f9acac44d2b223
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 08:59:52 +00:00
Eike Ziller
e2baa116ca Merge remote-tracking branch 'origin/4.5'
Change-Id: I86852d289c22210a0439e8e297819dc7276a96de
2017-11-29 09:56:22 +01:00
Christian Stenger
eaf4b67461 Tests: Fix compile on Linux and Windows
Change-Id: Ie8db68769a2419c9ad8700d9eef1d4093c209d9b
Reviewed-by: hjk <hjk@qt.io>
2017-11-28 08:47:39 +00:00
Tobias Hunger
566b118a87 Utils: Make algorithms take more containers
Change-Id: I05bd1052bbc2c6481fdec8a3763d9ae4f3dc8f44
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-27 15:00:16 +00:00
Christian Stenger
1914481a30 Tests: Disable test for LLDB
Change-Id: I1f7a576d3b8feb527013e3b679fc60c4e663f2eb
Reviewed-by: hjk <hjk@qt.io>
2017-11-27 12:48:42 +00:00
Christian Stenger
c2e92d3925 Tests: Fix compile with Qt5.6 + gcc4.9
Change-Id: Ic8d6c660cf4d5d185642dcad52753b4da9e70120
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-22 13:39:40 +00:00
Tobias Hunger
2e62690dcd SettingsAccessor: Do not hard-code document type
Change-Id: Ied886eac9fcb4a9c58f088c32ee5ba0646b94fbc
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 12:28:19 +00:00
Tobias Hunger
1aaed7477e SettingsAccessor: Add tests to save/load values
Change-Id: I08870a91c725eb6c5344545d8d829fc98a3231bc
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 12:28:13 +00:00
Tobias Hunger
0a202e4c29 SettingsAccessor: Use optional as return value of findIssues
Change-Id: Ib7ef8ec408f812a71735939514d98cf8755d292b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 11:59:08 +00:00
Tobias Hunger
6044b84e14 SettingsAccessor: Add tests for findIssues
Change-Id: Ib78c2c93dc9404087efe485fdaaad69595aa0125
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 11:59:02 +00:00
Tobias Hunger
b8f2d746d0 SettingsAccessor: Add methods to upgrade to a specific version
Change-Id: If368f4a35d3702dbf680b1306ca6311070aa9bb5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 11:58:56 +00:00
Tobias Hunger
5d6c2ca159 SettingsAccessor: Do not change data on invalid upgrade attempts
Make sure that the input data is returned unchanged if an invalid update
attempt is attempted.

Update tests accordingly.

Change-Id: If5c410bf1a757f984593bda871763af64d8dd972
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 11:58:50 +00:00
Tobias Hunger
9246a77a2f SettingsAccessor: Add tests for version upgrading
Change-Id: Ie41433b507bdd68b834a6fc1879f3f1b71f7b4ff
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-11-22 11:58:41 +00:00
Tobias Hunger
0269503dd8 SettingsAccessor: Improve SettingsAccessor::isBetterMatch
Improve the behavior of isBetterMatch, so that it now handles
invalid versions as well as invalid ids. Simplify code where possible.

Change-Id: I2e65c0cc01d32fa77df8b5ec0d62b765e6c458f7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-22 10:16:25 +00:00
Tobias Hunger
cacab453f7 SettingsAccessor: Add test for version upgrader registration
Change-Id: I04195b84b551333ef34f0f193d5c2237ad1c86c6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-22 08:59:48 +00:00