Commit Graph

132 Commits

Author SHA1 Message Date
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Fawzi Mohamed
e1b44e870f qmljs: new import/dep tracking
Change-Id: I9f4de2a06aad3afb80372a4b80e56db658683575
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-11-20 12:26:30 +01:00
Orgad Shaneh
4442a92729 Braces cleanup
Change-Id: I8413252c90a1487d291f15d92837c30ab697b245
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-11-14 08:13:52 +01:00
Fawzi Mohamed
0a4310d314 qmljs: added qmljsconstants.h
Moved Document::Language, Import::Type and StaticAnalysis::Severity
enums to qmljsconstants.h and renamed values removing the redundant
part.
Thus the effective length changed little or improved
(Document::QmlLanguage => Language::Qml).

The separate file allows better reuse of enum values without introducing
circular dependencies.

Change-Id: I5186d7c04f5d3f6c289068b919be5ff1ff118326
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-10-23 00:35:16 +02:00
Leena Miettinen
41411165ba Doc: use standard wording in \brief commands
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."

Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-20 11:22:47 +02:00
Fawzi Mohamed
5a4cdc11cb qmljs: adding qrc support
Qmljs now keeps a cache of parsed qrc files, and can resolve "qrc:" links.

This breaks the assumption that the name that the qml files has on
the filesystem is the one that qml sees, and that contents of
directories can be found just looking at file whose path starts with the
directory path.

Currently the first file is used when multiple qrc files contain the same
path, but support for strict and weak path resolving is already there.

At the moment only qrc files for projects that call updateQmljsCodeModel
are updated.

ChangeLog: QmljsSupport: Imports using qrc links are resolved.

Task-number: QTCREATORBUG-8953
Change-Id: I695fac2692af2417d49c192c580a1c2e7b4873f4
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2013-06-03 10:32:13 +02:00
Friedemann Kleint
7dce2f9899 Clean headers in QmlJs.
Ran script to remove inludes on a trial-and-error basis and
manually corrected it (Parser excluded).

Change-Id: I5ec6e1076430009bb72094411b2c3386f8bea548
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
2013-04-04 10:08:07 +02:00
Oswald Buddenhagen
1fda2111d4 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
	src/plugins/qmldesigner/designercore/include/widgetqueryview.h
	src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h
	src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp
	src/plugins/qnx/bardescriptormagicmatcher.h
	src/plugins/qt4projectmanager/profilekeywords.cpp
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h

Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
2013-01-31 16:25:33 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
Orgad Shaneh
29a93998df Remove braces for single lines of conditions
#!/usr/bin/env ruby

Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}

Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 10:48:18 +01:00
Orgad Shaneh
5ea0937167 QmlJS: Compile with QT_NO_CAST_FROM_ASCII
Change-Id: I0c5654a978f47a4db5428936fd44633f21394830
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-11-28 11:11:47 +01: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
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
Christian Kamm
097850c842 QmlJS: Speed up ValueOwner construction.
* Don't build all default values (including the global object)
  separately for each ValueOwner instance.
* Instead, keep all global, immutable values in a single, shared
  instance.

While refactoring, some cases where we *modified* the global object had
to be removed:

* C++ context properties no longer get injected into the global object,
  instead they now have their own scope just above the global one.
* The Qt object's prototype no longer gets modified in Link. Instead,
  it's now a reference to the "Qt" object provided in a qmltypes file.
* The whole concept of a function 'Activation' that could potentially
  affect the global object was removed.

Change-Id: Id382faf965efa747fcc7a9b0bc2c90429d84d61b
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-25 10:36:42 +01:00
Christian Kamm
dfd58916cd QmlJS: Add documentation for QmlJS::Value.
Also:
* Remove unnecessary QmlJS:: qualifications in existing documentation.
* Remove unnecessary explicit links in the documentation.

Change-Id: Icb41941d98b5cfe9d2fb3b3887fafee16635eb13
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-15 11:10:43 +01:00
Eike Ziller
85cf2b661e Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libs/qmljs/qmljsinterpreter.cpp
	src/libs/qmljs/qmljsinterpreter.h
	src/plugins/debugger/qml/scriptconsole.cpp
	src/plugins/git/gitplugin.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h

Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
2011-11-11 09:46:25 +01:00
Christian Kamm
a51120b7db QmlJS: Documentation.
Change-Id: I2a095e38b7d79a5fb39a16d8f32b48c8e28132f6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-11-07 15:16:59 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
Christian Kamm
bbb6a4bb64 QmlJS: Fix build.
Change-Id: I230442300bf03d229c0168c108eb69fbd98708af
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-10-21 08:59:27 +02:00
Christian Kamm
0b75a66407 QmlJS: Support module apis defined by QML modules.
Change-Id: I18ec9daf8088f7db5ff2da11da14b539f501bab3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-21 08:21:00 +02:00
Christian Kamm
89ff3cebe6 QmlJS: Introduce UnknownValue.
To distinguish known-to-be-undefined from a genuinely unknown value.

Change-Id: I606b4ea4d726f94553400b8950d3c0a4e76564a8
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-10-18 13:16:18 +02:00
Christian Kamm
90925c69f6 QmlJS: Rename QmlObjectValue -> CppComponentValue.
Reviewed-by: Fawzi Mohamed
Reviewed-by: Thomas Hartmann
Change-Id: Ib89388d5a5678403e4637eec5829f3520637ee27
Reviewed-on: http://codereview.qt-project.org/6310
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
2011-10-12 10:52:56 +02:00
Christian Kamm
038111c384 QmlJS checks: Disable some checks when imports failed.
The important error in this case is on the import.

Change-Id: I3a547ca7ac44a89aba6819ea80ec52185071408a
Reviewed-on: http://codereview.qt-project.org/5879
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
2011-10-12 08:49:30 +02:00
Christian Kamm
a7f78991c9 QmlJS: Move commonly used functions to qmlutils.h.
Change-Id: I22376d96fe575bc00a55094c06af80e32a5587e6
Reviewed-on: http://codereview.qt-project.org/6238
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-10-10 09:36:12 +02:00
Christian Kamm
82cbd0a974 QmlJS: Support .import directives in js files.
* Allow .import...
* Fix parsing of JS files when using Lexer::scanDirectives()
* Clean up ImportInfo construction.
* Rename ImportInfo::id to ImportInfo::as.

Change-Id: I888da248f06dc6184db99aa74c3b50d7f2f5e491
Reviewed-on: http://codereview.qt-project.org/5625
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-09-28 08:52:56 +02:00
Christian Kamm
fdd0a15ef4 QmlJS: Separate metaObjectRevision from minor version number.
They need not to be identical. Additionally:
* Rename ImportInfo::name to path, because that's what it does.
* Add ImportInfo::name, for getting the uri with the names
  separated by dots.
* Allow for exportMetaObjectRevisions in qmltypes files.
* Allow for exports with an empty type name, as generated by
  qmlRegisterRevision. They are used for associating meta object
  revisions with non-exported types.
* Rewrite the Qt 4.7 import to QtQuick 1.0 at an early stage. In
  preparation for the Qt 5 type information update, where Qt 4.7
  is gone.

Change-Id: Ia287193623d9530a56b9eb8d2481d50aabd94c3e
Reviewed-on: http://codereview.qt-project.org/5309
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-26 12:04:16 +02:00
Christian Kamm
6c925cf0fc QmlJS: Rework exported C++ type registry.
The problem was that if you exported
A 1.0, A 1.1 and B 1.0 where A is the prototype of B
the code model had not enough information to know that, depending
on the import, B 1.0's prototype should be A 1.1 or A 1.0.

To solve this problem QmlObjectValues now store the import's version
as well as the local component version. In the example above B 1.0
would have import version 1.1 if the 1.1 module was imported and thus
be able to choose the right prototype.

Change-Id: I7ef33f12ca5a528c62b2a8240f4b5720b0ebd4c3
Reviewed-on: http://codereview.qt-project.org/5129
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-09-19 13:52:26 +02:00
Christian Kamm
f8462cca65 QmlJS: Change from QMap to QHash for QString keys.
Tests indicate that lookup in QHash<QString, ...> is more performant
even for short strings.

Change-Id: I8e5a73d0f1a72e202522f397b16901887f9c3591
Reviewed-on: http://codereview.qt-project.org/5070
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-19 09:09:28 +02:00
Christian Kamm
9f3a5c7370 QmlJS: Cleanup Link.
* Don't use Qt macros for d-ptr.
* Move private functions to LinkPrivate.

Change-Id: Icb6f579e9168dd9bf5cccec1255fda1939e47c9a
Reviewed-on: http://codereview.qt-project.org/4767
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-09-14 11:13:31 +02:00
Christian Kamm
43a6a6d58c QmlJS: Improve import error messages.
Change-Id: Ief305b787fbc4577acfdec41083bc72e178db46d
Reviewed-on: http://codereview.qt-project.org/4537
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2011-09-14 11:03:16 +02:00
Christian Kamm
10a956a8f7 QmlJS: Find setContextProperty calls in C++ and expose to QML.
Task-number: QTCREATORBUG-3199

Change-Id: I591490ceafadc0f5a07c63ec063f1bdfa7055f47
Reviewed-on: http://codereview.qt-project.org/4074
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 12:34:22 +02:00
Christian Kamm
27d0830698 QmlJS: Move the exported-C++-type detection out of C++ code.
It now lives in qmljstools/qmljsfindexportedcpptypes, all in one place.

Also ensures that the source code is available when a file is being
scanned for QML exports. This will enable checking comments for
annotations about the URI a plugin is usually imported as.

Change-Id: I1da36d0678e0a8d34b171dbe0f6b5690d89eb18b
Reviewed-on: http://codereview.qt.nokia.com/3392
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-24 12:13:41 +02:00
Christian Kamm
a6ae570c31 QmlJS: Move 'file not found' error message from Bind to Link.
Change-Id: I701fc179f377581b87e31630eaa4231688152f5e
Reviewed-on: http://codereview.qt.nokia.com/2813
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-10 09:23:28 +02:00
Christian Kamm
0e54183d4d QmlJS: Remove Interpreter namespace.
The distinction between QmlJS and QmlJS::Interpreter has always been
weak and the extra namespace just added an unnecessary complication.

Change-Id: I4db8ef4bd91b5f6bf610a9d23fdbf55bd60250fc
Reviewed-on: http://codereview.qt.nokia.com/2743
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-08 13:21:28 +02:00
Christian Kamm
9dc9674c6b QmlJS: Share Context.
Previously Context was not entirely thread safe and had to be
copied locally. Now it is thread safe and its lifetime
managed by QSharedPointer.

The non-safe parts were moved into ScopeChain in a previous commit.

Change-Id: I851a93de85cbd6391dbea0fe33b011e2e093addb
Reviewed-on: http://codereview.qt.nokia.com/1695
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-08 12:05:19 +02:00
Christian Kamm
4285b48455 QmlJS: Dump builtins per Qt version.
Change-Id: I7b5179c4b33c24e83baf0536d158dd48d277637f
Reviewed-on: http://codereview.qt.nokia.com/1305
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-07-11 11:28:38 +02:00
Christian Kamm
59206106d3 QmlJS: Don't need to store imports per document in LinkPrivate.
Change-Id: I4bb9bcbc7a8e988760ca1b3463474b269e3802af
Reviewed-on: http://codereview.qt.nokia.com/1156
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-07-05 13:45:08 +02:00
Christian Kamm
9ea0380a4d QmlJS: Enforce Context always being linked.
The default way of creating a Context is through Link.

Change-Id: Ia81f7ce90ba2b33d02eed432a61be836d404bedd
Reviewed-on: http://codereview.qt.nokia.com/1041
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-07-05 11:52:09 +02:00
Christian Kamm
8b778b266b QmlJS: Rename Interpreter::Engine -> ValueOwner
Also move to a separate file.

Change-Id: I05910e8cf04a533b5d09a1c16e612e3b99b1d606
Reviewed-on: http://codereview.qt.nokia.com/1039
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-07-05 08:44:16 +02:00
Christian Kamm
8742026380 QmlJS: Allow for QML modules with version subdirectories.
That means
import Foo 2.1
can resolve to
/path/Foo.2.1 or
/path/Foo.2 or
/path/Foo

Task-number: QTCREATORBUG-4607
Change-Id: Ie1efc5be2ca2ed3ccc130e8a662f94aed11bec1a
Reviewed-on: http://codereview.qt.nokia.com/194
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-30 08:25:19 +02:00
Christian Kamm
96cde1e9de QmlJS: Fix import cache usage with 'as' imports.
Change-Id: I6c057e494f87df927adc7b83c6caf1ecc729ac65
Reviewed-on: http://codereview.qt.nokia.com/176
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-05-27 11:49:01 +02:00
Christian Kamm
a7f4e5fab5 QmlJS: Separate imported types and imported JS scopes.
Task-number: QTCREATORBUG-4981
Change-Id: I06d3e428ca4928296a3d5977aeff29fc3217c37c
Reviewed-on: http://codereview.qt.nokia.com/175
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-05-27 11:48:53 +02:00
Christian Kamm
d67b7d17dc QmlJS: Refactor ObjectValue members.
* property -> lookupMember
* setProperty -> setMember
* removeProperty -> removeMember

Change-Id: I638479ee2b90b684283e714630bdcab237f6b3f2
Done-with: Fawzi Mohamed
Reviewed-on: http://codereview.qt.nokia.com/77
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-05-24 11:55:03 +02:00
Christian Kamm
4937769eab QmlJS: Don't add invalid imports to TypeEnvironment.
Done-with: Fawzi Mohamed
2011-05-16 12:21:20 +02:00
Christian Kamm
cf15e14e5e QmlJS: Add tooltips to imports.
Task-number: QTCREATORBUG-4814
2011-05-12 15:29:41 +02:00
Christian Kamm
d0b12f8f19 QmlJS: Remove unused argument for Link helper function. 2011-05-11 09:13:13 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Christian Kamm
d05992d0fa QmlJS: Stop doing significant work in constructors.
To avoid order-of-initialization problems.

Reviewed-by: Thomas Hartmann
2011-05-06 13:48:55 +02:00