Commit Graph

54723 Commits

Author SHA1 Message Date
Marco Bubke
793acdb9c6 Utils: Improve SmallStringView::operator==
Change-Id: I5be22e86cdeb7045386633733d2347f48a705578
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 10:04:43 +00:00
Marco Bubke
f6228cae22 Utils: Improve SmallString::operator<
Change-Id: I893634dd4e95b4103f0fc822e5268cc5f95d3d4b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:55:48 +00:00
Marco Bubke
a39f659b65 Clang: Remove empty line
Change-Id: Icdb54baf17f6e4f028d32b98a1bc0c945da4968e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:48:36 +00:00
Marco Bubke
d54db53d2f Utils: Fix spacing
Change-Id: I3c3f4e22ad64144f7ea92e671b9f582fd434b491
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:48:15 +00:00
Marco Bubke
4c7cc99375 Utils: Fix short string capacity
The short string capacity is the data area size minus the size of \0.

Change-Id: Iffb4428bb81fc78bdc4c00218cf9f2c9ac8c25e5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:47:59 +00:00
Marco Bubke
08711525ec Utils: Clone the capacity too
It has it's advantages if the text grows otherwise we maybe waste memory.

Change-Id: Ic76d25207c2ef18182069fbf64bc0fb955a85353
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:40:09 +00:00
Marco Bubke
4cc89b97de Utils: Don't allocate new memory if it is fitting in the short string
If you call reserve on a read only reference we always allocated on the
heap which is not that smart.

Change-Id: Ib9653c6fc87bc65716a966545c13f7ecb3712039
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:32:21 +00:00
Marco Bubke
18453deafb Utils: Cleanup SmallString::replace
Improve the naming of the variables.

Change-Id: I125f3451e0e6a7437909067e9bff06cbeac111a0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:22:04 +00:00
Marco Bubke
0e3dc045a1 Utils: Fix replace crash
The bug was that we returned the new end() but not the old reallocated
after a reallocation of the memory. The return value is used to move the
string after the found sub string to the next found sub string to the
new position of after the replaced sub string. Because the new end moved
more to the right we moved a much bigger chunk of memory. So we
accessed memory outside of the allocated memory.

Change-Id: I9ac276e201eabee896190da0cf0ee1d86860777d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:05:33 +00:00
Andre Hartmann
3480579943 Extract CamelHumpMatcher for use in the C++/QML locator filters
Started-by: David Kaspar <dkaspar@blackberry.com>
Change-Id: I928ccdc4084f8d07826746c771e7fca6994f95ab
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-04 08:19:10 +00:00
Nikita Baryshnikov
7729195d19 Fix warnings in ProjectExplorerSettingsPage ui
from d6591625c3

Change-Id: I35bbba0ff9ccd69f4d3474f263de85dbc8ab49ff
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-08-04 06:36:48 +00:00
Vikas Pachdha
95d34c9277 Squish: Fix Start debugging button identification
The tooltip on start debugging button may not contain project
name and thus no trailing space

Change-Id: Ibc934770feb8b2f7d5fff553b91e3803c222bdad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-03 12:42:44 +00:00
Christian Kandeler
8b8a32ba0e qbs build: Do not access the bundle module unconditionally
We should not rely on its presence on non-Darwin platforms.

Change-Id: I3fa722038f9c2d1139f6e1dc8c49d1c4d2fe0bee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-03 11:09:55 +00:00
Nikolai Kosjar
2d27c55310 Clang: Suspend least recently used translation units
...to free some memory.

The translation units of the 7 most recently used documents ("hot
documents", tracked by document visibility) are kept in memory.
Translation units of other documents are suspended and will be resumed
once they become visible again.

The resumption of a translation unit needs the same time as reparse
(since it is a reparse effectively).

The number of hot documents can be modified by the run time environment
variable QTC_CLANG_HOT_DOCUMENTS=N. Visible documents are always hot.

Task-number: QTCREATORBUG-11640
Change-Id: I68ecd2b1373e303372300203e42d90f65a4b39b3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:27:32 +00:00
Nikolai Kosjar
c2cfc62f08 Clang: Use document visibility as jobrequest conditions
This is in preparation for a follow-up change that will add jobs that
also operate on invisible documents.

Change-Id: I2a0fc3b95cc5ab2e267429134a534df64c901376
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:53 +00:00
Nikolai Kosjar
643854cb8b Clang: Fix incomplete JobRequest in tests
Change-Id: Ibbe8f2722c81393d997efb33e6b29e01fde5eee7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:49 +00:00
Nikolai Kosjar
91cf73361b Clang: Clean up JobRequest::ExpirationReasons
Make it a class enum and remove some noise.

Change-Id: Icd83f680c0df5eed0579c853ce5b4615e7822a28
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:43 +00:00
Nikolai Kosjar
724573324c Clang: Track visibility timepoint of documents
This enables determination of "most recenlty used" documents, which is
needed for a follow-up change.

Change-Id: I7b2c9001fd00173044983780e99817b4416e280e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:39 +00:00
Nikolai Kosjar
ff05889755 CppEditor: Abort async schedule for synchronous CppUseSelectionsUpdater case
...since this makes no sense. If we are waiting for some results
synchronously, no other update should be triggered.

Change-Id: I5452c162d1608f841234ac8b9b7f3290828a5eb7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:24:50 +00:00
Alessandro Portale
dbf9bd444b Wizards: Refresh the basic Qt Quick Application wizard
It now really creates an empty project.
Also, adapt the QtQuickPrototype template accordingly.

Change-Id: I0749805211df080c88cad1b9c2d476d56836c18a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-08-02 17:00:52 +00:00
Samuel Gaist
d6591625c3 Add support to change the number of lines of the compile output
This patch adds support to modify the number of line shown in the
compile output window. This will allow users with big projects to have
more room to look at when compiling.

Task-number: QTCREATORBUG-2200
Change-Id: I1023b2150a3eff4a33b8872fb711d150e5a8b00c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-08-02 15:29:04 +00:00
Nikolai Kosjar
301dd629e6 ModelEditor: Fix build
stereotypedefinitionparser.cpp:205:59: error: 'value' has incomplete type

Change-Id: I6493734406c9fa4e3130cd562ca3ac3ab3a28c07
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-02 12:04:08 +00:00
Marco Bubke
98035954c9 Sqlite: Add Read and ReadWrite mode to database
We want open databases in read only mode too.

Change-Id: I3b20602d4bd7841c9fca3260edce082d21022052
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:26 +00:00
Marco Bubke
52a911b972 Sqlite: Cleanup table and column handling
Using values instead of pointers makes the handling much easier. We can
remove ColumnDefinition too, and use SqliteColumn instead.

Change-Id: I224db9cc569c4dfb6e2746179b02096904bfbccb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:18 +00:00
Marco Bubke
a41183f6c7 Sqlite: Add variadic bind and write functions
You can now write

SqliteWriteStatement statement("UPDATE test SET name=?, number=?
                                WHERE rowid=?", database);

statement.write("see", 7.23, 1);

and

SqliteWriteStatement statement("UPDATE test SET name=@name, number=@number
                                WHERE rowid=@id", database);

statement.writeNamed("@name", "see", "@number", 7.23, "@id", 1);

This is more type safe than using variants and performant too.

Change-Id: Ie1ed2a6d326b956be5c4ec056214f3f5b1531f45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:12 +00:00
Marco Bubke
71e1f66284 Sqlite: Add excute to the database
To execute some simple pragmas etc..

Change-Id: Iaa74406a182897dd55ee3ee8dc4d4b94bb8a8e11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:07 +00:00
Marco Bubke
a279b55415 Utils: Fix missing initialization in SmallString
Change-Id: I9f8d7aee15c1908f89c6208390cc46d737789144
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:00 +00:00
Tobias Hunger
93c832a621 Project: Get rid of *EnabledChanged signals on Project and Target
Change-Id: I87529e4eed73fedf34a1482c99129ecc3a5c0e98
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:20:43 +00:00
Tobias Hunger
f119eec4d1 Project: Get rid of builddirectoryChanged signal
Get rid of Project::buildDirectoryChanged signal as well as
Target::buildDirectoryChanged (and the infrastructure).

Change-Id: Ia749e62eec7e182e558d81115dc2a3d07b72b346
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:20:37 +00:00
Tim Jenssen
4a40a18c05 fix qbs build
Change-Id: I99628c9a47fb4dfd13a18351499d42c1a488031d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-02 11:19:45 +00:00
Tobias Hunger
e52ebbf217 ProjectExplorer: Add subscribeSignal method to targets and projects
Add a subscribeSignal method to targets and projects that will make
sure all signals of all project configurations added during the lifetime
of the project/target will get connected (if the type matches).

Use this to connect to some signal in all BuildConfigurations of
a project and get rid of code that keeps connecting to the current
build configuration.

Use Project::buildEnvironmentChanged as an example and convert its
usages.

Change-Id: I689bcebac4b191bf3f8a18765bf18eaac371c5fe
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:19:28 +00:00
Tobias Hunger
34456aa906 ProjectExplorer: Add ProjectConfiguration * to activeProjectConfigurationChanged
Add ProjectConfiguration * to activeProjectConfigurationChanged signal on
Projects and Targets.

Change-Id: I56f71e034eacaaa043b19c7fd5d82e6c5ea58517
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:18:59 +00:00
Tobias Hunger
ef2f2804a1 ProjectConfiguration: Add isActive() method
Returns true if the ProjectConfiguration element is currently active
and false otherwise.

Just a convenience method.

Change-Id: If75809ae7e78149d264deaaf6adc4ca8a8be43c2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:18:52 +00:00
Jochen Becher
90e40f932d ModelEditor: Implement dragging end of custom relations
Change-Id: I38dff44cecd21d32393dfac76d581138dbb6a589
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-02 11:13:58 +00:00
Jochen Becher
4c469e0111 ModelEditor: Introduce swimlanes
Change-Id: I9ac9c51eabc00c6912fd47fbf51b50b2938846ae
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-02 11:13:38 +00:00
Leena Miettinen
2a80ee8d63 Doc: Update information about XML-based wizard templates
The example wizard templates have been removed. None of the
remaining XML-based wizards use generator scripts (and those
are not recommended for new projects), so information about
genereator scripts was removed.

Change-Id: Ie84fad6a5acb39e9718358bd0b14a5caca454201
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-02 10:47:01 +00:00
Orgad Shaneh
c562dce322 Abi: Support Atmel AVR architecture
Change-Id: Ib2c894311d7318a9226ca2ac40001c4f96606f6e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-02 10:39:30 +00:00
Leena Miettinen
6cb2d8d355 Doc: Update screenshots of new project and file wizards
The wizard list now shows bigger icons.

Change-Id: I2ec842a915016dddef8ff20de7f70979bb5f1991
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-08-02 06:53:48 +00:00
Christian Stenger
4ad12a2b60 Squish: Add some hints for the setup on macOS
Change-Id: I7aaaee9f32b22f632bdd80c2bcfb1f0cc19f1c8d
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-02 06:42:33 +00:00
Orgad Shaneh
6907cd350b Utils: Fix compilation with clang
persistentsettings.cpp:435:23: error: default initialization of an object
of const type 'const Utils::Context' without a user-provided default
constructor
        const Context ctx;
                      ^

Change-Id: Ifd034d93c438bd1cd11c18e965417bf6ac24264b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-02 05:41:33 +00:00
Marco Bubke
2fed425cd3 Clang: Cleanup string interface of sqlite
We only will need the utf8 optimized SmallString for the indexer database.
So we remove all other string bindings, QByteArray and QVariant.

Change-Id: I4a77901a80b26bf292fc85df535c2ccf3a8ab52f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 13:44:50 +00:00
Marco Bubke
1727e64349 Utils: Use string view instead of a string
This is preventing unneeded mallocs.

Change-Id: Ia1f9b1be90635e7aa8b4b6f6e6705e5671f946c5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:33 +00:00
Marco Bubke
daa3aad651 Utils: Add startWith to string view
We will add more function if they are needed.

Change-Id: Iac6b432327be32a0778a82c23ed2de5996c555a1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:28 +00:00
Marco Bubke
19e0159661 Utils: Improve string vector for string view usage
Some times it makes sense to have a Utils::StringViewVector instead
of a Utils::SmallStringVector because you don't want to hold the ownership.

Change-Id: I5ae39efe21aebbf82d4b3effa9e67eae6727ba8b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:22 +00:00
Marco Bubke
3b46c09520 Utils: Add isEmpty to string view
Change-Id: Ib7e77602dcdcdf481f6ab690bacef53c5dd92580
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:14 +00:00
Marco Bubke
01e1f13bb9 Utils: Add + operator to SmallString
It should not be used for chained concatenation. Use initializer list
instead.

auto text = in + 'x';

auto text = Utils::SmallString{in, "x", other, ", "};

Change-Id: I453d986913eae89fd5e1f525b9f4e0c4bd089467
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:08 +00:00
Marco Bubke
1b14ec5056 Utils: Add number to string conversion
We use std::to_string except for integer where we want a low overhead
solution.

Change-Id: I16ce7d575d83ff56e61a5038aa7f9a1febfaf34f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-01 12:40:02 +00:00
Orgad Shaneh
e2e109c862 Debugger: Work around race when running from command line
If the project was not parsed yet while the debugger is invoked,
activeRunConfiguration is still null, so the debugger doesn't start.

Task-number: QTCREATORBUG-18551
Change-Id: I02d77fa8fb1b2a3673da5cbf28ea36156498918c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-01 11:33:37 +00:00
Tobias Hunger
45046f7071 ProjectNodes: Do not derive Project Nodes from QObject
That should save some memory per node, and since creator has a lot of nodes
(e.g. opening the LLVM project adds about 1 000 000 nodes) this should be
noticeable:-)

Calling update inside ProjectTree::currentNode() and rename it to
findCurrentNode() to make sure it is an still existing pointer.
Also, try to reduce the somehow more expensive currentNode() calls
and sprinkle some const around that usage.

Change-Id: I6a7c5db01a71d53d39544d3013cad557d5b96cdc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-01 11:24:53 +00:00
Leena Miettinen
6fccc45a92 Debugger: Fix UI text to follow the guidelines
Change-Id: I7afa680c15f9dacfa8b0a17c16c442211d4fc7ce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-08-01 11:15:04 +00:00