Commit 1ccde24c authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/2.5'

parents 929bc18a a66e344b
...@@ -1851,6 +1851,8 @@ bool Bind::visit(SimpleDeclarationAST *ast) ...@@ -1851,6 +1851,8 @@ bool Bind::visit(SimpleDeclarationAST *ast)
name = elabTypeSpec->name->name; name = elabTypeSpec->name->name;
} }
ensureValidClassName(&name, sourceLocation);
ForwardClassDeclaration *decl = control()->newForwardClassDeclaration(sourceLocation, name); ForwardClassDeclaration *decl = control()->newForwardClassDeclaration(sourceLocation, name);
setDeclSpecifiers(decl, type); setDeclSpecifiers(decl, type);
_scope->addMember(decl); _scope->addMember(decl);
...@@ -2894,20 +2896,7 @@ bool Bind::visit(ClassSpecifierAST *ast) ...@@ -2894,20 +2896,7 @@ bool Bind::visit(ClassSpecifierAST *ast)
} }
} }
// get the unqualified class name ensureValidClassName(&className, sourceLocation);
const QualifiedNameId *q = className->asQualifiedNameId();
const Name *unqualifiedClassName = q ? q->name() : className;
if (! unqualifiedClassName) // paranoia check
className = 0;
else if (! (unqualifiedClassName->isNameId() || unqualifiedClassName->isTemplateNameId())) {
translationUnit()->error(sourceLocation, "expected a class-name");
className = unqualifiedClassName->identifier();
if (q && className)
className = control()->qualifiedNameId(q->base(), className);
}
} }
Class *klass = control()->newClass(sourceLocation, className); Class *klass = control()->newClass(sourceLocation, className);
...@@ -3136,6 +3125,24 @@ bool Bind::visit(ArrayDeclaratorAST *ast) ...@@ -3136,6 +3125,24 @@ bool Bind::visit(ArrayDeclaratorAST *ast)
return false; return false;
} }
void Bind::ensureValidClassName(const Name **name, unsigned sourceLocation)
{
if (!*name)
return;
const QualifiedNameId *qName = (*name)->asQualifiedNameId();
if (qName)
*name = qName->name();
if (!(*name)->isNameId() && !(*name)->isTemplateNameId()) {
translationUnit()->error(sourceLocation, "expected a class-name");
*name = (*name)->identifier();
if (qName)
*name = control()->qualifiedNameId(qName->base(), *name);
}
}
int Bind::visibilityForAccessSpecifier(int tokenKind) int Bind::visibilityForAccessSpecifier(int tokenKind)
{ {
switch (tokenKind) { switch (tokenKind) {
......
...@@ -274,6 +274,8 @@ protected: ...@@ -274,6 +274,8 @@ protected:
private: private:
static const int kMaxDepth; static const int kMaxDepth;
void ensureValidClassName(const Name **name, unsigned sourceLocation);
Scope *_scope; Scope *_scope;
ExpressionTy _expression; ExpressionTy _expression;
const Name *_name; const Name *_name;
......
...@@ -549,8 +549,8 @@ void MercurialPlugin::commit() ...@@ -549,8 +549,8 @@ void MercurialPlugin::commit()
m_submitRepository = state.topLevel(); m_submitRepository = state.topLevel();
connect(m_client, SIGNAL(parsedStatus(QList<VcsBaseClient::StatusItem>)), connect(m_client, SIGNAL(parsedStatus(QList<VcsBase::VcsBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VcsBaseClient::StatusItem>))); this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>)));
m_client->emitParsedStatus(m_submitRepository); m_client->emitParsedStatus(m_submitRepository);
} }
...@@ -559,8 +559,8 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s ...@@ -559,8 +559,8 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance(); VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
//Once we receive our data release the connection so it can be reused elsewhere //Once we receive our data release the connection so it can be reused elsewhere
disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBaseClient::StatusItem>)), disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBase::VcsBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VcsBaseClient::StatusItem>))); this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>)));
if (status.isEmpty()) { if (status.isEmpty()) {
outputWindow->appendError(tr("There are no changes to commit.")); outputWindow->appendError(tr("There are no changes to commit."));
......
...@@ -59,8 +59,6 @@ ...@@ -59,8 +59,6 @@
:formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} :formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:frame.templateDescription_QTextBrowser {container=':New.frame_QFrame' name='templateDescription' type='QTextBrowser' visible='1'} :frame.templateDescription_QTextBrowser {container=':New.frame_QFrame' name='templateDescription' type='QTextBrowser' visible='1'}
:headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} :headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:projects.projects.pro_QModelIndex {column='0' container=':projects_QModelIndex' text='projects.pro' type='QModelIndex'}
:projects_QModelIndex {column='0' container=':Qt Creator_Utils::NavigationTreeView' text='projects' type='QModelIndex'}
:qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='QtSupport__Internal__QtVersionManager' type='QtSupport::Internal::QtOptionsPageWidget' visible='1'} :qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='QtSupport__Internal__QtVersionManager' type='QtSupport::Internal::QtOptionsPageWidget' visible='1'}
:scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'} :scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create build configurations:' type='QLabel' unnamed='1' visible='1'} :scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create build configurations:' type='QLabel' unnamed='1' visible='1'}
......
...@@ -153,7 +153,9 @@ def __verifyFileCreation__(path, expectedFiles): ...@@ -153,7 +153,9 @@ def __verifyFileCreation__(path, expectedFiles):
# created for this version. If it is None, all Qt versions will be used # created for this version. If it is None, all Qt versions will be used
# param checks turns tests in the function on if set to True # param checks turns tests in the function on if set to True
def createProject_Qt_GUI(path, projectName, qtVersion = None, checks = True): def createProject_Qt_GUI(path, projectName, qtVersion = None, checks = True):
available = __createProjectSelectType__(" Applications", "Qt Gui Application") template = "Qt Gui Application"
available = __createProjectSelectType__(" Applications", template)
JIRA.performWorkaroundIfStillOpen(6994, JIRA.Bug.CREATOR, template, available)
__createProjectSetNameAndPath__(path, projectName, checks) __createProjectSetNameAndPath__(path, projectName, checks)
__selectQtVersionDesktop__(qtVersion, checks, available) __selectQtVersionDesktop__(qtVersion, checks, available)
......
...@@ -221,7 +221,10 @@ class JIRA: ...@@ -221,7 +221,10 @@ class JIRA:
def _workaroundCreator6994_(self, *args): def _workaroundCreator6994_(self, *args):
if args[0] in ('Mobile Qt Application', 'Qt Gui Application', 'Qt Custom Designer Widget'): if args[0] in ('Mobile Qt Application', 'Qt Gui Application', 'Qt Custom Designer Widget'):
args[1].remove('Harmattan') if QtQuickConstants.Targets.HARMATTAN in args[1]:
args[1].remove(QtQuickConstants.Targets.HARMATTAN)
else:
args[1].remove(QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN))
test.xverify(False, "Removed Harmattan from expected targets.") test.xverify(False, "Removed Harmattan from expected targets.")
def _workaroundCreator6853_(self, *args): def _workaroundCreator6853_(self, *args):
......
...@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false ...@@ -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_build_new_project tst_cli_output_console TEST_CASES=tst_build_new_project tst_cli_output_console tst_simple_debug
VERSION=2 VERSION=2
WRAPPERS=Qt WRAPPERS=Qt
"node" "value"
":projects.projects.pro_QModelIndex" "projects.pro"
":projects_QModelIndex" "projects"
...@@ -18,12 +18,6 @@ def main(): ...@@ -18,12 +18,6 @@ def main():
openQmakeProject(SpeedCrunchPath) openQmakeProject(SpeedCrunchPath)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
# Test that some of the expected items are in the navigation tree
for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")):
node = testData.field(record, "node")
value = testData.field(record, "value")
test.compare(waitForObject(node).text, value)
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton") fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
qtVerPattern = re.compile("\d\.\d(\.\d+)?") qtVerPattern = re.compile("\d\.\d(\.\d+)?")
......
...@@ -23,12 +23,6 @@ def main(): ...@@ -23,12 +23,6 @@ def main():
return return
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
# Test that some of the expected items are in the navigation tree
for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")):
node = testData.field(record, "node")
value = testData.field(record, "value")
test.compare(findObject(node).text, value)
# Invoke a rebuild of the application # Invoke a rebuild of the application
invokeMenuItem("Build", "Rebuild All") invokeMenuItem("Build", "Rebuild All")
......
...@@ -15,17 +15,6 @@ def main(): ...@@ -15,17 +15,6 @@ def main():
# Wait for parsing to complete # Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000) waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000)
# Test that some of the expected items are in the navigation tree
for row, record in enumerate(testData.dataset("creator_tree.tsv")):
node = testData.field(record, "node")
value = testData.field(record, "value")
test.compare(waitForObject(node).text, value)
for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")):
node = testData.field(record, "node")
value = testData.field(record, "value")
test.compare(waitForObject(node).text, value)
# Now check some basic lookups in the search box # Now check some basic lookups in the search box
selectFromLocator(": Qlist::QList", "QList::QList") selectFromLocator(": Qlist::QList", "QList::QList")
test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList") test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment