Commit Graph

105 Commits

Author SHA1 Message Date
Alessandro Portale
0be309bcf1 Various places: performance-for-range-copy
Change-Id: I475990d32a5211d31a77782667a2dfedba134137
Reviewed-by: hjk <hjk@qt.io>
2020-06-15 05:58:46 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
Christian Kandeler
eb96f9900a Fix clang 10 warnings about unnecessary copies in range loops
Change-Id: I3b57869b5a04528518bc432b76768b01e3f53e81
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 13:45:43 +00:00
hjk
80a766a2cb Qmake: Move buildDir() from ProFileNode to QmakeBuildSystem
More a buildsystem than a node thing in general and removes
one use of activeBuildSystem and one use of the ProFileNode
-> ProFile back pointers.

Change-Id: Ie007fcd0db9e9294a08b3a1cd68f825c7d3dc9b8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-23 07:42:15 +00:00
Christian Kandeler
a102c11d00 Qmake: Add some debug output for file add/remove operations
This will help collecting feedback from users affected by bugs.

Task-number: QTCREATORBUG-22508
Change-Id: Idfc22245587dd2d71b229b4ab6c7562fb7a5ecfc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-16 11:13:32 +00:00
Christian Kandeler
e46df080ee QmakeProjectManager: Fix null pointer access
Amends c7d8b9b01c.

Fixes: QTCREATORBUG-23596
Change-Id: I466907e02572008d0e677ff29ecd712969f8bc54
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-02-12 16:39:01 +00:00
Christian Kandeler
a12d3721c0 QmakeProjectManager: Fix access to deleted object
Amends c7d8b9b01c.

Fixes: QTCREATORBUG-23576
Change-Id: I7de6679f3dd5ba950561d560195e5af5bfaf90a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-10 16:13:58 +00:00
hjk
99da91fc56 Qmake: Don't access never set QMakePriFile::m_buildSystem
Change-Id: I97e8f0c2b2e53a798bf2762324b4affab99fc938
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-04 11:04:10 +00:00
Christian Kandeler
37aecdd112 QmakeProjectManager: Do not keep an IDocument in QmakePriFile
Instead, we keep the IDocuments as "extra project files" in the Project
class, like the other project managers do it.
This has two advantages:
    - The document is no longer created in a parser thread
      callback, improving Qt Creator responsiveness while
      loading a project.
    - The IDocuments no longer get needlessly destroyed
      and re-created on a re-parse.
This is relevant because adding these objects to the DocumentManager
results in the creation of file watchers, which is expensive.

Task-number: QTCREATORBUG-18533
Change-Id: I49c03377974e6b33340234dbabbbd82b8d0c827c
Reviewed-by: hjk <hjk@qt.io>
2020-02-04 11:01:01 +00:00
Christian Kandeler
c7d8b9b01c QMakeProjectManager: Move some parsing code out of the UI thread
When parsing larger qmake project, the callbacks from the parser threads
are currently overloading the UI thread, often rendering the application
non-responsive until the project is completely loaded.
This patch moves some expensive operations from the UI thread into the
parser threads, at the cost of a somewhat ugly two-stage setup for some
types of objects.
On my Linux machine, I measured that the time spent in parser callback code
went down by almost 50% when loading the Qt Creator super project.

Task-number: QTCREATORBUG-18533
Change-Id: If9624da5b07e81a50c180693580b20a70e1aaea7
Reviewed-by: hjk <hjk@qt.io>
2020-02-03 16:07:54 +00:00
Alessandro Portale
9904464074 Make various Q_LOGGING_CATEGORY's static
Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 14:54:10 +00:00
hjk
e109b731ad Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here.

Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 08:43:18 +00:00
Eike Ziller
e16876df0c Merge remote-tracking branch 'origin/4.11'
Change-Id: Ieb0bb1ebab9a5efb42d15bbeac2cd4c46a6de962
2019-12-18 09:14:14 +01:00
Christian Kandeler
77126dc4b8 QmakeProjectManager: Extend Qt examples deployment hack
E.g. for Qnx, QT_INSTALL_PREFIX is not a prefix of QT_INSTALL_EXAMPLES.

Fixes: QTCREATORBUG-22592
Change-Id: I3092cd76af01519783e1162ab8e79caaf0836f00
Reviewed-by: hjk <hjk@qt.io>
2019-12-17 09:42:40 +00:00
hjk
b74f4c9140 Qmake: Parse two AppMan specific variables
Effectively the same approach as for Android, but a bit more ugly
as we don't have necessarily access to the appman plugin headers
even at compile time.

Change-Id: I6d00e69b593470e059a16a1fcf6b57bdd550ae40
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-02 09:56:53 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Christian Kandeler
03a52b9c87 QmakeProjectManager: Improve renaming functionality
This was implemented rather sloppily: The file was removed from all
variables, but only added to one. Also, no care was taken to insert the
new file name into the same block the old one was removed from.

Fixes: QTCREATORBUG-19257
Change-Id: Ib309389ba7647189112d5c7dd7b3e784f921d2c3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-04 13:37:17 +00:00
Christian Kandeler
ac37c5c950 QmakeProjectManager: Mark disabled source files in project tree
We show all source files in the project tree, including those which are
listed in scopes that evaluate to false in the current configuration.
This is intended, as we want users to be able to navigate to all files,
not just the ones that are part of the build for the current target.
However, it'd be nice for users to be able to tell which files are
"active" and which ones are not. Therefore, we now mark the non-active
ones as "disabled" in the project tree, just like the QbsProjectManager
does.

Task-number: QTCREATORBUG-22855
Change-Id: Icfb48d4f6a247de76fc109acb84b34f03866e754
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-22 11:57:45 +00:00
Christian Kandeler
6e63a0757b QmakeProjectManager: Fix possible assertion
Amends 6c40fec9b0.

Change-Id: I11426f17a7e7a81bf4adcba742c6298f224b7ef1
Reviewed-by: hjk <hjk@qt.io>
2019-08-14 11:42:58 +00:00
Christian Kandeler
6c40fec9b0 QmakeProjectManager: Try harder to find include paths in sysroot
As opposed to qmake itself, Qt Creator tries to resolve the value of
INCLUDEPATH against the sysroot. Therefore we should not reject Unix-
type absolute paths as candidates for sysrootification on Windows hosts.

Fixes: QTCREATORBUG-21164
Change-Id: If4be103061ad3edc64f8d1f5cfeb7c6b48e961c8
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-13 13:54:02 +00:00
Christian Kandeler
a666be04f2 QmakeProjectManager: List .ts files in the project tree
...without the user having to add them to DISTFILES or OTHER_FILES in
addition to TRANSLATIONS.

Task-number: QTCREATORBUG-7453
Change-Id: Ic9621e66079a52f22272c945b92d183eec852f68
Reviewed-by: hjk <hjk@qt.io>
2019-07-31 15:23:02 +00:00
Christian Kandeler
ead8aea35b QmakeProjectManager: Preserve line endings
... when adding and removing files via the project tree.

Fixes: QTCREATORBUG-2196
Change-Id: Ie4ee3a244c9089953cf414d9777fc65b6a8b9689
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-25 08:34:10 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
hjk
9ae2794114 Remove more deprecation warnings
Change-Id: Ie50e41737a4bf7bea41f550df7cc765267e8a144
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 12:51:17 +00:00
hjk
c77cef5706 Avoid more deprecation warnings
Change-Id: Icc7bb7a4ccf7fc9f89f6f668c194ccd440e5231c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 07:49:48 +00:00
Tim Jenssen
1df6443d4a Merge remote-tracking branch 'origin/4.10'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/libs/utils/synchronousprocess.cpp
	src/plugins/baremetal/iarewtoolchain.cpp
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	tests/unit/unittest/CMakeLists.txt

Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
2019-07-04 15:17:55 +02:00
Christian Kandeler
599b03179e QmakeProjectManager: Take "executable" CONFIG value into account
... when setting up deployment data.

Fixes: QTCREATORBUG-22663
Change-Id: I88c428177b76a7bb59fc884c0b727fd0f26a780f
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-04 10:49:43 +00:00
Ville Nummela
63e4180242 ProjectExplorer: Add special handling for removing files
... from a project which are pulled in via wildcards.
Such files cannot be removed from a project file, because they are
not listed verbatim. This kind of failure should not be reported to the
user if the file is also deleted, as the file list will have the correct
state after the next reparse.

Fixes: QTCREATORBUG-22586
Done-with: Christian Kandeler <christian.kandeler@qt.io>
Change-Id: I3dc66fe9a6594be7d0b86f46d830cd099ee49fd7
Reviewed-by: hjk <hjk@qt.io>
2019-06-25 11:53:58 +00:00
Christian Kandeler
019447c535 New class wizard: Add Qt module dependencies, if necessary
Provide general infrastrucure and implementation for qmake.

Fixes: QTCREATORBUG-16067
Change-Id: I8c6368fe2724c9450dcbc3410b6ca459bbbdc043
Reviewed-by: hjk <hjk@qt.io>
2019-06-19 14:06:49 +00:00
Christian Kandeler
cd8ebb21e3 QmakeProjectManager: Make sure OBJECTIVE_HEADERS appear in project tree
We do not introduce another category, but list them under "Headers", as
we do with PRECOMPILED_HEADER entries.

Fixes: QTCREATORBUG-17569
Change-Id: Ie0e6efdd09715daf2802b126a4ecbdc20b25d008
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-14 11:18:31 +00:00
hjk
42d7d3123a QmakeProjectManager: Remove dead code
Change-Id: Ib0cf30c9aa9dce6e55fbdb914cf0bfd4a539496f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 16:04:20 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
Eike Ziller
829a08047f Merge remote-tracking branch 'origin/4.9'
Conflicts:
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I473084232ab99c18e2316154656de0035af02628
2019-05-17 12:47:24 +02:00
hjk
f99d69ee43 Utils: Replace mutating FileName::appendString
... by a non-mutating .stringAppended, doing the same.

Change-Id: I7adb6cae3415942cc9a80088bd75cda9d577d4a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-15 07:42:59 +00:00
hjk
8b532c2cc5 Utils: Replace FileName::FileName(QFileInfo) by a named constructor
More consistent with the fromString case and avoiding false
conversions QString -> QFileInfo -> FileName in case the
inheritance of QString suddenly disappears.

Change-Id: Ib14646ab1a660fd45dd1ea6862a0b5faa52ad0e3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-13 11:33:33 +00:00
Christian Kandeler
b1b52ac674 QmakeProjectManager: Do not ignore files from included .pri files
... when setting up extra compilers.
For example, the code model was not able to resolve included ui_*.h
files in a project that wasn't built yet, if the respective FORMS
declaration came from a .pri file.

Fixes: QTCREATORBUG-22395
Change-Id: I75c4b2b38fec209519adb563d579ecd3a17fe042
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-08 13:07:31 +00:00
Eike Ziller
4545c81e57 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	doc/src/howto/creator-sidebar-views.qdoc
	doc/src/howto/creator-ui.qdoc
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/autotest/testresultmodel.cpp
	src/plugins/autotest/testresultmodel.h

Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
2019-05-08 12:41:25 +02:00
Ville Nummela
ecd386c67b QmakePM: Only schedule update when files are added/removed
When a file is saved, the directory is also touched. If files are not
added or removed, it is not necessary to reparse the project.

Change-Id: I718db68362d41ba936629be880f739ad79b8cb6f
Fixes: QTCREATORBUG-22361
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-26 05:41:07 +00:00
Christian Kandeler
f30d27b10f QmakePM: Find prf files for CONFIG values
... in the pro file editor.
When the user selects "Jump to file under cursor" (e.g. via F2), and the
string under the cursor is not resolvable as a local file path, we
assume it is a CONFIG value and try to locate a corresponding prf file.
To this end, we expose the "feature roots" information of the qmake
evaluator in the QmakeProFile class.

Fixes: QTCREATORBUG-15753
Change-Id: Ibdc6e194a40f07030a5d21f2ddc7b92b63d1765b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-02 08:23:57 +00:00
Christian Kandeler
47d159273e Qmake: Fix infinite reparsing loop
Under certain circumstances, the file system watcher in the qmake
project parser keeps emitting the directoryChanged() signal even though
there seem to be no changes on the file system. Make sure we reparse
only if the directory timestamp has really changed.
This amends 76262814b6.

Change-Id: Ibdcd1e8405a49e78528bf5903e7caafc371cad1b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-25 17:38:56 +00:00
Christian Kandeler
86e16c9e14 Qmake: Add special CONFIG variable "qtc_run" when parsing project files
The idea is that some of the more intrusive prf files in Qt can skip
themselves when they encounter this condition.

Task-number: QTCREATORBUG-17521
Change-Id: I09a33b2d3c5dee1232803d46c521cc9fd29e1898
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-27 12:01:52 +00:00
Christian Kandeler
69565d6c88 QmakePM: Respect editor settings when adding files to project
If the user wants to indent with tabs, then consider that when adding
source files via the UI. But try not to mix: If the respective variable
already uses a different indentation consistently, then keep using that
one.

Fixes: QTCREATORBUG-8016
Change-Id: I037c9ac4d4e7fbbe5753a846e57d938bbb440d6a
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-05 11:31:52 +00:00
Christian Kandeler
a420374976 QmakePM: Do a "sorted insert" when adding files
Don't blindly append to the end of the list, but try to put files into
the right place with regards to lexicographical order.
We do not re-sort existing file lists, nor do we attempt to be fancy
with strangely formatted project files. But lists conforming to our own
style will stay sorted, in particular lists that have only ever been
touched by Qt Creator.

Fixes: QTCREATORBUG-553
Fixes: QTCREATORBUG-21807
Change-Id: I15db0e867a2d477fcf95e008f98ba468dcd83e45
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-01-24 15:31:53 +00:00
Nikolai Kosjar
820e4f8177 ClangTools/QMake: Stop analyzing files not part of build configuration
...for the qmake project manager.

When parsing the project files, remember whether a file was discovered
by the exact or cumulative parse. Only files that were discovered by the
exact parse are considered "active" and thus part of the build
configuration. The others are not offered for selection.

Fixes: QTCREATORBUG-16016
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I7a28b4de15e048975d7f0cd737dd8c11f744315b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-08 14:09:52 +00:00
Ville Nummela
76262814b6 QmakeProjectManager: Watch wildcard directories for changes
If e.g. DISTFILES contains wildcards, watch the directory for changes.

Fixes: QTCREATORBUG-21603
Change-Id: Ia6e8c94ab7b74e0404776ba1d7d9b10eb3b643de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-12 05:09:22 +00:00
hjk
54efabd6e9 Qmake: Move some data accessors from QmakeProFile to QmakeProFileNode
These are not used during parsing but when operating on the items
in the project tree.

This loosens the ties between the qmake related parser and project
nodes.

Change-Id: I077356fcde240df56b466c71c902c821c4885f6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-14 10:04:25 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Alessandro Portale
cd5066d86b QmakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default

Change-Id: I7642992eee6838bb2566921de87390c1771ebcbe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-13 09:25:21 +00:00
Eike Ziller
9bbb085718 QMake parsing: Improve behavior in case of empty build directory
The build directory can be "empty" if there is no build configuration,
or if the build configuration's build directory is empty.

Handle both cases in the same way.
This avoids passing an actually empty build directory to the parser,
which the parser does no longer handles gracefully on Windows.

If the build directory is empty, use the project's source path (instead
of QDir(QString()) which is the current working directory), which makes
it consistent with the behavior when actually building in that case.
The parser does not actually write files to disk, so there is no issue
with temporarily using that directory and later switching to a shadow
build directory.

Task-number: QTCREATORBUG-20121
Change-Id: Ia454085edae6b55b445cc5cf0ec3ae1c85464b0c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-04 15:17:04 +00:00