Eike Ziller
602f8e72be
Revert "Revert "Algorithms: Simplify Utils::transform implementation""
...
This reverts commit 52f1fe7033 .
Revert the revert, which was done because we still support
compilation of 4.1 with GCC 4.7, and that crashes with this patch.
For master/4.2 we require GCC 4.8.
Change-Id: Ifd0b8b4641fe3dd658f9bde62b9e4f888d998ee7
Reviewed-by: Christian Stenger <christian.stenger@qt.io >
2016-07-13 06:12:13 +00:00
Christian Stenger
891899dcd4
Utils: Fix compile for Qt5.5
...
Change-Id: I4294fb7dd448e74236e085f7a1884ecedd5a5b90
Reviewed-by: Eike Ziller <eike.ziller@qt.io >
2016-06-27 08:58:56 +00:00
Eike Ziller
5fcf0c438f
PluginManager: Code clean up
...
Mostly refactor some explicit loops, and nicer reverse looping.
Change-Id: I102b86da597b37cd496762bd776af73ec407d838
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io >
2016-06-24 12:30:05 +00:00
Nikita Baryshnikov
2fbf126e4e
Utils::transform with using keyword
...
Change-Id: I98274bbd78a629854dd1774698158d9bdadc4096
Reviewed-by: Eike Ziller <eike.ziller@qt.io >
2016-06-02 20:29:58 +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
f72370f20a
Update License according to agreement with Free Qt Foundation
...
* Update remaining files in src
Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com >
2016-01-19 15:59:41 +00:00
Tobias Hunger
1bb16ad6b5
Algorithm: Add filteredUnique
...
This methods returns a new container with only the unique elements
in the input container. Uses == for comparison of elements.
Change-Id: I80c2027b4d275d27343bd64851c17d42bc971e82
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com >
2015-11-04 08:48:20 +00:00
Tobias Hunger
7d4078b963
Algorithm: Add partition functions
...
These take a container and a predicate and return a Partition
struct with the hit and miss fields. Any element in the original
container will end up in either hit or miss, depending on whether
the predicate returned true for the element or not.
Change-Id: Ia02cd704d6fe1388dc677308440acc48f7c9c1e1
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com >
2015-11-03 10:20:51 +00:00
Tobias Hunger
3810a14552
Utils: Fix indention
...
Change-Id: Idc7ec5d102b0e3c838700ee7d89db7aea3399728
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com >
2015-10-27 12:16:43 +00:00
Tobias Hunger
4df436f61a
Algorithm: Make filtered accept a member function pointer
...
Change-Id: Ib71da93b3893ffb3309d00d7ce2dc803ff0eb4b4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com >
2015-10-23 11:53:49 +00:00
Tobias Hunger
1ffd78bbf5
Algorithm: Make transform work with simple iterators
...
Do not require containers to provide a size() method. This
makes for a less optimized insertion into the target container,
but most Qt classes should still handle this ok.
The upside is that e.g. the treemodel iterators can now be
transformed.
Change-Id: I4f149720631d9efb7b787332f039074b4c796965
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com >
2015-10-21 14:07:46 +00:00
Tobias Hunger
a0269d8b27
Algorithm: Mark output of filtered as Q_REQUIRED_RESULT
...
Change-Id: I0518ed3c649efc8854cb5ef63c02e4def984cdd2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com >
2015-10-21 14:07:41 +00:00
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
Daniel Teske
e818a4ed90
Algorithm: Add a TODO for the future
...
Currently e.g. this won't compile:
Utils::equal(&Class::toString, QLatin1String("xxx"));
because eqaul_to<QLatin1String> doesn't know how to compare
QString and QLatin1String.
In C++14, equal_to<> (without any template parameter) was added,
which simply works in that case.
Change-Id: I463d01e23f9f0379fea95ef1de4305751af8f1a7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com >
2015-09-14 10:54:52 +00:00
Daniel Teske
33d1a91c4f
KitManager: Consider sdk kits for initial default kit
...
Change-Id: I86874f3d138f49d9962e11323364ba856b03bffd
Task-number: QTCREATORBUG-15002
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com >
2015-09-14 10:54:35 +00:00
Daniel Teske
9bcb933008
Utils::transform; Remove some code duplication
...
Change-Id: Ic1237351f6d67cdd8a5d19500d833dce96b08f36
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com >
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com >
2015-08-11 15:08:27 +00:00
wonder.mice
34b92b7574
CodeBlocks: Take into account file target when explicitly specified
...
Change-Id: I37556ef6c2c7a651709012daa9a84c66cf3af505
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com >
2015-06-15 10:18:18 +00:00
Eike Ziller
9926fc2ab1
Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
...
Conflicts:
src/libs/utils/tooltip/tipcontents.cpp
src/libs/utils/tooltip/tipcontents.h
src/plugins/android/androiddeployqtstep.cpp
src/plugins/baremetal/baremetalconstants.h
src/plugins/baremetal/baremetaldevice.cpp
src/plugins/baremetal/baremetaldevice.h
src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
src/plugins/baremetal/baremetalplugin.cpp
src/plugins/baremetal/baremetalplugin.h
src/plugins/baremetal/baremetalruncontrolfactory.cpp
src/plugins/baremetal/baremetalruncontrolfactory.h
src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
src/plugins/cppeditor/cppdoxygen_test.cpp
src/plugins/cppeditor/cppdoxygen_test.h
src/plugins/debugger/breakpointmarker.cpp
src/plugins/debugger/debuggeritemmodel.cpp
src/plugins/debugger/debuggeritemmodel.h
src/plugins/debugger/loadcoredialog.cpp
src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
src/plugins/projectexplorer/addnewmodel.cpp
src/plugins/projectexplorer/addnewmodel.h
src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
src/plugins/qmlprofiler/abstracttimelinemodel.cpp
src/plugins/qmlprofiler/abstracttimelinemodel.h
src/plugins/qmlprofiler/notesmodel.cpp
src/plugins/qmlprofiler/qml/CategoryLabel.qml
src/plugins/qmlprofiler/qml/MainView.qml
src/plugins/qmlprofiler/qml/Overview.js
src/plugins/qmlprofiler/qml/Overview.qml
src/plugins/qmlprofiler/qml/TimeDisplay.qml
src/plugins/qmlprofiler/qml/TimeMarks.qml
src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
src/plugins/qmlprofiler/sortedtimelinemodel.cpp
src/plugins/qmlprofiler/sortedtimelinemodel.h
src/plugins/qmlprofiler/timelinemodelaggregator.cpp
src/plugins/qmlprofiler/timelinemodelaggregator.h
src/plugins/qmlprofiler/timelinerenderer.cpp
src/plugins/qmlprofiler/timelinerenderer.h
src/plugins/qmlprojectmanager/QmlProjectManager.json.in
src/plugins/texteditor/findinfiles.cpp
src/plugins/vcsbase/vcsconfigurationpage.cpp
src/shared/qbs
src/shared/scriptwrapper/interface_wrap_helpers.h
src/shared/scriptwrapper/wrap_helpers.h
tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
tests/system/suite_debugger/tst_debug_empty_main/test.py
tests/system/suite_debugger/tst_qml_js_console/test.py
tests/system/suite_debugger/tst_qml_locals/test.py
Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Nikita Baryshnikov
5930e62b84
Utils.Transform: fix stolen const on MFP
...
Change-Id: I44ef3bac606a733a81f95472d0ca5bb50ee3bca0
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com >
2015-02-11 11:39:44 +00:00
Eike Ziller
3c85058694
Update License
...
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com >
2015-01-16 12:37:56 +01:00
Nikita Baryshnikov
0b5866bcf8
Utils::transform: Add missing overloads, simplify implementation
...
Use a helper class so that the actual implementation is shared and
introduce a helper class for treating QStringList and other qt
containers in the same way.
There are now 2² overloads, because:
- member function pointer vs everything else
- same container type, different container types
Change-Id: I343ca7d4e0007f7146b2e646c436c22174e27779
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com >
2014-11-07 12:43:18 +01:00
Daniel Teske
f0251e7e4f
Make Utils::transform more generic
...
- Works for all container types now, defaulting to
the same container type for input and output
- Enables specifying the result container type,
e.g. QSet<X> x = Utils::transform<QSet>(list, function);
- Use our own inserter instead of std::back_inserter,
to enable usage with QSet<>
Change-Id: I7256e51430bfc1409456c68b6ee270778b95e9d5
Reviewed-by: hjk <hjk121@nokiamail.com >
2014-11-04 15:21:59 +01:00
Robert Loehning
880b7625ec
Fix compile
...
Done-by: Daniel Teske <daniel.teske@digia.com >
Task-number: QTCREATORBUG-13254
Change-Id: I51da8cd76ac2f2315bf8fd74f58e28a1980c98de
Reviewed-by: Daniel Teske <daniel.teske@digia.com >
Reviewed-by: hjk <hjk121@nokiamail.com >
2014-10-24 12:35:10 +02:00
Eike Ziller
ea27143239
Merge remote-tracking branch 'origin/3.2'
...
Conflicts:
src/libs/utils/ipaddresslineedit.cpp
src/libs/utils/logging.h
src/plugins/analyzerbase/AnalyzerBase.pluginspec.in
src/plugins/android/Android.pluginspec.in
src/plugins/android/androiddeploystep.cpp
src/plugins/android/androiddeploystep.h
src/plugins/android/androiddeploystepfactory.cpp
src/plugins/android/androiddeploystepwidget.cpp
src/plugins/android/androidpackagecreationfactory.cpp
src/plugins/android/androidpackagecreationstep.cpp
src/plugins/android/androidpackagecreationstep.h
src/plugins/android/androidpackagecreationwidget.cpp
src/plugins/android/androidpackagecreationwidget.h
src/plugins/android/javafilewizard.cpp
src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
src/plugins/baremetal/BareMetal.pluginspec.in
src/plugins/bazaar/Bazaar.pluginspec.in
src/plugins/beautifier/Beautifier.pluginspec.in
src/plugins/bineditor/BinEditor.pluginspec.in
src/plugins/bookmarks/Bookmarks.pluginspec.in
src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in
src/plugins/clangcodemodel/clanghighlightingsupport.cpp
src/plugins/clangcodemodel/clangsymbolsearcher.cpp
src/plugins/classview/ClassView.pluginspec.in
src/plugins/clearcase/ClearCase.pluginspec.in
src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in
src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp
src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
src/plugins/coreplugin/Core.pluginspec.in
src/plugins/cpaster/CodePaster.pluginspec.in
src/plugins/cppeditor/CppEditor.pluginspec.in
src/plugins/cppeditor/cppfilewizard.cpp
src/plugins/cpptools/CppTools.pluginspec.in
src/plugins/cpptools/cpphighlightingsupportinternal.cpp
src/plugins/cpptools/cppmodelmanagerinterface.cpp
src/plugins/cpptools/cppmodelmanagerinterface.h
src/plugins/cvs/CVS.pluginspec.in
src/plugins/debugger/Debugger.pluginspec.in
src/plugins/designer/Designer.pluginspec.in
src/plugins/diffeditor/DiffEditor.pluginspec.in
src/plugins/emacskeys/EmacsKeys.pluginspec.in
src/plugins/fakevim/FakeVim.pluginspec.in
src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in
src/plugins/git/Git.pluginspec.in
src/plugins/git/gitorious/gitorious.cpp
src/plugins/git/gitorious/gitorious.h
src/plugins/git/gitorious/gitoriousclonewizard.cpp
src/plugins/git/gitorious/gitorioushostwidget.cpp
src/plugins/git/gitorious/gitorioushostwidget.h
src/plugins/git/gitorious/gitorioushostwizardpage.cpp
src/plugins/git/gitorious/gitoriousprojectwidget.cpp
src/plugins/git/gitorious/gitoriousprojectwidget.h
src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp
src/plugins/git/gitorious/gitoriousprojectwizardpage.h
src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp
src/plugins/git/gitorious/gitoriousrepositorywizardpage.h
src/plugins/glsleditor/GLSLEditor.pluginspec.in
src/plugins/glsleditor/glsleditorfactory.cpp
src/plugins/glsleditor/glslfilewizard.cpp
src/plugins/helloworld/HelloWorld.pluginspec.in
src/plugins/help/Help.pluginspec.in
src/plugins/imageviewer/ImageViewer.pluginspec.in
src/plugins/ios/Ios.pluginspec.in
src/plugins/macros/Macros.pluginspec.in
src/plugins/mercurial/Mercurial.pluginspec.in
src/plugins/perforce/Perforce.pluginspec.in
src/plugins/projectexplorer/ProjectExplorer.pluginspec.in
src/plugins/pythoneditor/PythonEditor.pluginspec.in
src/plugins/pythoneditor/pythoneditorwidget.cpp
src/plugins/pythoneditor/wizard/pythonfilewizard.cpp
src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in
src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in
src/plugins/qmakeprojectmanager/profileeditorfactory.cpp
src/plugins/qmldesigner/QmlDesigner.pluginspec.in
src/plugins/qmljseditor/QmlJSEditor.pluginspec.in
src/plugins/qmljseditor/qmljseditorfactory.cpp
src/plugins/qmljstools/QmlJSTools.pluginspec.in
src/plugins/qmlprofiler/QmlProfiler.pluginspec.in
src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in
src/plugins/qnx/Qnx.pluginspec.in
src/plugins/qtsupport/QtSupport.pluginspec.in
src/plugins/remotelinux/RemoteLinux.pluginspec.in
src/plugins/resourceeditor/ResourceEditor.pluginspec.in
src/plugins/resourceeditor/resourcewizard.h
src/plugins/subversion/Subversion.pluginspec.in
src/plugins/tasklist/TaskList.pluginspec.in
src/plugins/texteditor/TextEditor.pluginspec.in
src/plugins/texteditor/basetexteditor_p.h
src/plugins/texteditor/basetextmark.cpp
src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h
src/plugins/texteditor/codeassist/defaultassistinterface.h
src/plugins/texteditor/codeassist/iassistproposalitem.cpp
src/plugins/texteditor/itexteditor.cpp
src/plugins/texteditor/itexteditor.h
src/plugins/texteditor/itextmark.cpp
src/plugins/texteditor/plaintexteditor.cpp
src/plugins/texteditor/plaintexteditor.h
src/plugins/texteditor/texteditoractionhandler.cpp
src/plugins/todo/Todo.pluginspec.in
src/plugins/updateinfo/UpdateInfo.pluginspec.in
src/plugins/valgrind/Valgrind.pluginspec.in
src/plugins/vcsbase/VcsBase.pluginspec.in
src/plugins/welcome/Welcome.pluginspec.in
src/plugins/winrt/WinRt.pluginspec.in
tests/auto/debugger/temporarydir.h
Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
2014-10-14 15:36:16 +02:00
Eike Ziller
8295b503be
License update
...
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com >
2014-10-09 11:41:44 +02:00
Christian Kandeler
847f10e9cc
Remove Qt version checks.
...
Qt 5.3 is the minimum requirement these days. Remove all fallback code
from sources and project files.
Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6
Reviewed-by: Eike Ziller <eike.ziller@digia.com >
2014-09-08 10:33:25 +02:00
Daniel Teske
e476ff3587
QmakeProjectImporter: Prepare for multiple concurrent imports
...
Fix logic around temporary qt versions. We want essentially shared
ownership of kits on the temporary qt version.
Change-Id: Ic8c748aa2b04afb5a30444563b3fc2f4272ca47c
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com >
2014-09-03 17:31:09 +02:00
Eike Ziller
292cf6c9e8
Algorithms for DocumentModel
...
Change-Id: I9065951548a85190c991339f93cf57be2e1617da
Reviewed-by: Daniel Teske <daniel.teske@digia.com >
2014-07-18 11:40:59 +02:00
Alessandro Portale
01002a873d
Algorithms: Fix compilation
...
Msvc 2013 (with update 2) had problems with using the member variant of
Utils::equal in ToolChainModel::findToolChain. This patch removes the
Utils::equal variant and does a workaround in
ToolChainModel::findToolChain
Change-Id: Ib0717fe426e34763b912e4a73db266c56aa8c1dd
Reviewed-by: Daniel Teske <daniel.teske@digia.com >
2014-07-17 13:12:57 +02:00
Daniel Teske
98a88b0b84
Fix compile with g++ 4.7 on Jenkins
...
Apparently g++ 4.7 has a broken implementation of std::is_convertible.
Change-Id: I2857b265dcd70d11ead00b45e2ba096606985e63
Reviewed-by: Daniel Teske <daniel.teske@digia.com >
2014-07-17 11:52:01 +02:00
Daniel Teske
16ac3928a0
Algorithms: Introduce helper Utils::equal
...
Takes a member (function) pointer and a value and returns a functor,
that takes a instance of the mfp's class and returns whether it's equal
to value. Sounds complicated, but is a common pattern that is easy to
understand.
Change-Id: Iaaeb90488d34ddfd6940dadd4c66705381198fee
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com >
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com >
2014-07-16 18:21:03 +02:00
Daniel Teske
eccf1dc1e3
Even more algorithm usage in ProjectExplorer
...
Add Utils::transform and anyOf that take a member function pointer.
Remove bestElementOr it's unused.
Use declval<T> in transform's return type, because msvc does evaluate
T() and for types that don't have simple constructor this fails.
Add std::remove_reference since decltype returns a reference for
lvalues.
Change-Id: I22248b226748eeb27af0d300182d574438d7f756
Reviewed-by: Eike Ziller <eike.ziller@digia.com >
2014-07-16 18:20:57 +02:00
Nikita Baryshnikov
12103e0f67
Reinvent deprecated qSort as Utils::sort
...
Change-Id: I4f6011cc2b6127037249aabc2426a88ad7108ebf
Reviewed-by: Orgad Shaneh <orgads@gmail.com >
Reviewed-by: Daniel Teske <daniel.teske@digia.com >
Reviewed-by: hjk <hjk121@nokiamail.com >
2014-06-19 14:00:32 +02:00
Christian Stenger
3247028dee
Core: Utils: Fix compile with Qt4
...
Change-Id: Ibe4b504b84e467b1450b63bbbc7b569558fd8733
Reviewed-by: hjk <hjk121@nokiamail.com >
2014-06-17 08:49:18 +02:00
Daniel Teske
6d2d3ab54d
ProjectExplorer: Fix comparing priorities
...
Makes test_modelmanager_extraeditorsupport_uiFiles pass again. Before, a
"CMake Wizard" dialog blocked the auto test due to the wrong
comparisons.
The std::max_element function takes a less predicate. Thus the right way
to find e.g. highest int in a vector is:
std::max_element(..., std::less<>) or
std::min_element(..., std::greater<>)
Both variants are confussing to read. Instead of provinding
Utils::maxElementOr provide a bestElementOr which leads to this code:
bestElementOr(..., std::greater<>).
Change-Id: Ic30f0d742c03170b28227f60d3a5ae00e40fdf5a
Reviewed-by: Daniel Teske <daniel.teske@digia.com >
2014-06-16 22:47:28 +02:00
Daniel Teske
5a30007e45
ProjectExplorer: Use more algorithms
...
Make heavy use of lambdas
Change-Id: I53197d0ffb4ae8eec076f15335cc22b74e1def1d
Reviewed-by: Orgad Shaneh <orgads@gmail.com >
Reviewed-by: Eike Ziller <eike.ziller@digia.com >
Reviewed-by: hjk <hjk121@nokiamail.com >
2014-06-16 14:26:03 +02:00
Daniel Teske
c78258cd57
Allow the user to restrict rc creation to certain .pro
...
Task-number: QTCREATORBUG-10953
Change-Id: Iff1a31c007ac777bfa390d48237480ef56ffc0e4
Reviewed-by: Eike Ziller <eike.ziller@digia.com >
2014-06-16 13:04:23 +02:00
Daniel Teske
204de740ec
QmakeProject: Replace applicationProFilePaths by idsForNodes
...
Change-Id: Ie10e8cb93f26eb2087272646668fafd480b0208d
Reviewed-by: Eike Ziller <eike.ziller@digia.com >
2014-06-16 10:30:57 +02:00