Commit Graph

44349 Commits

Author SHA1 Message Date
Ivan Donchevskii
b276de576f CppTools: Replace "\r\n" with "\n" in cpp file content
When we get the file working copy it never contains "\r\n"
line endings. Let's provide the same behavior when we have
no working copy and read the file from disk.

Task-number: QTCREATORBUG-19905
Change-Id: I720d62426860dcdcdd8520db5430d9f4f5900ab6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 13:09:20 +00:00
Ulf Hermann
30638df441 QmlProject: Resolve import paths relative to target directory
On desktop the target directory is the same as the source directory. On
remote devices, it can be different. We need to resolve when we know
where to deploy.

Change-Id: I3f2bc088476ae73dac5231cb24f277c055f7d044
Task-number: QTCREATORBUG-19888
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 13:04:29 +00:00
David Schulz
bde42d755f ProjectExplorer: fix async loading of MSVC toolchain
Change-Id: Ie69f89fbe3f9b659ead4de5f570d4c00469855f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 13:00:00 +00:00
David Schulz
f4b0274f4e Utils: add != operator to environment items
Change-Id: Ib31fc09553a54290202329be1d54e6a955c65f77
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 12:59:55 +00:00
David Schulz
3c94b4cb6b Utils: Add variant converter for EnvironmentItem(List)
Simplify saving environment items to creator settings by providing
converter to QVariant.

Change-Id: I65ef3b33964ba0af97bbd46e18a13ae316d7ecee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 12:25:44 +00:00
Eike Ziller
16d1561794 Improve detection of toolchain and debugger for desktop kits
In the situation where a cross-compilation tool chain has the same ABI
as the host.
Prefer toolchains and debuggers in PATH if the ABI matches. This is just
a short-term hack. It is not fail-safe, because either both tool chains
could be found somewhere in the PATH, or the "right" desktop tool chain
could not be in PATH, but manually added.
Anyhow, in many default setups this should improve the result. (In case
of failure the user can still change the kit manually.)
A better long term solution would be to make our ABI settings more
flexible.

Change-Id: I6ec5aaf45ef0b983cd949895dacdd5190f786219
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 10:43:41 +00:00
Eike Ziller
4adf04c79f Work around Qt issue that setting 1.0 on opacity effect hides widget
Issue in Qt 5.9.4 & 5.10.1.
This should be reverted the moment that is fixed.

Task-number: QTCREATORBUG-19716
Change-Id: I9ae187a43d0054f162491308d30b9a5b96465ec4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-23 09:58:32 +00:00
Eike Ziller
7c3cfa166d Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/helpmanager.cpp

Change-Id: I2feb60ec0afb2f22f75dc137a01c3fa217b299d8
2018-02-23 10:56:52 +01:00
Christian Kandeler
09a7247bfc Update qbs submodule
To HEAD of 1.11 branch.

Change-Id: I42415f3b3b478dc5cb4e098bbeac1da54d547d9a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-02-23 09:39:29 +00:00
hjk
31a55b0247 ExtensionSystem: Remove per-plugin object pools
Remove now-unused IPlugin::addAutoReleasedObject and IPlugin::
{add,remove}Object convenience functions that were only forwarding
to the global pool.

Adjust all related tests.

All previous users of these convenience functions are gone, and we do
not want to encourage the use of object pool anymore.

Plugins that wish to share objects to implement weak dependencies
can use the global object pool via  ExtensionSystem::PluginManager::
{add,remove}Object directly.

Change-Id: Ic668ad5504af76963f6d4c69ae160438efc70db5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-23 08:57:49 +00:00
Ivan Donchevskii
66fe088ab8 Clang: Do not call processEvents call in local renaming
Use QFutureWatcher and lambda instead.

Task-number: QTCREATORBUG-19799
Change-Id: I00e9439d46609902cbfb02906280c0c96b8c884e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-23 08:40:54 +00:00
Ivan Donchevskii
34fec1cad2 Clang: Make Q_PROPERTY replacement simpler
The infrastructure around Q_PROPERTY extraction
allows to make it static assert and still find
it's parent.
This way makes it easier for Clang to parse
and does not provide unexisting functions for class.

Change-Id: I1c40550c72d214c2448169094a46c6f793132f23
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-23 08:40:33 +00:00
hjk
38d15ebe2f RunConfiguration: Avoid unneeded calls to availableCreators()
It has been used twice on each Target::updateDefaultRunConfigurations():
Once to help filter out potentially interesting factories, and then
to actually retrieve the creators from the interesting factories.

The same result can be obtained with less effort and less code.

Change-Id: Ic83423bbbc172c842ec5a55fcd6ad83106e268aa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-23 07:09:41 +00:00
hjk
39b66f2cb8 Introduce and use IRunConfiguration::addSupportedTargetDeviceType
In line with addSupportedProjectType, saves a few cycles due to the
non-use of the temporary list, and in theory more flexible than the
existing set...(QList<Id>) as it potentially allows dependent plugin
to declare support for already existing configurations instead of
re-implementing their own.

Change-Id: I2b83e90de49daa9bfce6f780c5f51c2e971eb7d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-23 07:08:55 +00:00
Christian Stenger
092d5068bd ClangRefactoring: Fix compile for Qt < 5.8
Change-Id: I61a848c9a7bad42697dd6de4f5b002cc655381c6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-23 06:24:17 +00:00
Nikita Baryshnikov
f369048d41 Clang: Suppress a compiler warning in fulltokeninfo.cpp
Change-Id: I75fadf3c38b2a75cb8791da0271bf6e100505708
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 15:13:34 +00:00
David Schulz
dc358dc841 TextEditor: update scrollbar after adding annotation between lines
Emit documentSizeChanged after resizing the block boundaries because of
an annotation between lines.

Task-number: QTCREATORBUG-19790
Change-Id: If468ec003a43f37fdcb182344992e4094b269c92
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-22 13:40:04 +00:00
Ivan Donchevskii
1d2b27081a C++: Fix unit-tests for MatchingText
BackwardScanner required more investigation and this is
the better fix than 413c66ec.

Change-Id: I651a7b416b549cc4a0e086873262d04409a7448e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-22 13:21:38 +00:00
hjk
4286a4d507 QmlDesigner: Fix NavigationWidgetFactory retrieval
They aren't in the global object pool anymore.

Change-Id: I4f0ae69ebabe33f0276dbfd7137a4f8adbaad489
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-22 12:53:09 +00:00
Marco Bubke
73963cc9c7 Clang: Add time stamp based filtering for project parts
The source ids are now filtered by the modified time. If the modified time
in the database is older than the modified time of the file it will be
parsed. If it is not newer it will be not parsed.

Change-Id: I4ade3443dd66573ac88053a2cafa600e54cfe973
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:24:59 +00:00
Marco Bubke
a6f47e872f Clang: Add isInPrecompiledHeader to the file status table
It will useful to find out if we have to wait for an updated precompiled
header.

Change-Id: I6a314f278485965571cc6e46982bbd6f5523c581
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:24:31 +00:00
Marco Bubke
49bdde2ab0 Clang: Fix formatting
Change-Id: I77fb233f101f7046d5cfab71933c413ae15835d4
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:24:23 +00:00
Marco Bubke
157c74e1f1 Clang: Use C++ condition instead of preprocessor
It is now possible to refactor the code. This pattern is favorable to the
preprocessor.

Change-Id: Ic85db43e23e16412d938a47892f1812b5883d949
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:24:16 +00:00
Marco Bubke
1a4c51d15f Clang: Prevent segmentation fault in WriteMessageBlock
There could be already messages send before the backend is available. In
that case we now record that messages and send them if the socket is set.

Task-number: QTCREATORBUG-19761
Change-Id: I7c8d6fdb4fcc043bcdbb9e9aeb5752f89c24fdab
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:23:51 +00:00
Marco Bubke
6922f549d5 Clang: Check if the include search path has changed
If the include search paths and the compiler macros have not changed it is
save to assume that we don't need to update the symbol database. This saves
us from executing a very expensive task. Later we have to test the
modification time of the files too.

Change-Id: I6b958075024a811c2abd3d7918263fd74bba090b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:23:39 +00:00
Christian Stenger
e7663d0cce QmlJSEditor: Fix crash when triggering context menu
Regression introduced with 3da9c89981.

Change-Id: Ia0ede1b46b7bc8cbce8b55335b3a548e7f8d384d
Reviewed-by: hjk <hjk@qt.io>
2018-02-22 09:05:55 +00:00
Eike Ziller
912d4616f5 File system view: Fix that bread crumbs could hide selected top item
If the current item is at the top, and the bread crumbs widget needs
more space, we may not just scroll, because that would scroll the
current item under the larger bread crumbs widget. We have to do the
delayed layouting in that case.

Task-number: QTCREATORBUG-19800
Change-Id: I93072c1932099501e99963220efdd975c255f586
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-22 07:04:49 +00:00
Alessandro Portale
84e17dd0f8 Core: Modernize FancyToolButton and FancyTabWidget
I got much help from clang-tidy, clazy and clang-format.

In preparation of QTCREATORBUG-18845

Change-Id: Ie881efd5093d86dc8a345e0a5badd93a6ccecbb9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-21 14:58:46 +00:00
Marco Bubke
0172631b48 Clang: Don't reparse if the macros haven't changed
We have to extend that to include paths too, which will be happen in a
follow up patch.

Change-Id: I7f8ac663ae8588e647fc6a6b5d689a629a28ef65
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-21 14:17:19 +00:00
Marco Bubke
b5c3d5a40d Clang: Improve ProjectPartArtefact
Empty strings were only handled by accident and wrongly formatted ones
were never handled. Now we do nothing for empty strings and throw an
exception from wrongly formatted strings. The exceptions are very helpful
in the test code because the show errors the the testing data.

Change-Id: I87d1678eda7502fdc3f74f51fad491803d28582b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-21 14:17:09 +00:00
Tobias Hunger
980fd54ea1 Fix warnings about unused lambda captures
Change-Id: Ib9bcf180fd8ceffbf88836a62fc9532e6f7fc656
Reviewed-by: hjk <hjk@qt.io>
2018-02-21 13:06:08 +00:00
David Schulz
9b5f4a41b9 Clang: fix qbs build
Change-Id: I969b1f3053421c7222fc04c7ba1e8324983506f0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-21 11:41:07 +00:00
hjk
d7348e0ccf QmakeProjectManager: Pimpl and remove uses of global object pool
Change-Id: I801a3b6b880e1113d12ece0cf70a882b9696811f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-21 11:29:58 +00:00
hjk
3b58153750 Revert "Utils: Add a ObjectPool convenience class template"
This reverts commit f6715fe52b
which introduced this.

It was prepering infrastructure for having ownership of
sets of objects handled separately from the global pool,
but that's not wanted and needed anymore.

Change-Id: I7368da624ea99bb70a6a1cce04677257322dc605
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-21 10:45:32 +00:00
hjk
6b7db0bae8 Debugger: Remove use of addAutoReleasedObject
Change-Id: I9a435448e05f56521eaca7f6ba2ac7780950fa18
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-21 08:21:14 +00:00
hjk
7945ba7923 TaskList: Pimpl and avoid using the global object pool
Use the pattern that's currently being established.

Change-Id: Icfb1472cc394f0e371056d5cb23fd22d291dbdaa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-21 08:14:35 +00:00
David Schulz
63cc5491f5 Core: cancel async documentation registration on shutdown
Change-Id: I46bc81cf6326e964309996e0e205fff011f596e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-21 07:58:10 +00:00
Christian Stenger
075d636655 Core: Fix build without Qt Help library
Change-Id: I8067a8ea6ef6395085673ae08c2242dd4a894d55
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-21 07:19:55 +00:00
Ivan Donchevskii
5e872c0fcd Clang: Introduce OverviewModel for clang
Change-Id: I1473e3f679f4345a04c55f1ee80cfe35e21a4347
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-02-21 06:55:59 +00:00
Ivan Donchevskii
8ffae6a08c Clang: Add cursor range to extra token information
Change-Id: Id410c94c79d61b8f4d5b53f937827356272b9f65
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-21 06:55:39 +00:00
David Schulz
e10b220189 TextEditor: modernize TextDocument
Change-Id: I9ea17165ba4eade89a6119135378793256e13358
Reviewed-by: hjk <hjk@qt.io>
2018-02-21 05:59:39 +00:00
Christian Stenger
f350018999 Welcome: Prohibit rename and delete of default session
Task-number: QTCREATORBUG-19642
Change-Id: I97d9fa84aad510fd8c2d95d3324f77fbcae4e9d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-20 19:39:06 +00:00
hjk
6e236d04a6 RemoteLinux: Decorate custom runconfig name with device name
Change-Id: I186adef1b7a7535cd0e06c0ddfe3d5e152c98195
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-20 16:07:27 +00:00
hjk
492a17b65b VcsBasePlugin: Remove last instance of addAutoReleasedObject
Change-Id: I6a622faed0bce39f21c5489afc0df623cb32f801
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-20 15:03:37 +00:00
Ivan Donchevskii
432ae65944 Clang: implement current document filter
Filter is based on full token infos which come
from clang code model after token infos with pure
highlighting information.

Inprovements:
- functions also provide the return type after the signature
- now supports Q_PROPERTY
- all c++ features that clang 5.0 supports

Change-Id: If3e30d238984f39df8d2c3b9ba3ee085c4117f3d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 14:03:53 +00:00
Ivan Donchevskii
dacfc611c5 Clang: Add highlighting types for ObjectiveC
Builtin code model supports ObjectiveC classes,
properties, etc. We can easily get the same
information from clang.

Change-Id: Iede5e177d4932f404e4ccb81ae356eee8faffb71
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 13:34:37 +00:00
Ivan Donchevskii
524d3ea28b Clang: Helper function to get token IconType
Change-Id: I9de562102eded9391ab0d6b895b8d812e259efd6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-20 12:44:56 +00:00
hjk
9a3dff8934 CMake: Pimpl CMakeProjectPlugin and avoid use of global object pool
Follows the recent pattern.

Change-Id: Ib91fb8e6ab343b5e595b9ed470daa3e55999f37c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-20 12:40:46 +00:00
hjk
08e73d1a93 Utils: Remove BaseTreeModel::hasChildren re-implementation
Not needed and wrong, as it doesn't handle the case of column != 0.

Change-Id: I0ff62df0547a47ea80e1450b7cca1ecc86da7005
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-20 11:19:47 +00:00
Orgad Shaneh
b114b0c95e DiffEditor: Minor cleanup
There is no need to enclose the argument with parentheses, and there is no
need to cast to QSharedPointer.

Change-Id: Ie8f6e4228e09203d1c42f614ee8a84de4a1e110b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-02-20 11:05:26 +00:00