forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.6'
This commit is contained in:
3
dist/changes-2.6.0
vendored
3
dist/changes-2.6.0
vendored
@@ -196,6 +196,7 @@ Credits go to:
|
|||||||
Kaffeine
|
Kaffeine
|
||||||
Kai Köhne
|
Kai Köhne
|
||||||
kh1
|
kh1
|
||||||
|
Knut Petter Svendsen
|
||||||
Konstantin Ritt
|
Konstantin Ritt
|
||||||
Konstantin Tokarev
|
Konstantin Tokarev
|
||||||
Leandro Melo
|
Leandro Melo
|
||||||
@@ -214,7 +215,7 @@ Credits go to:
|
|||||||
Orgad Shaneh
|
Orgad Shaneh
|
||||||
Oswald Buddenhagen
|
Oswald Buddenhagen
|
||||||
Oto Magaldadze
|
Oto Magaldadze
|
||||||
Peter Kuemmel
|
Peter Kümmel
|
||||||
Pierre Rossi
|
Pierre Rossi
|
||||||
Robert Loehning
|
Robert Loehning
|
||||||
Ryan May
|
Ryan May
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
|
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
|
||||||
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
|
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
|
||||||
} else {
|
} else {
|
||||||
|
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
|
||||||
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc3)
|
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc3)
|
||||||
}
|
}
|
||||||
|
|
||||||
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
|
|
||||||
|
|
||||||
VERSION_TAG = $$replace(QTCREATOR_VERSION, "[-.]", )
|
VERSION_TAG = $$replace(QTCREATOR_VERSION, "[-.]", )
|
||||||
|
|
||||||
|
|||||||
@@ -132,8 +132,7 @@
|
|||||||
Python-enabled GDB. Follow the instructions in
|
Python-enabled GDB. Follow the instructions in
|
||||||
\l{http://qt-project.org/wiki/QtCreatorBuildGdb}{Building GDB}.
|
\l{http://qt-project.org/wiki/QtCreatorBuildGdb}{Building GDB}.
|
||||||
|
|
||||||
You must use at least Python version 2.5, but we recommend that you use
|
You must use Python version 2.6 or 2.7.
|
||||||
version 2.6.
|
|
||||||
|
|
||||||
For more information on setting up debugger, see \l{Setting Up Debugger}.
|
For more information on setting up debugger, see \l{Setting Up Debugger}.
|
||||||
|
|
||||||
@@ -149,13 +148,6 @@
|
|||||||
context menu in the \gui Snapshot view. The core file is deleted when you
|
context menu in the \gui Snapshot view. The core file is deleted when you
|
||||||
stop debugging.
|
stop debugging.
|
||||||
|
|
||||||
\section1 Code Editor Questions
|
|
||||||
|
|
||||||
\bold {How can I get code-completion to work on the standard headers and
|
|
||||||
phonon?}
|
|
||||||
|
|
||||||
Install a build from March 31, 2009, or later.
|
|
||||||
|
|
||||||
\section1 Compiler Questions
|
\section1 Compiler Questions
|
||||||
|
|
||||||
\bold {How can I make use of my multi-core CPU with \QC?}
|
\bold {How can I make use of my multi-core CPU with \QC?}
|
||||||
@@ -181,7 +173,7 @@
|
|||||||
|
|
||||||
The Qt build in the SDK is built with QT_NO_OPENSSL defined. Rebuilding it
|
The Qt build in the SDK is built with QT_NO_OPENSSL defined. Rebuilding it
|
||||||
is possible. For more information, see
|
is possible. For more information, see
|
||||||
\l{http://www.qtcentre.org/forum/f-qt-programming-2/t-qssl-19222-post94842.html}.
|
\l{http://www.qtcentre.org/threads/19222-Qssl}.
|
||||||
|
|
||||||
\bold {Which development packages from the distribution are needed on
|
\bold {Which development packages from the distribution are needed on
|
||||||
Ubuntu or Debian?}
|
Ubuntu or Debian?}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
macdeployqt "$1" \
|
macdeployqt "$1" \
|
||||||
"-executable=$1/Contents/MacOS/qmlpuppet.app/Contents/MacOS/qmlpuppet" \
|
"-executable=$1/Contents/MacOS/qmlpuppet.app/Contents/MacOS/qmlpuppet" \
|
||||||
"-executable=$1/Contents/Resources/qtpromaker" || exit 1
|
"-executable=$1/Contents/Resources/qtpromaker" \
|
||||||
|
"-executable=$1/Contents/Resources/sdktool" || exit 1
|
||||||
qmlpuppetResources="$1/Contents/MacOS/qmlpuppet.app/Contents/Resources"
|
qmlpuppetResources="$1/Contents/MacOS/qmlpuppet.app/Contents/Resources"
|
||||||
test -d "$qmlpuppetResources" || mkdir -p "$qmlpuppetResources"
|
test -d "$qmlpuppetResources" || mkdir -p "$qmlpuppetResources"
|
||||||
cp "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmlpuppet_qt.conf" "$qmlpuppetResources/qt.conf"
|
cp "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmlpuppet_qt.conf" "$qmlpuppetResources/qt.conf"
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
<publisher>PUBLISHER</publisher>
|
<publisher>PUBLISHER</publisher>
|
||||||
<copyright>COPYRIGHT</copyright>
|
<copyright>COPYRIGHT</copyright>
|
||||||
|
|
||||||
|
<arg>-platform</arg>
|
||||||
|
<arg>qnx</arg>
|
||||||
|
|
||||||
<action system="true">run_native</action>
|
<action system="true">run_native</action>
|
||||||
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
|
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
|
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<displayname>BlackBerry Qt5 Gui Application</displayname>;
|
<displayname>BlackBerry Qt5 Gui Application</displayname>;
|
||||||
<description>Creates a Qt5 Gui application for BlackBerry.</description>
|
<description>Creates an experimental Qt5 Gui application for BlackBerry 10. You need an own Qt5 build for BlackBerry 10 since Qt5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices.</description>
|
||||||
<files>
|
<files>
|
||||||
<file source="main.cpp" openeditor="true"/>
|
<file source="main.cpp" openeditor="true"/>
|
||||||
<file source="mainwidget.cpp" openeditor="true"/>
|
<file source="mainwidget.cpp" openeditor="true"/>
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
|
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
|
||||||
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
|
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
|
||||||
|
|
||||||
|
<arg>-platform</arg>
|
||||||
|
<arg>qnx</arg>
|
||||||
|
|
||||||
<action system="true">run_native</action>
|
<action system="true">run_native</action>
|
||||||
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
|
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
|
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<displayname>BlackBerry Qt Quick 2 Application</displayname>;
|
<displayname>BlackBerry Qt Quick 2 Application</displayname>;
|
||||||
<description>Creates a Qt Quick 2 application for BlackBerry.</description>
|
<description>Creates an experimental Qt Quick 2 application for BlackBerry 10. You need an own Qt5 build for BlackBerry 10 since Qt5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices.</description>
|
||||||
<files>
|
<files>
|
||||||
<file source="main.cpp" openeditor="true"/>
|
<file source="main.cpp" openeditor="true"/>
|
||||||
<file source="qml/main.qml" openeditor="true"/>
|
<file source="qml/main.qml" openeditor="true"/>
|
||||||
|
|||||||
44631
share/qtcreator/translations/qtcreator_zh_TW.ts
Normal file
44631
share/qtcreator/translations/qtcreator_zh_TW.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -263,11 +263,23 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope) cons
|
|||||||
return 0;
|
return 0;
|
||||||
} else if (Block *block = scope->asBlock()) {
|
} else if (Block *block = scope->asBlock()) {
|
||||||
for (unsigned i = 0; i < block->memberCount(); ++i) {
|
for (unsigned i = 0; i < block->memberCount(); ++i) {
|
||||||
if (UsingNamespaceDirective *u = block->memberAt(i)->asUsingNamespaceDirective()) {
|
Symbol *m = block->memberAt(i);
|
||||||
|
if (UsingNamespaceDirective *u = m->asUsingNamespaceDirective()) {
|
||||||
if (ClassOrNamespace *uu = lookupType(u->name(), scope->enclosingNamespace())) {
|
if (ClassOrNamespace *uu = lookupType(u->name(), scope->enclosingNamespace())) {
|
||||||
if (ClassOrNamespace *r = uu->lookupType(name))
|
if (ClassOrNamespace *r = uu->lookupType(name))
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
} else if (Declaration *d = m->asDeclaration()) {
|
||||||
|
if (d->name() && d->name()->isEqualTo(name->asNameId())) {
|
||||||
|
if (d->isTypedef() && d->type()) {
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
Overview oo;
|
||||||
|
qDebug() << "Looks like" << oo(name) << "is a typedef for" << oo(d->type());
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
if (const NamedType *namedTy = d->type()->asNamedType())
|
||||||
|
return lookupType(namedTy->name(), scope);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lookupType(name, scope->enclosingScope());
|
return lookupType(name, scope->enclosingScope());
|
||||||
@@ -380,6 +392,9 @@ ClassOrNamespace *LookupContext::lookupParent(Symbol *symbol) const
|
|||||||
|
|
||||||
ClassOrNamespace::ClassOrNamespace(CreateBindings *factory, ClassOrNamespace *parent)
|
ClassOrNamespace::ClassOrNamespace(CreateBindings *factory, ClassOrNamespace *parent)
|
||||||
: _factory(factory), _parent(parent), _templateId(0), _instantiationOrigin(0)
|
: _factory(factory), _parent(parent), _templateId(0), _instantiationOrigin(0)
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
, _name(0)
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,6 +589,11 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
|||||||
else if (s->name()->isQualifiedNameId())
|
else if (s->name()->isQualifiedNameId())
|
||||||
continue; // skip qualified ids.
|
continue; // skip qualified ids.
|
||||||
|
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
Overview oo;
|
||||||
|
qDebug() << "Found" << id->chars() << "in" << (binding ? oo(binding->_name) : "<null>");
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
LookupItem item;
|
LookupItem item;
|
||||||
item.setDeclaration(s);
|
item.setDeclaration(s);
|
||||||
item.setBinding(binding);
|
item.setBinding(binding);
|
||||||
@@ -616,6 +636,11 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name,
|
|||||||
bool searchInEnclosingScope,
|
bool searchInEnclosingScope,
|
||||||
ClassOrNamespace *origin)
|
ClassOrNamespace *origin)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
Overview oo;
|
||||||
|
qDebug() << "Looking up" << oo(name) << "in" << oo(_name);
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
if (const QualifiedNameId *q = name->asQualifiedNameId()) {
|
if (const QualifiedNameId *q = name->asQualifiedNameId()) {
|
||||||
|
|
||||||
QSet<ClassOrNamespace *> innerProcessed;
|
QSet<ClassOrNamespace *> innerProcessed;
|
||||||
@@ -721,6 +746,9 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
|||||||
if (templId) {
|
if (templId) {
|
||||||
_alreadyConsideredTemplates.insert(templId);
|
_alreadyConsideredTemplates.insert(templId);
|
||||||
ClassOrNamespace *instantiation = _factory->allocClassOrNamespace(reference);
|
ClassOrNamespace *instantiation = _factory->allocClassOrNamespace(reference);
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
instantiation->_name = templId;
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
instantiation->_templateId = templId;
|
instantiation->_templateId = templId;
|
||||||
instantiation->_instantiationOrigin = origin;
|
instantiation->_instantiationOrigin = origin;
|
||||||
|
|
||||||
@@ -734,6 +762,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
|||||||
const unsigned argumentCount = templId->templateArgumentCount();
|
const unsigned argumentCount = templId->templateArgumentCount();
|
||||||
|
|
||||||
if (_factory->expandTemplates()) {
|
if (_factory->expandTemplates()) {
|
||||||
|
Clone cloner(_control.data());
|
||||||
Subst subst(_control.data());
|
Subst subst(_control.data());
|
||||||
for (unsigned i = 0, ei = std::min(argumentCount, templ->templateParameterCount()); i < ei; ++i) {
|
for (unsigned i = 0, ei = std::min(argumentCount, templ->templateParameterCount()); i < ei; ++i) {
|
||||||
const TypenameArgument *tParam = templ->templateParameterAt(i)->asTypenameArgument();
|
const TypenameArgument *tParam = templ->templateParameterAt(i)->asTypenameArgument();
|
||||||
@@ -743,12 +772,16 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
|||||||
if (!name)
|
if (!name)
|
||||||
continue;
|
continue;
|
||||||
const FullySpecifiedType &ty = templId->templateArgumentAt(i);
|
const FullySpecifiedType &ty = templId->templateArgumentAt(i);
|
||||||
subst.bind(name, ty);
|
subst.bind(cloner.name(name, &subst), ty);
|
||||||
}
|
}
|
||||||
|
|
||||||
Clone cloner(_control.data());
|
|
||||||
foreach (Symbol *s, reference->symbols()) {
|
foreach (Symbol *s, reference->symbols()) {
|
||||||
instantiation->_symbols.append(cloner.symbol(s, &subst));
|
Symbol *clone = cloner.symbol(s, &subst);
|
||||||
|
instantiation->_symbols.append(clone);
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
Overview oo;oo.setShowFunctionSignatures(true);oo.setShowReturnTypes(true);oo.setShowTemplateParameters(true);
|
||||||
|
qDebug()<<"cloned"<<oo(clone->type());
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
instantiation->_symbols.append(reference->symbols());
|
instantiation->_symbols.append(reference->symbols());
|
||||||
@@ -917,6 +950,9 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateType(const Name *name, ClassOrNa
|
|||||||
|
|
||||||
if (! e) {
|
if (! e) {
|
||||||
e = _factory->allocClassOrNamespace(this);
|
e = _factory->allocClassOrNamespace(this);
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
e->_name = name;
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
_classOrNamespaces[name] = e;
|
_classOrNamespaces[name] = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,10 @@ private:
|
|||||||
AlreadyConsideredClassContainer<Class> _alreadyConsideredClasses;
|
AlreadyConsideredClassContainer<Class> _alreadyConsideredClasses;
|
||||||
AlreadyConsideredClassContainer<TemplateNameId> _alreadyConsideredTemplates;
|
AlreadyConsideredClassContainer<TemplateNameId> _alreadyConsideredTemplates;
|
||||||
|
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
const Name *_name;
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
friend class CreateBindings;
|
friend class CreateBindings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -830,16 +830,22 @@ ClassOrNamespace *ResolveExpression::findClass(const FullySpecifiedType &origina
|
|||||||
|
|
||||||
static void resolveTypedefs(const LookupContext &context,
|
static void resolveTypedefs(const LookupContext &context,
|
||||||
FullySpecifiedType *type,
|
FullySpecifiedType *type,
|
||||||
Scope **scope)
|
Scope **scope, ClassOrNamespace *binding)
|
||||||
{
|
{
|
||||||
QSet<Symbol *> visited;
|
QSet<Symbol *> visited;
|
||||||
while (NamedType *namedTy = (*type)->asNamedType()) {
|
while (NamedType *namedTy = (*type)->asNamedType()) {
|
||||||
ClassOrNamespace *scopeCoN = context.lookupType(*scope);
|
|
||||||
if (!scopeCoN)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// check if namedTy->name() resolves to a typedef
|
// check if namedTy->name() resolves to a typedef
|
||||||
QList<LookupItem> namedTypeItems = scopeCoN->lookup(namedTy->name());
|
QList<LookupItem> namedTypeItems;
|
||||||
|
if (binding)
|
||||||
|
namedTypeItems = binding->lookup(namedTy->name());
|
||||||
|
if (ClassOrNamespace *scopeCon = context.lookupType(*scope))
|
||||||
|
namedTypeItems += scopeCon->lookup(namedTy->name());
|
||||||
|
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
qDebug() << "-- we have" << namedTypeItems.size() << "candidates";
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
bool foundTypedef = false;
|
bool foundTypedef = false;
|
||||||
foreach (const LookupItem &it, namedTypeItems) {
|
foreach (const LookupItem &it, namedTypeItems) {
|
||||||
if (it.declaration() && it.declaration()->isTypedef()) {
|
if (it.declaration() && it.declaration()->isTypedef()) {
|
||||||
@@ -864,11 +870,26 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
|
|||||||
int accessOp,
|
int accessOp,
|
||||||
bool *replacedDotOperator) const
|
bool *replacedDotOperator) const
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
qDebug() << "In ResolveExpression::baseExpression with" << baseResults.size() << "results...";
|
||||||
|
int i = 0;
|
||||||
|
Overview oo;
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
foreach (const LookupItem &r, baseResults) {
|
foreach (const LookupItem &r, baseResults) {
|
||||||
FullySpecifiedType ty = r.type().simplified();
|
FullySpecifiedType ty = r.type().simplified();
|
||||||
Scope *scope = r.scope();
|
Scope *scope = r.scope();
|
||||||
|
|
||||||
resolveTypedefs(_context, &ty, &scope);
|
#ifdef DEBUG_LOOKUP
|
||||||
|
qDebug("trying result #%d", ++i);
|
||||||
|
qDebug()<<"- before typedef resolving we have:"<<oo(ty);
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
|
resolveTypedefs(_context, &ty, &scope, r.binding());
|
||||||
|
|
||||||
|
#ifdef DEBUG_LOOKUP
|
||||||
|
qDebug()<<"- after typedef resolving:"<<oo(ty);
|
||||||
|
#endif // DEBUG_LOOKUP
|
||||||
|
|
||||||
if (accessOp == T_ARROW) {
|
if (accessOp == T_ARROW) {
|
||||||
if (PointerType *ptrTy = ty->asPointerType()) {
|
if (PointerType *ptrTy = ty->asPointerType()) {
|
||||||
@@ -892,7 +913,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
|
|||||||
|
|
||||||
FullySpecifiedType retTy = instantiatedFunction->returnType().simplified();
|
FullySpecifiedType retTy = instantiatedFunction->returnType().simplified();
|
||||||
|
|
||||||
resolveTypedefs(_context, &retTy, &functionScope);
|
resolveTypedefs(_context, &retTy, &functionScope, r.binding());
|
||||||
|
|
||||||
if (PointerType *ptrTy = retTy->asPointerType()) {
|
if (PointerType *ptrTy = retTy->asPointerType()) {
|
||||||
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), functionScope))
|
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), functionScope))
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ TEMPLATE = lib
|
|||||||
TARGET = CPlusPlus
|
TARGET = CPlusPlus
|
||||||
|
|
||||||
DEFINES += NDEBUG
|
DEFINES += NDEBUG
|
||||||
|
#DEFINES += DEBUG_LOOKUP
|
||||||
unix:QMAKE_CXXFLAGS_DEBUG += -O2
|
unix:QMAKE_CXXFLAGS_DEBUG += -O2
|
||||||
|
|
||||||
include(../../qtcreatorlibrary.pri)
|
include(../../qtcreatorlibrary.pri)
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
|
|||||||
CMakeOpenProjectWizard::BuildInfo info;
|
CMakeOpenProjectWizard::BuildInfo info;
|
||||||
info.sourceDirectory = project->projectDirectory();
|
info.sourceDirectory = project->projectDirectory();
|
||||||
info.environment = Utils::Environment::systemEnvironment();
|
info.environment = Utils::Environment::systemEnvironment();
|
||||||
|
parent->kit()->addToEnvironment(info.environment);
|
||||||
info.buildDirectory = project->defaultBuildDirectory();
|
info.buildDirectory = project->defaultBuildDirectory();
|
||||||
info.kit = parent->kit();
|
info.kit = parent->kit();
|
||||||
info.useNinja = false; // This is ignored anyway
|
info.useNinja = false; // This is ignored anyway
|
||||||
|
|||||||
@@ -36,14 +36,12 @@
|
|||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6
|
|
||||||
enum {
|
enum {
|
||||||
NSWindowCollectionBehaviorFullScreenPrimary = (1 << 7)
|
Qtc_NSWindowCollectionBehaviorFullScreenPrimary = (1 << 7)
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NSString *NSWindowDidEnterFullScreenNotification = @"NSWindowDidEnterFullScreenNotification";
|
static NSString *Qtc_NSWindowDidEnterFullScreenNotification = @"NSWindowDidEnterFullScreenNotification";
|
||||||
static const NSString *NSWindowDidExitFullScreenNotification = @"NSWindowDidExitFullScreenNotification";
|
static NSString *Qtc_NSWindowDidExitFullScreenNotification = @"NSWindowDidExitFullScreenNotification";
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface WindowObserver : NSObject {
|
@interface WindowObserver : NSObject {
|
||||||
Core::Internal::MainWindow *window;
|
Core::Internal::MainWindow *window;
|
||||||
@@ -86,11 +84,7 @@ using namespace Core::Internal;
|
|||||||
|
|
||||||
bool MacFullScreen::supportsFullScreen()
|
bool MacFullScreen::supportsFullScreen()
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x040800
|
|
||||||
return QSysInfo::MacintoshVersion >= QSysInfo::MV_LION;
|
return QSysInfo::MacintoshVersion >= QSysInfo::MV_LION;
|
||||||
#else
|
|
||||||
return QSysInfo::MacintoshVersion >= 0x0009; /* MV_LION not defined */
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacFullScreen::addFullScreen(MainWindow *window)
|
void MacFullScreen::addFullScreen(MainWindow *window)
|
||||||
@@ -98,15 +92,15 @@ void MacFullScreen::addFullScreen(MainWindow *window)
|
|||||||
if (supportsFullScreen()) {
|
if (supportsFullScreen()) {
|
||||||
NSView *nsview = (NSView *) window->winId();
|
NSView *nsview = (NSView *) window->winId();
|
||||||
NSWindow *nswindow = [nsview window];
|
NSWindow *nswindow = [nsview window];
|
||||||
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
[nswindow setCollectionBehavior:Qtc_NSWindowCollectionBehaviorFullScreenPrimary];
|
||||||
|
|
||||||
if (observer == nil)
|
if (observer == nil)
|
||||||
observer = [[WindowObserver alloc] initWithMainWindow:window];
|
observer = [[WindowObserver alloc] initWithMainWindow:window];
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
[nc addObserver:observer selector:@selector(notifyDidEnterFullScreen:)
|
[nc addObserver:observer selector:@selector(notifyDidEnterFullScreen:)
|
||||||
name:NSWindowDidEnterFullScreenNotification object:nswindow];
|
name:Qtc_NSWindowDidEnterFullScreenNotification object:nswindow];
|
||||||
[nc addObserver:observer selector:@selector(notifyDidExitFullScreen:)
|
[nc addObserver:observer selector:@selector(notifyDidExitFullScreen:)
|
||||||
name:NSWindowDidExitFullScreenNotification object:nswindow];
|
name:Qtc_NSWindowDidExitFullScreenNotification object:nswindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -296,6 +296,76 @@ void CppToolsPlugin::test_completion_template_3()
|
|||||||
QVERIFY(completions.contains("Tupple"));
|
QVERIFY(completions.contains("Tupple"));
|
||||||
QVERIFY(completions.contains("a"));
|
QVERIFY(completions.contains("a"));
|
||||||
QVERIFY(completions.contains("b"));
|
QVERIFY(completions.contains("b"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CppToolsPlugin::test_completion_template_4()
|
||||||
|
{
|
||||||
|
TestData data;
|
||||||
|
data.srcText = "\n"
|
||||||
|
"template <class T>\n"
|
||||||
|
"struct List\n"
|
||||||
|
"{\n"
|
||||||
|
" typedef T U;\n"
|
||||||
|
" U u;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct Tupple { int a; int b; };\n"
|
||||||
|
"\n"
|
||||||
|
"void func() {\n"
|
||||||
|
" List<Tupple> l;\n"
|
||||||
|
" @\n"
|
||||||
|
" // padding so we get the scope right\n"
|
||||||
|
"}";
|
||||||
|
|
||||||
|
setup(&data);
|
||||||
|
|
||||||
|
Utils::ChangeSet change;
|
||||||
|
QString txt = QLatin1String("l.u.");
|
||||||
|
change.insert(data.pos, txt);
|
||||||
|
QTextCursor cursor(data.doc);
|
||||||
|
change.apply(&cursor);
|
||||||
|
data.pos += txt.length();
|
||||||
|
|
||||||
|
QStringList completions = getCompletions(data);
|
||||||
|
|
||||||
|
QCOMPARE(completions.size(), 3);
|
||||||
|
QVERIFY(completions.contains("Tupple"));
|
||||||
|
QVERIFY(completions.contains("a"));
|
||||||
|
QVERIFY(completions.contains("b"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CppToolsPlugin::test_completion_template_5()
|
||||||
|
{
|
||||||
|
TestData data;
|
||||||
|
data.srcText = "\n"
|
||||||
|
"template <class T>\n"
|
||||||
|
"struct List\n"
|
||||||
|
"{\n"
|
||||||
|
" T u;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct Tupple { int a; int b; };\n"
|
||||||
|
"\n"
|
||||||
|
"void func() {\n"
|
||||||
|
" typedef List<Tupple> LT;\n"
|
||||||
|
" LT l;"
|
||||||
|
" @\n"
|
||||||
|
" // padding so we get the scope right\n"
|
||||||
|
"}";
|
||||||
|
|
||||||
|
setup(&data);
|
||||||
|
|
||||||
|
Utils::ChangeSet change;
|
||||||
|
QString txt = QLatin1String("l.u.");
|
||||||
|
change.insert(data.pos, txt);
|
||||||
|
QTextCursor cursor(data.doc);
|
||||||
|
change.apply(&cursor);
|
||||||
|
data.pos += txt.length();
|
||||||
|
|
||||||
|
QStringList completions = getCompletions(data);
|
||||||
|
|
||||||
|
QCOMPARE(completions.size(), 3);
|
||||||
|
QVERIFY(completions.contains("Tupple"));
|
||||||
QVERIFY(completions.contains("a"));
|
QVERIFY(completions.contains("a"));
|
||||||
QVERIFY(completions.contains("b"));
|
QVERIFY(completions.contains("b"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void switchHeaderSource();
|
void switchHeaderSource();
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|
||||||
// codegen tests
|
// codegen tests
|
||||||
@@ -95,6 +94,8 @@ private slots:
|
|||||||
void test_completion_template_1();
|
void test_completion_template_1();
|
||||||
void test_completion_template_2();
|
void test_completion_template_2();
|
||||||
void test_completion_template_3();
|
void test_completion_template_3();
|
||||||
|
void test_completion_template_4();
|
||||||
|
void test_completion_template_5();
|
||||||
void test_completion_template_as_base();
|
void test_completion_template_as_base();
|
||||||
void test_completion_template_as_base_data();
|
void test_completion_template_as_base_data();
|
||||||
void test_completion_use_global_identifier_as_base_class();
|
void test_completion_use_global_identifier_as_base_class();
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ TARGET = Help
|
|||||||
QT += network
|
QT += network
|
||||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
QT += printsupport help
|
QT += printsupport help
|
||||||
!isEmpty(QT.webkit.name): QT += webkit
|
!isEmpty(QT.webkitwidgets.name): QT += webkitwidgets
|
||||||
else: DEFINES += QT_NO_WEBKIT
|
else: DEFINES += QT_NO_WEBKIT
|
||||||
} else {
|
} else {
|
||||||
CONFIG += help
|
CONFIG += help
|
||||||
|
|||||||
@@ -322,8 +322,6 @@ HelpViewer::HelpViewer(qreal zoom, QWidget *parent)
|
|||||||
setAcceptDrops(false);
|
setAcceptDrops(false);
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
|
|
||||||
QWebSettings::globalSettings()->setAttribute(QWebSettings::JavaEnabled, true);
|
|
||||||
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
|
|
||||||
QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
|
QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
|
||||||
|
|
||||||
setPage(new HelpPage(this));
|
setPage(new HelpPage(this));
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ ToolChainKitInformation::ToolChainKitInformation()
|
|||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
|
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
|
||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
|
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
|
||||||
|
this, SLOT(toolChainUpdated(ProjectExplorer::ToolChain*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id ToolChainKitInformation::dataId() const
|
Core::Id ToolChainKitInformation::dataId() const
|
||||||
@@ -235,6 +237,13 @@ QString ToolChainKitInformation::msgNoToolChainInTarget()
|
|||||||
return tr("No compiler set in kit.");
|
return tr("No compiler set in kit.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolChainKitInformation::toolChainUpdated(ToolChain *tc)
|
||||||
|
{
|
||||||
|
foreach (Kit *k, KitManager::instance()->kits())
|
||||||
|
if (toolChain(k) == tc)
|
||||||
|
notifyAboutUpdate(k);
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// DeviceTypeInformation:
|
// DeviceTypeInformation:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@@ -317,6 +326,8 @@ DeviceKitInformation::DeviceKitInformation()
|
|||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
|
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
|
||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
|
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
|
||||||
|
this, SLOT(deviceUpdated(Core::Id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id DeviceKitInformation::dataId() const
|
Core::Id DeviceKitInformation::dataId() const
|
||||||
@@ -403,4 +414,11 @@ void DeviceKitInformation::setDeviceId(Kit *k, const Core::Id id)
|
|||||||
k->setValue(Core::Id(DEVICE_INFORMATION), id.toString());
|
k->setValue(Core::Id(DEVICE_INFORMATION), id.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceKitInformation::deviceUpdated(const Core::Id &id)
|
||||||
|
{
|
||||||
|
foreach (Kit *k, KitManager::instance()->kits())
|
||||||
|
if (deviceId(k) == id)
|
||||||
|
notifyAboutUpdate(k);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ public:
|
|||||||
static void setToolChain(Kit *k, ToolChain *tc);
|
static void setToolChain(Kit *k, ToolChain *tc);
|
||||||
|
|
||||||
static QString msgNoToolChainInTarget();
|
static QString msgNoToolChainInTarget();
|
||||||
|
private slots:
|
||||||
|
void toolChainUpdated(ProjectExplorer::ToolChain *tc);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public KitMatcher
|
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public KitMatcher
|
||||||
@@ -207,6 +209,8 @@ public:
|
|||||||
static Core::Id deviceId(const Kit *k);
|
static Core::Id deviceId(const Kit *k);
|
||||||
static void setDevice(Kit *k, IDevice::ConstPtr dev);
|
static void setDevice(Kit *k, IDevice::ConstPtr dev);
|
||||||
static void setDeviceId(Kit *k, const Core::Id id);
|
static void setDeviceId(Kit *k, const Core::Id id);
|
||||||
|
private slots:
|
||||||
|
void deviceUpdated(const Core::Id &id);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
|
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
|
||||||
|
|||||||
@@ -460,4 +460,9 @@ QString KitInformation::displayNamePostfix(const Kit *k) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KitInformation::notifyAboutUpdate(Kit *k)
|
||||||
|
{
|
||||||
|
KitManager::instance()->notifyAboutUpdate(k);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ public:
|
|||||||
|
|
||||||
virtual QString displayNamePostfix(const Kit *k) const;
|
virtual QString displayNamePostfix(const Kit *k) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void notifyAboutUpdate(Kit *k);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void validationNeeded();
|
void validationNeeded();
|
||||||
};
|
};
|
||||||
@@ -165,6 +168,7 @@ private:
|
|||||||
friend class ProjectExplorerPlugin; // for constructor
|
friend class ProjectExplorerPlugin; // for constructor
|
||||||
friend class Kit;
|
friend class Kit;
|
||||||
friend class Internal::KitModel;
|
friend class Internal::KitModel;
|
||||||
|
friend class KitInformation; // for notifyAbutUpdate
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBe
|
|||||||
m_runningStateTimer->setInterval(3000);
|
m_runningStateTimer->setInterval(3000);
|
||||||
m_runningStateTimer->setSingleShot(true);
|
m_runningStateTimer->setSingleShot(true);
|
||||||
connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState()));
|
connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState()));
|
||||||
|
connect(this, SIGNAL(started()), this, SLOT(checkSlog2Info()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackBerryApplicationRunner::start()
|
void BlackBerryApplicationRunner::start()
|
||||||
|
|||||||
@@ -47,14 +47,13 @@ BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfig
|
|||||||
m_connector = BlackBerryConnect::instance(runConfiguration);
|
m_connector = BlackBerryConnect::instance(runConfiguration);
|
||||||
|
|
||||||
connect(m_runner, SIGNAL(started()), this, SIGNAL(started()));
|
connect(m_runner, SIGNAL(started()), this, SIGNAL(started()));
|
||||||
connect(m_runner, SIGNAL(started()), m_connector, SLOT(connectToDevice()));
|
|
||||||
connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished()));
|
connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished()));
|
||||||
connect(m_runner, SIGNAL(finished()), m_connector, SLOT(disconnectFromDevice()));
|
connect(m_runner, SIGNAL(finished()), m_connector, SLOT(disconnectFromDevice()));
|
||||||
connect(m_runner, SIGNAL(output(QString,Utils::OutputFormat)),
|
connect(m_runner, SIGNAL(output(QString,Utils::OutputFormat)),
|
||||||
this, SLOT(appendMessage(QString,Utils::OutputFormat)));
|
this, SLOT(appendMessage(QString,Utils::OutputFormat)));
|
||||||
connect(m_runner, SIGNAL(startFailed(QString)), this, SLOT(handleStartFailed(QString)));
|
connect(m_runner, SIGNAL(startFailed(QString)), this, SLOT(handleStartFailed(QString)));
|
||||||
|
|
||||||
connect(m_connector, SIGNAL(connected()), this, SLOT(launchTailProcess()));
|
connect(m_connector, SIGNAL(connected()), m_runner, SLOT(start()));
|
||||||
connect(m_connector, SIGNAL(output(QString,Utils::OutputFormat)),
|
connect(m_connector, SIGNAL(output(QString,Utils::OutputFormat)),
|
||||||
this, SLOT(appendMessage(QString,Utils::OutputFormat)));
|
this, SLOT(appendMessage(QString,Utils::OutputFormat)));
|
||||||
}
|
}
|
||||||
@@ -66,7 +65,7 @@ BlackBerryRunControl::~BlackBerryRunControl()
|
|||||||
|
|
||||||
void BlackBerryRunControl::start()
|
void BlackBerryRunControl::start()
|
||||||
{
|
{
|
||||||
m_runner->start();
|
m_connector->connectToDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunControl::StopResult BlackBerryRunControl::stop()
|
ProjectExplorer::RunControl::StopResult BlackBerryRunControl::stop()
|
||||||
@@ -88,10 +87,3 @@ void BlackBerryRunControl::handleStartFailed(const QString &message)
|
|||||||
{
|
{
|
||||||
appendMessage(message, Utils::StdErrFormat);
|
appendMessage(message, Utils::StdErrFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackBerryRunControl::launchTailProcess()
|
|
||||||
{
|
|
||||||
// Delay the launch of "tail" to ensure the blackberry-connect
|
|
||||||
// connection has been properly established
|
|
||||||
QTimer::singleShot(500, m_runner, SLOT(checkSlog2Info()));
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleStartFailed(const QString &message);
|
void handleStartFailed(const QString &message);
|
||||||
void launchTailProcess();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BlackBerryApplicationRunner *m_runner;
|
BlackBerryApplicationRunner *m_runner;
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ QtKitInformation::QtKitInformation()
|
|||||||
setObjectName(QLatin1String("QtKitInformation"));
|
setObjectName(QLatin1String("QtKitInformation"));
|
||||||
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
||||||
this, SIGNAL(validationNeeded()));
|
this, SIGNAL(validationNeeded()));
|
||||||
|
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
||||||
|
this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id QtKitInformation::dataId() const
|
Core::Id QtKitInformation::dataId() const
|
||||||
@@ -166,6 +168,17 @@ void QtKitInformation::setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion
|
|||||||
setQtVersionId(k, v->uniqueId());
|
setQtVersionId(k, v->uniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtKitInformation::qtVersionsChanged(const QList<int> &addedIds,
|
||||||
|
const QList<int> &removedIds,
|
||||||
|
const QList<int> &changedIds)
|
||||||
|
{
|
||||||
|
Q_UNUSED(addedIds);
|
||||||
|
Q_UNUSED(removedIds);
|
||||||
|
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::instance()->kits())
|
||||||
|
if (changedIds.contains(qtVersionId(k)))
|
||||||
|
notifyAboutUpdate(k);
|
||||||
|
}
|
||||||
|
|
||||||
QtPlatformKitMatcher::QtPlatformKitMatcher(const QString &platform) :
|
QtPlatformKitMatcher::QtPlatformKitMatcher(const QString &platform) :
|
||||||
m_platform(platform)
|
m_platform(platform)
|
||||||
{ }
|
{ }
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ public:
|
|||||||
static void setQtVersionId(ProjectExplorer::Kit *k, const int id);
|
static void setQtVersionId(ProjectExplorer::Kit *k, const int id);
|
||||||
static BaseQtVersion *qtVersion(const ProjectExplorer::Kit *k);
|
static BaseQtVersion *qtVersion(const ProjectExplorer::Kit *k);
|
||||||
static void setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion *v);
|
static void setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion *v);
|
||||||
|
private slots:
|
||||||
|
void qtVersionsChanged(const QList<int> &addedIds,
|
||||||
|
const QList<int> &removedIds,
|
||||||
|
const QList<int> &changedIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
class QTSUPPORT_EXPORT QtPlatformKitMatcher : public ProjectExplorer::KitMatcher
|
class QTSUPPORT_EXPORT QtPlatformKitMatcher : public ProjectExplorer::KitMatcher
|
||||||
|
|||||||
@@ -993,8 +993,8 @@ bool VcsBasePlugin::runFullySynchronous(const QString &workingDirectory,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SynchronousProcess::readDataFromProcess(process, timeoutMS,
|
if (!SynchronousProcess::readDataFromProcess(process, timeoutMS, outputText, errorText, true)) {
|
||||||
outputText, errorText, true)) {
|
if (errorText)
|
||||||
errorText->append(tr("Error: Executable timed out after %1s.").arg(timeoutMS / 1000).toLocal8Bit());
|
errorText->append(tr("Error: Executable timed out after %1s.").arg(timeoutMS / 1000).toLocal8Bit());
|
||||||
SynchronousProcess::stopProcess(process);
|
SynchronousProcess::stopProcess(process);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ def validateSearchResult(expectedCount):
|
|||||||
for chRow in range(model.rowCount(index)):
|
for chRow in range(model.rowCount(index)):
|
||||||
chIndex = model.index(chRow, 0, index)
|
chIndex = model.index(chRow, 0, index)
|
||||||
resultTreeView.scrollTo(chIndex)
|
resultTreeView.scrollTo(chIndex)
|
||||||
text = str(chIndex.data())
|
text = str(chIndex.data()).rstrip('\r')
|
||||||
rect = resultTreeView.visualRect(chIndex)
|
rect = resultTreeView.visualRect(chIndex)
|
||||||
doubleClick(resultTreeView, rect.x+5, rect.y+5, 0, Qt.LeftButton)
|
doubleClick(resultTreeView, rect.x+5, rect.y+5, 0, Qt.LeftButton)
|
||||||
editor = getEditorForFileSuffix(itemText)
|
editor = getEditorForFileSuffix(itemText)
|
||||||
@@ -295,3 +295,14 @@ def invokeFindUsage(editor, line, typeOperation, n=1):
|
|||||||
type(editor, typeOperation)
|
type(editor, typeOperation)
|
||||||
invokeContextMenuItem(editor, "Find Usages")
|
invokeContextMenuItem(editor, "Find Usages")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def openDocument(treeElement):
|
||||||
|
try:
|
||||||
|
navigator = waitForObject(":Qt Creator_Utils::NavigationTreeView")
|
||||||
|
fileName = waitForObjectItem(navigator, treeElement).text
|
||||||
|
doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton)
|
||||||
|
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
|
||||||
|
waitFor("fileName in str(mainWindow.windowTitle)")
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|||||||
@@ -68,17 +68,6 @@ def openCmakeProject(projectPath, buildDir):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def shadowBuildDir(path, project, qtVersion, debugVersion):
|
|
||||||
qtVersion = qtVersion.replace(" ", "_")
|
|
||||||
qtVersion = qtVersion.replace(".", "_")
|
|
||||||
qtVersion = qtVersion.replace("(", "_")
|
|
||||||
qtVersion = qtVersion.replace(")", "_")
|
|
||||||
buildDir = path + os.sep + project + "-build-desktop-" + qtVersion
|
|
||||||
if debugVersion:
|
|
||||||
return buildDir + "_Debug"
|
|
||||||
else:
|
|
||||||
return buildDir + "_Release"
|
|
||||||
|
|
||||||
# this function returns a list of available targets - this is not 100% error proof
|
# this function returns a list of available targets - this is not 100% error proof
|
||||||
# because the Simulator target is added for some cases even when Simulator has not
|
# because the Simulator target is added for some cases even when Simulator has not
|
||||||
# been set up inside Qt versions/Toolchains
|
# been set up inside Qt versions/Toolchains
|
||||||
@@ -463,7 +452,11 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
|
|||||||
# copy example project (sourceExample is path to project) to temporary directory inside repository
|
# copy example project (sourceExample is path to project) to temporary directory inside repository
|
||||||
def prepareTemplate(sourceExample):
|
def prepareTemplate(sourceExample):
|
||||||
templateDir = os.path.abspath(tempDir() + "/template")
|
templateDir = os.path.abspath(tempDir() + "/template")
|
||||||
|
try:
|
||||||
shutil.copytree(sourceExample, templateDir)
|
shutil.copytree(sourceExample, templateDir)
|
||||||
|
except:
|
||||||
|
test.fatal("Error while copying '%s' to '%s'" % (sourceExample, templateDir))
|
||||||
|
return None
|
||||||
return templateDir
|
return templateDir
|
||||||
|
|
||||||
def __sortFilenamesOSDependent__(filenames):
|
def __sortFilenamesOSDependent__(filenames):
|
||||||
@@ -509,3 +502,26 @@ def compareProjectTree(rootObject, dataset):
|
|||||||
'Line %s in dataset' % str(i + 1))
|
'Line %s in dataset' % str(i + 1))
|
||||||
return
|
return
|
||||||
test.passes("No errors found in project tree")
|
test.passes("No errors found in project tree")
|
||||||
|
|
||||||
|
def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False):
|
||||||
|
if name == None:
|
||||||
|
test.fatal("File must have a name - got None.")
|
||||||
|
return
|
||||||
|
__createProjectOrFileSelectType__(" C++", template, isProject=False)
|
||||||
|
window = "{type='Utils::FileWizardDialog' unnamed='1' visible='1'}"
|
||||||
|
basePath = str(waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1' "
|
||||||
|
"window=%s}" % window).text)
|
||||||
|
lineEdit = waitForObject("{name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' "
|
||||||
|
"visible='1' window=%s}" % window)
|
||||||
|
replaceEditorContent(lineEdit, name)
|
||||||
|
clickButton(waitForObject(":Next_QPushButton"))
|
||||||
|
__createProjectHandleLastPage__()
|
||||||
|
if (os.path.exists(os.path.join(basePath, name))):
|
||||||
|
overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}"
|
||||||
|
waitForObject(overwriteDialog)
|
||||||
|
if forceOverwrite:
|
||||||
|
buttonToClick = 'OK'
|
||||||
|
else:
|
||||||
|
buttonToClick = 'Cancel'
|
||||||
|
clickButton("{text='%s' type='QPushButton' unnamed='1' visible='1' window=%s}"
|
||||||
|
% (buttonToClick, overwriteDialog))
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ def waitForCleanShutdown(timeOut=10):
|
|||||||
shutdownDone=True
|
shutdownDone=True
|
||||||
if not shutdownDone and datetime.utcnow() > endtime:
|
if not shutdownDone and datetime.utcnow() > endtime:
|
||||||
break
|
break
|
||||||
|
snooze(4)
|
||||||
|
|
||||||
def __removeTmpSettingsDir__():
|
def __removeTmpSettingsDir__():
|
||||||
waitForCleanShutdown()
|
waitForCleanShutdown()
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
source("../../shared/qtcreator.py")
|
source("../../shared/qtcreator.py")
|
||||||
|
|
||||||
projectsPath = tempDir()
|
|
||||||
project = "SquishProject"
|
project = "SquishProject"
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
createProject_Qt_Console(projectsPath, project)
|
createProject_Qt_Console(tempDir(), project)
|
||||||
availableConfigs = iterateBuildConfigs(1, 0)
|
availableConfigs = iterateBuildConfigs(1, 0)
|
||||||
if not availableConfigs:
|
if not availableConfigs:
|
||||||
test.fatal("Haven't found a suitable Qt version - leaving without building.")
|
test.fatal("Haven't found a suitable Qt version - leaving without building.")
|
||||||
@@ -14,11 +13,3 @@ def main():
|
|||||||
test.log("Testing build configuration: " + config)
|
test.log("Testing build configuration: " + config)
|
||||||
runAndCloseApp()
|
runAndCloseApp()
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
waitForCleanShutdown()
|
|
||||||
|
|
||||||
def init():
|
|
||||||
cleanup()
|
|
||||||
|
|
||||||
def cleanup():
|
|
||||||
deleteDirIfExists(projectsPath + os.sep + project)
|
|
||||||
deleteDirIfExists(shadowBuildDir(projectsPath, project, defaultQtVersion, 1))
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
source("../../shared/qtcreator.py")
|
source("../../shared/qtcreator.py")
|
||||||
|
|
||||||
projectsPath = tempDir()
|
|
||||||
project = "untitled"
|
project = "untitled"
|
||||||
|
|
||||||
def __handlerunControlFinished__(object, runControlP):
|
def __handlerunControlFinished__(object, runControlP):
|
||||||
@@ -18,7 +17,7 @@ def main():
|
|||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
installLazySignalHandler("{type='ProjectExplorer::Internal::ProjectExplorerPlugin' unnamed='1'}",
|
installLazySignalHandler("{type='ProjectExplorer::Internal::ProjectExplorerPlugin' unnamed='1'}",
|
||||||
"runControlFinished(ProjectExplorer::RunControl*)", "__handlerunControlFinished__")
|
"runControlFinished(ProjectExplorer::RunControl*)", "__handlerunControlFinished__")
|
||||||
createProject_Qt_Console(projectsPath, project)
|
createProject_Qt_Console(tempDir(), project)
|
||||||
|
|
||||||
mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
replaceEditorContent(mainEditor, "")
|
replaceEditorContent(mainEditor, "")
|
||||||
@@ -88,11 +87,3 @@ def main():
|
|||||||
clickButton(waitForObject(":Qt Creator_CloseButton"))
|
clickButton(waitForObject(":Qt Creator_CloseButton"))
|
||||||
|
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
waitForCleanShutdown()
|
|
||||||
|
|
||||||
def init():
|
|
||||||
cleanup()
|
|
||||||
|
|
||||||
def cleanup():
|
|
||||||
deleteDirIfExists(projectsPath + os.sep + project)
|
|
||||||
deleteDirIfExists(shadowBuildDir(projectsPath, project, defaultQtVersion, 1))
|
|
||||||
|
|||||||
11
tests/system/suite_editors/shared/simplePlainCPP/main.cpp
Normal file
11
tests/system/suite_editors/shared/simplePlainCPP/main.cpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "testfile.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
cout << "Hello World!" << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include "testfile.h"
|
||||||
|
|
||||||
|
class SomeClass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SomeClass() {}
|
||||||
|
void function1(int a);
|
||||||
|
};
|
||||||
|
|
||||||
|
bool function1(int a) {
|
||||||
|
SOME_MACRO_NAME(a)
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
11
tests/system/suite_editors/shared/simplePlainCPP/testfile.h
Normal file
11
tests/system/suite_editors/shared/simplePlainCPP/testfile.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class AnyClass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AnyClass() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SOME_MACRO_NAME( X )\
|
||||||
|
{\
|
||||||
|
(X) = 1;\
|
||||||
|
}\
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
TEMPLATE = app
|
||||||
|
CONFIG += console
|
||||||
|
CONFIG -= app_bundle
|
||||||
|
CONFIG -= qt
|
||||||
|
|
||||||
|
SOURCES += main.cpp \
|
||||||
|
testfile.cpp
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
testfile.h
|
||||||
|
|
||||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
|||||||
IMPLICITAUTSTART=0
|
IMPLICITAUTSTART=0
|
||||||
LANGUAGE=Python
|
LANGUAGE=Python
|
||||||
OBJECTMAP=../objects.map
|
OBJECTMAP=../objects.map
|
||||||
TEST_CASES=tst_memberoperator
|
TEST_CASES=tst_memberoperator tst_rename_macros tst_basic_cpp_support tst_select_all tst_qml_indent tst_qml_editor
|
||||||
VERSION=2
|
VERSION=2
|
||||||
WRAPPERS=Qt
|
WRAPPERS=Qt
|
||||||
|
|||||||
@@ -1,15 +1,24 @@
|
|||||||
source("../../shared/qtcreator.py")
|
source("../../shared/qtcreator.py")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if not neededFilePresent(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro"):
|
projectDir = os.path.join(srcPath, "creator", "tests", "manual", "cplusplus-tools")
|
||||||
|
proFileName = "cplusplus-tools.pro"
|
||||||
|
if not neededFilePresent(os.path.join(projectDir, proFileName)):
|
||||||
return
|
return
|
||||||
|
# copy example project to temp directory
|
||||||
|
tempDir = prepareTemplate(projectDir)
|
||||||
|
if not tempDir:
|
||||||
|
return
|
||||||
|
# make sure the .user files are gone
|
||||||
|
proFile = os.path.join(tempDir, proFileName)
|
||||||
|
cleanUpUserFiles(proFile)
|
||||||
|
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
overrideInstallLazySignalHandler()
|
overrideInstallLazySignalHandler()
|
||||||
installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()",
|
installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()",
|
||||||
"__handleTextChanged__")
|
"__handleTextChanged__")
|
||||||
prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
|
prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
|
||||||
openQmakeProject(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro")
|
openQmakeProject(proFile)
|
||||||
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
|
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
|
||||||
selectFromLocator("dummy.cpp")
|
selectFromLocator("dummy.cpp")
|
||||||
|
|
||||||
@@ -67,23 +76,7 @@ def main():
|
|||||||
cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
__typeAndWaitForAction__(cppwindow, "<Shift+F2>")
|
__typeAndWaitForAction__(cppwindow, "<Shift+F2>")
|
||||||
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)")
|
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)")
|
||||||
|
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
waitForCleanShutdown()
|
|
||||||
|
|
||||||
def init():
|
|
||||||
cleanup()
|
|
||||||
|
|
||||||
def cleanup():
|
|
||||||
# Make sure the .user files are gone
|
|
||||||
cleanUpUserFiles(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro")
|
|
||||||
|
|
||||||
BuildPath = glob.glob(srcPath + "/qtcreator-build-*")
|
|
||||||
BuildPath += glob.glob(srcPath + "/projects-build-*")
|
|
||||||
|
|
||||||
for dir in BuildPath:
|
|
||||||
if os.access(dir, os.F_OK):
|
|
||||||
shutil.rmtree(dir)
|
|
||||||
|
|
||||||
def __handleTextChanged__(object):
|
def __handleTextChanged__(object):
|
||||||
global textChanged
|
global textChanged
|
||||||
153
tests/system/suite_editors/tst_rename_macros/test.py
Normal file
153
tests/system/suite_editors/tst_rename_macros/test.py
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
source("../../shared/qtcreator.py")
|
||||||
|
|
||||||
|
cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget"
|
||||||
|
|
||||||
|
def main():
|
||||||
|
global cppEditorStr
|
||||||
|
folder = prepareTemplate(os.path.abspath(os.path.join(os.getcwd(), "..", "shared",
|
||||||
|
"simplePlainCPP")))
|
||||||
|
if folder == None:
|
||||||
|
test.fatal("Could not prepare test files - leaving test")
|
||||||
|
return
|
||||||
|
proFile = os.path.join(folder, "testfiles.pro")
|
||||||
|
startApplication("qtcreator" + SettingsPath)
|
||||||
|
openQmakeProject(proFile)
|
||||||
|
if not testRenameMacroAfterSourceModification():
|
||||||
|
return
|
||||||
|
addCPlusPlusFileToCurrentProject("anothertestfile.h", "C++ Header File")
|
||||||
|
if not testRenameMacroAfterSourceMoving():
|
||||||
|
return
|
||||||
|
invokeMenuItem("File", "Save All")
|
||||||
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
|
def testRenameMacroAfterSourceModification():
|
||||||
|
def __deleteAnyClass__():
|
||||||
|
global cppEditorStr
|
||||||
|
if platform.system() == 'Darwin':
|
||||||
|
type(cppEditorStr, "<Command+Left>")
|
||||||
|
else:
|
||||||
|
type(cppEditorStr, "<Home>")
|
||||||
|
for i in range(5):
|
||||||
|
type(cppEditorStr, "<Shift+Down>")
|
||||||
|
type(cppEditorStr, "<Delete>")
|
||||||
|
|
||||||
|
test.log("Testing rename macro after modifying source.")
|
||||||
|
formerTexts = {}
|
||||||
|
content = openDocumentPlaceCursor("testfiles.Headers.testfile\\.h",
|
||||||
|
"class AnyClass", __deleteAnyClass__)
|
||||||
|
if not content:
|
||||||
|
return False
|
||||||
|
formerTexts["testfiles.Headers.testfile\\.h"] = content
|
||||||
|
content = openDocumentPlaceCursor("testfiles.Sources.testfile\\.cpp", "SOME_MACRO_NAME(a)")
|
||||||
|
if not content:
|
||||||
|
return False
|
||||||
|
formerTexts["testfiles.Sources.testfile\\.cpp"] = content
|
||||||
|
performMacroRenaming('SOME_OTHER_MACRO_NAME')
|
||||||
|
verifyChangedContent(formerTexts, "SOME_MACRO_NAME", "SOME_OTHER_MACRO_NAME")
|
||||||
|
revertChanges(formerTexts)
|
||||||
|
return True
|
||||||
|
|
||||||
|
def testRenameMacroAfterSourceMoving():
|
||||||
|
def __cut__():
|
||||||
|
global cppEditorStr
|
||||||
|
if platform.system() == 'Darwin':
|
||||||
|
type(cppEditorStr, "<Command+Left>")
|
||||||
|
else:
|
||||||
|
type(cppEditorStr, "<Home>")
|
||||||
|
for i in range(4):
|
||||||
|
type(cppEditorStr, "<Shift+Down>")
|
||||||
|
invokeMenuItem("Edit", "Cut")
|
||||||
|
|
||||||
|
def __paste__():
|
||||||
|
global cppEditorStr
|
||||||
|
type(cppEditorStr, "<Return>")
|
||||||
|
invokeMenuItem("Edit", "Paste")
|
||||||
|
|
||||||
|
def __insertInclude__():
|
||||||
|
global cppEditorStr
|
||||||
|
typeLines(cppEditorStr, ['', '#include "anothertestfile.h"'])
|
||||||
|
|
||||||
|
test.log("Testing rename macro after moving source.")
|
||||||
|
formerTexts = {}
|
||||||
|
content = openDocumentPlaceCursor("testfiles.Headers.testfile\\.h",
|
||||||
|
"#define SOME_MACRO_NAME( X )\\", __cut__)
|
||||||
|
if not content:
|
||||||
|
return False
|
||||||
|
formerTexts["testfiles.Headers.testfile\\.h"] = content
|
||||||
|
content = openDocumentPlaceCursor("testfiles.Headers.anothertestfile\\.h",
|
||||||
|
"#define ANOTHERTESTFILE_H", __paste__)
|
||||||
|
if not content:
|
||||||
|
return False
|
||||||
|
formerTexts["testfiles.Headers.anothertestfile\\.h"] = content
|
||||||
|
content = openDocumentPlaceCursor('testfiles.Sources.testfile\\.cpp',
|
||||||
|
'#include "testfile.h"', __insertInclude__)
|
||||||
|
if not content:
|
||||||
|
return False
|
||||||
|
formerTexts["testfiles.Sources.testfile\\.cpp"] = content
|
||||||
|
placeCursorToLine(cppEditorStr, "SOME_MACRO_NAME(a)")
|
||||||
|
performMacroRenaming("COMPLETELY_DIFFERENT_MACRO_NAME")
|
||||||
|
verifyChangedContent(formerTexts, "SOME_MACRO_NAME", "COMPLETELY_DIFFERENT_MACRO_NAME")
|
||||||
|
revertChanges(formerTexts)
|
||||||
|
return True
|
||||||
|
|
||||||
|
def openDocumentPlaceCursor(doc, line, additionalFunction=None):
|
||||||
|
global cppEditorStr
|
||||||
|
if openDocument(doc) and placeCursorToLine(cppEditorStr, line):
|
||||||
|
if additionalFunction:
|
||||||
|
additionalFunction()
|
||||||
|
return str(waitForObject(cppEditorStr).plainText)
|
||||||
|
else:
|
||||||
|
earlyExit("Open %s or placing cursor to line (%s) failed." % (simpleFileName(doc), line))
|
||||||
|
return None
|
||||||
|
|
||||||
|
def performMacroRenaming(newMacroName):
|
||||||
|
for i in range(10):
|
||||||
|
type(cppEditorStr, "<Left>")
|
||||||
|
invokeContextMenuItem(waitForObject(cppEditorStr), "Refactor",
|
||||||
|
"Rename Symbol Under Cursor")
|
||||||
|
validateSearchResult(2)
|
||||||
|
replaceLineEdit = waitForObject("{leftWidget={text='Replace with:' type='QLabel' "
|
||||||
|
"unnamed='1' visible='1'} "
|
||||||
|
"type='Find::Internal::WideEnoughLineEdit' unnamed='1' "
|
||||||
|
"visible='1' "
|
||||||
|
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
|
replaceEditorContent(replaceLineEdit, newMacroName)
|
||||||
|
clickButton(waitForObject("{text='Replace' type='QToolButton' unnamed='1' visible='1' "
|
||||||
|
"window=':Qt Creator_Core::Internal::MainWindow'}"))
|
||||||
|
|
||||||
|
def verifyChangedContent(origTexts, replacedSymbol, replacement):
|
||||||
|
global cppEditorStr
|
||||||
|
successfullyCompared = []
|
||||||
|
for fileName,text in origTexts.iteritems():
|
||||||
|
if openDocument(fileName):
|
||||||
|
successfullyCompared.append(test.compare(waitForObject(cppEditorStr).plainText,
|
||||||
|
text.replace(replacedSymbol, replacement),
|
||||||
|
"Verifying content of %s" %
|
||||||
|
simpleFileName(fileName)))
|
||||||
|
else:
|
||||||
|
successfullyCompared.append(False)
|
||||||
|
test.fail("Failed to open document %s" % simpleFileName(fileName))
|
||||||
|
if successfullyCompared.count(True) == len(origTexts):
|
||||||
|
test.passes("Successfully compared %d changed files" % len(origTexts))
|
||||||
|
else:
|
||||||
|
test.fail("Verifyied %d files - %d have been successfully changed and %d failed to "
|
||||||
|
"change correctly." % (len(origTexts), successfullyCompared.count(True),
|
||||||
|
successfullyCompared.count(False)))
|
||||||
|
|
||||||
|
def revertChanges(files):
|
||||||
|
for f in files:
|
||||||
|
simpleName = simpleFileName(f)
|
||||||
|
if openDocument(f):
|
||||||
|
invokeMenuItem('File', 'Revert "%s" to Saved' % simpleName)
|
||||||
|
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
|
||||||
|
test.log("Reverted changes inside %s" % simpleName)
|
||||||
|
else:
|
||||||
|
test.fail("Could not open %s for reverting changes" % simpleName)
|
||||||
|
|
||||||
|
def simpleFileName(navigatorFileName):
|
||||||
|
return ".".join(navigatorFileName.split(".")[-2:]).replace("\\","")
|
||||||
|
|
||||||
|
def earlyExit(details="No additional information"):
|
||||||
|
test.fail("Something went wrong running this test", details)
|
||||||
|
invokeMenuItem("File", "Save All")
|
||||||
|
invokeMenuItem("File", "Exit")
|
||||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
|||||||
IMPLICITAUTSTART=0
|
IMPLICITAUTSTART=0
|
||||||
LANGUAGE=Python
|
LANGUAGE=Python
|
||||||
OBJECTMAP=../objects.map
|
OBJECTMAP=../objects.map
|
||||||
TEST_CASES=tst_openqt_creator tst_build_speedcrunch tst_cmake_speedcrunch tst_basic_cpp_support tst_select_all tst_create_proj_wizard
|
TEST_CASES=tst_openqt_creator tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard
|
||||||
VERSION=2
|
VERSION=2
|
||||||
WRAPPERS=Qt
|
WRAPPERS=Qt
|
||||||
|
|||||||
@@ -44,17 +44,11 @@ def main():
|
|||||||
|
|
||||||
def init():
|
def init():
|
||||||
global SpeedCrunchPath
|
global SpeedCrunchPath
|
||||||
SpeedCrunchPath = srcPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro"
|
SpeedCrunchPath = os.path.join(srcPath, "creator-test-data", "speedcrunch", "src", "speedcrunch.pro")
|
||||||
cleanup()
|
cleanup()
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
# Make sure the .user files are gone
|
# Make sure the .user files are gone
|
||||||
cleanUpUserFiles(SpeedCrunchPath)
|
cleanUpUserFiles(SpeedCrunchPath)
|
||||||
|
for dir in glob.glob(os.path.join(srcPath, "creator-test-data", "speedcrunch", "speedcrunch-build-*")):
|
||||||
BuildPath = glob.glob(srcPath + "/creator-test-data/speedcrunch/speedcrunch-build-*")
|
deleteDirIfExists(dir)
|
||||||
BuildPath += glob.glob(srcPath + "/creator-test-data/speedcrunch/qtcreator-build-*")
|
|
||||||
|
|
||||||
if BuildPath:
|
|
||||||
for dir in BuildPath:
|
|
||||||
if os.access(dir, os.F_OK):
|
|
||||||
shutil.rmtree(dir)
|
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
|||||||
IMPLICITAUTSTART=0
|
IMPLICITAUTSTART=0
|
||||||
LANGUAGE=Python
|
LANGUAGE=Python
|
||||||
OBJECTMAP=../objects.map
|
OBJECTMAP=../objects.map
|
||||||
TEST_CASES=tst_qtquick_creation tst_qtquick_creation2 tst_qtquick_creation3 tst_qtquick_creation4 tst_qml_indent tst_qml_editor
|
TEST_CASES=tst_qtquick_creation tst_qtquick_creation2 tst_qtquick_creation3 tst_qtquick_creation4
|
||||||
VERSION=2
|
VERSION=2
|
||||||
WRAPPERS=Qt
|
WRAPPERS=Qt
|
||||||
|
|||||||
Reference in New Issue
Block a user