Commit Graph

173 Commits

Author SHA1 Message Date
Tim Jenssen
1df6443d4a Merge remote-tracking branch 'origin/4.10'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/libs/utils/synchronousprocess.cpp
	src/plugins/baremetal/iarewtoolchain.cpp
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	tests/unit/unittest/CMakeLists.txt

Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
2019-07-04 15:17:55 +02:00
hjk
6a58666f44 More Utils::toSet/toList
... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-04 12:28:38 +00:00
Ville Nummela
63e4180242 ProjectExplorer: Add special handling for removing files
... from a project which are pulled in via wildcards.
Such files cannot be removed from a project file, because they are
not listed verbatim. This kind of failure should not be reported to the
user if the file is also deleted, as the file list will have the correct
state after the next reparse.

Fixes: QTCREATORBUG-22586
Done-with: Christian Kandeler <christian.kandeler@qt.io>
Change-Id: I3dc66fe9a6594be7d0b86f46d830cd099ee49fd7
Reviewed-by: hjk <hjk@qt.io>
2019-06-25 11:53:58 +00:00
hjk
7ebe005206 ProjectExplorer: Replace RunConfiguration::executable
... by a RunConfiguration::commandLine().

That's what is typically consumed, and removes the need for some
custom runnable() implementations.

Change-Id: I7700b12cdd0965802a0add977b432314734a5a72
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-12 12:30:23 +00:00
hjk
611e1ea837 Utils: Encourage marking of raw command line parameters
Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-06 12:22:47 +00:00
hjk
7d02a76be1 PythonEditor: Use Utils::CommandLine when creating a runnable
Change-Id: I670390f6034923d1f7f750435c0c8eb02d60b6f6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 10:17:52 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
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>
2019-05-28 12:23:26 +00:00
Christian Kandeler
a9d2e14dca ProjectExplorer: Add executable() accessor to RunConfiguration
Amends f6c276daf0, which was a quick fix for 4.9.

Change-Id: I94281af6a9a0d0bfe197ce836488f708d5bd677d
Reviewed-by: hjk <hjk@qt.io>
2019-05-24 09:12:42 +00:00
hjk
ce449e4219 ProjectExplorer: Remove BuildTargetInfoList wrapper class
Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-14 13:30:34 +00:00
Eike Ziller
b5e7522237 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/pythoneditor/pythoneditorplugin.cpp

Change-Id: I9a95df5e16b34538539ced7dfc5d326b700794e6
2019-04-02 12:22:48 +02:00
hjk
841bbfa7bf ProjectExplorer: Switch order of template parameters
... of SimpleRunWorkerFactory.

This requires being explicit about the SimpleTargetRunner worker
default, but makes the template re-usable for current users of
RunWorker::registerWorker() which I would like to phase out now,
for less variations in the RunWorkerFactory setup.

Change-Id: I32638437e5bb29f143650f5fde706711ab25accf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-02 09:46:48 +00:00
Eike Ziller
d408d74f44 PythonEditorPlugin: Sprinkle const over code
Change-Id: I01b4b11299bd73f6bae87045deef0328753720a7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-03-28 08:48:31 +00:00
Eike Ziller
ae046702b0 Fix detaches in for loop
Change-Id: I8d1de1435c7f53057611597b06d8c2af709563ec
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-03-28 08:48:21 +00:00
hjk
1bc10248c0 ProjectExplorer: Introduce a SimpleRunWorkerFactory template
... and use in as replacement for RunConfiguration::addRunWorkerFactory.

It is still convenient to have a simple way to set up run worker
factories for the typical "just run for this configuration" case,
but it's even better if it follows the nowadays predominant pattern
of keeping factories in the plugin's pimpl.

Also, it turned out there were two copies of
QmlProjectRunconfigurationFactory code, one is enough.

Change-Id: I0b28c4ea18d0f52165a49f6133dc8687a3b9c7cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-19 15:56:17 +00:00
hjk
a6fc9a5812 Python: De-macrofy
Change-Id: I5a0b2406d1ba8ad3a168c2635cbaec9711c4474f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-03-15 12:51:15 +00:00
Cristián Maureira-Fredes
b503ea7f06 Add more Python features
On the wizard related to Main Windows, not there are more
options to specify the name of the files and classes.

It's possible to Add and Remove files on Python projects
that use the new .pyproject file.

Improved the empty application,
to template the .pyproject file and use the proper name
for the file.

Added the icons for file overlay.

Change-Id: Iaba7feda69e0f608260b5fb1d1b04b2a42b08c2d
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 12:50:38 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00
Robert Loehning
10b3da5d34 PythonEditor: Fix strings
Change-Id: Ib48c5b7c5cc56ac8bfe1d0641d595e680faf62e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-03-11 17:21:54 +00:00
hjk
6faaea8d0c ProjectExplorer: Split EnvironmentAspect
... at least logically a bit more into hunks responsible for
one of the possible choices of base environments.

This makes it possible to move code that modifies individual
cases closer to the only place that uses it.

Change-Id: I1c87bb869e04e44b92ff097b0bf25274f93808be
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-11 12:40:51 +00:00
Eike Ziller
0619de8681 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/tools/clangpchmanagerbackend/source/taskscheduler.h

Change-Id: I518adaf647df412887c2a372416634359f09ad2a
2019-03-05 10:22:45 +01:00
Friedemann Kleint
e1ac54c33b Python projects: Add error handling to the JSON parser
Display parse errors in case the file is invalid.
Amends f7e1354ae5.

Task-number: QTCREATORBUG-21824
Change-Id: I0d357597257fcbc49719fae781c61f251a5392fe
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-03-01 17:37:45 +00:00
hjk
e3a7aa1ad2 ProjectExplorer: Flip default for ProjectNode::showInSimpleTree
Change-Id: Ibd4f91ad55b2be93d20dfc4f583de95274e981ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:57:05 +00:00
hjk
729c74379a ProjectExplorer: Merge Node::isFileNodeType and asFileNode
They were identifying the same set of nodes.

Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:44:22 +00:00
hjk
89c9eed127 ProjectExplorer: De-virtualize FolderNode::addFileFilter
... which interestingly enough is only used with Add Existing
Directory, not with Add Existing Files.

Change-Id: If76ba5f192dc49f3cb56e3d0c9ab249e47aa1c28
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:42:14 +00:00
hjk
ad4e2562fa ProjectExplorer: Replace Node::setNodeType by virtual functions
Not the usual direction of change, but currently there are
several systems to identify or invoke node functionality.

Virtual functions are likely to stay in this context, so this
here attempts to help consolidation by reducing the influence
of the node type flags, hopefully leading to full removal
by making remaining functionality available through the
other mechanisms (virtual functions, asFooNode() 'casts',
less so the FileType flag).

Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:32:14 +00:00
hjk
09372918c1 ProjectExplorer: Remove FileNode's isGenerated constructor bool
Use setter of base class, similar to setListInProject() before.

Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-25 12:23:31 +00:00
Cristian Maureira-Fredes
f7e1354ae5 Add Qt for Python templates and better support
QtCreator:
* Add new icons
* Add support for `.pyproject` files,
* Set `.pyproject` as default, but keep compatibility with `.pyqtc`
    * `.pyproject` is a JSON file, while `.pyqtc` is a plain-text.

Python class:
* Add option to ask if use PySide2 or PyQt5
* Remove the old import try-except structure
* Remove iconText and add icon option
* Remove shebang
* Add utf-8 support

Python file:
* Remove code
* Remove iconText and add icon option
* Remove shebang
* Add utf-8 support

Qt for Python - Empty
* Add file with basic statements to execute a QApplication

Qt for Python - Window
* Add file with basic statements to execute a QApplication,
  which contains a QMainWindow

Task-number: QTCREATORBUG-21824
Change-Id: I4adb3ab6b179f084c7b674a6d4f643445fe24929
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-04 09:32:30 +00:00
Alessandro Portale
45db65e09c PythonEditor: Modernize
modernize-*

Change-Id: I3d8a79b59822f9d13f90730b770121dbf582da84
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-30 16:50:50 +00:00
hjk
1c9410e353 ProjectExplorer: Rename 'extraAspect' to 'aspect'
Using aspects is the standard pattern nowadays, there's nothing 'extra'
to them anymore.

Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-02 08:32:51 +00:00
Orgad Shaneh
d585b85550 PythonEditor: Support file operations
Change-Id: I0fc5a3e1795fe56c753e300ed1c1ca7514964401
Reviewed-by: hjk <hjk@qt.io>
2018-10-01 16:44:31 +00:00
Orgad Shaneh
a31655cde7 PythonEditor: Avoid file duplication
Every add/remove of a file added another entry of the project file.

Change-Id: I800adc3540c3fc8b109864e86ab590af5374e30b
Reviewed-by: hjk <hjk@qt.io>
2018-10-01 16:44:16 +00:00
Orgad Shaneh
b1c37910f1 PythonEditor: Remove dead code
Change-Id: I55f7d513755857a5759ba8688e5cfeccbdaa379f
Reviewed-by: hjk <hjk@qt.io>
2018-10-01 16:42:43 +00:00
hjk
32ba65c7f8 ProjectExplorer: Remove IRunConfigurationAspect::runConfiguration
... and adapt constructors to not take the now-unneeded
RunConfiguration pointer.

Change-Id: I53ff338f51334ff7b0c22d4bed92bfcfc8225ea7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 12:09:39 +00:00
hjk
f66770cde1 ProjectExplorer: Pass macro expander to ArgumentsAspect::arguments
To remove the last user of IRCAspect::runConfiguration.

Change-Id: I1390166730112008a4050877f96bb29f274e7ef1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 07:32:22 +00:00
hjk
4192d7d62f ProjectExplorer: Compactify runconfiguration aspect creation
Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-09-04 12:45:21 +00:00
hjk
25400751a4 ProjectExplorer: Remove RunConfiguration::fillConfigurationLayout
Instead of using a hard-coded list of well-known (optional) aspects,
add all aspects, so there is no need for special treatment of
RunConfiguration with unusual/custom aspects needed.

Price and benefit is that the individual run configs are again
responsible for the aspect display order which is determined
from the aspect construction order.

Change-Id: Iff2656b2e358c0f0f789d4c006a5c44d0a1536a5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-09-04 11:02:49 +00:00
hjk
98f3b961c6 Unify key names for various fields in stored RunConfigurations
This replaces various versions of the key name of the arguments,
working directory, use terminal and use dyld image suffix fields
by unified versions ("RunConfiguration.Arguments",
"RunConfiguration.WorkingDirectory", "RunConfiguration.UseTerminal",
"RunConfiguration.UseDyldImageSuffix").

The different names for the fields are technically not needed
(as proven by several cases that already now used the same key),
partially outdated ("Qt4ProjectManager.MaemoRunConfiguration.Arguments")
make RunConfiguration constructors less uniform and more complex
than needed.

The "RunConfiguration." prefix in the new names is not needed, but used
by several other settings, so having it there looks more uniform now.

In (the unexpected case) that different keys would ever be necessary,
the default key name could still be overridden by using setSettingsKey
from user code.

Change-Id: Ifb74ad74e0a9c724c8bf5e71e1bb2424d5d1831b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:00:46 +00:00
hjk
0fbb2839f9 Remove ApplicationLauncher::Mode
The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.

All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.

Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-05 15:08:29 +00:00
hjk
99631bcdb4 PythonEditor: Use new convenience function to set up run workers
Change-Id: I2c7b0c57a077794756643862c242c499d93295c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-30 11:59:25 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Christian Stenger
9ebfda4c03 PythonEditor: Fix history completer for interpreter
Change-Id: I14e67e585e06adc926b052b625701b3fbe7fca94
Reviewed-by: hjk <hjk@qt.io>
2018-05-09 12:01:28 +00:00
Tobias Hunger
d332954567 ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptr
Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:15 +00:00
Tobias Hunger
5754d5accf ProjectExplorer: Use unique_ptr for Project::setRootProjectNode
Change-Id: If63a49d0eecfb93adcc6076fcb3208c87603af10
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:35 +00:00
hjk
67c775afd6 Python: Code cosmetics
Remove some unnecessary #include and use a recently introduced
RunConfiguration::builtTargetInfo() convenience function.

Change-Id: I76750fd66ae2c268b68d225c62aad7d880256d07
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-30 08:48:48 +00:00
hjk
c6cc997be4 Python: More RunConfiguration aspect use
Include interpreter and main script settings.

Change-Id: I91c19ef124ff8b7da34bc67fb1a5ef054c3499b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-30 07:36:42 +00:00
hjk
50f2bcd9ae Python: Plugin code cosmetics
Use the common pattern for PythonEditorPluginPrivate.

Change-Id: Icec8d975e0ab921be7121d123af4dddecd7d0384
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-27 12:12:37 +00:00
hjk
366be94ad9 Pass id to RunConfiguration constructor
It's what the base class requires, and opens the possibility to
have several factories creating the same type of run configuration.

Also move ios, winrt and android factories closer to their products,
it's the predominant pattern nowadays.

Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-25 15:06:11 +00:00
hjk
def04e88a2 Simplify runconfiguration aspect addTo... interface
The parent widget is always given by the layout, no need to pass
it as separate parameter.

Change-Id: I9e7ed3a89eb63b78a549471d839060131737ff78
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-24 07:26:22 +00:00
Tobias Hunger
2a34f2177c ProjectExplorer: Hide build page for projects that do not build
Change-Id: I56feaab67690b5ece7379a9c1f676392230de107
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:52 +00:00