Commit 54569c06 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Merge remote branch 'origin/2.1'

parents fe72f7c2 5a5ba58d
import Qt 4.7
import Bauhaus 1.0
QWidget {
layout: QVBoxLayout {
topMargin: 0
bottomMargin: 0
leftMargin: 0
rightMargin: 0
spacing: 0
GroupBox {
GroupBox {
maximumHeight: 200;
finished: finishedNotify;
caption: qsTr("Grid");
id: gridSpecifics;
layout: QVBoxLayout {
topMargin: 18;
bottomMargin: 2;
leftMargin: 8;
rightMargin: 8;
IntEditor {
id: spacing;
backendValue: backendValues.spacing;
caption: qsTr("Spacing")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 200;
}
}
}
}
}
import Qt 4.7
import Bauhaus 1.0
QWidget {
layout: QVBoxLayout {
topMargin: 0
bottomMargin: 0
leftMargin: 0
rightMargin: 0
spacing: 0
GroupBox {
GroupBox {
maximumHeight: 200;
finished: finishedNotify;
caption: qsTr("Grid")
id: gridSpecifics;
layout: QVBoxLayout {
topMargin: 18;
bottomMargin: 2;
leftMargin: 8;
rightMargin: 8;
IntEditor {
id: spacing;
backendValue: backendValues.spacing;
caption: qsTr("Spacing")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 200;
}
IntEditor {
id: rows;
backendValue: backendValues.rows;
caption: qsTr("Rows")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 1;
maximumValue: 20;
}
IntEditor {
id: columns;
backendValue: backendValues.columns;
caption: qsTr("Columns")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 1;
maximumValue: 20;
}
}
}
}
}
import Qt 4.7
import Bauhaus 1.0
QWidget {
layout: QVBoxLayout {
topMargin: 0
bottomMargin: 0
leftMargin: 0
rightMargin: 0
spacing: 0
GroupBox {
GroupBox {
maximumHeight: 200;
finished: finishedNotify;
caption: qsTr("Grid")
id: gridSpecifics;
layout: QVBoxLayout {
topMargin: 18;
bottomMargin: 2;
leftMargin: 8;
rightMargin: 8;
IntEditor {
id: spacing;
backendValue: backendValues.spacing;
caption: qsTr("Spacing")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 200;
}
}
}
}
}
include(../../../qtcreator.pri)
LANGUAGES = de ja pl ru uk zh_CN
#LANGUAGES = cs es fr hu it sl
LANGUAGES = de fr ja ru
# var, prepend, append
defineReplace(prependAll) {
......@@ -30,16 +29,26 @@ extract.commands += \
$$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq
QMAKE_EXTRA_TARGETS += extract
plugin_sources = $$files($$IDE_SOURCE_TREE/src/plugins/*)
plugin_sources ~= s,^$$re_escape($$IDE_SOURCE_TREE/),,g
plugin_sources -= src/plugins/plugins.pro \
src/plugins/helloworld \ # just an example
# the following ones are dead
src/plugins/qtestlib \
src/plugins/snippets \
src/plugins/regexp
sources = src/app src/libs $$plugin_sources src/shared share/qtcreator/qmldesigner
files = $$files($$PWD/*_??.ts) $$PWD/qtcreator_untranslated.ts
for(file, files) {
lang = $$replace(file, .*_([^/]*)\\.ts, \\1)
v = ts-$${lang}.commands
$$v = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$file
$$v = cd $$IDE_SOURCE_TREE && $$LUPDATE $$sources $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$file
v = ts-$${lang}.depends
$$v = extract
QMAKE_EXTRA_TARGETS += ts-$$lang
}
ts-all.commands = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$files
ts-all.commands = cd $$IDE_SOURCE_TREE && $$LUPDATE $$sources $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$files
ts-all.depends = extract
QMAKE_EXTRA_TARGETS += ts-all
......
......@@ -1254,7 +1254,7 @@ case $rule_number: {
else
node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
node->lbraceToken = loc(1);
node->lbraceToken = loc(3);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
./
......@@ -1265,7 +1265,7 @@ case $rule_number: {
AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
sym(2).PropertyNameAndValueList->finish ());
node->lbraceToken = loc(1);
node->lbraceToken = loc(4);
node->rbraceToken = loc(4);
sym(1).Node = node;
} break;
./
......
......@@ -679,7 +679,7 @@ case 85: {
else
node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
node->lbraceToken = loc(1);
node->lbraceToken = loc(3);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
......@@ -687,7 +687,7 @@ case 86: {
AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
sym(2).PropertyNameAndValueList->finish ());
node->lbraceToken = loc(1);
node->lbraceToken = loc(4);
node->rbraceToken = loc(4);
sym(1).Node = node;
} break;
......
......@@ -33,6 +33,8 @@
#include "qmljs_global.h"
#include "qmljsdocument.h"
#include <utils/environment.h>
#include <QObject>
#include <QStringList>
#include <QSharedPointer>
......@@ -77,6 +79,7 @@ public:
QStringList sourceFiles;
QStringList importPaths;
QString qmlDumpPath;
Utils::Environment qmlDumpEnvironment;
};
class WorkingCopy
......
......@@ -30,7 +30,7 @@
#ifndef SCRIPTMANAGER_P_H
#define SCRIPTMANAGER_P_H
#include <coreplugin/scriptmanager/scriptmanager.h>
#include "scriptmanager.h"
#include <QtCore/QObject>
#include <QtScript/QScriptEngine>
......
......@@ -1247,6 +1247,12 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
*indentDepth = m_indentSize;
break;
}
// ensure padding and indent are >= 0
*indentDepth = qMax(0, *indentDepth);
*savedIndentDepth = qMax(0, *savedIndentDepth);
*paddingDepth = qMax(0, *paddingDepth);
*savedPaddingDepth = qMax(0, *savedPaddingDepth);
}
void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, int lexerState, int *indentDepth, int *paddingDepth) const
......@@ -1287,7 +1293,10 @@ void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, i
if (topState.type == expression && previousState.type == declaration_start) {
*paddingDepth = m_indentSize;
} else if (topState.type == ternary_op) {
*paddingDepth -= 2;
if (*paddingDepth >= 2)
*paddingDepth -= 2;
else
*paddingDepth = 0;
}
break;
case T_LBRACE: {
......@@ -1382,8 +1391,12 @@ void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, i
break;
case T_LESS_LESS:
case T_GREATER_GREATER:
if (topState.type == stream_op || topState.type == stream_op_cont)
*paddingDepth -= 3; // to align << with <<
if (topState.type == stream_op || topState.type == stream_op_cont) {
if (*paddingDepth >= 3)
*paddingDepth -= 3; // to align << with <<
else
*paddingDepth = 0;
}
break;
case T_COMMENT:
case T_DOXY_COMMENT:
......@@ -1395,7 +1408,10 @@ void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, i
&& (kind == T_COMMENT || kind == T_DOXY_COMMENT)
&& (lexerState == Lexer::State_Default
|| tokens.size() != 1)) {
*indentDepth -= m_indentSize;
if (*indentDepth >= m_indentSize)
*indentDepth -= m_indentSize;
else
*indentDepth = 0;
}
break;
}
......
......@@ -168,6 +168,10 @@ bool CdbEnginePrivate::init(QString *errorMessage)
DebuggerEngine *CdbEngine::create(const DebuggerStartParameters &sp,
QString *errorMessage)
{
if (!CdbCore::CoreEngine::interfacesAvailable()) {
*errorMessage = CdbEngine::tr("An instance of the CDB engine is still running; cannot create an a new instance.");
return 0;
}
CdbEngine *rc = new CdbEngine(sp);
if (rc->m_d->init(errorMessage)) {
rc->syncDebuggerPaths();
......@@ -563,6 +567,7 @@ void CdbEngine::processTerminated(unsigned long exitCode)
bool CdbEnginePrivate::endInferior(bool detachOnly, QString *errorMessage)
{
QTC_ASSERT(hasInterfaces(), return true; )
// Prevent repeated invocation.
const bool hasHandles = m_hDebuggeeProcess != NULL;
if (debugCDBExecution)
......@@ -635,6 +640,8 @@ void CdbEnginePrivate::endDebugging(bool detachOnly)
if (debugCDBExecution)
qDebug("endDebugging() detach=%d, state=%s", detachOnly, DebuggerEngine::stateName(m_engine->state()));
QTC_ASSERT(hasInterfaces(), return; )
switch (m_engine->state()) {
case DebuggerNotReady:
case EngineShutdownOk:
......@@ -659,6 +666,8 @@ void CdbEnginePrivate::endDebugging(bool detachOnly)
m_engine->showMessage(errorMessage, LogError);
m_engine->notifyEngineShutdownFailed();
}
// At this point release interfaces as we might be kept around by the run control.
releaseInterfaces();
}
void CdbEngine::detachDebugger()
......
......@@ -49,6 +49,8 @@ static const char *debugCreateFuncC = "DebugCreate";
enum { debug = 0 };
Q_GLOBAL_STATIC(QString, baseImagePath)
static inline QString msgLibLoadFailed(const QString &lib, const QString &why)
{
return QCoreApplication::translate("Debugger::Cdb",
......@@ -223,6 +225,8 @@ bool DebuggerEngineLibrary::init(const QString &path,
return true;
}
CoreEngine *CoreEngine::m_instance = 0;
// ------ Engine
CoreEngine::CoreEngine(QObject *parent) :
QObject(parent),
......@@ -231,32 +235,70 @@ CoreEngine::CoreEngine(QObject *parent) :
m_lastTimerModuleCount(0),
m_modulesLoadedEmitted(true)
{
m_instance = this;
}
CoreEngine::~CoreEngine()
{
releaseInterfaces();
m_instance = 0;
}
bool CoreEngine::hasInterfaces() const
{
return m_cif.debugClient != 0;
}
bool CoreEngine::interfacesAvailable()
{
return CoreEngine::m_instance == 0 ||
!CoreEngine::m_instance->hasInterfaces();
}
void CoreEngine::releaseInterfaces()
{
if (m_cif.debugClient) {
m_cif.debugClient->SetOutputCallbacksWide(0);
m_cif.debugClient->SetEventCallbacksWide(0);
m_cif.debugClient->Release();
m_cif.debugClient = 0;
}
if (m_cif.debugControl)
if (m_cif.debugControl) {
m_cif.debugControl->Release();
if (m_cif.debugSystemObjects)
m_cif.debugControl = 0;
}
if (m_cif.debugSystemObjects) {
m_cif.debugSystemObjects->Release();
if (m_cif.debugSymbols)
m_cif.debugSystemObjects =0;
}
if (m_cif.debugSymbols) {
m_cif.debugSymbols->Release();
if (m_cif.debugRegisters)
m_cif.debugSymbols = 0;
}
if (m_cif.debugRegisters) {
m_cif.debugRegisters->Release();
if (m_cif.debugDataSpaces)
m_cif.debugRegisters = 0;
}
if (m_cif.debugDataSpaces) {
m_cif.debugDataSpaces->Release();
if (m_cif.debugAdvanced)
m_cif.debugDataSpaces = 0;
}
if (m_cif.debugAdvanced) {
m_cif.debugAdvanced->Release();
m_cif.debugAdvanced = 0;
}
}
bool CoreEngine::init(const QString &dllEnginePath, QString *errorMessage)
{
if (!CoreEngine::interfacesAvailable()) {
*errorMessage = QString::fromLatin1("Internal error: The COM interfaces are already in use.");
return false;
}
enum { bufLen = 10240 };
// Load the DLL
DebuggerEngineLibrary lib;
......@@ -293,13 +335,18 @@ bool CoreEngine::init(const QString &dllEnginePath, QString *errorMessage)
return false;
}
WCHAR buf[bufLen];
hr = m_cif.debugSymbols->GetImagePathWide(buf, bufLen, 0);
if (FAILED(hr)) {
*errorMessage = msgComFailed("GetImagePathWide", hr);
return false;
// Query inherited image path from environment only once as it is remembered.
static bool firstInstance = true;
if (firstInstance) {
firstInstance = false;
WCHAR buf[bufLen];
hr = m_cif.debugSymbols->GetImagePathWide(buf, bufLen, 0);
if (FAILED(hr)) {
*errorMessage = msgComFailed("GetImagePathWide", hr);
return false;
}
*baseImagePath() = QString::fromWCharArray(buf);
}
m_baseImagePath = QString::fromWCharArray(buf);
hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast<void**>(&m_cif.debugRegisters));
if (FAILED(hr)) {
......@@ -430,10 +477,11 @@ bool CoreEngine::startDebuggerWithExecutable(const QString &workingDirectory,
// Set image path
const QFileInfo fi(filename);
QString imagePath = QDir::toNativeSeparators(fi.absolutePath());
if (!m_baseImagePath.isEmpty()) {
if (!baseImagePath()->isEmpty()) {
imagePath += QLatin1Char(';');
imagePath += m_baseImagePath;
imagePath += baseImagePath();
}
HRESULT hr = m_cif.debugSymbols->SetImagePathWide(reinterpret_cast<PCWSTR>(imagePath.utf16()));
if (FAILED(hr)) {
*errorMessage = tr("Unable to set the image path to %1: %2").arg(imagePath, msgComFailed("SetImagePathWide", hr));
......
......@@ -69,6 +69,11 @@ public:
explicit CoreEngine(QObject *parent = 0);
virtual ~CoreEngine();
// Preliminary release interfaces.
void releaseInterfaces();
bool hasInterfaces() const;
static bool interfacesAvailable();
bool init(const QString &dllEnginePath, QString *errorMessage);
// code level/output
......@@ -179,11 +184,11 @@ private:
void setModuleCount(unsigned m);
void resetModuleLoadTimer();
static CoreEngine *m_instance;
ComInterfaces m_cif;
DebugOutputBasePtr m_debugOutput;
DebugEventCallbackBasePtr m_debugEventCallback;
QString m_dbengDLL;
QString m_baseImagePath;
int m_watchTimer;
unsigned m_moduleCount;
unsigned m_lastTimerModuleCount;
......
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