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>
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>
- 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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
"Project WARNING: CONFIG+=qtestlib is deprecated. Use QT+=testlib
instead."
Change-Id: Ia6dcce078736cac0f0b05e0f621a25f97c9dac87
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
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>
After some refactorings not all usages, especially in tests and tools,
were adapted.
Change-Id: I7ed24bb1c8e55e55ed74eda3a8fd7610e725f4cb
Reviewed-by: hjk <qthjk@ovi.com>
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>
empty directory has no children, and root directory was not handled correctly
Change-Id: I1936eab96aef0a3be462f705c60f1f26995be68b
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Attaching a second RewriterView is not allowed.
Change-Id: I54055b36f86cd1cff0313edfd405c128c5783705
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
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>
Image does not exist have a revision 1.1.
Change-Id: I012cf4e3636239665b45369717fba8c3c61c0352
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This header file is not needed and was moved
by recent refactoring.
Change-Id: I0899de93be4e6f03c42d94e128feaa203a12063d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
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>
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>
This is needed process all the events created by NodeInstanceView.
Change-Id: Ia2df51f5aafdc670e60a47064092123a1a100049
Reviewed-by: Marco Bubke <marco.bubke@digia.com>