Commit Graph

40457 Commits

Author SHA1 Message Date
Nikolai Kosjar
07f32ef57a CppTools: Use fallback project part if project is closed
...instead of sticking to the old one.

If a project is closed, the editor should reflect that. It also simplifies the code.

Change-Id: I9b8a94513d3b06a238cfc4ee60c11c0d0da3d93f
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 07:50:05 +00:00
Nikolai Kosjar
ec3dcfd6ad CppEditor: Show info bar for project-less file
While at it, centralize the code for handling the info bars and actions.

Change-Id: Ied62e3db268aaff3ef87e246bfe2b50399341be3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 07:35:30 +00:00
Oswald Buddenhagen
3080bda066 fix fallbacks in external property parsing, take 2
while the fallback chain really *is* "Put" => Raw => Get => Src, this
implies that to get sane looking condensed qmake output with only the
plain and the /raw property variants, the /get and /src variants must be
lacking the sysroot, which is profoundly useless in the case of an
installed prefix build with sysroot and without extprefix.

so to get actually useful paths, we just drop Raw from the fallback
chain. qmake will be fixed later to actually conform with this much
saner interpretation.

amends 61419e7bf.

Change-Id: I76fced03c5774ad581df2bf6ccc92a908fa243ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-25 16:22:42 +00:00
Eike Ziller
a93fc0a4fe Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ia6083434a811fc975696edf126df101ec8040f49
2017-01-25 16:27:49 +01:00
hjk
3c743346b0 ProjectExplorer: Make the FlatModel a Utils::TreeModel
The FlatModel is essentially a proxy model keeping expansion and
filter state per ProjectTree(View). Using a Utils::TreeModel makes
it fast enough to allow recreation of the proxy structure on
structural changes simplifying the parent/child logic significantly.

The {Session,Project,Folder,File}Node hierarchy still is still primary
information and shared by all views.

Change-Id: Ic08180a19bda37908280ff30e0737d188ed93e92
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-25 13:52:51 +00:00
Marco Bubke
03a68a91bb Utils: Test if vector::operator=(&&) is not throwing exceptions
It is advantageous to mark move assignments noexcept. Some implementations
are already implementing it and with C++ 17 it will be standard. So we take
advantage of it and make it conditionally.

Change-Id: I7c6d77d09a02639096ce0fb43733c1fbf190c7c4
Reviewed-by: hjk <hjk@qt.io>
2017-01-25 13:30:40 +00:00
Eike Ziller
23a2eff60d Update copyright year in about dialog
Change-Id: Icbbe1ebd0f77e32d45c1c3ea3cada7c4aaa59ab2
Reviewed-by: hjk <hjk@qt.io>
2017-01-25 12:54:19 +00:00
hjk
4ab6d1fa9d Debugger: Fix spurious cppcheck warning in reformatCharacter
The code path is never taken, size == 4 only happens in conjunction
with isSigned == false.

Task-number: QTCREATORBUG-17632
Change-Id: I3fd5a08fd5e414690bccf487f9d3cfb704ab5e47
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-01-25 12:08:58 +00:00
Tim Jenssen
1b62ce2a98 use direct member initialization
Change-Id: I74cae303ba3b7df771b16dd203e8b5fbc9adb398
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-25 10:44:51 +00:00
Orgad Shaneh
7e37ddd416 VcsCommand: Do not use QueuedConnection for the output proxy
This causes messages reordering. For example:

Amended "9036e2103c".

08:55 Executing in ...: git commit -F /tmp/QtCreator.i12936 --amend

Change-Id: Ifb3466cdd0c441b7597339451661b416dcdc1fb4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-25 09:03:36 +00:00
Arnold Dumas
203644bf28 Clang: ClangExecutableVersion is now a QVersionNumber
Change-Id: If1e1327ad54681ce6d8c59e2cee298ba7bd7996b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-25 08:32:27 +00:00
Tobias Hunger
f50d73cc3c TemporaryDirectory: Fix failing test cases
Change-Id: Ied61a1de9d226815da1eaa050a09dde30091d006
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-25 08:16:59 +00:00
Tim Jenssen
7db35aa8ef white space only changes
Change-Id: Ib78ea3244594320f54a2feb04f639caa83e1ba84
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 17:13:44 +00:00
Thomas Hartmann
30b9dd4884 Some cleanup
Change-Id: I16e2cd891dfb2f799c6be0d606762d44b9bb0b59
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:06:28 +00:00
Thomas Hartmann
fcdc902712 QmlDesigner: Adjust default NodeHints
If not valid we should return the default value.

Change-Id: I61b66747392b3d065dd41bbe3d27d32652a0a380
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:04:16 +00:00
Thomas Hartmann
bbff1822ae QmlDesigner: Fix bug in MetaInfoReader
Hints were never cleared.

Change-Id: I9c60314f8c345de487c8ddf0b7f1085d6e496a32
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:04:08 +00:00
Thomas Hartmann
635fec1aef QmlDesigner: Use NodeHints for clipping in form editor
Change-Id: Icbc8e08cab760020126324bcae6dd5909508d5d3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:03:59 +00:00
Thomas Hartmann
4fb9bd12cb QmlDesigner: Use NodeHints in navigator
Change-Id: I90cffc6d814c06d2474b003a4b6c5714b1a9ad1c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:03:44 +00:00
Thomas Hartmann
85ce230e56 QmlDesigner: Fixing potential crash
+ some white spaces

Change-Id: I3458495a8dcae4d78c96c104acc30b5dd0c6ed96
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:03:17 +00:00
Thomas Hartmann
a28d9f739a QmlDesigner: Respect hints in DragTool
Change-Id: Ic5af9dd39a1442d9c8a868ccf0afe9f2f6e720f7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:03:09 +00:00
Thomas Hartmann
c0e63ee784 QmlDesigner: fixes in NodeHints
Changing the default and not checking for valid.
We want to check for these hints even if there is no model node.

Change-Id: Ic19056fa4c24dbf5a687bcf3d288fc9ac48c908c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:03:01 +00:00
Thomas Hartmann
1cd4cfc411 QmlDesigner: Allow creation of NodeHints from ItemLibraryEntry
Change-Id: I8ddc03f3bcf54bd7523429fd4bd98de5761fb425
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 17:02:53 +00:00
Thomas Hartmann
e3d6051013 QmlDesigner: Make constructor of NodeHints private
Using a static creation function makes tpyical usage simpler.

Change-Id: I0cf9347693633e8ad5fb98be5b0ec86c15c5a61f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 16:38:06 +00:00
Thomas Hartmann
119cab0b08 QmlDesigner: Using canBereparentedTo() in DragTool and MoveTool
Change-Id: If90675cd127ba79416e3a17672c9592037d1bf7a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 16:37:49 +00:00
Thomas Hartmann
c6350682ac QmlDesigner: Using NodeHints
The NodeHints are not supposed to be used directly.
QmlItemNode should provide the necessary convenience functions.

Change-Id: Ie19b3dcc0452af9f6962ea50988a2dd33bfbd410
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 16:37:36 +00:00
Thomas Hartmann
ee0a1ae69a QmlDesigner: Update NodeHints
Adding a couple of more functions
Adding an optional second ModelNode as argument

Change-Id: Ib38ec14a17d6d9cc2a55d417c2d43d6d3c4d8a95
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 16:37:28 +00:00
Tobias Hunger
588211e2e8 CMake: Use shorter names for local sockets in server-mode
Apparently there is a limit to about 100 characters or so on some
versions of Unix (e.g. Darwin), and there is also the tendency to
point TMPDIR into places very far from '/' (e.g. Darwin), which
can result in the local socket path getting trunkated.

So make sure to put the local socket into /tmp on Unix. That works
on Linux and on Darwin.

Change-Id: I40bfaf932c5013cf72addb5621360e97c9583daa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-01-24 16:12:26 +00:00
Tobias Hunger
5d53289f12 ProjectExplorer: Simplify Language Ids
Language ids are exposed via the MacroExpander to the user. So remove the
prefix and only leave the bare essential (C and Cxx), so that
%{Compiler::Executable:Cxx} continues to work.

Add code to transition kits and toolchains to the new Ids.

Change-Id: I012e5fd405b09032418c90d2517aede21cfa1b47
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-01-24 16:11:14 +00:00
Tobias Hunger
ca380246a2 ToolChains: Fix soft assert
Only call defaultDisplayName after the toolchain is set up completely.
This is necessary since the defaultDisplayName uses a lot of information
on the toolchain by default, which was not there yet.

Change-Id: I79c8791b6a7faf3d5b72840322849e4a9fc88a87
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 16:11:04 +00:00
Christian Kandeler
1b67f9eafd QbsProjectManager: Fix false positives when classifying files
... for the C++ code model. In particular, a file ending in ".h" must
not be unconditionally classified as an "ambiguous header", but only if
it has the "hpp" tag.

Change-Id: I33a463de78525fb965e781b4b75d1e088c055c3d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-24 14:53:25 +00:00
Nikolai Kosjar
0b8df41387 CppTools: Provide hints about chosen project part for editor document
Parse issues can have multiple reasons (invalid kit, not a project file,
actual parse issue) and we should be able to tell them apart. With this
change, we can distinguish between the fallback project part and a
ambiguous project part.

Follow up changes will use this to display more accurate diagnostics.

Change-Id: Icc8767607cc17dc14d6227b07f34e81ba5525a96
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-24 14:41:48 +00:00
David Schulz
b2ea28c79e fix crash by guarding QString::setRawData
QString::lastIndexOf can return a -1 if the pattern was not found. Using
a QString that was created by QString::setRawData with a size of -1 will
result in a crash.

Change-Id: Ie02645f00db7e7150424ca367095a7ebc9051578
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 14:29:09 +00:00
Oswald Buddenhagen
19eaf87ef9 de-duplicate fallback paths in external qmake property parsing
Change-Id: I976ab923d9ef213800eabe7a9c331191abea9430
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-24 14:05:11 +00:00
Oswald Buddenhagen
61419e7bf0 fix fallbacks in external property parsing
the fallback chain is "Put" => Raw => Get => Src.
formerly, everything fell back on "Put", which is plain wrong.

Change-Id: I13967120e381ddbb03ed6a877c2960f8e5bc4f7d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-24 14:05:05 +00:00
Oswald Buddenhagen
03e699ce29 external qmake property parsing: ensure that QT_HOST_LIBS has a fallback
the property has been added to qmake a while ago. catch up with it.

Change-Id: I8fae79c6d593ee201b44172d14189ec6502bc61c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-24 14:01:50 +00:00
Oswald Buddenhagen
89868ee2b9 simplify the qt4 fallback in the external property parsing
only qmakes from qt4 don't have QT_HOST_* properties. and as they don't
have _any_ of them, the fallback can be simplified.

Change-Id: Id2ccbc7c01a56b894841980b0bc45bd84d160c54
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-24 14:01:38 +00:00
Oswald Buddenhagen
2cb7c81e62 de-duplicate qmake property parsing code
Change-Id: I7555de5c72a9250b31e20fc60e39680d19882fcb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-24 14:01:31 +00:00
Oswald Buddenhagen
8a69c25475 BaseQtVersion: use QMakeEvaluator's native format for m_versionInfo
Change-Id: I926bc97fe6fa510ac5a8fe77b64014333a69bd04
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-24 14:01:25 +00:00
Oswald Buddenhagen
8288ca1251 make more use of BaseQtVersion::qmakeProperty()
... instead of peeking into versionInfo().
in fact, make versionInfo() private, to avoid subsequent deterioration
as happened before (after 5e596e89d).
some other functions that use it in its interface also become private.

this fixes several breakages related to working with non-installed
prefix builds of qt.

Change-Id: Ib67de79323c9e38f3de48a09854b155de9eef5b2
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 14:01:06 +00:00
Marco Bubke
dea722a20c Utils: Fix white space
Change-Id: I9f8246f3c4e6ad076f1397e4bedbd244fe37324d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 13:17:00 +00:00
Tim Jenssen
97a0d62c8e QmlDesigner: move outputPlaceholder to the bottom
Change-Id: Id4b3e47b513bcd9097ff884d7cc9a647715e2734
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 11:34:44 +00:00
hjk
7d63c3b899 FakeVim: Compile fix after ef80d060e7
Change-Id: Ifc21a3b24cd8dc546848254d12c86cc8dfcf6f1f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 11:23:14 +00:00
hjk
ef80d060e7 FakeVim: Remove a few uses of QObject::sender()
Considered bad style...

Change-Id: Idc1d39bd55fa30dfa854bbc99094f5f6ec9afc4d
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <hjk@qt.io>
2017-01-24 11:10:12 +00:00
Tim Jenssen
b25a70bf03 QmlDesigner: remove unnecessary Pimpl
Change-Id: I56cbab9897be37281ff500a01452c9a09fb537f9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 10:55:45 +00:00
Tim Jenssen
a5980f146f QmlDesigner: formeditorview code clean ups
- no behavior change
 - use nullptr instead of 0
 - use new connect syntax and use a lambda to react on zoomLevelChanged
 - removing unused method adjustStatesForModelNodes

Change-Id: I6a289e6771765112b7ac9c292ce3c2073a22829a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-24 10:55:04 +00:00
Tim Jenssen
318e9214db QmlDesigner: used initializer list for mimeTyp registration
Change-Id: Ief2cedc6b836500a7bd04e3fb0088f7b45c47732
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 10:54:00 +00:00
Tim Jenssen
d46f7bb876 QmlDesigner: beautify code in ViewManager
- it makes more clrear that we use a here QTabWidget

Change-Id: I03d1b7572b73570aa07e002d8b2cd8099b086c0d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 10:52:01 +00:00
Tim Jenssen
4715afcbbc QmlDesigner: beautify code in TextEditorWidget
Change-Id: Ieb0bb96f4eb93700298dc7a369e1bfc7b324aea6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 10:48:29 +00:00
hjk
a17919fbd0 Debugger: Allow explicitly marking of non-Python commands again
This conceptually reverts part of a61b6dfc.

Task-number: QTCREATORBUG-17594
Change-Id: I9ff72a027838a20039f217ed0d669b6c45bc2acf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-24 10:46:47 +00:00
Lukas Holecek
4ecbebace5 FakeVim: Allow plugin interaction before saving file
This allows plugins like Beautifier to interact with the document before
it's saved.

Change-Id: I74f9735214c0fa115635b1809dc467036170ae75
Reviewed-by: hjk <hjk@qt.io>
2017-01-24 10:44:59 +00:00