Commit Graph

54893 Commits

Author SHA1 Message Date
Marco Benelli a874cf581d Qml/js reformatter: use quotes in objects literals
The reformatter used to remove the quotes that wraps the property name
in object literals.  This causes problem when the name is not a
valid identifier, resulting in that valid code become invalid after
reformatting.
This patch forces wrapping of property's name in quotes: in this way,
the reformatted code is consistent and it never get invalidated.

However the resulting formatted code is not consisted with the one
formatted by previous versions.

Task-number: QTCREATORBUG-17455
Change-Id: I1e361102819055de210d6c81020f204c08aaa253
Reviewed-by: Markus Maier <markus.maier.sw@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-05 06:50:03 +00:00
Christian Stenger bf285af007 Utils: Fix compile with gcc 4.9
Otherwise compile fails with
 constexpr constructor does not have empty body.
Broke with 2f8c075a01.

Change-Id: I04ce03eaf51ddb3b4233abc4b51a553355e28e04
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-05 06:25:15 +00:00
Orgad Shaneh 704a70810d Clang: Add a missing break
Detected by GCC8.

Change-Id: I64e399a006c9ad93af4798f0e6cf48f1ca391f39
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-05 06:19:51 +00:00
hjk 150011823e Qbs: Split mangled build key only when needed
Easier to keep one variable in sync than three, and moves
the code closer towards a unified pattern in the local
runconfigurations.

Change-Id: I2df09127d476be4ddab466f8a709a2b383a76b97
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-04 16:09:49 +00:00
Marco Bubke efd9b08eb4 Utils: Remove noexcept from SmallString::append
We want to get bad_alloc. ;-)

Change-Id: Icc7995405bfb96d3f709b80e30b13c5d81fb3979
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:51 +00:00
Marco Bubke 28da1261c8 Sqlite: Use compiled statements for transactions
So we don't recompile them again and again.

Change-Id: I54c95e9d81df86f4944b9e3d45a7277f93f37312
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:44 +00:00
Marco Bubke 549aa7ee02 Sqlite: Don't register ranking any more
We don't use it now but maybe later.

Change-Id: I46912728321c5523b59cf8e76a75c538f903b618
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:38 +00:00
Marco Bubke 071a6f90d3 Sqlite: Throw misuse Exception in SqliteStatement::bind
Change-Id: I014cf7e067bc67c38448bd79a179858c8abb0b5b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:32 +00:00
Marco Bubke 5e42bbc7fb Sqlite: Throw IoError in SqliteStatement::prepareStatement
If we get this any hope is lost any way but we now know why. ;-)

Change-Id: Ic08b104825dc51ce5453203e70a0804265e47330
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:25 +00:00
Marco Bubke b6c038924c Sqlite: Fix container programming bug
We really want to delete the right copy and move constructor.

Change-Id: I9572c197b1be89fc1ce996d65e2de671f48abb4e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:17 +00:00
Marco Bubke 23865a102d Clang: Handle constraint exceptions in the file path storage
It can be happen that the entry is written by an other connection after
we tried to read and before we write. This would lead to a double entry
which be prevented by the unique index in the database. In that case we
simply try again and read the id from the database.

Change-Id: I6c9d94e95ae11556bb446813f64be0855be4ddbe
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:37 +00:00
Marco Bubke c5f9765c93 Clang: Handle all busy states in the file storage
It can be happen if different connections try to write and read at the
same time.

Change-Id: I30e9120fdb8f6963f5440eed48e2cfdf8803b2be
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:29 +00:00
Marco Bubke 68c1140d27 Clang: Add busy timeout handler to database
You use now a busy timeout of one second. This is preventing the throwing
of a exception for a busy time under one second.

Change-Id: Iae800a525ad009b594c29883ffb243c1be8b3874
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:12 +00:00
Marco Bubke 5870905db6 Clang: Handle a busy database in the PCH plugin
This can be always happen for write statements. It fixes the wrong behavior
of the transaction that it tried to rollback if begin fails. If begin fails
the transaction never started so there is nothing to rollback.

Change-Id: I8a03162257fa22a0bb66ccb844f90c6afbc7db64
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:06 +00:00
Marco Bubke 789379a8e3 Clang: Fix includes in the PCH creator
We now distinguish between the the top external headers which are used for
the PCH and all external includes which are used for watching. Adding
indirect external includes can lead to errors because some are not
protected by a header guard.

Change-Id: I01576fcf1ad25e7a6e3efc252eabbd23d5c0e727
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:59 +00:00
Marco Bubke 4b97126d28 Clang: Fix exception catching
Change-Id: I5914ee4056e821359109786190b7006ef992b60e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:52 +00:00
Marco Bubke 410a2b95c4 Clang: Make more indices unique
This is providing more security that there will be no double entries in
the database. Instead you will get an exception if you try to corrupt the
database.

Change-Id: I162dc8ddd270b86afdf12ba4d55686637b2c09ef
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:39 +00:00
Marco Bubke b6cb22899c Utils: Improve SmallString
The small string control block moved to the beginning, so it is more cache
local. The control block is cleanup too, so it should be easier to read.
The alignment is removed because it is creating to big holes.

Change-Id: I401aeb9d55455cbaa5e722dd8192e54b525ddc40
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:20 +00:00
Alessandro Portale 0ecd543614 AutoTest: Use a prefix in autotest.qrc
Since all resources in Qt Creator get merged together at runtime, they
should be prefixed with the library/plugin name.

Change-Id: Ie411388ed72f099647b25787a140feff1828d3f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-04 13:27:45 +00:00
Alessandro Portale 65329ca22a Nim: Use a prefix in nim.qrc
Since all resources in Qt Creator get merged together at runtime, they
should be prefixed with the library/plugin name.

Change-Id: Id724fadd45397148ab4a5a815dc7e4114e10c9d2
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2018-04-04 11:31:18 +00:00
hjk 66d18ce07f ProjectExplorer: Simplify IBuildConfigurationFactory interface
Following the RunConfigurationFactory lead this replaces
f = Foo::find(); f->do() by static Foo::do() stanzas.

Also de-virtualize/private-ize IBuildConfigurationFactory::canCreate()
as it is only a local helper nowadays.

Change-Id: Id36ba514f426ebd054592189aa29c170ba00d92f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-04 10:14:22 +00:00
Nikolai Kosjar bfdcbf861f Clang: Fix parse errors in clazy/tidy demo project
...otherwise not all intended diagnostics can be demonstrated.

Change-Id: I2f69862cc6c8a2e58059d9075ad6fd7c7e72b4a5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 08:08:39 +00:00
Friedemann Kleint 217f2a49f6 PythonEditor: Show python stack traces in the build issues pane
Add an output formatter that captures stack traces and adds them
as tasks.

This helps to speed up fixing syntax errors.

Change-Id: I8a4fa77d0f87b4d16f4bb780b15ec06154a52441
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-04 07:56:24 +00:00
Nikita Baryshnikov 0297cdd4f7 ApplicationLauncher: fix odr warning for State enum
applicationlauncher.cpp:68:6: warning: type ‘State’ violates the C++ One
Definition Rule [-Wodr]
 enum State { Inactive, Run };
      ^

deviceprocesslist.cpp:34:6: note: an enum with different value name is
defined in another translation unit
 enum State { Inactive, Listing, Killing };
      ^

Change-Id: I242754c1e4f18c5dd0e8bb017f94783528ad759f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-03 15:57:49 +00:00
Marco Benelli b9d72a5737 qmljs: remove remaining references to QtQuick1
This patch removes all references to QtQuick1 in qml library,
plugin, designer, profiler and tests.

Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-03 14:40:30 +00:00
hjk 4e4a07ea1d Designer: Use PluginManager getObjectByName instead of getObjectByClassName
There was only one user ever of getObjectByClassName, and has never
been more than one object here. So the more common function does
the trick, too.

Change-Id: I9df09127d476be4ddab466f8a709a2b383a76b97
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-03 06:47:13 +00:00
Eike Ziller 9b563dc142 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I3b2d81462b2dfb9753863c87c79ffbbf8d536aac
2018-03-31 08:53:21 +02:00
Marco Bubke b01813d794 Clang: Fix destructors
Change-Id: I95164b195b912068496d5c8de0fe09cf88678916
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-29 15:37:25 +00:00
hjk 8c713d45a8 CMake: Use new ExecutableAspect
Change-Id: Ic880351802c52b61c53c6730d23dfe3f124ebc44
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-29 14:27:14 +00:00
hjk 1c006e406f ProjectExplorer: Introduce and use a ExecutableAspect
... to hold the label with the executable's name in the
RunConfiguration widgets.

This basically follows suit on {WorkingDirectory,Arguments}Aspect,
allowing for some centralized handling of decorations on invalid
names etc.

Implementation is even simpler as this is read-only and not saved
in settings envisioned use cases.

Change-Id: I20c5c19e5f19ba8367afc0d04ed2ac3681e6491d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-29 14:27:06 +00:00
Eike Ziller b8eea8f9f8 Locator/JavaScript: Fix min/max with more than 2 arguments
Pass a variable amount of arguments along

Task-number: QTCREATORBUG-20167
Change-Id: I3643aca8c18cba14beb8d625b62f45aa4b39d2a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-03-29 10:51:45 +00:00
BogDan Vatra aa2ea72679 Add stdcpp NDK paths to soLibSearchPath
It's useful when the application uses std::abort & co to get
a useful callstack.

Change-Id: I805478333bac3eba21db158df52942599a80c088
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-03-29 10:18:27 +00:00
Eike Ziller 454e9ee5ca Add Context Help to text editor context menu
For this make the default context menu for the text editor extensible
and add the context help item from the help plugin, which now has an
optional dependency on the text editor to ensure correct loading order
if both are present.

Task-number: QTCREATORBUG-55
Change-Id: I378a491ba3700e65fc262bdb10c8ead5ad62cb33
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-29 08:26:24 +00:00
Eike Ziller 26bfa469db Fix that clearing shortcut in settings did no longer work
This broke in 8d1a592d16

We should ask the validator of a fancy line edit if an entry is valid,
also if the line edit is empty and shows a placeholder text, even if we
then do not mark the place holder with the error color, etc.

In case of the shortcut settings, the validator has side effects that
are important.

Change-Id: I41c0d98ed3c6e9e68df4484a47c108b00ddbbfe7
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-29 08:03:15 +00:00
Eike Ziller 3ef455da18 Shortcut settings: Simplify code that extracts shortcut item
Change-Id: Ib9e6c11ea26c09837629ac2ef1c1dff0def1a9dd
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-29 08:03:02 +00:00
Marco Bubke ff1ce3a475 Clang: Honor directories for the file name
The file name id must be unique for very entry, so the directory id must be
incorporated too. Now there is always one unique integer id for every
file path. The directory id is there to access and compare the directory
much faster but not provide any data to the uniqueness of the id.

Change-Id: I0f9a2ca70bc9dda0ce32ebc45eb7b082821eb909
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-28 14:01:12 +00:00
Tim Jenssen 2e25ce32cb QmlDesigner: fix crash on exit
Change-Id: I2e72699dd3f49c917a28d724753e27701a930fac
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-03-28 13:16:23 +00:00
Robert Loehning d424fb36f1 Clang: Don't dereference nullptr
Change-Id: Ib36c2d18fd01684cad45042b9f1a6901a028b345
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-03-28 13:12:15 +00:00
Tobias Hunger 530fc225fa Project: Use std::unique_ptr for root project node
Change-Id: Ice101fa57c5ee09a58dc6c99f6716fa4919ade59
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-28 13:11:32 +00:00
Nikolai Kosjar 39306d55eb Clang: Fix build with QTC_NO_CLANG_LIBTOOLING
Change-Id: I8b3f4db10c43fc1620b765933915e3c4fd0a594a
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-28 11:47:52 +00:00
Eike Ziller 603b031ab2 Version bump to 4.6.1
Change-Id: I814d2b864dff341977a41c4d03d96de465a72775
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-28 10:11:53 +00:00
Eike Ziller 5cc24f9ac1 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/projectexplorer/msvctoolchain.cpp

Change-Id: If2116aa2dbfdb9d07088595e791f8fa706b39e00
2018-03-28 10:01:44 +02:00
Eike Ziller 1e1c212090 Use QTCREATOR_COPYRIGHT_YEAR for documentation
For this the offline style overwrites any footer that was set in the
qt-html-templates-offline.qdocconf from Qt.

Change-Id: I8a8f7048445bc03a72b19df6c60b7cea680c5803
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-03-28 06:45:51 +00:00
Marco Bubke de4f6301e6 Clang: Process SymbolKind and SymbolTags with the indexer
We add the infrastructure to compute the SymbolKind and SymbolTags in the
indexer. Later we have to add more for templates, virtual functions etc..

Change-Id: I9203c5cfbfffed3065337292010de5fce5736453
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-27 14:45:58 +00:00
Marco Bubke a8b11cb2c5 Clang: Improve access to caching structure
The clang file id is counted from zero, so it better to use a vector
instead of a hash with all the overhead.

Change-Id: Iaf201898e9e16005d196b5b49065f15f9d3d2dfa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-27 14:45:41 +00:00
Marco Bubke 576eb3370c Clang: Use the clang indexer for indexing
It is not removing so much code but will makes somethings easier in the
future. We added the SymbolType::Definition too.

Change-Id: I4e106b8518e6bfed0c6a4aa6be61c4a5fe5f8bef
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-27 14:45:35 +00:00
Leena Miettinen 3616725049 Doc: Increment copyright year in doc HTML file template
Change-Id: I281c907e2ee6593bed7854385e9b6f1ca5f169cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-27 14:12:58 +00:00
Ivan Donchevskii 41a12410e6 Clang: Fix initial tidy settings tab
When no settings exist it has to be disabled.

Change-Id: I1cb8368edf182fa616930f5718323c8e03a0e649
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-27 13:54:06 +00:00
Joerg Bornemann af939831f8 ClangSupport: Fix qbs build after incomplete refactoring
Remove files that are not supposed to be built anymore.
These were removed from the .pro file, but the .qbs file
picks them up, because it uses wildcards.

Change-Id: I457044147153baadcc223ff7e9d6b5497dd80fc0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-27 12:41:35 +00:00
hjk 3bce4b9af2 QmlProject: Use new helper function to create run configuration widgets
Change-Id: I471fe60d25bb3d8ca3ebf2d2abe8e725bc7daa56
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-03-27 12:33:51 +00:00