Commit Graph

43591 Commits

Author SHA1 Message Date
Eike Ziller
9b52d193a3 Add Utils::filtered as a wrapper around std::copy_if
Change-Id: I4a189581a4a7f42f880c47b91372d7e96d50655e
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-14 12:25:34 +00:00
Tobias Hunger
a447645422 AbstractEditorSupport: Simplify licenseheader handling
Change-Id: I6bad3870b14066716fff5adc2a03b18f1840b6c7
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-14 12:05:30 +00:00
Tobias Hunger
fe8e14eb4c Snippets: Make it possible again to escape $fields$
Update the unit tests while at it. Add some new tests, rearrange
existing ones.

Change-Id: Icc2db644f8fe9752c1bf8e66b134738c27b0fb25
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-14 12:05:20 +00:00
Tobias Hunger
8641277121 TemplateEngine: Do not append trailing newline
Change-Id: I99731186ae1e14c79728ebc6c74a5b842cf25069
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-14 11:59:24 +00:00
Tobias Hunger
ccd3bf0b19 TemplateEngine: Fix indention
Change-Id: I9eaaac11af938bcd3e96687dec435303448c0749
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-14 11:59:18 +00:00
Orgad Shaneh
3389e5f969 ProjectExplorer: Do not resolve symlinks when opening a project
Task-number: QTCREATORBUG-15145
Change-Id: I71ec43fa8cb0073100c988b6aa8a8a59a254af0c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-14 11:58:46 +00:00
Tobias Hunger
981f7411d3 PathChooser: Add interface to set ok/error color for lineedit
Change-Id: I4fcd72e8b9281d1cdb404ccc268c453417ec35db
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-14 11:44:46 +00:00
Tobias Hunger
2e8332088b FancyLineEdit: Remove setTextColor
It is unused now.

Change-Id: I6627754f1f49e18767955a4647270638ec9fad4b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-14 11:44:39 +00:00
Tobias Hunger
e9370ccf83 Gerrit: Add ProgressIndicator
Show a nice spinner while waiting for data from Gerrit.

Change-Id: Ia35d7408e6a65126d40e8cff5278a442f4b5c760
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-14 11:16:08 +00:00
Tobias Hunger
2a014eaee6 Gerrit: No need to subclass FancyLineEdit
Change-Id: I9b25c1e0a72e8a7e5ba268e539cf71f5b28d420b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-14 11:08:50 +00:00
Tobias Hunger
0aad5fac70 FindToolBar: Update to FancyLineEdit changes
Change-Id: I2a1b0440e0cbf511f7e73057bb9fe75e3a01a695
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-14 11:07:52 +00:00
Tobias Hunger
b0bb2d3422 FancyLineEdit: Allow to set the ok color
... and not just the error color.

Change-Id: I7fabd85404193ca3ee54d27025ca952995a0840f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-14 11:04:55 +00:00
Tobias Hunger
1f8b9077ab FancyLineEdit: Use static initializers
Change-Id: Ifd3eee165b03ae6e4868911d039f503d9bbd13b8
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-14 11:04:43 +00:00
Orgad Shaneh
941d23a206 ProjectExplorer: Avoid execution of g++ on startup
Change-Id: I53719f58714b3dd0fcf21d8c7b1deb8d86190408
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-14 10:47:49 +00:00
Ulf Hermann
f2ca9eb166 Show tool name in warning about wrong build mode
Change-Id: I3fd8daf5ffea9708adf173b4685b2b8235c89e54
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-14 10:18:57 +00:00
Nikolai Kosjar
c45f08cdae Clang: Rename isProjectPartValid to isProjectPartLoaded
Change-Id: Ib20700ebb7142cfa9e75edff3b21410fd3bdab05
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-14 10:12:08 +00:00
Nikolai Kosjar
143983a857 Clang: Tests: Move test data into test/data
Change-Id: Ib33cec849ffd575d8b0bf87c6969170af4cd30d3
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-14 10:11:26 +00:00
Nikolai Kosjar
08bf761834 Clang: Tests: Clarify test names
Change-Id: Ic27c4f9473fc215aee7aa6acdb0496388be2360d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-14 10:11:15 +00:00
Nikolai Kosjar
7b631d484d Clang: Add testUnsavedFilesTrackingByModifyingIncludedFileExternally2
Same test as the first version, but without having the header open in
the editor. This one is also skipped since we can't make it reliable
without adding extra messages.

Follow up changes will improve the names of both tests and will make
them both reliable so that the can be activated again.

Change-Id: Ie3ca52e01aedd612bc07e7429dd64d92eb1a23b5
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-14 10:11:08 +00:00
Nikolai Kosjar
77270648e8 CppTools: Fix dead lock on project unloading
...with the clang code model.

In updateProjectInfo() we lock the project mutex and emit a signal.
However, the correspondig slot in the clang code model will call back
into a function that needs to lock the mutex, too:

    CppTools::CppModelManager::workingCopy // dead locks here
    CppTools::BaseEditorDocumentParser::InMemoryInfo::InMemoryInfo
    ClangCodeModel::Internal::ClangEditorDocumentProcessor::run
    ClangCodeModel::Internal::ModelManagerSupportClang::unregisterTranslationUnitsWithProjectParts
    ClangCodeModel::Internal::ModelManagerSupportClang::onProjectPartsRemoved
     ...
    CppTools::CppModelManager::projectPartsRemoved
    CppTools::CppModelManager::updateProjectInfo // emits here

Fixed by emitting the signal after releasing the mutex.

Change-Id: Id3f3cd22b0604f343ada56ea13c26f0dc1a75bd6
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-14 10:10:47 +00:00
Tobias Hunger
924c8bf8b1 ToolChains: Fix theoretically possible null pointer access
This can not be triggered right now, but somebody might run into this
later.

Change-Id: Ibc635e7dca1db7ab77376b5373db67dcdd2bb46e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-10-14 09:46:00 +00:00
Christian Kandeler
6cb205363a Fix qbs build with Qt that does not have the SVG module.
This now works the same way as with qmake.

Change-Id: I8e6b7f32ffff19e6f4fe9d83ffe804984e33f298
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-10-14 09:14:34 +00:00
Eike Ziller
109ce6ef42 Revert "TextEditor: Use canonical path for opened document"
This reverts commit 67cfdbd224.
We cannot just resolve symlinks when opening files.
The resolved name might not have much to do with the name of
the symlink (e.g. some version control systems do that).

Change-Id: I373bfc3d4474fe6b7ef4723de254293665fe87ea
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-14 07:59:33 +00:00
Orgad Shaneh
91cd7b9a33 Main: Replace preprocessor directives with HostOsInfo
Change-Id: I5d72f159baa9a6b22bcb626e55ddf6de7724d4fc
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-14 07:47:57 +00:00
Orgad Shaneh
67cfdbd224 TextEditor: Use canonical path for opened document
Symlinks need to be resolved, similar to project paths resolving.

Task-number: QTCREATORBUG-15145
Change-Id: I034b99d2a34ddaa664ec6d97b9be76bd4131d706
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-14 07:42:48 +00:00
Jochen Becher
caf1bec76f ModelEditor: Simplify file format
The file format does not longer contain object IDs because references are
not used. This simplifies the file format, leads to shorter files and
supportes merges between model files much better - changes in model are
reflected by minimal changes in the file.

Change-Id: I8c76b7899306eec9a493c6cf61add02111229760
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-13 19:27:59 +00:00
Jochen Becher
0d309fc8c0 ModelEditor: Introduce newest version of qtserialization framework
This change unfortunately contains many single changes because it is an
update of the 3rd party component:

* Introduce new Parameter class for better serialization of containers
and other future enhancements
* Delete dead code
* Introduce user data in base archive class
* Fix minor source code issues and typos in comments
* Remove unused and conceptionally broken support of forward refernces
* Fix a memory leak in QXmlInArchive
* prefer load()/save() methods over stream operators
* throw exception on unsuported forward references in QXmlOutArchive
* refactor serialization of pointer types into own header
* remove unneeded specialisation for serialization of free functions
* check for default value of serialization using a getter

Change-Id: Ic197a92b00b22b85dab4a1b88c431cf4da8b3c3b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-13 19:27:52 +00:00
Jochen Becher
f4628dcc8c ModelEditor: Remove unused DiagramReferenceSerializer
Change-Id: Ia5226234c54d1d6b2a5acc5f91ef4b5b02d2734d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-13 19:27:34 +00:00
Nikolai Kosjar
66ada45ce5 Utils: State Qt dependencies in the *.pri file
...to avoid compilation errors for projects that include the *.pri file.

This fixed the compilation of tests/unit/unittest/unittest.pro.

Change-Id: Ia50322d3a7b7a9d05b7f17239e772f013ffe2ff5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-13 16:05:16 +00:00
Nikolai Kosjar
98b57c1162 Utils: Fix compilation of utils.qbs
Change-Id: If2eb76fb82b43170992866f61813c6ab2e9d3b15
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-10-13 14:20:49 +00:00
Nikolai Kosjar
bc67114d53 Tests: Fix compilation of templateengine.qbs
"Duplicate product name 'StringUtils autotest" - looks like a copy/paste
error from coming from tests/auto/utils/stringutils/stringutils.qbs.

Change-Id: Ibf6088eea4471e6248581a02839a4d8ba9bc73ef
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-10-13 14:04:17 +00:00
Marco Bubke
250c8d662b Clang: Add UpdateTranslationUnitsForEditorMessage
If an editor is changing all translation units independent of their project
part they must be updated too. So we introduce a new message to update all
translation units with the same file path.

Change-Id: I70d0ea2bbca9fa880111ff7219573e54f3277026
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-13 14:03:11 +00:00
Tobias Hunger
b1dced66d7 KitInformationConfigWidget: Clean up header a bit
Change-Id: I0e8d92a5b58a6045240a18d655f6a02ae3165804
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-13 13:48:47 +00:00
Tobias Hunger
b26077a7a4 MiniProjectTargetSelector: Improve theme handling for mutable kitinfo
Change-Id: Ibcce2931ca88c6bb0d29b7cbaf45bf6d26e6ee35
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-13 13:48:37 +00:00
Tobias Hunger
43b8e64bac MiniProjectTargetSelector: Update mutable KitInformation
Make sure the widgets get updated. This used to work implicitly for
QComboBoxes, but not for other widgets.

Task-number: QTCREATORBUG-14774
Change-Id: I84440090e459b60fee268693ba0857ea1c0fe5c2
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-13 13:48:33 +00:00
Tobias Hunger
629c24abdc FancyLineEdit: Refactor class
Rename the code that evaluates the text and make it a public
slot.

Change-Id: I843bf505fa6e33661fc840a1fd2ec13ceb210037
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-10-13 13:05:27 +00:00
Tobias Hunger
c455e78781 MiniProjectTargetSelector: Add button widget for mutable KitInformation
This makes some of the more obscure KitInformation useable in that place.

Task-number: QTCREATORBUG-14774
Change-Id: I55f39f2275d96782ee6490d7160ade0c3a5623e1
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-13 12:43:03 +00:00
Marco Bubke
0eaa9f668c Clang: Improve diagnostic update timer
Start the timer after a translation unit change and stop after every
diagnostic is sent. We should decrease the interval as we are
sending the diagnostics because otherwise the sending is delayed to much.
If the file watcher is emitting a file change we should only react
to changes of files which have no editor open.

Change-Id: I5431b4bf6b4c0b825bfc74bb9c697bb2d198fa26
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-13 11:56:51 +00:00
Tobias Hunger
08ca3eb480 Snippet: Use Template engine to pre-process snippets
This enables macros in snippets as well as if/else to select/deselect
lines to have in the snippet.

Change-Id: Ic88fb3277a0f5ac803bcab486b245c688c00822a
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-10-13 09:15:36 +00:00
hjk
ec2e01faec Debugger: Make basic native-mixed debugging work with LLDB
Change-Id: I4d55c6a486d5adbccaa93eaa1ee461238fecfea3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-13 06:49:00 +00:00
Jochen Becher
d6ef70573d ModelEditor: Show scrollbar as needed in properties panel
Change-Id: I0f07dc713aa0faff8071134f183a4e3c9b1c796b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-12 16:39:36 +00:00
Marco Bubke
b8a9e85880 Clang: Don't set a translation unit dirty if the main file is deleted
If a file is deleted the translation unit should be not updated. It will be
later removed anyway.

Task-number: QTCREATORBUG-15070
Change-Id: I40c9c70629dab1d35b713d54442ffdbb2df3db43
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-12 15:49:07 +00:00
Marco Bubke
d8ba9fa972 Clang: Check in translation unit if the file exists
We get in crashes in clang if we not check if the file exists.

Change-Id: I78a20507db6403247c02f8c1e69cd872e3e8f774
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-12 15:32:13 +00:00
Marco Bubke
08041bd5fb Clang: Fix exception message
Change-Id: I010777926d868a9b644c83740c560e4998dbf285
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-12 15:32:08 +00:00
Marco Bubke
bc89baa6e8 Clang: Request new diagnostics after reload
Diagnostics should be not computed after a file change but after creator
is requesting them. Now we wait for the dialog if the file should be
reloaded.

Change-Id: Id0d51874b95e0f8743002a91511d07e0ed47ecdc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-10-12 15:32:03 +00:00
Nikolai Kosjar
b2713716b9 CppEditor: Use SymbolFinder from CppModelManager in CppElementEvaluator
...in order to profit from its file iteration cache.

Change-Id: I3b7c3e7bd3fd24b0a4dfa29f83158baa9414cc06
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-12 15:08:27 +00:00
Nikolai Kosjar
6b6ad446eb CppTools: Make FollowSymbol respect projects
Finding the class definition for a forward declaration or finding the
function definition from its declaration is mostly determined by the
file iteration order. Documents with the most common path prefix are
checked first.

This works fine as long as the files of your project have a common
ancestor. If that's not the case, FollowSymbol might take you to the
definition within another project.

Fix that issue by considering the project part id when constructing the
file iteration order. Since the cached file iteration order now depends
on the projects, ensure to clear it if projects are added, changed or
removed.

Task-number: QTCREATORBUG-15116
Change-Id: I529166bac363959c9fee0b946747fd0370a88809
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-12 15:08:24 +00:00
Orgad Shaneh
eccc567651 ProjectExplorer: Support ABI triplet of cygwin (x86_64-pc-cygwin)
Change-Id: Idd0cc7986e0e6ba8185b32f3bb69a9c9cbf3ffe0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-12 14:49:38 +00:00
Nikolai Kosjar
6ced48ea89 CppEditor: Move static symbol finder instance to CppTools
...to it can be reused by other clients more easily. Also, in a
follow-up change it will have a project part dependency that can be
cleared inside the CppModelManager more easily.

Change-Id: Ic9f2ce5212a94fd05ab0571e9ad99d0a25f5bc5c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-12 14:04:31 +00:00
Tobias Hunger
b4993e142d QmakeKitConfigWidget: Use Qt5 style connects
Change-Id: Ia36138ebba53e8f34332c3af98e357f06769ed3b
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-10-12 12:28:27 +00:00