Commit 923bfa52 authored by mae's avatar mae
Browse files

Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta

parents 4fd9f1e6 cecd5023
......@@ -68,8 +68,8 @@ src/corelib/lib
src/network/lib
src/xml/lib/
# Files copied by syncIde
# -----------------------
# Binaries
# --------
bin/Aggregation.dll
bin/CodeModel.dll
bin/ExtensionSystem.dll
......@@ -77,24 +77,4 @@ bin/QtConcurrent.dll
bin/Utils.dll
bin/qtcreator
bin/qtcreator.exe
shared/help/bookmarkdialog.ui
shared/help/bookmarkmanager.cpp
shared/help/bookmarkmanager.h
shared/help/contentwindow.cpp
shared/help/contentwindow.h
shared/help/filternamedialog.cpp
shared/help/filternamedialog.h
shared/help/filternamedialog.ui
shared/help/helpviewer.cpp
shared/help/helpviewer.h
shared/help/indexwindow.cpp
shared/help/indexwindow.h
shared/help/topicchooser.cpp
shared/help/topicchooser.h
shared/help/topicchooser.ui
shared/proparser/abstractproitemvisitor.h
shared/proparser/profileevaluator.cpp
shared/proparser/profileevaluator.h
shared/proparser/proitems.cpp
shared/proparser/proitems.h
shared/proparser/proparserutils.h
tests/manual/cplusplus/cplusplus0
......@@ -1191,6 +1191,11 @@ bool Parser::parseClassSpecifier(SpecifierAST *&node)
NameAST *name = 0;
parseName(name);
bool parsed = false;
const bool previousInFunctionBody = _inFunctionBody;
_inFunctionBody = false;
if (LA() == T_COLON || LA() == T_LBRACE) {
BaseSpecifierAST *base_clause = 0;
if (LA() == T_COLON) {
......@@ -1233,9 +1238,12 @@ bool Parser::parseClassSpecifier(SpecifierAST *&node)
}
}
node = ast;
return true;
parsed = true;
}
return false;
_inFunctionBody = previousInFunctionBody;
return parsed;
}
bool Parser::parseAccessSpecifier(SpecifierAST *&node)
......
......@@ -292,6 +292,7 @@ Use *Scope::useAt(unsigned index) const
void Scope::addUse(unsigned sourceOffset, Name *name)
{
#ifdef CPLUSPLUS_WITH_USES
if (++_useCount == _allocatedUses) {
_allocatedUses += 4;
_uses = reinterpret_cast<Use *>(realloc(_uses, _allocatedUses * sizeof(Use)));
......@@ -303,6 +304,7 @@ void Scope::addUse(unsigned sourceOffset, Name *name)
else
lastVisibleSymbol = _symbols[_symbolCount];
_uses[_useCount].init(sourceOffset, name, lastVisibleSymbol);
#endif
}
CPLUSPLUS_END_NAMESPACE
......@@ -9,7 +9,8 @@ HEADERS += \
$$PWD/helpviewer.h \
$$PWD/contentwindow.h \
$$PWD/bookmarkmanager.h \
$$PWD/../namespace_global.h
$$PWD/../namespace_global.h \
$$PWD/indexwindow.h
SOURCES += \
$$PWD/filternamedialog.cpp \
......@@ -19,7 +20,7 @@ SOURCES += \
$$PWD/contentwindow.cpp \
$$PWD/bookmarkmanager.cpp
FORMS += \
FORMS += \
$$PWD/filternamedialog.ui \
$$PWD/topicchooser.ui \
$$PWD/bookmarkdialog.ui
......@@ -153,6 +153,11 @@ void Document::appendMacro(const QByteArray &macroName, const QByteArray &text)
_definedMacros += text;
}
void Document::addMacroUse(unsigned offset, unsigned length)
{
_macroUses.append(Block(offset, offset + length));
}
TranslationUnit *Document::translationUnit() const
{
return _translationUnit;
......
......@@ -68,6 +68,8 @@ public:
void appendMacro(const QByteArray &macroName, const QByteArray &text);
void addMacroUse(unsigned offset, unsigned length);
Control *control() const;
TranslationUnit *translationUnit() const;
......@@ -176,6 +178,9 @@ public:
QList<Block> skippedBlocks() const
{ return _skippedBlocks; }
QList<Block> macroUses() const
{ return _macroUses; }
private:
Symbol *findSymbolAt(unsigned line, unsigned column, Scope *scope) const;
......@@ -189,6 +194,7 @@ private:
QByteArray _definedMacros;
QSet<QByteArray> _macroNames;
QList<Block> _skippedBlocks;
QList<Block> _macroUses;
};
} // end of namespace CPlusPlus
......
......@@ -235,9 +235,9 @@ bool ResolveExpression::visit(ExpressionListAST *)
return false;
}
bool ResolveExpression::visit(BinaryExpressionAST *)
bool ResolveExpression::visit(BinaryExpressionAST *ast)
{
// nothing to do.
accept(ast->left_expression);
return false;
}
......
......@@ -91,7 +91,8 @@ Document::Ptr TypeOfExpression::documentForExpression(const QString &expression)
{
// create the expression's AST.
Document::Ptr doc = Document::create(QLatin1String("<completion>"));
doc->setSource(expression.toUtf8());
const QByteArray bytes = expression.toUtf8();
doc->setSource(bytes);
doc->parse(Document::ParseExpression);
return doc;
}
......@@ -165,7 +165,7 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future,
int numFilesSearched = 0;
int numMatches = 0;
if (flags & QTextDocument::FindWholeWords)
searchTerm = QString("\b%1\b").arg(searchTerm);
searchTerm = QString("\\b%1\\b").arg(searchTerm);
Qt::CaseSensitivity caseSensitivity = (flags & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive;
QRegExp expression(searchTerm, caseSensitivity);
......
......@@ -44,6 +44,8 @@ FileWizardDialog::FileWizardDialog(QWidget *parent) :
m_filePage(new FileWizardPage)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setOption(QWizard::NoCancelButton, false);
setOption(QWizard::NoDefaultButton, false);
setPixmap(QWizard::WatermarkPixmap, QPixmap(QLatin1String(":/qworkbench/images/qtwatermark.png")));
addPage(m_filePage);
connect(m_filePage, SIGNAL(activated()), button(QWizard::FinishButton), SLOT(animateClick()));
......
......@@ -125,6 +125,7 @@ struct SynchronousProcessPrivate {
SynchronousProcessResponse m_result;
int m_hangTimerCount;
int m_maxHangTimerCount;
bool m_startFailure;
ChannelBuffer m_stdOut;
ChannelBuffer m_stdErr;
......@@ -133,7 +134,8 @@ struct SynchronousProcessPrivate {
SynchronousProcessPrivate::SynchronousProcessPrivate() :
m_stdOutCodec(0),
m_hangTimerCount(0),
m_maxHangTimerCount(defaultMaxHangTimerCount)
m_maxHangTimerCount(defaultMaxHangTimerCount),
m_startFailure(false)
{
}
......@@ -143,6 +145,7 @@ void SynchronousProcessPrivate::clearForRun()
m_stdOut.clearForRun();
m_stdErr.clearForRun();
m_result.clear();
m_startFailure = false;
}
// ----------- SynchronousProcess
......@@ -221,22 +224,26 @@ SynchronousProcessResponse SynchronousProcess::run(const QString &binary,
qDebug() << '>' << Q_FUNC_INFO << binary << args;
m_d->clearForRun();
m_d->m_timer.start();
QApplication::setOverrideCursor(Qt::WaitCursor);
// On Windows, start failure is triggered immediately if the
// executable cannot be found in the path. Do not start the
// event loop in that case.
m_d->m_process.start(binary, args, QIODevice::ReadOnly);
m_d->m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
if (m_d->m_result.result == SynchronousProcessResponse::Finished || m_d->m_result.result == SynchronousProcessResponse::FinishedError) {
processStdOut(false);
processStdErr(false);
}
if (!m_d->m_startFailure) {
m_d->m_timer.start();
QApplication::setOverrideCursor(Qt::WaitCursor);
m_d->m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
if (m_d->m_result.result == SynchronousProcessResponse::Finished || m_d->m_result.result == SynchronousProcessResponse::FinishedError) {
processStdOut(false);
processStdErr(false);
}
m_d->m_result.stdOut = convertStdOut(m_d->m_stdOut.data);
m_d->m_result.stdErr = convertStdErr(m_d->m_stdErr.data);
m_d->m_result.stdOut = convertStdOut(m_d->m_stdOut.data);
m_d->m_result.stdErr = convertStdErr(m_d->m_stdErr.data);
m_d->m_timer.stop();
QApplication::restoreOverrideCursor();
m_d->m_timer.stop();
QApplication::restoreOverrideCursor();
}
if (debug)
qDebug() << '<' << Q_FUNC_INFO << binary << m_d->m_result;
......@@ -246,12 +253,14 @@ SynchronousProcessResponse SynchronousProcess::run(const QString &binary,
void SynchronousProcess::slotTimeout()
{
if (++m_d->m_hangTimerCount > m_d->m_maxHangTimerCount) {
if (debug)
qDebug() << Q_FUNC_INFO << "HANG detected, killing";
m_d->m_process.kill();
m_d->m_result.result = SynchronousProcessResponse::Hang;
} else {
if (debug)
qDebug() << Q_FUNC_INFO << m_d->m_hangTimerCount;
}
if (debug)
qDebug() << Q_FUNC_INFO << m_d->m_hangTimerCount;
}
void SynchronousProcess::finished(int exitCode, QProcess::ExitStatus e)
......@@ -265,7 +274,9 @@ void SynchronousProcess::finished(int exitCode, QProcess::ExitStatus e)
m_d->m_result.exitCode = exitCode;
break;
case QProcess::CrashExit:
m_d->m_result.result = SynchronousProcessResponse::TerminatedAbnormally;
// Was hang detected before and killed?
if (m_d->m_result.result != SynchronousProcessResponse::Hang)
m_d->m_result.result = SynchronousProcessResponse::TerminatedAbnormally;
m_d->m_result.exitCode = -1;
break;
}
......@@ -277,7 +288,10 @@ void SynchronousProcess::error(QProcess::ProcessError e)
m_d->m_hangTimerCount = 0;
if (debug)
qDebug() << Q_FUNC_INFO << e;
m_d->m_result.result = SynchronousProcessResponse::StartFailed;
// Was hang detected before and killed?
if (m_d->m_result.result != SynchronousProcessResponse::Hang)
m_d->m_result.result = SynchronousProcessResponse::StartFailed;
m_d->m_startFailure = true;
m_d->m_eventLoop.quit();
}
......
......@@ -40,6 +40,7 @@ namespace Constants {
const char * const PROJECTCONTEXT = "CMakeProject.ProjectContext";
const char * const CMAKEMIMETYPE = "text/x-cmake"; // TOOD check that this is correct
const char * const CMAKESTEP = "CMakeProjectManager.CMakeStep";
const char * const MAKESTEP = "CMakeProjectManager.MakeStep";
} // namespace Constants
......
......@@ -7,10 +7,12 @@ HEADERS = cmakeproject.h \
cmakeprojectmanager.h \
cmakeprojectconstants.h \
cmakeprojectnodes.h \
cmakestep.h
cmakestep.h \
makestep.h
SOURCES = cmakeproject.cpp \
cmakeprojectplugin.cpp \
cmakeprojectmanager.cpp \
cmakeprojectnodes.cpp \
cmakestep.cpp
cmakestep.cpp \
makestep.cpp
RESOURCES += cmakeproject.qrc
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "cmakestep.h"
#include "cmakeprojectconstants.h"
#include "cmakeproject.h"
......@@ -6,7 +39,7 @@ using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
CMakeStep::CMakeStep(CMakeProject *pro)
: BuildStep(pro), m_pro(pro)
: AbstractProcessStep(pro), m_pro(pro)
{
}
......@@ -18,14 +51,17 @@ CMakeStep::~CMakeStep()
bool CMakeStep::init(const QString &buildConfiguration)
{
// TODO
return true;
setEnabled(buildConfiguration, true);
setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration));
setCommand(buildConfiguration, "cmake"); // TODO give full path here?
setArguments(buildConfiguration, QStringList()); // TODO
setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration));
return AbstractProcessStep::init(buildConfiguration);
}
void CMakeStep::run(QFutureInterface<bool> &fi)
{
// TODO
fi.reportResult(true);
AbstractProcessStep::run(fi);
}
QString CMakeStep::name()
......
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef CMAKESTEP_H
#define CMAKESTEP_H
#include <projectexplorer/buildstep.h>
#include <projectexplorer/abstractprocessstep.h>
namespace CMakeProjectManager {
namespace Internal {
......@@ -10,7 +44,7 @@ class CMakeProject;
class CMakeBuildStepConfigWidget;
class CMakeStep : public ProjectExplorer::BuildStep
class CMakeStep : public ProjectExplorer::AbstractProcessStep
{
public:
CMakeStep(CMakeProject *pro);
......
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "makestep.h"
#include "cmakeprojectconstants.h"
#include "cmakeproject.h"
using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
MakeStep::MakeStep(CMakeProject *pro)
: AbstractProcessStep(pro), m_pro(pro)
{
}
MakeStep::~MakeStep()
{
}
bool MakeStep::init(const QString &buildConfiguration)
{
setEnabled(buildConfiguration, true);
setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration));
setCommand(buildConfiguration, "make"); // TODO give full path here?
setArguments(buildConfiguration, QStringList()); // TODO
setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration));
return AbstractProcessStep::init(buildConfiguration);
}
void MakeStep::run(QFutureInterface<bool> &fi)
{
AbstractProcessStep::run(fi);
}
QString MakeStep::name()
{
return "Make";
}
QString MakeStep::displayName()
{
return Constants::CMAKESTEP;
}
ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget()
{
return new MakeBuildStepConfigWidget();
}
bool MakeStep::immutable() const
{
return true;
}
//
// CMakeBuildStepConfigWidget
//
QString MakeBuildStepConfigWidget::displayName() const
{
return "Make";
}
void MakeBuildStepConfigWidget::init(const QString &buildConfiguration)
{
// TODO
}
//
// MakeBuildStepFactory
//
bool MakeBuildStepFactory::canCreate(const QString &name) const
{
return (Constants::MAKESTEP == name);
}
ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
{
Q_ASSERT(name == Constants::MAKESTEP);
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
Q_ASSERT(pro);
return new MakeStep(pro);
}
QStringList MakeBuildStepFactory::canCreateForProject(ProjectExplorer::Project *pro) const
{
return QStringList();
}
QString MakeBuildStepFactory::displayNameForName(const QString &name) const
{
return "Make";
}
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef MAKESTEP_H
#define MAKESTEP_H
#include <projectexplorer/abstractprocessstep.h>
namespace CMakeProjectManager {
namespace Internal {
class CMakeProject;
class MakeStep : public ProjectExplorer::AbstractProcessStep
{
public:
MakeStep(CMakeProject *pro);
~MakeStep();
virtual bool init(const QString &buildConfiguration);
virtual void run(QFutureInterface<bool> &fi);
virtual QString name();
virtual QString displayName();
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const;
private:
CMakeProject *m_pro; <