Commit Graph

34 Commits

Author SHA1 Message Date
Christian Stenger
9a4cae42c0 Tests: Make environment test less verbose
Only print out additional information if the environment
does not match the expected one.

Change-Id: I9be1a90400a180a4cbd0381f54eea79409c007c7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-05 11:46:04 +00:00
Christian Stenger
5b93e34c00 Utils: Allow comments in environment items
This patch allows commenting environment changes or adding
comments to the batch edit widget.
To mark a line as comment prefix it with '##'.

Modifying the environment by using the batch edit mode
allows using '#' to disable variables.
Mis-using this to disable statements of the environment
items widget is tempting and other tools explicitly allow
it this way. But when doing so, the environment may get
some unforeseen modifications.
So, explicitly provide a mechanism for comments and be
more clear about this inside the documentation.

Change-Id: I6a58d0d00e996a3f886ec30e826cade324321818
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-05 10:48:24 +00:00
hjk
0a1783d656 Utils: Rename NameValueItem to EnvironmentItem (1/2)
Only used in Environments nowadays.

Change-Id: I64a645ebebd5cb57c50d5d8f72a5e4dba40e122f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-02-14 11:33:53 +00:00
Marcus Tillmanns
a25bbf23c6 Utils: Fix error prone default value of appendOrSet
It was not readily clear that Environment::appendOrSet/prependOrSet
needed a value for "sep", otherwise it would just concat the values without separator. This got apparent when looking at usages of
appendOrSet.

Instead there are now three options, "Auto", "Colon" or "Semicolon"
with the default being "Auto", which determines the separator based on
the Environment::OsType.

Usages of appendOrSet and prependOrSet are also fixed with this commit.

Change-Id: I868e14ce38f50be9cd07292fe3f22663a62d116d
Reviewed-by: hjk <hjk@qt.io>
2024-01-26 10:10:03 +00:00
hjk
41b6ecf502 Fix environment auto test
Amends 1e1befd9eb.

Change-Id: Iecd06ee06081057208a2b3387d618142dc74d0bd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-08 12:03:52 +00:00
Alessandro Portale
1e1befd9eb Proliferate pathListSeparator()
Change-Id: I546107af6a88ad5901659a0a64485e4ebca3a164
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 15:17:10 +00:00
Christian Stenger
13bf47c875 Tests: Add another environment test
Test appending and prepending PATH.

Change-Id: If2ff84b24a8f961af0a3bb64ed77aaf37fe247fd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-17 14:21:24 +00:00
hjk
3e5d14b020 Utils: Replace Environment::find iterator use
Task-number: QTCREATORBUG-28357
Change-Id: I2723ffd6b7842f88009701eccea9aacac8cbf516
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-02 16:02:41 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
Eike Ziller
737877984d Use QTEST_GUILESS_MAIN where applicable
instead of QTEST_MAIN. Reduces the initialization that is done by the Qt
test applications, and can also reduce interference with normal OS
operations like the current window loosing focus.

Change-Id: If88f289281aa1c8703ac7d4dbe0799d067c16588
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-13 06:06:44 +00:00
Christian Kandeler
868236886a Utils::Environment: Extend autotest
... to cover the diff/apply mechanism.

Change-Id: I7d9e794792d6730e935c99c66062ea417dc65fe7
Reviewed-by: hjk <hjk@qt.io>
2020-08-11 12:13:23 +00:00
Christian Kandeler
567a0db6dd Utils::Environment: Consider target OS type when sorting
That is, use case-insensitive sorting on Windows, so that e.g. "Path"
will not appear after "PROCESSOR_REVISION".

Fixes: QTCREATORBUG-22786
Change-Id: I42d469b6079037d1062dbd5b273f5aa8ade25e79
Reviewed-by: hjk <hjk@qt.io>
2019-08-22 10:29:22 +00:00
Christian Kandeler
6d3f236aab Utils::Environment: Use expanded values
The Environment class is supposed to support values with references to
other variables, but we failed to actually expand them in most places.

Fixes: QTCREATORBUG-22687
Change-Id: I108cb59d3b4571471423455240f6f4f1cf64bf05
Reviewed-by: hjk <hjk@qt.io>
2019-08-20 12:39:16 +00:00
Christian Kandeler
4d71c0f13e Let users disable environment entries
It's helpful to be able to temporarily disable environment variables, as
opposed to having to remove (and then re-add) them entirely.

Fixes: QTCREATORBUG-20984
Change-Id: Ib0d287035b9357507c4c19faaf3a1517382506b5
Reviewed-by: hjk <hjk@qt.io>
2019-07-22 14:31:01 +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
Tobias Hunger
5bd2887045 Environment: Keep case of environment variables on windows
Task-number: QTCREATORBUG-18915
Change-Id: I4c389155e03dde423d1ed578409baa1f38fc26db
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-09-19 11:37:03 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Tobias Hunger
954569387c Update License according to agreement with Free Qt Foundation
* Update license information in tests directory

Change-Id: I311441dd37d053ca3175e44b284258e232ee93e0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 16:01:06 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
hjk
a322bd606f Replace qt-info@nokia.com with info@qt.nokia.com
Change-Id: I61e7cf189a1c4ea04e2a88a80a4f15e43cd3c018
Reviewed-on: http://codereview.qt.nokia.com/1187
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-07-06 11:14:01 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
con
23c22b7c66 License headers, part 2 2010-12-17 17:14:20 +01:00
Oswald Buddenhagen
0641ed0eaa change Environment::expandVariables() semantics
instead of being os-agnostic, interpret the os-native expansion style,
so it is consistent with proper (shell) command lines.

don't interpret quotes, as this function is meant for expanding isolated
filepaths, where nobody would expect quoting. instead, use the windows
style of simply not doing an expansion if a referenced variable is not
found, which should be good enough - it's rather unlikely that something
which happens to be an expansion of an existing variable is actually not
meant to be one.
2010-11-17 13:19:06 +01:00