Commit Graph

3443 Commits

Author SHA1 Message Date
Tobias Hunger
f3a23813fd CMake: Use eliding label instead of manually eliding text
This fixes the kit options page becoming wider in some cases as the
eliding was apparently off.

Change-Id: Ia682b75a2441d8d265b7c5a3c9943e36f33167db
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-18 12:05:14 +00:00
Tobias Hunger
5efd82468b SynchronousProcess: Store raw bytes from stdout/stderr of the process
Only convert the raw output later in a stdOut() and stdErr() method of
the SynchronousProcessResponse.

This is necessary since we have processes that use different encodings
for different sections of the file (I am looking at you, git).

Also remove the signals for raw data on stdout/stderr, leaving only the
signals returning buffered QString lines. This should be safe, even
with UTF-16 output.

Change-Id: Ida613fa86d1468cbd33bc6b3a1506a849c2d1c0a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-15 14:16:03 +00:00
Tobias Hunger
cb14fb0d71 Kits: Save several ToolChains per kit
BREAKS BACKWARD COMPATIBILITY OF TOOLCHAIN SETTINGS!

* Convert old ToolChainKitInformation to new version
* Store several toolchains in one kit (one per language)

Change-Id: Ia59a2ad067c57971ec34ce9b2e43758344443755
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-14 15:34:06 +00:00
hjk
e48451b0a3 TreeModel: Consolidate child()/childAt() and rowCount()/childCount()
We never used the possibility to overload the virtual child() and
rowCount() functions, it's unlikely to be needed in future.

Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-07 13:39:15 +00:00
hjk
7b4c7d49a9 TreeModel: Introduce a destroyItem() convenience function
Shorthand for delete takeItem(...).

Change-Id: Icb7b60e5c19aa0d21650eefff65f7eb55e9f90b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-06 11:41:55 +00:00
Tobias Hunger
703c410085 CMake: Only start parsing when creator gets focus again
Rip out QFileSystemWatcher and use Qt Creators IDocument for file
watching instead. The latter properly delays any action till creator
gets focus again.

Task-number: QTCREATORBUG-16354
Change-Id: Ibb71963416b09712a80ee95347425550453b7fd4
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-28 09:10:02 +00:00
Tobias Hunger
d8ed91c44f CMake: Add per-cmake option to not automatically run cmake
Task-number: QTCREATORBUG-15934
Change-Id: I54fdb505a451fb269c3747a370c8dfd7043c6c9d
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-28 09:09:10 +00:00
hjk
2536c2bfc7 TreeModel: Re-order template arguments for tree levels
More natural and easier to extend to use parameter packs later.

Adjust users.

Change-Id: Ic167196cc969d18bb1615084397e884f769d1e85
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-24 07:34:13 +00:00
Eike Ziller
0e923c2a75 Merge remote-tracking branch 'origin/4.1'
Change-Id: I5cdc704c827a6f5abf4dc39e2a131d53df328bd2
2016-06-22 11:29:12 +02:00
Eike Ziller
4f9016e03f Merge remote-tracking branch 'origin/4.0' into 4.1
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/android/android.qbs
	src/plugins/android/androiddevice.cpp
	src/plugins/autotest/testcodeparser.cpp
	src/plugins/debugger/analyzer/analyzerstartparameters.h
	src/plugins/projectexplorer/devicesupport/desktopdevice.cpp
	src/plugins/projectexplorer/devicesupport/idevice.cpp
	src/plugins/projectexplorer/runconfiguration.h

Change-Id: I2474d06f2309fa71210a8401846bc2ef85bebf1d
2016-06-22 11:09:32 +02:00
Leena Miettinen
4df0421b12 CMake: Fix capitalization in a message
Change-Id: I7bd0c2198d4cf3c49930b8a57f37f2a07752e028
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-21 15:33:04 +00:00
David Schulz
6750607244 Editor: Skip auto completed character only if it was recently inserted.
This means you can skip automatically inserted characters as long as you
don't explicitly move the text cursor and the editor doesn't lose the
focus. This will be visualized by highlighting the automatically
inserted character as long as you can perform the skipping.

This will reduce unexpected skipping in the case a cursor was explicitly
placed before an closing brace and a closing brace is typed.

Change-Id: I28e29e79ba10c9c48e8bc8817405fea630cca9bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-21 11:56:56 +00:00
David Faure
52ed384549 cmake: resolve symlinks when comparing source directories.
Testcase: trying to use an existing build dir which was
made for /d/foo where /d is a symlink to $HOME/d.

To help understanding the problem, the error message now prints
both source dirs, the one found in the builddir and the one we expected.

Change-Id: I9a24fbd6ef3cf8108c5edba0d2a5b99ecdea0e89
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-20 07:37:41 +00:00
hjk
fb482846fc TreeModel: Add a StaticTreeItem(QString) convenience constructor
Covers the common case and hopefully avoids the recurring MSVC
problem with initializer lists in this location.

Change-Id: I1b2bbb083f9fc86af3b51b8f52615fb70c832b95
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-17 08:09:48 +00:00
Tim Jenssen
96a3d49b07 msvc2013 can not handle 1 item initializer lists
Change-Id: I44b3c3888f15a6b68ddaed2777b90cf4057792b1
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-15 10:55:46 +00:00
hjk
b281d6dad7 TreeModel: Introduce a StaticTreeItem
This splits out the case of static string displays from the
TreeItem base class, making the base more lightweight.

Change-Id: If1f442011ec60094399a41b65d9b5015f432f82e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-15 08:55:16 +00:00
hjk
0c1cdc3a4a Decorate root items in debugger and cmake options pages
More consistent with Kits, Qt versions and Compilers.

Change-Id: I16bb497a9fb17f271ffbf89e746d478b3aecb6a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-15 08:41:30 +00:00
Tobias Hunger
069bb2d359 CMake: Work around cmake reporting include paths in random order
Work around cmake reporting include paths in random order to Qt Creator
due to a bug in the CodeBlocks generator.

Remove the tool chains include paths from the list reported by cmake and
have the code model add those again later. That keeps at least the
include paths of the compiler in order, which is important as this
makes sure any fixed headers shipped with the compiler actually get
picked up.

Task-number: QTCREATORBUG-16432
Change-Id: I218735914bcc750ce87b02b05d111f3fe2bb5644
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-15 08:11:40 +00:00
hjk
b8b56659ed CMake: Use a LeveledTreeModel for settings page
Change-Id: I4ff30c260f7b106f65f070d83f929e901ec287d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-10 12:56:50 +00:00
hjk
639b372b3e CMake: Prevent creation of duplicated entries on apply()
Hitting 'apply' after adding a custom cmake in the setting
duplicated the entry.

Change-Id: Ibfaf35b4c9b44d98e90b812269c464da2019cea1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-10 12:48:22 +00:00
hjk
519cc8ded6 ProjectExplorer: De-duplicate code in IBuildStepFactory derived classes
This removes 900 lines of duplicated code, some duplicated checks at
runtime and some (minor) quadratic behavior when gathering display names.

canClone(), canRestore() and canCreate() and restore() use the same
pattern. Handle that on the core side once. Leave retore() virtual to let
the ios code unmodified (which is likely not needed, later...). Introduce
'Unclonable' and 'Uncreatable' flags to keep Android package installation
and WinRT deployment (non-)functionality unchanged.

Change-Id: I0325479aff818a4038b2f241ca733b8d8cd66f2f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-10 10:34:51 +00:00
Mashrab Kuvatov
5ca8a921f6 cmakesettingspage: Update model on add/remove CMake tool
Connected signals on add and remove CMake tool from CMake manager to the
appropriate slots of the view's model. Now, the view is updated when CMake
tool added or removed using CMake manager's API.

Task-number: QTCREATORBUG-16396
Change-Id: I913546f7554b6c9baa70237835e5a7e3d9137af7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-09 08:20:20 +00:00
hjk
04a93c3bb5 CMake: Demote non-matching generator to 'Warning'
Default KitChooser behavior is to suppress kits with errors everywhere
but non-matching CMake generator settings are irrelevant for both non-CMake
using projects and analyzer/debugger tools.

Change-Id: Ie60f0f23b5c2423128304227fc573526b7ec2113
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-06 10:53:40 +00:00
Orgad Shaneh
868ec2b6d8 CMake: Pass STATIC types on cmake execution
Was submitted by mistake for 4.0 (and reverted). Resubmit for master.

Change-Id: Ie3401d009044a46af7fac314d1f29975543a44b0
(cherry picked from commit 0043c721c2)
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-03 07:41:50 +00:00
Eike Ziller
73bb92c5a6 Merge remote-tracking branch 'origin/4.0'
Change-Id: I89c52ca2145a43c94d3366367ba72fde605dd577
2016-05-31 12:02:13 +02:00
Eike Ziller
79733e5625 Remove a few TextDocument subclasses
Which only differed in some property settings.

Change-Id: Ie844c32709ebe719a5b749fd2ef828b64086ba9a
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-31 07:31:29 +00:00
Takumi ASAKI
b2f24fc0a7 CMake: Fix translation message
Change-Id: Ide60eda0b0dba8de0bd3a1675dece437857391e4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-31 02:46:26 +00:00
Tobias Hunger
8405a16179 Revert "CMake: Pass STATIC types on cmake execution"
I have missed that this change was headed for 4.0 instead
of master. It breaks the build there.

This reverts commit 0043c721c2.

Change-Id: Ia359798c2636b2b4699de9cc73484ec12a757601
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-05-30 12:06:54 +00:00
Orgad Shaneh
0043c721c2 CMake: Pass STATIC types on cmake execution
Change-Id: Ie3401d009044a46af7fac314d1f29975543a44b0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-30 11:34:26 +00:00
Orgad Shaneh
6531ff5672 CMake: Unindent a lambda
Change-Id: I71af11e3fba9a47c24b06bb19617ab212ee5b8a1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-30 11:34:07 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
Tobias Hunger
5d3823ac47 Use SynchronousProcess::runBlocking
Use SynchronousProcess::runBlocking in favor of SychronousProcess::run.
This avoid nested event loops which can produce really strange crashes
if not use carefully.

This patch only converts those processes that have a timeout of less
than 5 seconds or use the default timeout.

Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-26 11:50:03 +00:00
David Schulz
7595aaa227 Editor: Separate auto insert brace and quote magic.
To allow enabling/disabling both features separately.

Change-Id: Ica154e3b400823de7cf22daf006958802d751c64
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-05-25 13:55:50 +00:00
Stanislav Ionascu
c1d735503b CMake: make it possible to insert new vars in project settings
Task-number: QTCREATORBUG-16238
Change-Id: If98acc4f27cabbb606b2fc1017096da626ba1144
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-24 08:44:57 +00:00
Tobias Hunger
278819f8fd CMake: WS-only fix
Change-Id: If1dcc869560b526d8750195f90b2b94b928eb918
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:19:05 +00:00
Tobias Hunger
d5a1eff8ee CMake: Fix warning about empty filename after persisting cmake config
Change-Id: I2639059055cc42cf6ab9431f4885a01970980fca
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:19:01 +00:00
Tobias Hunger
1f7582e86e CMake: Fix race between persisting cmake configuration and parsing
First make sure the configuration is reset: This makes sure the correct
branch is taken in parse().

Then trigger parsing through the event loop so that its signals will
definitely arrive after persistCMakeState has returned.

Task-number: QTCREATORBUG-16258
Change-Id: I103ca6b6119ec70c99828d883d728a8bb97fd6bf
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:18:54 +00:00
Tobias Hunger
5bc0d12c6d CMake: Check CMakeCache.txt for changes
Check CMakeCache.txt for changes and ask whether to apply these to the
project going forward.

This will only consider settings that were previously changed by Qt Creator
and will not pick up on newly changed settings.

Change-Id: Ia20c67bc2a5e9965243f08003c10ec684875387f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:18:47 +00:00
Tobias Hunger
8c316aa1c1 CMake: Do not parse that often
Wait longer before triggering a reparse.

Change-Id: I02ed83b0e9a3be7de5f720f9a9595e6a886d1ab0
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:03:32 +00:00
Tobias Hunger
0695384b12 CMake: Show INTERNAL settings as advanced
Sometimes cmake changes the type of random settings to INTERNAL.
This change keeps them visible even then.

Change-Id: Icd6bf26b8e2cb031b76bbba8bf0aac70c349fb7b
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:03:27 +00:00
Tobias Hunger
5d69bdfde7 CMake: Cache CMakeCache.txt
Change-Id: Ib3e7a9943d15a2e90afd29642b666892ba7b0613
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:03:20 +00:00
Tobias Hunger
f6bf3344d6 CMake: Do not store kit cmake configuration in BuildConfiguration
Change-Id: Ia45c03f42083af0871b12351c98092a2e7887158
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-20 13:05:35 +00:00
Tobias Hunger
0d262e3a6b CMake: Do leave the project configuration alone on reparses
This keeps user-overrides made via other tools visible in Creator.

Change-Id: Ice07bebb2b82f29ecae83e442bc2090af7f2ee06
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-20 13:05:27 +00:00
Tobias Hunger
b910b36458 CMake: Also treat "yes" as true for boolean settings
Change-Id: I78426ec5b6b2cf0a1d4cca26202632b27e2036e9
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-20 11:55:19 +00:00
Tobias Hunger
fd761cd790 CMake: Warn if kit settings are overridden by the project
Change-Id: I8f01b267f27617d6561124d173ac2e5ae5b9f4d6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-20 11:52:17 +00:00
Tobias Hunger
5100454222 CMake: Make it easier to get the expanded value of a CMake configuration
Change-Id: If289c48ef4ec2815e8bd12e08b990d1dc809c524
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-20 11:51:23 +00:00
Eike Ziller
6efd8e33e2 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I6217662f0c51d04a83f7a85dc5d7c7f25e78e09a
2016-05-13 16:24:37 +02:00
hjk
602d899e0f Move CustomExecutableRunConfiguration to ProjectExplorer
There's nothing QtSupport specific in there.

Change-Id: I616a37ed56f1853cdbb16f483de5682d5ea63715
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-13 11:03:06 +00:00
Tobias Hunger
82b6d728c7 CMake: Fix Clear Cache when builddir is not persistent yet.
Change-Id: I4dc2c5889845b13ebe167b89e78b104f8805a1f6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-12 13:10:02 +00:00
hjk
dee7ad3806 TreeModel: Rework tree iteration
Use function objects to apply directly during a depth-first
walk of the tree instead of faking a flat container of tree
nodes. Less code, and allows even some non-const operations.

Change-Id: I804ab11df358fe937b40809cbcb772e6f3ff8dc5
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-12 12:30:36 +00:00