Commit Graph

243 Commits

Author SHA1 Message Date
Orgad Shaneh
e99aaf23b9 CppEditor: Fix ConvertQt4Connect for different namespace
Change-Id: I152d7cda02bb034bf817eeeb4b467667e1188b2f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-15 10:49:49 +00:00
Orgad Shaneh
dc8dab3d01 CppEditor: Add a failing test for add include for static function
Task-number: QTCREATORBUG-14499
Change-Id: I21d4281a01028d8c4cd5462d64da6428133219a4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-21 12:01:26 +00:00
Nikolai Kosjar
45778539d8 CppEditor: Fix crash with invalid switch/case statement
Task-number: QTCREATORBUG-14925
Change-Id: Iea2cf17070d9db48924e76f6c7febca0d52e4686
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-18 09:44:40 +00:00
Nikolai Kosjar
892cb154b2 C++: Do not let ASTPath calculate line/column for generated tokens
ASTPath uses TranslationUnit::getPosition(), which returns reasonable
results for:

    1. non-expanded tokens
    2. expanded but not generated tokens

The expanded *and* generated tokens case is not handled since there is
no reasonable mapping from generated tokens to a continuous line/column
information. Consider:

    #define DECLARE_FOO int foo; // Multiple generated tokens
    DECLARE_FOO // ...can be mapped to this line, but to which columns?

Since the result where not valid for the expanded and generated case,
ASTPath took the wrong branches. Avoid this by skipping generated
tokens.

Change-Id: I33a2e0f62917f87d691b19feaeef67b09ea8d563
Task-number: QTCREATORBUG-13386
Task-number: QTCREATORBUG-13390
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-31 11:01:02 +00:00
Orgad Shaneh
b1e0731d55 CppEditor: Add a failing test for ConvertToPointer with macro
Task-number: QTCREATORBUG-14801
Change-Id: Ie34b131de4e6f701aeac29567a09be54e2e63bd8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-28 19:54:36 +00:00
Lorenz Haas
7389f46959 CppEditor: ExtractFunction quick fix asks for access specifier
Task-number: QTCREATORBUG-12127
Change-Id: Ifb6ff22282f0f181e49a260e57307ec937f5dfb2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-09 11:17:20 +00:00
Lorenz Haas
7879aa5fae CppEditor: Fix added newlines for GenerateGetterSetter quick fix
As a nice side effect superfluous new lines - introduced by quick fixes
that are using InsertionPointLocator::methodDefinition - vanished.

Task-number: QTCREATORBUG-13872
Change-Id: Ib3df2b2acbc22449f16f4444092a57ae93d53d35
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-09 10:11:56 +00:00
Joerg Bornemann
4b5315bd7c CppEditor: fix "Convert to Stack Variable" for empty initializer lists
The "Convert to Stack Variable" quick fix generated invalid code for
the following snippet: QString s = new QString();

Task-number: QTCREATORBUG-14279
Change-Id: I1f5e33d2089bc2d5713eae1e9f4dc5986523112c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 16:14:43 +00:00
Lorenz Haas
0ea753ad63 CppEditor: Respect current getter coding style
With a simple check GenerateGetterSetter looks for symbols starting with
"get". If such symbols are found it is most likely that the current
class uses "getFoo" for getters and thus the quick fix uses this coding
style for generating the getter name.

Change-Id: I9ff8ef8bb936572abaaf9e671b8985553c1018f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-24 16:08:01 +00:00
Lorenz Haas
0913eb8660 CppEditor: GenerateGetterSetter now ignores symbols in Q_PROPERTY
Since the Q_PROPERTY's name equals the typical getter name the "Generate
Getter" quick fix was not offered.

Q_PROPERTY(int a ...) // <-- a is "recognized" as "int a();"
int m_a;

Task-number: QTCREATORBUG-14166
Change-Id: I35709a1b6492b68309d02427d60251df4fd76cfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-24 16:07:27 +00:00
Nikolai Kosjar
6a94f7e355 CppEditor: Add basic test for ExtractFunction
Change-Id: I44f2edb2905e202669630ab5da85066011491fae
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-03-13 13:41:37 +00:00
Orgad Shaneh
dbb9891f43 CppEditor: Support implicit pointers in Qt5 connect conversion
Task-number: QTCREATORBUG-14104
Change-Id: I157dbcb0e06ed1bf49d2df01bdbad215e35a4c3a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-09 13:27:12 +00:00
Orgad Shaneh
683540bee7 CppEditor: Expand templates for Qt5 connect conversion
Fixes at least explicit data() calls for templated pointers:

QPointer<QAction> action;
connect(action.data(), SIGNAL(triggered()), this, SLOT(slot()));

Change-Id: I7f76c1f556c0f271936728d611751424969916a7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-09 13:16:06 +00:00
Libor Tomsik
0038e82782 Refactor: Comment out delete statement of heap variables
Convert to Stack Variable generates crashing code.

Task-number: QTCREATORBUG-13685
Change-Id: I4555de223e50bc8d75e97205d273aa0f09f652fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-26 17:12:58 +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
Lorenz Haas
a51acf42ef CppEditor: Create only getter or setter member function
In addition to create both getter and setter member functions at once it
can now be decided to only create a getter or setter member function.

Task-number: QTCREATORBUG-13874
Change-Id: I9127a31b7d87dc91619abb2e2335bd8221f170a2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-09 15:53:22 +00:00
Lorenz Haas
c131160c67 CppEditor: Use proper argument name in QtProperty quick fix
Instead of using "arg" for the generated getter/setter/signal argument
try to detect a proper name.

Task-number: QTCREATORBUG-12656
Change-Id: Iddaeb1f1d490af003d172d515033d85d778c10df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 16:42:02 +00:00
Orgad Shaneh
65e7db42b8 C++: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 15:27:22 +00:00
Lorenz Haas
59d6fbd533 CppEditor: MoveAllFuncDef now ignores generated function definitions
Task-number: QTCREATORBUG-13900
Change-Id: I394ed96072c590df627bc29f1962cdab4f7d34d7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 17:05:02 +00:00
Orgad Shaneh
6728741702 CppEditor: Be more strict about quickfixes that were not triggered
in tests

Change-Id: I1f4b4c7a1f4068a83d385e74d75a482b5effdb0c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-29 08:11:53 +00:00
Orgad Shaneh
d2b5136a50 CppEditor: s/testFile/testDocument/
Change-Id: I5e7cd4998fe1ab5aa649f27d06710582f5c77453
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-29 08:09:04 +00:00
Lorenz Haas
f08266497e CppEditor: Add new QuickFix MoveAllFuncDefOutside
This QuickFix behaves like MoveFuncDefOutside except it moves all
member function definitions. It is triggered on the class name.

Change-Id: I1393a51cad521a7bb58a1ed6223ab0fe4db0e592
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-26 17:52:40 +01:00
Lorenz Haas
e58b326a29 CppEditor: Fix AssignToLocalVariable
Make calls like a->b()->c() assignable to a local variable.

Task-number: QTCREATORBUG-10355
Change-Id: If4a55b435c99150710d00567188f901acb2c1a89
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-26 17:52:18 +01:00
Nikolai Kosjar
4a397a5ff5 CppEditor: Tests: Make AddIncludeForUndefinedIdentifier tests data driven
...as far as possible.

Change-Id: Ida039df7fbd4f1a9fce354dd8541c32255752082
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-23 11:36:03 +01:00
Orgad Shaneh
8bb176d2ec C++: Do not compare flags when matching types
Trust the matcher to do the job.

Task-number: QTCREATORBUG-13564
Change-Id: I4ff14608a1ce12d3f4424242e50ba71233ac9bfd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-21 12:05:32 +01: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
Nikolai Kosjar
d9c70f43d9 CppEditor: Tests: Use QTemporaryDir and avoid writing into creator source tree
This should improve results of CI tests where multiple creator instances
execute the plugin tests.

Change-Id: I557a0964568655662108df201589ba369096f4bf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-14 12:10:39 +01:00
Joerg Bornemann
c64a3891a2 CppEditor: make convert from/to pointer aware of auto
Change-Id: Ic378ea1f7fc58fdb9351c9eaa9e9602e568d5ac9
Task-number: QTCREATORBUG-13605
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-17 12:00:34 +01:00
Nikolai Kosjar
2fc4acbc35 CppEditor: Avoid duplicate "Add #include XYZ"
Task-number: QTCREATORBUG-13422
Change-Id: I3648bf44760fdac4e8e1e79652519136af6032c8
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-28 14:01:10 +01:00
Nikolai Kosjar
c58b029319 CppEditor: Tests: Refactor out BaseQuickFixTestCase
We will add another type of test case that allows us to test the list of
offered operations.

Change-Id: I528b3844181c139c8955091ac0bbcf6475fd8a4f
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-28 14:00:58 +01:00
Nikolai Kosjar
5cc3378858 CppEditor: Fix crash in InsertQtPropertyMembers for invalid code
Change-Id: I8a3a3240033d23aa9e3df5276c4e6302d97f71b9
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-27 11:42:30 +01:00
Nikolai Kosjar
7a3c942f35 CppEditor: Merge AddIncludeForForwardDeclaration into AddIncludeForUndefinedIdentifier
* Fixes multiple addition of same include.
* Takes over the check of AddIncludeForForwardDeclaration for forward
  headers.

Task-number: QTCREATORBUG-9704
Change-Id: I84629d35ae433385942a9157e5d32ef04159d07f
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-22 11:58:48 +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
Nikolai Kosjar
a366429766 CppEditor: Add very first include after include guard
...when adding an include for an undefined identifier.

Change-Id: Ia338e924901262a847d3bd7ed9733d8e66c631dd
Task-number: QTCREATORBUG-10391
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-08 15:49:04 +02:00
Nikolai Kosjar
2db588f8c5 CppEditor: Make AddIncludeForUndefinedIdentifier work on template name ids
Task-number: QTCREATORBUG-9704
Change-Id: Ib08c331364fbfcb6e3fb9971d45e8b27311143ae
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-08 15:48:47 +02:00
Nikolai Kosjar
57279c0d0f CppEditor: Trigger AddIncludeForUndefinedIdentifier on qualified name base
Now there is no need to position the cursor on "C" of "Namespace::C" to
trigger the quick fix. It will already trigger if the cursor is
somewhere within the name.

Change-Id: Ic99325f95b5cf5551fc74b55606c402461849fb0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-08 15:48:42 +02:00
Nikolai Kosjar
cb320e1bfa CppEditor: Tests: Rename some tests and add one
...for AddIncludeForUndefinedIdentifier.

There are two basic tests for AddIncludeForUndefinedIdentifier:
 * Tests bypassing match() in order to only test the inserting of an
   include at the right position (now named *_inserting_*)
 * Tests also testing match()

Change-Id: I5b2b008ff9462a1cdaa5718f6a430c46992effab
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-08 15:48:37 +02:00
hjk
8872ef1b73 CppEditor: Allow connect quickfix to operate on disconnect, too
Change-Id: I94794214d969aeda6b3ce21fdca9e0bd23dea800
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-02 15:52:11 +02:00
hjk
af23e254df CppEditor: Make connect refactoring work with 3-args form
Change-Id: I256753726cd543e157663faddabf960b26b04300
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-02 10:42:28 +02:00
hjk
9b8c6c6012 CppEditor: Add quickfix to convert to new style connect()
Limitations:
 * Overloads are not yet handled
 * Action is not offered if the slot can't be looked up in the
   receiver expression (e.g. when it's a base class pointer).

Change-Id: I5779ff1b74657025d058d4f3690f6723b4784497
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-30 17:58:00 +02:00
hjk
9ebb63c78f CppEditor: Simplify CppQuickFixOperation interface
Change-Id: I5c047cf5e2bffa2f7c19c145c4f8d0adf3e64533
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-30 09:38:25 +02:00
hjk
e11bbac671 TextEditor: Add a convenience append method for quick fixes
Less noise on the user side.

Change-Id: Ia5b495a1f9d3ec43623056d793f6771b3b84fd6b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-26 18:55:50 +02:00
Erik Verbruggen
cc70b603d3 C++: Change QStringList to QSet<QString> to prevent conversions.
This eliminates a bunch of list->set->list conversions. Especially the
ProjectInfo::appendProjectPart takes lots of time converting for every
part added.

Change-Id: Ib3c8cd4b0ad6c012ccbeed12ebedd46b9b6cca95
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-09-04 15:59:40 +02:00
hjk
02d26f9221 CppEditor: Compile fix for clang after renaming
Change-Id: Iaabb45fb066afb600718d874a0461bc88fae92e5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-28 13:32:56 +02:00
Nikolai Kosjar
461a54bd2d CppEditor: Trigger "Convert to Pointer" only in function scope
Change-Id: I449330e9d5811f88b359c82726154065b3a6b494
Task-number: QTCREATORBUG-12866
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-21 10:40:44 +02:00
Eike Ziller
c4e51e7405 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I926bdfc7df6158207cfc07f3c6c591d0a59b7667
2014-08-19 12:34:58 +02:00
Nikolai Kosjar
a01f6cadf4 CppEditor: Return on invalid code in ExtractLiteralAsParameter::match
No declarator was provided but we assumed one.

Task-number: QTCREATORBUG-12853
Change-Id: I5faf96b63f39aff43c0165f7277345737e53f191
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-08-18 14:16:43 +02:00
Joerg Bornemann
d7449a0097 CppEditor: quickfix for conversion between pointer and stack variable
The ConvertFromAndToPointer quickfix allows to convert a pointer to a
stack variable and vice versa. The initializer of the declaration is
adjusted. Member accesses change to . or -> accordingly.
Usages of the & and * operators are automatically fixed.

Task-number: QTCREATORBUG-9598
Task-number: QTCREATORBUG-12733
Change-Id: I388a9bd32179c79bff808615299a91a225acea64
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-08 16:32:00 +02:00
Takumi Asaki
66feceacb0 CppEditor: Add escape/unescape string literal QuickFix
Change-Id: I32c22dfa32ee0345b76e8c35381bce988d20ed49
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-07 10:13:57 +02:00