Commit Graph

185 Commits

Author SHA1 Message Date
Jarek Kobus
784de5fb6c ClassView: don't clear project's file list cache when files removed
Instead of clearing the project's file list completely,
remove just a project (in case a removed file was a project)
and remove from all project's lists the removed file (in case
a removed file was contained in any project).

Task-number: QTCREATORBUG-25317
Change-Id: I63a5f9eb1043bd0d9b835d55f4a16f7f6af7bc6e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-12 14:50:03 +00:00
Jarek Kobus
480220a7e7 Remove a code for Subprojects mode
After fixing QTCREATORBUG-17977 we don't have Subprojects
mode anymore, since currently Parser::addProjectTree() and
Parser::addFlatTree() are identical. For now, we just
remove this duplication. The subproject mode to be fixed later.

Amends 8634aa4cbd

Change-Id: I53d1b5a7354295449c2995c4421f8fa21a3ac2be
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-11 19:21:04 +00:00
Jarek Kobus
9d0b661551 ClassView: Remove redundant call to clearCache() before resetParser()
clearCache() is already called from inside
Manager::resetParser() ->
Parser::resetDataToCurrentState() ->
Parser::resetData() ->
Parser::clearCache().

Change-Id: I270be85b291f99552959e50ee54bd6e1f293c63a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-09 11:33:44 +00:00
Jarek Kobus
1b9c0c7ef5 Simplify interface of classes in ClassViewPlugin
Remove unused methods. Replace one slot with a call
to lambda.

Amends a673fca144

Task-number: QTCREATORBUG-25317
Change-Id: I1125b62b9ea66b8dc43038a6b748d52a5a27224f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-09 10:14:17 +00:00
Jarek Kobus
a673fca144 Simplify interface of classes in ClassViewPlugin
Allow for direct connections where signal emitter and
receiver live in the same thread.
Remove unneeded mutexState, as changes to state and
all queries of state are done in the same thread.
Remove some indirections by removing some signals
and by calling respective slots through
QMetaObject::invokeMethod() or directly.
Remove some unused methods.
Remove a code path of setState(false), as this was never called.
Remove an initial call to onProjectListChanged(), as initially
the state is false and a call is no-op.

This change doesn't influence the existing behavior.

Task-number: QTCREATORBUG-25317
Change-Id: I683525b49afaf04e155d1859bb85ee5dd8e26dd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-08 15:49:40 +00:00
Jarek Kobus
a3318e33db Make Class View interactive again
After you load the project, and after "Parsing C/C++ Files"
has finished, if you open the Class View and start
typing in cpp editor, a warning appears:
"QObject::killTimer: Timers cannot be stopped from another thread"
and changes to source files, like adding a new method or
renaming it, are not reflected anymore in Class View.

Short:
A fix is to give timer a parent in order to move it properly
into another thread.

Long:
Just after creating a Parser object we move it into another
thread by calling moveToThread(), inside constructor of
Manager in classviewmanager.cpp. All the children
of the moved object are moved together into the target thread.
Original intention of the timer object inside Parser was
that it should live in the same thread as its parent
Parser object. In meantime, after some refactoring,
that's not the case anymore and the timer is orphaned
(parentless in terms of QObject hierarchy). It means
it's not moved together with the parent Parser anymore,
while still being a member field of the Parser.
This is reflected in a warning message and class view
doesn't react to the changes in edited document anymore.

Amends 87b3ea9af4

Change-Id: I9cca7556d5b77aa31ce7b4ab426f84a478488a84
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-04 14:38:50 +00:00
Eike Ziller
c898047880 ProjectExplorer: Don't save defaults to settings
Writes less settings and makes it possible to change defaults in the
future.

Task-number: QTCREATORBUG-24762
Change-Id: I73873b3684827b4fe27cfa5ea2f62a76003f9750
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-16 08:40:24 +00:00
hjk
babc1006f2 Various Qt6 porting
Rename QHashSeedType to QHashValueType and use it also for return
values.

Use qHashMulti directly instead of continuing using temporary QPairs.
Avoids ugly namespace tricks to find the new pair overloads, and is
actually clearer.

Classes used in signals cannot be forward-declared.  ...

Change-Id: I22450a0c642437a43f876e8e89cc8788fff3db61
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-16 09:45:43 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Igor Sidorov
a9e40ad14c Add final specifies to classes
Warning -Wfinal-dtor-non-final-class in clang trunk

Change-Id: I2bf17064bf8898eab10b82b69583a283157766d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-05 09:33:55 +00:00
Christian Kandeler
2c295905a9 Fix various leaks relating to use of Core::NavigationView
Change-Id: I8ba508b279376047bcf7ae17dbdadba70ec13582
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-27 09:12:52 +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
hjk
3c6c61d1c8 ClassView: Dissolve the internal 'Utils' class
It's regularly getting in my way, and it's rather a namespace anyway.

Also, move the functions that are only used once closer to their
place of use.

Change-Id: I97951aae1b69c04f391afbdd1b491a8a9173a977
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-18 08:33:26 +00:00
Nikolai Kosjar
d4797587b1 ClassView: Fix a readability-simplify-boolean-expr
Change-Id: I6ad8009551f90dc2d2ab01698cc2d972cf47a79b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-01 08:41:11 +00:00
Tobias Hunger
d272a64eab Project: Remove Project::document() method
The document is used to do file watching, which may or may not be
ideal. So make sure we do not leak the information how we watch
files into the API and its users.

The method is not used sensibly anywhere in creator, so it seems
safe to remove it entirely.

Change-Id: Ieed755bd5c852875378e4e96665dc906499975b0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:27:06 +00: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
6a58666f44 More Utils::toSet/toList
... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-04 12:28:38 +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
Cristian Adam
d855b84c5d Qt Creator CMake port
Based on Tobias Hunger's work from a few months ago.

The CMake configuration needs libclang and Qt paths specified as
CMAKE_PREFIX_PATH.

Auto tests are run with "ctest". At the moment the pass rate is 87%.

Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 13:33:28 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
Eike Ziller
3666e3aaeb Merge remote-tracking branch 'origin/4.8'
Conflicts:
	tests/unit/unittest/unittest.pro

Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
2018-11-09 13:30:40 +01:00
Ivan Donchevskii
8469e317c9 Utils: Adjust column numbers affected by convertPosition change
convertPosition change was introduced in 931ec39f64.
It changed 0-based column to 1-based which is how it
naturally is in Qt Creator.

This fixed some usages but broke many more. This is an
attempt to fix the remaining use cases.

Fixes CppEditor auto-tests.

Change-Id: Ia8d14da0ebb035cd2fdd6da4ff6ec89c1c5121a8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-09 08:51:21 +00:00
Alessandro Portale
5001927425 ClassView: Modernize
modernize-use-nullptr
modernize-use-auto
modernize-use-override
modernize-use-equals-default
modernize-use-using
modernize-loop-convert

Change-Id: I7dcc03ad38f6f943bc4c8b1049e7069f4b99c985
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-08 10:57:20 +00:00
David Schulz
141f19a652 Utils: move code model icons to utils
In preperation for the language server protocol support.

Change-Id: Iee4ccd53a86d9afdb357972ea62b75ace2edcb1d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-06 13:22:47 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Eike Ziller
1997692f86 Class view: Fix keyboard focus when using shortcut
Pass focus to the treeview, and make sure something is selected, so
focus is also visibly moving there.

Task-number: QTCREATORBUG-15920
Change-Id: Icf7c213765739e992edcb52cc88f8730875e0bed
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-09 08:50:08 +00:00
hjk
0b33500655 ClassView: Adapt to new plugin setup pattern
Change-Id: Ieb97736ceb462baf6d97dc39cc4bd08854477a92
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-06 14:28:27 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Eike Ziller
5639144466 ClassView: Avoid mixing const and non-const iterators
Change-Id: I27e35b0225345de7b335dd8ac3a1af5fd5cf164e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-10-23 09:57:06 +00:00
Eike Ziller
b91064f386 Fix more copyright years in plugins
Change-Id: I44845b3cc6f393e76a2f3ff5f166c6170c4eff56
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-08-29 07:28:38 +00:00
Tobias Hunger
107a93ff0d ClassView: WS-only change
Change-Id: If9907e6ba67a9a70765ad3e15f80c9b54bd2575a
Reviewed-by: hjk <hjk@qt.io>
2017-04-06 15:51:04 +00:00
Tobias Hunger
8634aa4cbd ClassView: Adapt to ProjectTree changes
Use functionality available on Project if possible, thus preventing a crash
when trying to work with the rootProjectNode.

Task-number: QTCREATORBUG-17977
Change-Id: I397bbf501dc42b306ca88a67a3b2a0c9a9334d92
Reviewed-by: hjk <hjk@qt.io>
2017-04-06 15:51:00 +00:00
hjk
87b3ea9af4 ClassView: Make Internal::ParserPrivate::timer a real member
Two indirections suffice.

Change-Id: Ie6cb6a32e1482074266f450f8bba004468e5e1b0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-06 09:03:17 +00:00
Serhii Moroz
69da534f99 TextEditor: add right sidebar
Task-number: QTCREATORBUG-9436
Change-Id: Ic0406758a30d52c22c58433f5f35305b798cb462
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-09 08:19:54 +00:00
Tim Jenssen
f2b8e9acd1 SessionManager: Clean up methods around projects
Clean up methods around projects() and update its usages to modern
language standards.

Change-Id: Ia0a4574d014ce41e0d511a392e4eed4680981d0e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-02 09:31:23 +00:00
Montel Laurent
f3c8a2db1e Use isEmpty() vs "count() == 0"
Change-Id: I9b3103fbc4e881693039c1a5e81f0d2b97803978
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-02-22 10:27:14 +00:00
hjk
1d686f9aa4 ClassView: Use visitor-by-lambda
Less code, and avoiding the need to have the temporary
file and folder node lists.

Change-Id: I65e1a7ec022b61f94b01e1e8476bb932d22fd161
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 12:13:35 +00:00
Nikolai Kosjar
c0f2bc254e C++: Sort source files in *.qbs
This makes the diff smaller when adding new files with the wizards.

Change-Id: Iabd35afc32f363c465c8d9b36c45d480ea666627
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-13 11:13:11 +00:00
Tobias Hunger
67e011ba5f ProjectExplorer: Make naming of methods on Nodes more consistent
Change-Id: I5050a020f0fc0ef4556db1d2020afeadfcd51585
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:02 +00:00
Tobias Hunger
c9ee7ee378 ProjectExplorer: Shorten NodeType enum
Use a class enum with a type quint16 for the NodeType. Frees 2 bytes
per node that can be used for better things now.

Change-Id: Ib84bf8629e9f4a5fb0793355eff0f0d6302167dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-03 15:55:13 +00:00
Orgad Shaneh
3b669a37cd ClassView: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I6aac0c1e66b24bb8b638aee906f9f355d2e23d48
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-05-30 06:43:47 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Alessandro Portale
57f31cb89b ClassView: Remove duplicated icon
This change makes ClassView reuse the equivalent icon from CPlusPlus.

Change-Id: I2c83d8869dfdb3d8e8f229fc7cf768dee15442ca
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-07 11:04:34 +00:00
Alessandro Portale
984a6eca73 cplusplus: Make functions of Icons static
This avoids multiple instatiations and reloading of the same image files.

Change-Id: I4d0bb955e23c1cb817671c25bff4e74fb7b3d0f4
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-06 08:48:32 +00:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Ulf Hermann
42d570a3fe Rename Project::ExcludeGeneratedFiles
We want to distinguish between source files and generated files. So
let's call them by their names.

Change-Id: I324c4b82ca7fb7d8d0e175ea6c4f14f1306ec929
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-13 14:12:08 +00:00
Tobias Hunger
5d7f5a2a32 ProjectNode: Rename path() to filePath()
Change-Id: I78bb73f8c9457fd74c470eacbf54eb9195ac9681
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-03 11:01:50 +00:00
Alexander Izmailov
398ad5a40a Add icons for static fields and functions.
Icons for static members in completion list now with S letter.
Task-number: QTCREATORBUG-203
Change-Id: I6c997ad14eeb500936ffe73e2fc0ad8e552a46c9
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-06-22 11:27:48 +00:00
Jochen Becher
431b25ad27 Introduce dragging for all explorer nodes.
Extend drop support with variant values. A drop may be a file drop or a
value drop or both.

Rename Utils::FileDropSupport to Utils::DropSupport and add methods to
add not only files but any QVariant value to the mime data. Project
explorer adds dragged nodes (which will be needed for future ModelEditor
plugin).

Change-Id: I799542c60fdecb3e64af0d3ba47b6caa9adbcfd7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-06-15 08:12:56 +00:00