Commit Graph

945 Commits

Author SHA1 Message Date
Erik Verbruggen
dada2614d5 C++: add include-guard tracking.
Track the typical #ifndef/#define/#endif usage in header files to see if
the macro is an include guard. If so, store it in the Document. No
behavioural change, just recording the name.

This can be used in the future to track if a file needs to be re-parsed
when a macro changes: if it was used in the file, and not defined in it
nor being the include-guard, a file should be re-preprocessed and
re-parsed.

It can also be used to check if two files have the same include guard.

Change-Id: I2715f529997a7b24a11bdbc6150652e2669f1a46
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-01-18 14:58:07 +01:00
Francois Ferrand
4c43655cec C++: fix macro calls with comment before arguments
When in 'keep comments' mode, the preprocessor does not properly handle macro calls with
comments between the macro name and the opening parenthesis: "FOO /*something to say*/
(45)".

Change-Id: I6fe733242e4d2ccff2985d17399d0a084917415a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-01-18 14:56:47 +01:00
Fawzi Mohamed
db3ad7e2aa debugger: fixing tests
- using .pri file for Utils lib (needed on mac)
 - add SKIP macros to support qt5

Change-Id: I76c970a62c4bb44301a8239c1d0b3eeeff4bc081
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-17 11:43:43 +01:00
Orgad Shaneh
c58482eca4 Tests: Exclude QT_NO_CAST_FROM_ASCII
Change-Id: I5bba2a3bf164e5069938b7835176787beb646817
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-17 10:02:22 +01:00
Christian Kandeler
dd195c9dac Debugger: Fix compilation of name demangler test.
No more automatic QString <-> char* conversion.

Change-Id: I236c119932f11e5c2515a68499451ada0fc4f6f3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-01-16 18:36:27 +01:00
Fawzi Mohamed
285bffd99b tests/qmlproject: adding utils lib
Change-Id: I80c952ef8571229893adc6002b39812d6b738b9e
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-01-16 15:46:35 +01:00
Fawzi Mohamed
7ae32b1331 qmldesigner: fixing tests
Change-Id: I2d98ea04860dfab083234904aa83f96cf6790472
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-01-16 15:46:10 +01:00
Fawzi Mohamed
5935ad14d7 tests/ioutils: fixing namespace change
Change-Id: Ie30abed23657e6c2d221877a236468650bbbbd2e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-01-16 14:23:45 +01:00
Francois Ferrand
5e8c3f4be7 C++: fix constructor definition parsing.
When a constructor is defined with a single, unnamed argument of a custom type without
extra type specifiers (const...), then the constructor was not identified as such.
There was an heuristic in case the constructor was in the class definition, but not if the
the constructor was defined later.

Examples:

class Arg;
class Other;

class Foo {
  Foo(Arg /*arg*/);               // working
  Foo(const Arg /*arg*/);         // working
  Foo(int /*arg*/);               // working
  Foo(Other /*arg*/)         {}   // working
};

Foo::Foo(Arg /*arg*/)        {}   // used not to work, fixed
Foo::Foo(Arg arg){}               // working
Foo::Foo(const Arg /*arg*/)  {}   // working
Foo::Foo(int arg)            {}   // working

Change-Id: I741e4ba62672ddc99a837fdcdc27996fba5ae6c7
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 13:36:43 +01:00
Francois Ferrand
058d2e8cb5 Support preserving case when replacing.
When making a case insensitive search, try to keep the string capitalization when doing
the replace:
      - All upper-case matches are replaced with the upper-case new	text.
      - All lower-case matches are replaced with the lower-case new text.
      - Capitalized matches are replace with the capitalized new text.
      - Other matches are replaced with the new text as provided.

Note: this does not work with regexp replace, only plain text.

Change-Id: I87cbc28eb64688bdf3c8c6ec173fcb22f91abcd0
Reviewed-by: Cristian Tibirna <tibirna@kde.org>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-12-14 10:22:41 +01:00
Fawzi Mohamed
82a8e9bb86 qmljs: added persistent trie
Add a presistent trie to store imports, and provide a better (IMHO)
completion algorithm.
The trie is quite generic and it might be worth while to move it to utils.

Change-Id: I4081346af6215b1ee8ff14bd063c2a021d7c8218
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-12-06 12:57:48 +01:00
Fawzi Mohamed
f3a5a60762 qmljs: fix tst_qmlcodeformatter for qt5
qt5 needs a QGuiApp to access fonts (as TextDocument does).

Change-Id: I2779501532ada817dc22f48b5eb9f5af1bb9c3aa
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-12-03 13:41:44 +01:00
Fawzi Mohamed
66eb27e687 qmljs: indent expression in if condition and indent lambda expressions
* indent expressions (like function defs) in if condition
  fixes QTCREATORBUG-7243

Change-Id: I61197317a8dcba72a45b660600711748e2e2b962
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-12-03 13:41:22 +01:00
Erik Verbruggen
cab6ed5e51 Fix: no scope walking for name resolving after MemAccess operator
Change-Id: Ic093079fa65d8d749911fd9f5b0f629e9fe68a1e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>

Conflicts:
	tests/auto/cplusplus/findusages/tst_findusages.cpp

Change-Id: I87d305e2d68582aa00b92f9599368615cd76ec74
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-11-22 16:39:47 +01:00
Thomas Hartmann
5e243dabd9 QmlDesigner: export core functionality
We export the core functionality of the model allowing
other plugins to use it.

The general functionality was already there, but I had
to rename the macro to avoid name clashes.

Also I renamed the .pri file to avoid confusion.

Change-Id: I88203ce9dbfddc8d734e5e232ff71bc0e244e5b8
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-11-21 16:00:24 +01:00
Erik Verbruggen
8cbf0e7045 Fix: no scope walking for name resolving after MemAccess operator
Change-Id: Ic093079fa65d8d749911fd9f5b0f629e9fe68a1e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2012-11-21 14:38:00 +01:00
Thomas Hartmann
d19d254df6 QmlJS::SimpleReader: adding unit test
Change-Id: Iff063bc8037fe11e7f7dd1662408c5a2d0e381cd
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-11-21 13:59:04 +01:00
Thomas Hartmann
6cf321a316 QmlJS:SimpleReader: adding support for arrays
Also adding test.

Change-Id: Idaf0aeacbb6f78e5c8404db740c2a8b7b297dad2
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-11-21 13:58:58 +01:00
Eike Ziller
fe74a9a722 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/fakevim/fakevimhandler.cpp
	src/plugins/qtsupport/baseqtversion.cpp
	tests/auto/cplusplus/cxx11/cxx11.pro
	tests/auto/cplusplus/cxx11/tst_cxx11.cpp
	tests/auto/icheckbuild/icheckbuild.pro

Change-Id: I3c8351ad35617f56d15b788c8a46d8a6f453ef70
2012-11-09 11:20:10 +01:00
Thomas Hartmann
5debabc410 QmlJS: adding SimpleReader
SimpleReader is a !simple! parser for json like qml files.
SimpleReader only parses literal properties for e.g. configuration
files.

SimpleAbstractStreamReader allows event based parsing and SimpleReader
stores the parsed data in a reference counted tree structure.

Change-Id: I0f6422a97f5c356149c516f227f8bbd7b736a6d0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-11-07 16:42:28 +01:00
Nikolai Kosjar
492ca1cbcf Tests: C++: Make tests run from shadow builds.
For shadow builds some tests couldn't find their test data. Solved by
using the same pattern as in Qt tests: Inject $$PWD as SRCDIR via a
DEFINES statement.

Note: It was considered to use QFINDTESTDATA for Qt5, but this was
rejected due to:
 1) It's Qt5 only (would mean to introduce some wrapper...)
 2) As the doc states, it will not work with QTEST_APPLESS_MAIN tests.

Change-Id: Ie6cf59570fe61725b7f6f83b7da650331ddb38fc
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-11-07 14:10:24 +01:00
Nikolai Kosjar
9f38f7bfbc C++: Store lambda captures in the code model.
Done-with: Erik Verbruggen
Task-number: QTCREATORBUG-7968
Task-number: QTCREATORBUG-7949

Change-Id: I0cf727052d0a3536ed96ee894b18768c9538c213
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-11-07 13:36:20 +01:00
Nikolai Kosjar
fb61be5ed6 Qt5: Correct usage of testlib.
This corrects commit 112f80. $$QTESTLIB is not needed since both Qt4 and
Qt5 support "QT += testlib".

Change-Id: I776b44825295c86d2d85e9b8dc6a422da6f36ab6
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2012-11-05 12:58:53 +01:00
Eike Ziller
0a1bdf4257 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/share.qbs
	tests/auto/icheckbuild/icheckbuild.pro

Change-Id: I13bc737c981aaeb615ab1a3571cc8a18f60a7cd6
2012-10-25 10:45:58 +02:00
Nikolai Kosjar
112f80c6c6 Qt5: Fix warning "qtestlib is deprecated".
"Project WARNING: CONFIG+=qtestlib is deprecated. Use QT+=testlib
instead."

Change-Id: Ia6dcce078736cac0f0b05e0f621a25f97c9dac87
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2012-10-24 13:51:16 +02:00
Nikolai Kosjar
6481deb8c8 C++: Fix crashes in tests with Qt5.
tst_Semantic and tst_CodeFormatter crash with QTEST_APPLESS_MAIN since
they need to access some font settings via QTextDocument /
Q*Application. Use QTEST_MAIN instead.

Change-Id: Id85228acb6006cfaee41c634c6a32b6c23a70105
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-10-23 14:07:35 +02:00
Nikolai Kosjar
5d730be06e C++: Compile fixes in tests and tools.
After some refactorings not all usages, especially in tests and tools,
were adapted.

Change-Id: I7ed24bb1c8e55e55ed74eda3a8fd7610e725f4cb
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-23 12:26:47 +02:00
Erik Verbruggen
e72be772c5 C++: added some notes regarding QTCREATORBUG-7968
Change-Id: Ia7a0e4b416ba6ef768d76595d8576262a828ae78
Reviewed-by: David Schulz <david.schulz@digia.com>
2012-10-11 08:53:51 +02:00
Eike Ziller
e6623754e8 One more Nokia replacement.
Change-Id: Ic0a3718d0f1f12e8894c532d5cc034574e26ebeb
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2012-10-09 15:49:48 +02:00
Thomas Hartmann
13d4972e67 QmlDesigner.MetaInfo: meta info fix for versions
Version numbers were not respected in all cases in the meta system.
If we (just) have a QtQuick 2.0 import Rectangle 1.0 is not valid.

Also adding a test.

Change-Id: I2e1dc174aaa180ad1750f0eca04c6879ef6e304d
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-10-09 14:39:44 +02:00
Eike Ziller
086dd684ab Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/coreplugin/fileiconprovider.cpp
	src/plugins/cppeditor/cppplugin.cpp
	tests/auto/qml/qmldesigner/coretests/coretests.pro

Change-Id: I0e83becf661ded9316ce6766786c9ef4c2f897a7
2012-10-09 14:27:29 +02:00
Eike Ziller
1504ca67fb More Nokia -> Digia/QtProject changes
Change-Id: If52505dbc95ee48ac3467cdfbbea91629c11089c
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2012-10-09 12:24:24 +02:00
Thomas Hartmann
ac8f94a8d2 Test.QmlDesigner: removing declarative dependency
Change-Id: Ib15120c846187bd37cf22fae88ae6ece20d2417a
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-10-08 14:30:52 +02:00
Eike Ziller
6fd252b0a5 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessageloghandler.h
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemodeployconfigurationwidget.h
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentinfo.h
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/ichecklib_global.h
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h
	tests/manual/ssh/tunnel/tunnel.h

Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
2012-10-05 21:20:50 +02:00
Eike Ziller
68c796e244 Merge origin/2.6
Conflicts:
	src/libs/utils/fileutils.cpp
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp
	src/plugins/cmakeprojectmanager/makestep.cpp
	src/plugins/qtsupport/baseqtversion.cpp

Change-Id: I153295bad2d97609d96d28945e9f942c5b46b2da
2012-10-05 20:51:31 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Orgad Shaneh
34354148db FileName: Fix isChildOf for some corner cases
empty directory has no children, and root directory was not handled correctly

Change-Id: I1936eab96aef0a3be462f705c60f1f26995be68b
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2012-10-04 16:50:02 +02:00
Thomas Hartmann
7fee2d7a34 Tests:QmlDesigner: fixing changeGradientId
Attaching a second RewriterView is not allowed.

Change-Id: I54055b36f86cd1cff0313edfd405c128c5783705
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-25 12:58:13 +02:00
Thomas Hartmann
2f0f887acc Tests.QmlDesigner: fixing testStatesBaseState
We have to process events to ensure that the correct
data is actually delivered by qmlpuppet.

Change-Id: I5a8b18d20ced5c7b9279868c53fbee698a752b74
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-25 12:58:02 +02:00
Thomas Hartmann
facd24c6b5 Tests.QmlDesigner: fixing defaultPropertyValues
Image does not exist have a revision 1.1.

Change-Id: I012cf4e3636239665b45369717fba8c3c61c0352
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-25 12:57:49 +02:00
Christian Kamm
47d2558f6f C++11: Fix bug with parsing ctor initializers.
Task-number: QTCREATORBUG-7919

Change-Id: I12307c3fb6c20424c8b5aaf564a031924c755d25
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-25 11:03:18 +02:00
Thomas Hartmann
c620ea67f0 Tests.QmlDesigner: compile fix
This header file is not needed and was moved
by recent refactoring.

Change-Id: I0899de93be4e6f03c42d94e128feaa203a12063d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-24 12:23:48 +02:00
Thomas Hartmann
102f915463 Tests.QmlDesigner: adding testBasicStatesQtQuick20
Testing basic states for Qt Quick 2.0.

Change-Id: I86b4dbaffa3ec340eb175a1cd687eef465d87efe
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-24 12:21:42 +02:00
Thomas Hartmann
3c42ca4138 Tests.QmlDesigner: adding testQtQuick20BasicRectangle
Basic test for Qt Quick 2.0.
This time using Rectangle (different prototype chain).

Change-Id: I5500fa5d1a6e2d049404944be81f0b5657cefe3c
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-24 12:21:30 +02:00
Christian Kamm
a81389356e C++11: Fix and add test for simple decltype uses.
Change-Id: I7f843fa96e33671ecb135b9db6f68d9f2cbf2fac
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-24 12:08:25 +02:00
Thomas Hartmann
3c5b64a722 Tests.QmlDesigner: adding basic test for Qt Quick 2.0
Change-Id: Id98be8ec130eb5adfcbd490600369e8353f168b8
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-09-24 11:47:07 +02:00
Thomas Hartmann
e4114505ee QmlDesigner: fix regression uncovered by tests
Fixing a regression in the meta info system.

We follow now Qthe Declarative1StateOperation convention (note the 1).
Since this data is provided by Qt Creator it is independent from any Qt
version. (4.8/5.1)

Also the type comparison was broken in NodeMetaInfo for <cpp> types.
PackageName() does retrieve the package name of the cpp type which might
be different from the one used in qualfiedTypeName().

Change-Id: I5cdae37c2024cdc89824e68168c16e2050051d06
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-09-20 12:01:20 +02:00
Thomas Hartmann
6fb9e90920 Tests.QmlDesigner: adding some QApplication::processEvents();
This is needed process all the events created by NodeInstanceView.

Change-Id: Ia2df51f5aafdc670e60a47064092123a1a100049
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-09-19 16:31:45 +02:00
Thomas Hartmann
96a41678c8 Tests.QmlDesigner: remove QSkip for working tests
Change-Id: I85f61ff4b0ff5abcbff4ef766c4ca7706069bdbc
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-09-19 16:31:35 +02:00
Thomas Hartmann
4cc46ef904 Tests.QmlDesigner: fix testSubComponentManager()
Types names changed.

Change-Id: Ide7cc23289ab490ff272ca99ee048ccc6c99d335
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2012-09-19 16:31:29 +02:00