forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
version=4.4.3
|
||||
version="4.5-rc1"
|
||||
workdir=/home/berlin/dev/qt-${version}-temp
|
||||
destdir=/home/berlin/dev/qt-${version}-shipping/qt # "/qt" suffix for Bitrock
|
||||
dir=qt-x11-opensource-src-${version}
|
||||
|
@@ -68,6 +68,11 @@ bool Overview::showReturnTypes() const
|
||||
return _showReturnTypes;
|
||||
}
|
||||
|
||||
unsigned Overview::markArgument() const
|
||||
{
|
||||
return _markArgument;
|
||||
}
|
||||
|
||||
void Overview::setMarkArgument(unsigned position)
|
||||
{
|
||||
_markArgument = position;
|
||||
@@ -98,9 +103,5 @@ QString Overview::prettyType(const FullySpecifiedType &ty,
|
||||
const QString &name) const
|
||||
{
|
||||
TypePrettyPrinter pp(this);
|
||||
pp.setMarkArgument(_markArgument);
|
||||
pp.setShowArgumentNames(_showArgumentNames);
|
||||
pp.setShowReturnTypes(_showReturnTypes);
|
||||
pp.setShowFunctionSignatures(_showFunctionSignatures);
|
||||
return pp(ty, name);
|
||||
}
|
||||
|
@@ -57,7 +57,10 @@ public:
|
||||
bool showFunctionSignatures() const;
|
||||
void setShowFunctionSignatures(bool showFunctionSignatures);
|
||||
|
||||
void setMarkArgument(unsigned position); // 1-based
|
||||
// 1-based
|
||||
// ### rename
|
||||
unsigned markArgument() const;
|
||||
void setMarkArgument(unsigned position);
|
||||
|
||||
QString operator()(Name *name) const
|
||||
{ return prettyName(name); }
|
||||
|
@@ -42,37 +42,12 @@ using namespace CPlusPlus;
|
||||
|
||||
TypePrettyPrinter::TypePrettyPrinter(const Overview *overview)
|
||||
: _overview(overview),
|
||||
_name(0),
|
||||
_markArgument(0),
|
||||
_showArgumentNames(false),
|
||||
_showReturnTypes(false),
|
||||
_showFunctionSignatures(true)
|
||||
_name(0)
|
||||
{ }
|
||||
|
||||
TypePrettyPrinter::~TypePrettyPrinter()
|
||||
{ }
|
||||
|
||||
bool TypePrettyPrinter::showArgumentNames() const
|
||||
{ return _showArgumentNames; }
|
||||
|
||||
void TypePrettyPrinter::setShowArgumentNames(bool showArgumentNames)
|
||||
{ _showArgumentNames = showArgumentNames; }
|
||||
|
||||
bool TypePrettyPrinter::showReturnTypes() const
|
||||
{ return _showReturnTypes; }
|
||||
|
||||
void TypePrettyPrinter::setShowReturnTypes(bool showReturnTypes)
|
||||
{ _showReturnTypes = showReturnTypes; }
|
||||
|
||||
bool TypePrettyPrinter::showFunctionSignatures() const
|
||||
{ return _showFunctionSignatures; }
|
||||
|
||||
void TypePrettyPrinter::setShowFunctionSignatures(bool showFunctionSignatures)
|
||||
{ _showFunctionSignatures = showFunctionSignatures; }
|
||||
|
||||
void TypePrettyPrinter::setMarkArgument(unsigned position)
|
||||
{ _markArgument = position; }
|
||||
|
||||
const Overview *TypePrettyPrinter::overview() const
|
||||
{ return _overview; }
|
||||
|
||||
@@ -102,15 +77,16 @@ QString TypePrettyPrinter::operator()(const FullySpecifiedType &type, const QStr
|
||||
|
||||
void TypePrettyPrinter::acceptType(const FullySpecifiedType &ty)
|
||||
{
|
||||
if (ty.isConst())
|
||||
_text += QLatin1String("const ");
|
||||
if (ty.isVolatile())
|
||||
_text += QLatin1String("volatile ");
|
||||
if (ty.isSigned())
|
||||
_text += QLatin1String("signed ");
|
||||
if (ty.isUnsigned())
|
||||
_text += QLatin1String("unsigned ");
|
||||
out(QLatin1String("signed "));
|
||||
|
||||
else if (ty.isUnsigned())
|
||||
out(QLatin1String("unsigned "));
|
||||
|
||||
const FullySpecifiedType previousFullySpecifiedType = _fullySpecifiedType;
|
||||
_fullySpecifiedType = ty;
|
||||
accept(ty.type());
|
||||
_fullySpecifiedType = previousFullySpecifiedType;
|
||||
}
|
||||
|
||||
QString TypePrettyPrinter::switchName(const QString &name)
|
||||
@@ -127,9 +103,9 @@ QString TypePrettyPrinter::switchText(const QString &name)
|
||||
return previousName;
|
||||
}
|
||||
|
||||
QList<Type *> TypePrettyPrinter::switchPtrOperators(const QList<Type *> &ptrOperators)
|
||||
QList<FullySpecifiedType> TypePrettyPrinter::switchPtrOperators(const QList<FullySpecifiedType> &ptrOperators)
|
||||
{
|
||||
QList<Type *> previousPtrOperators = _ptrOperators;
|
||||
QList<FullySpecifiedType> previousPtrOperators = _ptrOperators;
|
||||
_ptrOperators = ptrOperators;
|
||||
return previousPtrOperators;
|
||||
}
|
||||
@@ -137,31 +113,53 @@ QList<Type *> TypePrettyPrinter::switchPtrOperators(const QList<Type *> &ptrOper
|
||||
void TypePrettyPrinter::applyPtrOperators(bool wantSpace)
|
||||
{
|
||||
for (int i = _ptrOperators.size() - 1; i != -1; --i) {
|
||||
Type *op = _ptrOperators.at(i);
|
||||
const FullySpecifiedType op = _ptrOperators.at(i);
|
||||
|
||||
if (i == 0 && wantSpace)
|
||||
_text += QLatin1Char(' ');
|
||||
space();
|
||||
|
||||
if (PointerType *ptrTy = op->asPointerType()) {
|
||||
_text += QLatin1Char('*');
|
||||
if (ptrTy->elementType().isConst())
|
||||
_text += " const";
|
||||
if (ptrTy->elementType().isVolatile())
|
||||
_text += " volatile";
|
||||
if (op->isPointerType()) {
|
||||
out(QLatin1Char('*'));
|
||||
outCV(op);
|
||||
} else if (op->isReferenceType()) {
|
||||
_text += QLatin1Char('&');
|
||||
} else if (PointerToMemberType *memPtrTy = op->asPointerToMemberType()) {
|
||||
_text += QLatin1Char(' ');
|
||||
_text += _overview->prettyName(memPtrTy->memberName());
|
||||
_text += QLatin1Char('*');
|
||||
out(QLatin1Char('&'));
|
||||
} else if (const PointerToMemberType *memPtrTy = op->asPointerToMemberType()) {
|
||||
space();
|
||||
out(_overview->prettyName(memPtrTy->memberName()));
|
||||
out(QLatin1Char('*'));
|
||||
outCV(op);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(VoidType *)
|
||||
{
|
||||
_text += QLatin1String("void");
|
||||
out(QLatin1String("void"));
|
||||
applyPtrOperators();
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(NamedType *type)
|
||||
{
|
||||
out(overview()->prettyName(type->name()));
|
||||
applyPtrOperators();
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(Namespace *type)
|
||||
{
|
||||
_text += overview()->prettyName(type->name());
|
||||
applyPtrOperators();
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(Class *type)
|
||||
{
|
||||
_text += overview()->prettyName(type->name());
|
||||
applyPtrOperators();
|
||||
}
|
||||
|
||||
|
||||
void TypePrettyPrinter::visit(Enum *type)
|
||||
{
|
||||
_text += overview()->prettyName(type->name());
|
||||
applyPtrOperators();
|
||||
}
|
||||
|
||||
@@ -169,25 +167,25 @@ void TypePrettyPrinter::visit(IntegerType *type)
|
||||
{
|
||||
switch (type->kind()) {
|
||||
case IntegerType::Char:
|
||||
_text += QLatin1String("char");
|
||||
out(QLatin1String("char"));
|
||||
break;
|
||||
case IntegerType::WideChar:
|
||||
_text += QLatin1String("wchar_t");
|
||||
out(QLatin1String("wchar_t"));
|
||||
break;
|
||||
case IntegerType::Bool:
|
||||
_text += QLatin1String("bool");
|
||||
out(QLatin1String("bool"));
|
||||
break;
|
||||
case IntegerType::Short:
|
||||
_text += QLatin1String("short");
|
||||
out(QLatin1String("short"));
|
||||
break;
|
||||
case IntegerType::Int:
|
||||
_text += QLatin1String("int");
|
||||
out(QLatin1String("int"));
|
||||
break;
|
||||
case IntegerType::Long:
|
||||
_text += QLatin1String("long");
|
||||
out(QLatin1String("long"));
|
||||
break;
|
||||
case IntegerType::LongLong:
|
||||
_text += QLatin1String("long long");
|
||||
out(QLatin1String("long long"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -198,13 +196,13 @@ void TypePrettyPrinter::visit(FloatType *type)
|
||||
{
|
||||
switch (type->kind()) {
|
||||
case FloatType::Float:
|
||||
_text += QLatin1String("float");
|
||||
out(QLatin1String("float"));
|
||||
break;
|
||||
case FloatType::Double:
|
||||
_text += QLatin1String("double");
|
||||
out(QLatin1String("double"));
|
||||
break;
|
||||
case FloatType::LongDouble:
|
||||
_text += QLatin1String("long double");
|
||||
out(QLatin1String("long double"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -213,99 +211,135 @@ void TypePrettyPrinter::visit(FloatType *type)
|
||||
|
||||
void TypePrettyPrinter::visit(PointerToMemberType *type)
|
||||
{
|
||||
_ptrOperators.append(type);
|
||||
outCV(type->elementType());
|
||||
space();
|
||||
|
||||
_ptrOperators.append(_fullySpecifiedType);
|
||||
acceptType(type->elementType());
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(PointerType *type)
|
||||
{
|
||||
_ptrOperators.append(type);
|
||||
outCV(type->elementType());
|
||||
space();
|
||||
|
||||
_ptrOperators.append(_fullySpecifiedType);
|
||||
acceptType(type->elementType());
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(ReferenceType *type)
|
||||
{
|
||||
_ptrOperators.append(type);
|
||||
outCV(type->elementType());
|
||||
space();
|
||||
|
||||
_ptrOperators.append(_fullySpecifiedType);
|
||||
acceptType(type->elementType());
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(ArrayType *type)
|
||||
{
|
||||
_text += overview()->prettyType(type->elementType());
|
||||
out(overview()->prettyType(type->elementType()));
|
||||
if (! _ptrOperators.isEmpty()) {
|
||||
_text += QLatin1Char('(');
|
||||
out(QLatin1Char('('));
|
||||
applyPtrOperators(false);
|
||||
if (! _name.isEmpty()) {
|
||||
_text += _name;
|
||||
out(_name);
|
||||
_name.clear();
|
||||
}
|
||||
_text += QLatin1Char(')');
|
||||
out(QLatin1Char(')'));
|
||||
}
|
||||
_text += QLatin1String("[]");
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(NamedType *type)
|
||||
{
|
||||
_text += overview()->prettyName(type->name());
|
||||
applyPtrOperators();
|
||||
out(QLatin1String("[]"));
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(Function *type)
|
||||
{
|
||||
if (_showReturnTypes)
|
||||
_text += _overview->prettyType(type->returnType());
|
||||
if (_overview->showReturnTypes())
|
||||
out(_overview->prettyType(type->returnType()));
|
||||
|
||||
if (! _ptrOperators.isEmpty()) {
|
||||
_text += QLatin1Char('(');
|
||||
out(QLatin1Char('('));
|
||||
applyPtrOperators(false);
|
||||
if (! _name.isEmpty()) {
|
||||
_text += _name;
|
||||
_name.clear();
|
||||
}
|
||||
_text += QLatin1Char(')');
|
||||
} else if (! _name.isEmpty() && _showFunctionSignatures) {
|
||||
_text += QLatin1Char(' '); // ### fixme
|
||||
_text += _name;
|
||||
out(QLatin1Char(')'));
|
||||
} else if (! _name.isEmpty() && _overview->showFunctionSignatures()) {
|
||||
space();
|
||||
out(_name);
|
||||
_name.clear();
|
||||
}
|
||||
|
||||
if (_showFunctionSignatures) {
|
||||
if (_overview->showFunctionSignatures()) {
|
||||
Overview argumentText;
|
||||
_text += QLatin1Char('(');
|
||||
argumentText.setShowReturnTypes(true);
|
||||
argumentText.setShowArgumentNames(false);
|
||||
argumentText.setShowFunctionSignatures(true);
|
||||
|
||||
out(QLatin1Char('('));
|
||||
|
||||
for (unsigned index = 0; index < type->argumentCount(); ++index) {
|
||||
if (index != 0)
|
||||
_text += QLatin1String(", ");
|
||||
out(QLatin1String(", "));
|
||||
|
||||
if (Argument *arg = type->argumentAt(index)->asArgument()) {
|
||||
if (index + 1 == _markArgument)
|
||||
_text += QLatin1String("<b>");
|
||||
if (index + 1 == _overview->markArgument())
|
||||
out(QLatin1String("<b>"));
|
||||
|
||||
Name *name = 0;
|
||||
if (_showArgumentNames)
|
||||
|
||||
if (_overview->showArgumentNames())
|
||||
name = arg->name();
|
||||
_text += argumentText(arg->type(), name);
|
||||
if (index + 1 == _markArgument)
|
||||
_text += QLatin1String("</b>");
|
||||
|
||||
out(argumentText(arg->type(), name));
|
||||
|
||||
if (index + 1 == _overview->markArgument())
|
||||
out(QLatin1String("</b>"));
|
||||
}
|
||||
}
|
||||
|
||||
if (type->isVariadic())
|
||||
_text += QLatin1String("...");
|
||||
out(QLatin1String("..."));
|
||||
|
||||
_text += QLatin1Char(')');
|
||||
|
||||
if (type->isConst())
|
||||
_text += QLatin1String(" const");
|
||||
|
||||
if (type->isVolatile())
|
||||
_text += QLatin1String(" volatile");
|
||||
out(QLatin1Char(')'));
|
||||
if (type->isConst() && type->isVolatile()) {
|
||||
space();
|
||||
out("const volatile");
|
||||
} else if (type->isConst()) {
|
||||
space();
|
||||
out("const");
|
||||
} else if (type->isVolatile()) {
|
||||
space();
|
||||
out("volatile");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::visit(Namespace *type)
|
||||
{ _text += overview()->prettyName(type->name()); }
|
||||
void TypePrettyPrinter::space()
|
||||
{
|
||||
if (_text.isEmpty())
|
||||
return;
|
||||
|
||||
void TypePrettyPrinter::visit(Class *type)
|
||||
{ _text += overview()->prettyName(type->name()); }
|
||||
const QChar ch = _text.at(_text.length() - 1);
|
||||
|
||||
void TypePrettyPrinter::visit(Enum *type)
|
||||
{ _text += overview()->prettyName(type->name()); }
|
||||
if (ch.isLetterOrNumber() || ch == QLatin1Char('_') || ch == QLatin1Char(')'))
|
||||
_text += QLatin1Char(' ');
|
||||
}
|
||||
|
||||
void TypePrettyPrinter::out(const QString &text)
|
||||
{ _text += text; }
|
||||
|
||||
void TypePrettyPrinter::out(const QChar &ch)
|
||||
{ _text += ch; }
|
||||
|
||||
void TypePrettyPrinter::outCV(const FullySpecifiedType &ty)
|
||||
{
|
||||
if (ty.isConst() && ty.isVolatile())
|
||||
out(QLatin1String("const volatile"));
|
||||
|
||||
else if (ty.isConst())
|
||||
out(QLatin1String("const"));
|
||||
|
||||
else if (ty.isVolatile())
|
||||
out(QLatin1String("volatile"));
|
||||
}
|
||||
|
@@ -33,7 +33,8 @@
|
||||
#ifndef TYPEPRETTYPRINTER_H
|
||||
#define TYPEPRETTYPRINTER_H
|
||||
|
||||
#include "TypeVisitor.h"
|
||||
#include <TypeVisitor.h>
|
||||
#include <FullySpecifiedType.h>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
|
||||
@@ -50,23 +51,12 @@ public:
|
||||
|
||||
const Overview *overview() const;
|
||||
|
||||
bool showArgumentNames() const;
|
||||
void setShowArgumentNames(bool showArgumentNames);
|
||||
|
||||
bool showReturnTypes() const;
|
||||
void setShowReturnTypes(bool showReturnTypes);
|
||||
|
||||
bool showFunctionSignatures() const;
|
||||
void setShowFunctionSignatures(bool showFunctionSignatures);
|
||||
|
||||
void setMarkArgument(unsigned position); // 1-based
|
||||
|
||||
QString operator()(const FullySpecifiedType &type);
|
||||
QString operator()(const FullySpecifiedType &type, const QString &name);
|
||||
|
||||
protected:
|
||||
QString switchText(const QString &text = QString());
|
||||
QList<Type *> switchPtrOperators(const QList<Type *> &ptrOperators);
|
||||
QList<FullySpecifiedType> switchPtrOperators(const QList<FullySpecifiedType> &ptrOperators);
|
||||
QString switchName(const QString &name);
|
||||
|
||||
void applyPtrOperators(bool wantSpace = true);
|
||||
@@ -85,15 +75,17 @@ protected:
|
||||
virtual void visit(Class *type);
|
||||
virtual void visit(Enum *type);
|
||||
|
||||
void space();
|
||||
void out(const QString &text);
|
||||
void out(const QChar &ch);
|
||||
void outCV(const FullySpecifiedType &ty);
|
||||
|
||||
private:
|
||||
const Overview *_overview;
|
||||
QString _name;
|
||||
QString _text;
|
||||
QList<Type *> _ptrOperators;
|
||||
unsigned _markArgument;
|
||||
bool _showArgumentNames: 1;
|
||||
bool _showReturnTypes: 1;
|
||||
bool _showFunctionSignatures: 1;
|
||||
FullySpecifiedType _fullySpecifiedType;
|
||||
QList<FullySpecifiedType> _ptrOperators;
|
||||
};
|
||||
|
||||
} // end of namespace CPlusPlus
|
||||
|
@@ -475,10 +475,12 @@ void EditorManager::setCurrentEditor(IEditor *editor, bool ignoreNavigationHisto
|
||||
setCurrentView(0);
|
||||
if (m_d->m_currentEditor == editor)
|
||||
return;
|
||||
if (m_d->m_currentEditor)
|
||||
updateCurrentPositionInNavigationHistory();
|
||||
|
||||
m_d->m_currentEditor = editor;
|
||||
if (editor) {
|
||||
bool addToHistory = (!ignoreNavigationHistory && editor != currentEditor());
|
||||
bool addToHistory = (!ignoreNavigationHistory);
|
||||
if (addToHistory)
|
||||
addCurrentPositionToNavigationHistory(true);
|
||||
|
||||
@@ -678,8 +680,6 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
||||
|
||||
QList<EditorView*> currentViews;
|
||||
EditorView *currentView = 0;
|
||||
if (currentEditor())
|
||||
addCurrentPositionToNavigationHistory(true);
|
||||
|
||||
// remove the editors
|
||||
foreach (IEditor *editor, acceptedEditors) {
|
||||
@@ -812,11 +812,7 @@ void EditorManager::activateEditor(Core::Internal::EditorView *view, Core::IEdit
|
||||
return;
|
||||
}
|
||||
|
||||
bool hasCurrent = (view->currentEditor() != 0);
|
||||
|
||||
editor = placeEditor(view, editor);
|
||||
if (!(flags & NoActivate) || !hasCurrent)
|
||||
view->setCurrentEditor(editor);
|
||||
|
||||
if (!(flags & NoActivate)) {
|
||||
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
|
||||
@@ -1349,6 +1345,7 @@ void EditorManager::addCurrentPositionToNavigationHistory(bool compress)
|
||||
return;
|
||||
if (!editor->file())
|
||||
return;
|
||||
|
||||
QString fileName = editor->file()->fileName();
|
||||
QByteArray state = editor->saveState();
|
||||
// cut existing
|
||||
@@ -1383,8 +1380,18 @@ void EditorManager::addCurrentPositionToNavigationHistory(bool compress)
|
||||
updateActions();
|
||||
}
|
||||
|
||||
void EditorManager::updateCurrentPositionInNavigationHistory()
|
||||
{
|
||||
if (!m_d->m_currentEditor
|
||||
|| m_d->currentNavigationHistoryPosition < 0
|
||||
|| m_d->m_navigationHistory.at(m_d->currentNavigationHistoryPosition)->editor != m_d->m_currentEditor)
|
||||
return;
|
||||
m_d->m_navigationHistory.at(m_d->currentNavigationHistoryPosition)->state = m_d->m_currentEditor->saveState();
|
||||
}
|
||||
|
||||
void EditorManager::goBackInNavigationHistory()
|
||||
{
|
||||
updateCurrentPositionInNavigationHistory();
|
||||
while (m_d->currentNavigationHistoryPosition > 0) {
|
||||
--m_d->currentNavigationHistoryPosition;
|
||||
EditorManagerPrivate::EditLocation *location = m_d->m_navigationHistory.at(m_d->currentNavigationHistoryPosition);
|
||||
@@ -1408,6 +1415,7 @@ void EditorManager::goBackInNavigationHistory()
|
||||
|
||||
void EditorManager::goForwardInNavigationHistory()
|
||||
{
|
||||
updateCurrentPositionInNavigationHistory();
|
||||
if (m_d->currentNavigationHistoryPosition >= m_d->m_navigationHistory.size()-1)
|
||||
return;
|
||||
++m_d->currentNavigationHistoryPosition;
|
||||
|
@@ -229,6 +229,8 @@ private:
|
||||
void emptyView(Core::Internal::EditorView *view);
|
||||
IEditor *pickUnusedEditor() const;
|
||||
|
||||
void updateCurrentPositionInNavigationHistory();
|
||||
|
||||
static EditorManager *m_instance;
|
||||
EditorManagerPrivate *m_d;
|
||||
|
||||
|
@@ -329,9 +329,11 @@ EditorView::~EditorView()
|
||||
|
||||
void EditorView::addEditor(IEditor *editor)
|
||||
{
|
||||
if (m_container->indexOf(editor->widget()) != -1)
|
||||
if (m_editors.contains(editor))
|
||||
return;
|
||||
|
||||
m_editors.append(editor);
|
||||
|
||||
m_container->addWidget(editor->widget());
|
||||
m_widgetEditorMap.insert(editor->widget(), editor);
|
||||
|
||||
@@ -348,7 +350,7 @@ void EditorView::addEditor(IEditor *editor)
|
||||
|
||||
bool EditorView::hasEditor(IEditor *editor) const
|
||||
{
|
||||
return (m_container->indexOf(editor->widget()) != -1);
|
||||
return m_editors.contains(editor);
|
||||
}
|
||||
|
||||
void EditorView::closeView()
|
||||
@@ -360,9 +362,14 @@ void EditorView::closeView()
|
||||
void EditorView::removeEditor(IEditor *editor)
|
||||
{
|
||||
QTC_ASSERT(editor, return);
|
||||
if (!m_editors.contains(editor))
|
||||
return;
|
||||
|
||||
const int index = m_container->indexOf(editor->widget());
|
||||
QTC_ASSERT((index != -1), return);
|
||||
bool wasCurrent = (index == m_container->currentIndex());
|
||||
if (index != -1) {
|
||||
m_editors.removeAll(editor);
|
||||
|
||||
m_container->removeWidget(editor->widget());
|
||||
m_widgetEditorMap.remove(editor->widget());
|
||||
editor->widget()->setParent(0);
|
||||
@@ -377,9 +384,8 @@ void EditorView::removeEditor(IEditor *editor)
|
||||
toolBar->setVisible(false);
|
||||
toolBar->setParent(0);
|
||||
}
|
||||
}
|
||||
if (wasCurrent)
|
||||
setCurrentEditor(currentEditor());
|
||||
if (wasCurrent && m_editors.count())
|
||||
setCurrentEditor(m_editors.last());
|
||||
}
|
||||
|
||||
IEditor *EditorView::currentEditor() const
|
||||
@@ -394,6 +400,8 @@ void EditorView::setCurrentEditor(IEditor *editor)
|
||||
if (!editor || m_container->count() <= 0
|
||||
|| m_container->indexOf(editor->widget()) == -1)
|
||||
return;
|
||||
m_editors.removeAll(editor);
|
||||
m_editors.append(editor);
|
||||
|
||||
const int idx = m_container->indexOf(editor->widget());
|
||||
QTC_ASSERT(idx >= 0, return);
|
||||
|
@@ -144,6 +144,7 @@ private:
|
||||
QToolButton *m_infoWidgetButton;
|
||||
IEditor *m_editorForInfoWidget;
|
||||
QSortFilterProxyModel m_proxyModel;
|
||||
QList<IEditor *>m_editors;
|
||||
QMap<QWidget *, IEditor *> m_widgetEditorMap;
|
||||
};
|
||||
|
||||
|
@@ -185,7 +185,9 @@ void CodepasterPlugin::post()
|
||||
|
||||
// Submit to codepaster
|
||||
|
||||
m_poster = new CustomPoster(serverUrl());
|
||||
m_poster = new CustomPoster(serverUrl(),
|
||||
m_settingsPage->copyToClipBoard(),
|
||||
m_settingsPage->displayOutput());
|
||||
|
||||
// Copied from cpaster. Otherwise lineendings will screw up
|
||||
if (!data.contains("\r\n")) {
|
||||
|
@@ -65,8 +65,8 @@ public:
|
||||
QString username() const;
|
||||
QUrl serverUrl() const;
|
||||
|
||||
bool copyToClipBoard() const;
|
||||
bool displayOutput() const;
|
||||
inline bool copyToClipBoard() const { return m_copy; }
|
||||
inline bool displayOutput() const { return m_output; }
|
||||
|
||||
private:
|
||||
Ui_SettingsPage m_ui;
|
||||
|
@@ -158,8 +158,10 @@ static QString buildHelpId(const FullySpecifiedType &type,
|
||||
scope = e->scope();
|
||||
} else if (const NamedType *t = type->asNamedType()) {
|
||||
name = t->name();
|
||||
} else if (const Declaration *d = symbol->asDeclaration()) {
|
||||
if (d->scope() && d->scope()->owner()->isEnum()) {
|
||||
} else if (symbol && symbol->isDeclaration()) {
|
||||
const Declaration *d = symbol->asDeclaration();
|
||||
|
||||
if (d->scope() && d->scope()->isEnumScope()) {
|
||||
name = d->name();
|
||||
scope = d->scope();
|
||||
}
|
||||
|
@@ -187,10 +187,10 @@ using namespace CppTools::Internal;
|
||||
FunctionArgumentWidget::FunctionArgumentWidget()
|
||||
: m_item(0)
|
||||
{
|
||||
QObject *editorObject = Core::ICore::instance()->editorManager()->currentEditor();
|
||||
QObject *editorObject = Core::EditorManager::instance()->currentEditor();
|
||||
m_editor = qobject_cast<TextEditor::ITextEditor *>(editorObject);
|
||||
|
||||
m_popupFrame = new QFrame(0, Qt::ToolTip|Qt::WindowStaysOnTopHint);
|
||||
m_popupFrame = new QFrame(0, Qt::ToolTip | Qt::WindowStaysOnTopHint);
|
||||
m_popupFrame->setFocusPolicy(Qt::NoFocus);
|
||||
m_popupFrame->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
@@ -1069,7 +1069,10 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
|
||||
Function *function = symbol->type()->asFunctionType();
|
||||
QTC_ASSERT(function, return);
|
||||
|
||||
m_functionArgumentWidget = new FunctionArgumentWidget();
|
||||
// Recreate if necessary
|
||||
if (!m_functionArgumentWidget)
|
||||
m_functionArgumentWidget = new FunctionArgumentWidget;
|
||||
|
||||
m_functionArgumentWidget->showFunctionHint(function, typeOfExpression.snapshot());
|
||||
}
|
||||
} else if (m_completionOperator == T_SIGNAL || m_completionOperator == T_SLOT) {
|
||||
|
@@ -33,7 +33,6 @@
|
||||
|
||||
#include "debuggermanager.h"
|
||||
|
||||
#include "assert.h"
|
||||
#include "debuggerconstants.h"
|
||||
#include "idebuggerengine.h"
|
||||
|
||||
@@ -58,6 +57,8 @@
|
||||
#include "startexternaldialog.h"
|
||||
#include "attachexternaldialog.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
@@ -149,6 +150,7 @@ void DebuggerManager::init()
|
||||
{
|
||||
m_status = -1;
|
||||
m_busy = false;
|
||||
m_shutdown = false;
|
||||
|
||||
m_attachedPID = 0;
|
||||
m_startMode = startInternal;
|
||||
@@ -451,10 +453,7 @@ QDockWidget *DebuggerManager::createDockForWidget(QWidget *widget)
|
||||
{
|
||||
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
|
||||
dockWidget->setObjectName(widget->windowTitle());
|
||||
//dockWidget->setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea);
|
||||
dockWidget->setAllowedAreas(Qt::AllDockWidgetAreas); // that space is needed.
|
||||
//dockWidget->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
dockWidget->setFeatures(QDockWidget::AllDockWidgetFeatures);
|
||||
dockWidget->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
dockWidget->setTitleBarWidget(new QWidget(dockWidget));
|
||||
dockWidget->setWidget(widget);
|
||||
connect(dockWidget->toggleViewAction(), SIGNAL(toggled(bool)),
|
||||
@@ -591,7 +590,18 @@ void DebuggerManager::showApplicationOutput(const QString &str)
|
||||
void DebuggerManager::shutdown()
|
||||
{
|
||||
//qDebug() << "DEBUGGER_MANAGER SHUTDOWN START";
|
||||
engine()->shutdown();
|
||||
m_shutdown = true;
|
||||
if (m_engine)
|
||||
m_engine->shutdown();
|
||||
m_engine = 0;
|
||||
|
||||
delete scriptEngine;
|
||||
scriptEngine = 0;
|
||||
delete gdbEngine;
|
||||
gdbEngine = 0;
|
||||
delete winEngine;
|
||||
winEngine = 0;
|
||||
|
||||
// Delete these manually before deleting the manager
|
||||
// (who will delete the models for most views)
|
||||
delete m_breakWindow;
|
||||
@@ -645,41 +655,49 @@ void DebuggerManager::toggleBreakpoint()
|
||||
|
||||
void DebuggerManager::toggleBreakpoint(const QString &fileName, int lineNumber)
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
QTC_ASSERT(m_breakHandler, return);
|
||||
int index = m_breakHandler->indexOf(fileName, lineNumber);
|
||||
if (index == -1)
|
||||
breakHandler()->setBreakpoint(fileName, lineNumber);
|
||||
m_breakHandler->setBreakpoint(fileName, lineNumber);
|
||||
else
|
||||
breakHandler()->removeBreakpoint(index);
|
||||
engine()->attemptBreakpointSynchronization();
|
||||
m_breakHandler->removeBreakpoint(index);
|
||||
m_engine->attemptBreakpointSynchronization();
|
||||
}
|
||||
|
||||
void DebuggerManager::setToolTipExpression(const QPoint &pos, const QString &exp)
|
||||
{
|
||||
engine()->setToolTipExpression(pos, exp);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->setToolTipExpression(pos, exp);
|
||||
}
|
||||
|
||||
void DebuggerManager::updateWatchModel()
|
||||
{
|
||||
engine()->updateWatchModel();
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->updateWatchModel();
|
||||
}
|
||||
|
||||
void DebuggerManager::expandChildren(const QModelIndex &idx)
|
||||
{
|
||||
watchHandler()->expandChildren(idx);
|
||||
QTC_ASSERT(m_watchHandler, return);
|
||||
m_watchHandler->expandChildren(idx);
|
||||
}
|
||||
|
||||
void DebuggerManager::collapseChildren(const QModelIndex &idx)
|
||||
{
|
||||
watchHandler()->collapseChildren(idx);
|
||||
QTC_ASSERT(m_watchHandler, return);
|
||||
m_watchHandler->collapseChildren(idx);
|
||||
}
|
||||
|
||||
void DebuggerManager::removeWatchExpression(const QString &exp)
|
||||
{
|
||||
watchHandler()->removeWatchExpression(exp);
|
||||
QTC_ASSERT(m_watchHandler, return);
|
||||
m_watchHandler->removeWatchExpression(exp);
|
||||
}
|
||||
|
||||
QVariant DebuggerManager::sessionValue(const QString &name)
|
||||
{
|
||||
// this is answered by the plugin
|
||||
QVariant value;
|
||||
emit sessionValueRequested(name, &value);
|
||||
return value;
|
||||
@@ -687,16 +705,19 @@ QVariant DebuggerManager::sessionValue(const QString &name)
|
||||
|
||||
void DebuggerManager::querySessionValue(const QString &name, QVariant *value)
|
||||
{
|
||||
// this is answered by the plugin
|
||||
emit sessionValueRequested(name, value);
|
||||
}
|
||||
|
||||
void DebuggerManager::setSessionValue(const QString &name, const QVariant &value)
|
||||
{
|
||||
// this is answered by the plugin
|
||||
emit setSessionValueRequested(name, value);
|
||||
}
|
||||
|
||||
QVariant DebuggerManager::configValue(const QString &name)
|
||||
{
|
||||
// this is answered by the plugin
|
||||
QVariant value;
|
||||
emit configValueRequested(name, &value);
|
||||
return value;
|
||||
@@ -704,11 +725,13 @@ QVariant DebuggerManager::configValue(const QString &name)
|
||||
|
||||
void DebuggerManager::queryConfigValue(const QString &name, QVariant *value)
|
||||
{
|
||||
// this is answered by the plugin
|
||||
emit configValueRequested(name, value);
|
||||
}
|
||||
|
||||
void DebuggerManager::setConfigValue(const QString &name, const QVariant &value)
|
||||
{
|
||||
// this is answered by the plugin
|
||||
emit setConfigValueRequested(name, value);
|
||||
}
|
||||
|
||||
@@ -791,7 +814,7 @@ bool DebuggerManager::startNewDebugger(StartMode mode)
|
||||
else
|
||||
setDebuggerType(GdbDebugger);
|
||||
|
||||
if (!engine()->startDebugger())
|
||||
if (!m_engine->startDebugger())
|
||||
return false;
|
||||
|
||||
m_busy = false;
|
||||
@@ -812,7 +835,10 @@ void DebuggerManager::cleanupViews()
|
||||
|
||||
void DebuggerManager::exitDebugger()
|
||||
{
|
||||
engine()->exitDebugger();
|
||||
if (m_shutdown)
|
||||
return;
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->exitDebugger();
|
||||
cleanupViews();
|
||||
setStatus(DebuggerProcessNotReady);
|
||||
setBusyCursor(false);
|
||||
@@ -821,62 +847,73 @@ void DebuggerManager::exitDebugger()
|
||||
|
||||
void DebuggerManager::assignValueInDebugger(const QString &expr, const QString &value)
|
||||
{
|
||||
engine()->assignValueInDebugger(expr, value);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->assignValueInDebugger(expr, value);
|
||||
}
|
||||
|
||||
void DebuggerManager::activateFrame(int index)
|
||||
{
|
||||
engine()->activateFrame(index);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->activateFrame(index);
|
||||
}
|
||||
|
||||
void DebuggerManager::selectThread(int index)
|
||||
{
|
||||
engine()->selectThread(index);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->selectThread(index);
|
||||
}
|
||||
|
||||
void DebuggerManager::loadAllSymbols()
|
||||
{
|
||||
engine()->loadAllSymbols();
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->loadAllSymbols();
|
||||
}
|
||||
|
||||
void DebuggerManager::loadSymbols(const QString &module)
|
||||
{
|
||||
engine()->loadSymbols(module);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->loadSymbols(module);
|
||||
}
|
||||
|
||||
void DebuggerManager::stepExec()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
resetLocation();
|
||||
engine()->stepExec();
|
||||
m_engine->stepExec();
|
||||
}
|
||||
|
||||
void DebuggerManager::stepOutExec()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
resetLocation();
|
||||
engine()->stepOutExec();
|
||||
m_engine->stepOutExec();
|
||||
}
|
||||
|
||||
void DebuggerManager::nextExec()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
resetLocation();
|
||||
engine()->nextExec();
|
||||
m_engine->nextExec();
|
||||
}
|
||||
|
||||
void DebuggerManager::stepIExec()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
resetLocation();
|
||||
engine()->stepIExec();
|
||||
m_engine->stepIExec();
|
||||
}
|
||||
|
||||
void DebuggerManager::nextIExec()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
resetLocation();
|
||||
engine()->nextIExec();
|
||||
m_engine->nextIExec();
|
||||
}
|
||||
|
||||
void DebuggerManager::executeDebuggerCommand(const QString &command)
|
||||
{
|
||||
engine()->executeDebuggerCommand(command);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->executeDebuggerCommand(command);
|
||||
}
|
||||
|
||||
void DebuggerManager::sessionLoaded()
|
||||
@@ -894,16 +931,18 @@ void DebuggerManager::aboutToSaveSession()
|
||||
|
||||
void DebuggerManager::loadSessionData()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_breakHandler->loadSessionData();
|
||||
m_watchHandler->loadSessionData();
|
||||
engine()->loadSessionData();
|
||||
m_engine->loadSessionData();
|
||||
}
|
||||
|
||||
void DebuggerManager::saveSessionData()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_breakHandler->saveSessionData();
|
||||
m_watchHandler->saveSessionData();
|
||||
engine()->saveSessionData();
|
||||
m_engine->saveSessionData();
|
||||
}
|
||||
|
||||
void DebuggerManager::dumpLog()
|
||||
@@ -962,19 +1001,24 @@ void DebuggerManager::addToWatchWindow()
|
||||
|
||||
void DebuggerManager::watchExpression(const QString &expression)
|
||||
{
|
||||
watchHandler()->watchExpression(expression);
|
||||
QTC_ASSERT(m_watchHandler, return);
|
||||
m_watchHandler->watchExpression(expression);
|
||||
}
|
||||
|
||||
void DebuggerManager::setBreakpoint(const QString &fileName, int lineNumber)
|
||||
{
|
||||
breakHandler()->setBreakpoint(fileName, lineNumber);
|
||||
engine()->attemptBreakpointSynchronization();
|
||||
QTC_ASSERT(m_breakHandler, return);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_breakHandler->setBreakpoint(fileName, lineNumber);
|
||||
m_engine->attemptBreakpointSynchronization();
|
||||
}
|
||||
|
||||
void DebuggerManager::breakByFunction(const QString &functionName)
|
||||
{
|
||||
breakHandler()->breakByFunction(functionName);
|
||||
engine()->attemptBreakpointSynchronization();
|
||||
QTC_ASSERT(m_breakHandler, return);
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_breakHandler->breakByFunction(functionName);
|
||||
m_engine->attemptBreakpointSynchronization();
|
||||
}
|
||||
|
||||
void DebuggerManager::breakByFunction()
|
||||
@@ -1084,14 +1128,16 @@ bool DebuggerManager::useCustomDumpers() const
|
||||
|
||||
void DebuggerManager::setUseCustomDumpers(bool on)
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_settings.m_useCustomDumpers = on;
|
||||
engine()->setUseCustomDumpers(on);
|
||||
m_engine->setUseCustomDumpers(on);
|
||||
}
|
||||
|
||||
void DebuggerManager::setDebugDumpers(bool on)
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_settings.m_debugDumpers = on;
|
||||
engine()->setDebugDumpers(on);
|
||||
m_engine->setDebugDumpers(on);
|
||||
}
|
||||
|
||||
void DebuggerManager::setSkipKnownFrames(bool on)
|
||||
@@ -1107,29 +1153,31 @@ void DebuggerManager::queryCurrentTextEditor(QString *fileName, int *lineNumber,
|
||||
|
||||
void DebuggerManager::continueExec()
|
||||
{
|
||||
engine()->continueInferior();
|
||||
m_engine->continueInferior();
|
||||
}
|
||||
|
||||
void DebuggerManager::interruptDebuggingRequest()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
//qDebug() << "INTERRUPTING AT" << status();
|
||||
bool interruptIsExit = (status() != DebuggerInferiorRunning);
|
||||
if (interruptIsExit)
|
||||
exitDebugger();
|
||||
else {
|
||||
setStatus(DebuggerInferiorStopRequested);
|
||||
engine()->interruptInferior();
|
||||
m_engine->interruptInferior();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DebuggerManager::runToLineExec()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
QString fileName;
|
||||
int lineNumber = -1;
|
||||
emit currentTextEditorRequested(&fileName, &lineNumber, 0);
|
||||
if (!fileName.isEmpty())
|
||||
engine()->runToLineExec(fileName, lineNumber);
|
||||
m_engine->runToLineExec(fileName, lineNumber);
|
||||
}
|
||||
|
||||
void DebuggerManager::runToFunctionExec()
|
||||
@@ -1161,7 +1209,7 @@ void DebuggerManager::runToFunctionExec()
|
||||
}
|
||||
//qDebug() << "RUN TO FUNCTION " << functionName;
|
||||
if (!functionName.isEmpty())
|
||||
engine()->runToFunctionExec(functionName);
|
||||
m_engine->runToFunctionExec(functionName);
|
||||
}
|
||||
|
||||
void DebuggerManager::jumpToLineExec()
|
||||
@@ -1170,20 +1218,20 @@ void DebuggerManager::jumpToLineExec()
|
||||
int lineNumber = -1;
|
||||
emit currentTextEditorRequested(&fileName, &lineNumber, 0);
|
||||
if (!fileName.isEmpty())
|
||||
engine()->jumpToLineExec(fileName, lineNumber);
|
||||
m_engine->jumpToLineExec(fileName, lineNumber);
|
||||
}
|
||||
|
||||
void DebuggerManager::resetLocation()
|
||||
{
|
||||
//m_watchHandler->removeMouseMoveCatcher(editor->widget());
|
||||
// connected to the plugin
|
||||
emit resetLocationRequested();
|
||||
}
|
||||
|
||||
void DebuggerManager::gotoLocation(const QString &fileName, int line,
|
||||
bool setMarker)
|
||||
{
|
||||
// connected to the plugin
|
||||
emit gotoLocationRequested(fileName, line, setMarker);
|
||||
//m_watchHandler->installMouseMoveCatcher(editor->widget());
|
||||
}
|
||||
|
||||
|
||||
@@ -1195,9 +1243,10 @@ void DebuggerManager::gotoLocation(const QString &fileName, int line,
|
||||
|
||||
void DebuggerManager::reloadDisassembler()
|
||||
{
|
||||
QTC_ASSERT(m_engine, return);
|
||||
if (!m_disassemblerDock || !m_disassemblerDock->isVisible())
|
||||
return;
|
||||
engine()->reloadDisassembler();
|
||||
m_engine->reloadDisassembler();
|
||||
}
|
||||
|
||||
void DebuggerManager::disassemblerDockToggled(bool on)
|
||||
@@ -1217,7 +1266,7 @@ void DebuggerManager::reloadModules()
|
||||
{
|
||||
if (!m_modulesDock || !m_modulesDock->isVisible())
|
||||
return;
|
||||
engine()->reloadModules();
|
||||
m_engine->reloadModules();
|
||||
}
|
||||
|
||||
void DebuggerManager::modulesDockToggled(bool on)
|
||||
@@ -1235,11 +1284,13 @@ void DebuggerManager::modulesDockToggled(bool on)
|
||||
|
||||
void DebuggerManager::showDebuggerOutput(const QString &prefix, const QString &msg)
|
||||
{
|
||||
QTC_ASSERT(m_outputWindow, return);
|
||||
m_outputWindow->showOutput(prefix, msg);
|
||||
}
|
||||
|
||||
void DebuggerManager::showDebuggerInput(const QString &prefix, const QString &msg)
|
||||
{
|
||||
QTC_ASSERT(m_outputWindow, return);
|
||||
m_outputWindow->showInput(prefix, msg);
|
||||
}
|
||||
|
||||
@@ -1260,7 +1311,7 @@ void DebuggerManager::reloadRegisters()
|
||||
{
|
||||
if (!m_registerDock || !m_registerDock->isVisible())
|
||||
return;
|
||||
engine()->reloadRegisters();
|
||||
m_engine->reloadRegisters();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -466,6 +466,8 @@ private:
|
||||
IDebuggerEngine *engine();
|
||||
IDebuggerEngine *m_engine;
|
||||
DebuggerSettings m_settings;
|
||||
// set during application shutdown
|
||||
bool m_shutdown;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -107,11 +107,14 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
|
||||
: RunControl(runConfiguration), m_manager(manager), m_running(false)
|
||||
{
|
||||
connect(m_manager, SIGNAL(debuggingFinished()),
|
||||
this, SLOT(debuggingFinished()));
|
||||
this, SLOT(debuggingFinished()),
|
||||
Qt::QueuedConnection);
|
||||
connect(m_manager, SIGNAL(applicationOutputAvailable(QString)),
|
||||
this, SLOT(slotAddToOutputWindowInline(QString)));
|
||||
this, SLOT(slotAddToOutputWindowInline(QString)),
|
||||
Qt::QueuedConnection);
|
||||
connect(m_manager, SIGNAL(inferiorPidChanged(qint64)),
|
||||
this, SLOT(bringApplicationToForeground(qint64)));
|
||||
this, SLOT(bringApplicationToForeground(qint64)),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void DebuggerRunControl::start()
|
||||
|
@@ -112,6 +112,7 @@ enum GdbCommandType
|
||||
GdbExecInterrupt,
|
||||
GdbInfoShared,
|
||||
GdbInfoProc,
|
||||
GdbInfoThreads,
|
||||
GdbQueryDataDumper1,
|
||||
GdbQueryDataDumper2,
|
||||
|
||||
@@ -230,6 +231,15 @@ static bool isLeavableFunction(const QString &funcName, const QString &fileName)
|
||||
return false;
|
||||
}
|
||||
|
||||
static QString startSymbolName()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return "WinMainCRTStartup";
|
||||
#else
|
||||
return "_start";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -241,22 +251,16 @@ GdbEngine::GdbEngine(DebuggerManager *parent)
|
||||
{
|
||||
q = parent;
|
||||
qq = parent->engineInterface();
|
||||
init();
|
||||
initializeVariables();
|
||||
initializeConnections();
|
||||
}
|
||||
|
||||
GdbEngine::~GdbEngine()
|
||||
{
|
||||
}
|
||||
|
||||
void GdbEngine::init()
|
||||
void GdbEngine::initializeConnections()
|
||||
{
|
||||
m_pendingRequests = 0;
|
||||
m_gdbVersion = 100;
|
||||
m_outputCodec = QTextCodec::codecForLocale();
|
||||
m_dataDumperState = DataDumperUninitialized;
|
||||
|
||||
m_oldestAcceptableToken = -1;
|
||||
|
||||
// Gdb Process interaction
|
||||
connect(&m_gdbProc, SIGNAL(error(QProcess::ProcessError)), this,
|
||||
SLOT(gdbProcError(QProcess::ProcessError)));
|
||||
@@ -284,6 +288,23 @@ void GdbEngine::init()
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void GdbEngine::initializeVariables()
|
||||
{
|
||||
m_dataDumperState = DataDumperUninitialized;
|
||||
m_gdbVersion = 100;
|
||||
|
||||
m_fullToShortName.clear();
|
||||
m_shortToFullName.clear();
|
||||
m_varToType.clear();
|
||||
|
||||
m_modulesListOutdated = true;
|
||||
m_oldestAcceptableToken = -1;
|
||||
m_outputCodec = QTextCodec::codecForLocale();
|
||||
m_pendingRequests = 0;
|
||||
m_waitingForBreakpointSynchronizationToContinue = false;
|
||||
m_waitingForFirstBreakpointToBeHit = false;
|
||||
}
|
||||
|
||||
void GdbEngine::gdbProcError(QProcess::ProcessError error)
|
||||
{
|
||||
QString msg;
|
||||
@@ -650,7 +671,7 @@ void GdbEngine::maybeHandleInferiorPidChanged(const QString &pid0)
|
||||
}
|
||||
if (pid == q->m_attachedPID)
|
||||
return;
|
||||
//qDebug() << "FOUND PID " << pid;
|
||||
qDebug() << "FOUND PID " << pid;
|
||||
q->m_attachedPID = pid;
|
||||
qq->notifyInferiorPidChanged(pid);
|
||||
}
|
||||
@@ -750,8 +771,10 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record)
|
||||
--m_pendingRequests;
|
||||
PENDING_DEBUG(" TYPE " << cmd.type << " DECREMENTS PENDING TO: "
|
||||
<< m_pendingRequests << cmd.command);
|
||||
if (m_pendingRequests <= 0)
|
||||
if (m_pendingRequests <= 0) {
|
||||
PENDING_DEBUG(" .... AND TRIGGERS MODEL UPDATE");
|
||||
updateWatchModel2();
|
||||
}
|
||||
} else {
|
||||
PENDING_DEBUG(" UNKNOWN TYPE " << cmd.type << " LEAVES PENDING AT: "
|
||||
<< m_pendingRequests << cmd.command);
|
||||
@@ -778,6 +801,9 @@ void GdbEngine::handleResult(const GdbResultRecord & record, int type,
|
||||
case GdbInfoProc:
|
||||
handleInfoProc(record);
|
||||
break;
|
||||
case GdbInfoThreads:
|
||||
handleInfoThreads(record);
|
||||
break;
|
||||
|
||||
case GdbShowVersion:
|
||||
handleShowVersion(record);
|
||||
@@ -971,6 +997,19 @@ void GdbEngine::handleQuerySources(const GdbResultRecord &record)
|
||||
}
|
||||
}
|
||||
|
||||
void GdbEngine::handleInfoThreads(const GdbResultRecord &record)
|
||||
{
|
||||
if (record.resultClass == GdbResultDone) {
|
||||
// FIXME: use something more robust
|
||||
// WIN: * 3 Thread 2312.0x4d0 0x7c91120f in ?? ()
|
||||
// LINUX: * 1 Thread 0x7f466273c6f0 (LWP 21455) 0x0000000000404542 in ...
|
||||
QRegExp re(QLatin1String("Thread (\\d+)\\.0x.* in"));
|
||||
QString data = record.data.findChild("consolestreamoutput").data();
|
||||
if (re.indexIn(data) != -1)
|
||||
maybeHandleInferiorPidChanged(re.cap(1));
|
||||
}
|
||||
}
|
||||
|
||||
void GdbEngine::handleInfoProc(const GdbResultRecord &record)
|
||||
{
|
||||
if (record.resultClass == GdbResultDone) {
|
||||
@@ -1062,14 +1101,15 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
|
||||
{
|
||||
const QString reason = data.findChild("reason").data();
|
||||
|
||||
QString msg = data.findChild("consolestreamoutput").data();
|
||||
if (reason.isEmpty()) {
|
||||
GdbMi frame = data.findChild("frame");
|
||||
if (frame.findChild("func").data() == "_start") {
|
||||
//MAC: bool isFirstStop = data.findChild("bkptno").data() == "1";
|
||||
//!MAC: startSymbolName == data.findChild("frame").findChild("func")
|
||||
if (m_waitingForFirstBreakpointToBeHit) {
|
||||
m_waitingForFirstBreakpointToBeHit = false;
|
||||
//
|
||||
// that's the "early stop"
|
||||
frame.findChild("func").data() + '%';
|
||||
//
|
||||
#if defined(Q_OS_WIN)
|
||||
sendCommand("info proc", GdbInfoProc);
|
||||
sendCommand("info thread", GdbInfoThreads);
|
||||
#endif
|
||||
#if defined(Q_OS_LINUX)
|
||||
sendCommand("info proc", GdbInfoProc);
|
||||
@@ -1078,9 +1118,6 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
|
||||
sendCommand("info pid", GdbInfoProc, QVariant(), true);
|
||||
#endif
|
||||
sendCommand("-file-list-exec-source-files", GdbQuerySources);
|
||||
|
||||
sendCommand("sharedlibrary libc"); // for malloc
|
||||
sendCommand("sharedlibrary libdl"); // for dlopen
|
||||
tryLoadCustomDumpers();
|
||||
|
||||
// intentionally after tryLoadCustomDumpers(),
|
||||
@@ -1098,15 +1135,15 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
|
||||
sendCommand("set auto-solib-add off");
|
||||
sendCommand("set stop-on-solib-events 0");
|
||||
}
|
||||
// nicer to see a bit of the world we live in
|
||||
reloadModules();
|
||||
// this will "continue" if done
|
||||
attemptBreakpointSynchronization();
|
||||
m_waitingForBreakpointSynchronizationToContinue = true;
|
||||
QTimer::singleShot(0, this, SLOT(attemptBreakpointSynchronization()));
|
||||
return;
|
||||
}
|
||||
// fall through
|
||||
}
|
||||
|
||||
static bool modulesDirty = false;
|
||||
QString msg = data.findChild("consolestreamoutput").data();
|
||||
if (msg.contains("Stopped due to shared library event") || reason.isEmpty()) {
|
||||
if (qq->wantsSelectedPluginBreakpoints()) {
|
||||
qDebug() << "SHARED LIBRARY EVENT " << data.toString();
|
||||
@@ -1116,10 +1153,21 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
|
||||
q->showStatusMessage(tr("Loading %1...").arg(QString(data.toString())));
|
||||
return;
|
||||
}
|
||||
modulesDirty = true;
|
||||
m_modulesListOutdated = true;
|
||||
// fall through
|
||||
}
|
||||
|
||||
// seen on XP after removing a breakpoint while running
|
||||
// stdout:945*stopped,reason="signal-received",signal-name="SIGTRAP",
|
||||
// signal-meaning="Trace/breakpoint trap",thread-id="2",
|
||||
// frame={addr="0x7c91120f",func="ntdll!DbgUiConnectToDbg",
|
||||
// args=[],from="C:\\WINDOWS\\system32\\ntdll.dll"}
|
||||
if (reason == "signal-received"
|
||||
&& data.findChild("signal-name").toString() == "SIGTRAP") {
|
||||
continueInferior();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isExitedReason(reason)) {
|
||||
qq->notifyInferiorExited();
|
||||
QString msg = "Program exited normally";
|
||||
@@ -1171,11 +1219,9 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
|
||||
}
|
||||
|
||||
if (isStoppedReason(reason) || reason.isEmpty()) {
|
||||
if (modulesDirty) {
|
||||
sendCommand("-file-list-exec-source-files", GdbQuerySources);
|
||||
sendCommand("-break-list", BreakList);
|
||||
if (m_modulesListOutdated) {
|
||||
reloadModules();
|
||||
modulesDirty = false;
|
||||
m_modulesListOutdated = false;
|
||||
}
|
||||
// Need another round trip
|
||||
if (reason == "breakpoint-hit") {
|
||||
@@ -1228,30 +1274,6 @@ void GdbEngine::handleAsyncOutput2(const GdbMi &data)
|
||||
{
|
||||
qq->notifyInferiorStopped();
|
||||
|
||||
//
|
||||
// Breakpoints
|
||||
//
|
||||
//qDebug() << "BREAK ASYNC: " << output.toString();
|
||||
//sendListBreakpoints();
|
||||
//attemptBreakpointSynchronization();
|
||||
//if (m_breakListOnStopNeeded)
|
||||
// sendListBreakpoints();
|
||||
|
||||
// something reasonably 'invariant'
|
||||
// Linux:
|
||||
//"79*stopped,reason="end-stepping-range",reason="breakpoint-hit",bkptno="1",
|
||||
//thread-id="1",frame={addr="0x0000000000405d8f",func="run1",
|
||||
//args=[{name="argc",value="1"},{name="argv",value="0x7fffb7c23058"}],
|
||||
//file="test1.cpp",fullname="/home/apoenitz/dev/work/test1/test1.cpp"
|
||||
//,line="261"}"
|
||||
// Mac: (but only sometimes)
|
||||
// "82*stopped,bkpt={number="0",type="step
|
||||
// resume",disp="keep",enabled="y",addr="0x43127171",at="<Find::
|
||||
// Internal::FindToolWindow::invokeFindIncremental()
|
||||
// +225>",thread="1",shlib="/Users/epreuss/dev/ide/main/bin/
|
||||
// workbench.app/Contents/PlugIns/Trolltech/libFind.1.0.0.dylib",
|
||||
// frame="0xbfffd800",thread="1",times="1"},
|
||||
|
||||
//
|
||||
// Stack
|
||||
//
|
||||
@@ -1333,7 +1355,6 @@ void GdbEngine::handleExecRun(const GdbResultRecord &response)
|
||||
if (response.resultClass == GdbResultRunning) {
|
||||
qq->notifyInferiorRunning();
|
||||
q->showStatusMessage(tr("Running..."));
|
||||
//reloadModules();
|
||||
} else if (response.resultClass == GdbResultError) {
|
||||
QString msg = response.data.findChild("msg").data();
|
||||
if (msg == "Cannot find bounds of current function") {
|
||||
@@ -1421,11 +1442,8 @@ void GdbEngine::exitDebugger()
|
||||
if (m_gdbProc.state() != QProcess::NotRunning)
|
||||
qDebug() << "PROBLEM STOPPING DEBUGGER";
|
||||
|
||||
m_shortToFullName.clear();
|
||||
m_fullToShortName.clear();
|
||||
m_varToType.clear();
|
||||
m_dataDumperState = DataDumperUninitialized;
|
||||
m_outputCollector.shutdown();
|
||||
initializeVariables();
|
||||
//q->settings()->m_debugDumpers = false;
|
||||
}
|
||||
|
||||
@@ -1572,7 +1590,7 @@ bool GdbEngine::startDebugger()
|
||||
if (!q->m_processArgs.isEmpty())
|
||||
sendCommand("-exec-arguments " + q->m_processArgs.join(" "));
|
||||
sendCommand("set auto-solib-add off");
|
||||
sendCommand("x/2i _start", GdbStart);
|
||||
sendCommand("x/2i " + startSymbolName(), GdbStart);
|
||||
}
|
||||
|
||||
if (q->startMode() == q->attachExternal) {
|
||||
@@ -1597,8 +1615,6 @@ bool GdbEngine::startDebugger()
|
||||
else
|
||||
qq->breakHandler()->setAllPending();
|
||||
|
||||
//QTimer::singleShot(0, this, SLOT(attemptBreakpointSynchronization()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1618,10 +1634,11 @@ void GdbEngine::handleStart(const GdbResultRecord &response)
|
||||
// stdout:~"0x404540 <_start>:\txor %ebp,%ebp\n"
|
||||
// stdout:~"0x404542 <_start+2>:\tmov %rdx,%r9\n"
|
||||
QString msg = response.data.findChild("consolestreamoutput").data();
|
||||
QRegExp needle("0x([0-9a-f]+) <_start\\+.*>:");
|
||||
QRegExp needle("0x([0-9a-f]+) <" + startSymbolName() + "\\+.*>:");
|
||||
if (needle.indexIn(msg) != -1) {
|
||||
//qDebug() << "STREAM: " << msg << needle.cap(1);
|
||||
sendCommand("tbreak *0x" + needle.cap(1));
|
||||
m_waitingForFirstBreakpointToBeHit = true;
|
||||
sendCommand("-exec-run");
|
||||
qq->notifyInferiorRunningRequested();
|
||||
} else {
|
||||
@@ -2080,11 +2097,14 @@ void GdbEngine::handleBreakInsert1(const GdbResultRecord &record, int index)
|
||||
|
||||
void GdbEngine::attemptBreakpointSynchronization()
|
||||
{
|
||||
// Non-lethal check for nested calls
|
||||
static bool inBreakpointSychronization = false;
|
||||
QTC_ASSERT(!inBreakpointSychronization, /**/);
|
||||
inBreakpointSychronization = true;
|
||||
|
||||
BreakHandler *handler = qq->breakHandler();
|
||||
//qDebug() << "BREAKPOINT SYNCHRONIZATION ";
|
||||
|
||||
foreach (BreakpointData *data, handler->takeRemovedBreakpoints()) {
|
||||
//qDebug() << " SYNCHRONIZATION REMOVING" << data;
|
||||
QString bpNumber = data->bpNumber;
|
||||
if (!bpNumber.trimmed().isEmpty())
|
||||
sendCommand("-break-delete " + bpNumber, BreakDelete, 0, true);
|
||||
@@ -2150,10 +2170,13 @@ void GdbEngine::attemptBreakpointSynchronization()
|
||||
}
|
||||
}
|
||||
|
||||
if (!updateNeeded) {
|
||||
if (!updateNeeded && m_waitingForBreakpointSynchronizationToContinue) {
|
||||
m_waitingForBreakpointSynchronizationToContinue = false;
|
||||
// we continue the execution
|
||||
continueInferior();
|
||||
}
|
||||
|
||||
inBreakpointSychronization = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3441,8 +3464,6 @@ void GdbEngine::handleDumpCustomValue1(const GdbResultRecord &record,
|
||||
&& msg.startsWith("The program being debugged stopped while")
|
||||
&& msg.contains("qDumpObjectData440")) {
|
||||
// Fake full stop
|
||||
sendCommand("-file-list-exec-source-files", GdbQuerySources);
|
||||
sendCommand("-break-list", BreakList);
|
||||
sendCommand("p 0", GdbAsyncOutput2); // dummy
|
||||
return;
|
||||
}
|
||||
@@ -3924,55 +3945,60 @@ void GdbEngine::tryLoadCustomDumpers()
|
||||
return;
|
||||
|
||||
PENDING_DEBUG("TRY LOAD CUSTOM DUMPERS");
|
||||
m_dataDumperState = DataDumperLoadTried;
|
||||
m_dataDumperState = DataDumperUnavailable;
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
QString lib = q->m_buildDir + "/qtc-gdbmacros/libgdbmacros.so";
|
||||
if (QFileInfo(lib).isExecutable()) {
|
||||
if (QFileInfo(lib).exists()) {
|
||||
m_dataDumperState = DataDumperLoadTried;
|
||||
//sendCommand("p dlopen");
|
||||
QString flag = QString::number(RTLD_NOW);
|
||||
sendSynchronizedCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
|
||||
sendCommand("sharedlibrary libc"); // for malloc
|
||||
sendCommand("sharedlibrary libdl"); // for dlopen
|
||||
sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
|
||||
WatchDumpCustomSetup);
|
||||
// some older systems like CentOS 4.6 prefer this:
|
||||
sendSynchronizedCommand("call (void)__dlopen(\"" + lib + "\", " + flag + ")",
|
||||
sendCommand("call (void)__dlopen(\"" + lib + "\", " + flag + ")",
|
||||
WatchDumpCustomSetup);
|
||||
sendSynchronizedCommand("sharedlibrary " + dotEscape(lib));
|
||||
} else {
|
||||
qDebug() << "DEBUG HELPER LIBRARY IS NOT USABLE: "
|
||||
<< lib << QFileInfo(lib).isExecutable();
|
||||
sendCommand("sharedlibrary " + dotEscape(lib));
|
||||
}
|
||||
#endif
|
||||
#if defined(Q_OS_MAC)
|
||||
QString lib = q->m_buildDir + "/qtc-gdbmacros/libgdbmacros.dylib";
|
||||
if (QFileInfo(lib).isExecutable()) {
|
||||
//sendCommand("p dlopen"); // FIXME: remove me
|
||||
if (QFileInfo(lib).exists()) {
|
||||
m_dataDumperState = DataDumperLoadTried;
|
||||
sendCommand("sharedlibrary libc"); // for malloc
|
||||
sendCommand("sharedlibrary libdl"); // for dlopen
|
||||
QString flag = QString::number(RTLD_NOW);
|
||||
sendSynchronizedCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
|
||||
sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")",
|
||||
WatchDumpCustomSetup);
|
||||
sendSynchronizedCommand("sharedlibrary " + dotEscape(lib));
|
||||
} else {
|
||||
qDebug() << "DEBUG HELPER LIBRARY IS NOT USABLE: "
|
||||
<< lib << QFileInfo(lib).isExecutable();
|
||||
sendCommand("sharedlibrary " + dotEscape(lib));
|
||||
}
|
||||
#endif
|
||||
#if defined(Q_OS_WIN)
|
||||
QString lib = q->m_buildDir + "/qtc-gdbmacros/debug/gdbmacros.dll";
|
||||
if (QFileInfo(lib).exists()) {
|
||||
m_dataDumperState = DataDumperLoadTried;
|
||||
sendCommand("sharedlibrary .*"); // for LoadLibraryA
|
||||
//sendCommand("handle SIGSEGV pass stop print");
|
||||
//sendCommand("set unwindonsignal off");
|
||||
sendSynchronizedCommand("call LoadLibraryA(\"" + lib + "\")",
|
||||
sendCommand("call LoadLibraryA(\"" + lib + "\")",
|
||||
WatchDumpCustomSetup);
|
||||
sendSynchronizedCommand("sharedlibrary " + dotEscape(lib));
|
||||
} else {
|
||||
qDebug() << "DEBUG HELPER LIBRARY IS NOT USABLE: "
|
||||
<< lib << QFileInfo(lib).isExecutable();
|
||||
sendCommand("sharedlibrary " + dotEscape(lib));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_dataDumperState == DataDumperLoadTried) {
|
||||
// retreive list of dumpable classes
|
||||
sendSynchronizedCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
|
||||
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
|
||||
GdbQueryDataDumper1);
|
||||
sendSynchronizedCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2);
|
||||
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2);
|
||||
} else {
|
||||
gdbOutputAvailable("", QString("DEBUG HELPER LIBRARY IS NOT USABLE: "
|
||||
" %1 EXISTS: %2, EXECUTABLE: %3").arg(lib)
|
||||
.arg(QFileInfo(lib).exists())
|
||||
.arg(QFileInfo(lib).isExecutable()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -144,7 +144,8 @@ private:
|
||||
|
||||
bool supportsThreads() const;
|
||||
|
||||
void init(); // called by destructor
|
||||
void initializeConnections();
|
||||
void initializeVariables();
|
||||
void queryFullName(const QString &fileName, QString *fullName);
|
||||
QString fullName(const QString &fileName);
|
||||
QString shortName(const QString &fullName);
|
||||
@@ -188,6 +189,7 @@ private:
|
||||
void handleExecRunToFunction(const GdbResultRecord &response);
|
||||
void handleInfoShared(const GdbResultRecord &response);
|
||||
void handleInfoProc(const GdbResultRecord &response);
|
||||
void handleInfoThreads(const GdbResultRecord &response);
|
||||
void handleShowVersion(const GdbResultRecord &response);
|
||||
void handleQueryPwd(const GdbResultRecord &response);
|
||||
void handleQuerySources(const GdbResultRecord &response);
|
||||
@@ -328,6 +330,10 @@ private:
|
||||
QString m_currentFrame;
|
||||
QMap<QString, QString> m_varToType;
|
||||
|
||||
bool m_waitingForBreakpointSynchronizationToContinue;
|
||||
bool m_waitingForFirstBreakpointToBeHit;
|
||||
bool m_modulesListOutdated;
|
||||
|
||||
DebuggerManager *q;
|
||||
IDebuggerManagerAccessForEngines *qq;
|
||||
};
|
||||
|
@@ -45,6 +45,8 @@
|
||||
#include <QtDesigner/QDesignerFormWindowInterface>
|
||||
#include <QtDesigner/QDesignerFormEditorInterface>
|
||||
#include <QtDesigner/QDesignerFormWindowManagerInterface>
|
||||
#include <QtDesigner/QDesignerPropertyEditorInterface>
|
||||
#include <QtDesigner/QDesignerWidgetDataBaseInterface>
|
||||
#include <qt_private/formwindowbase_p.h>
|
||||
#include <qt_private/qtresourcemodel_p.h>
|
||||
|
||||
@@ -325,3 +327,25 @@ void FormWindowEditor::activate()
|
||||
{
|
||||
m_editorWidget->activate();
|
||||
}
|
||||
|
||||
QString FormWindowEditor::contextHelpId() const
|
||||
{
|
||||
// TODO [13.2.09]: Replace this by QDesignerIntegrations context help Id
|
||||
// in the upcoming version of Qt
|
||||
QDesignerFormEditorInterface *core = FormEditorW::instance()->designerEditor();
|
||||
QObject *o = core->propertyEditor()->object();
|
||||
if (!o)
|
||||
return QString();
|
||||
const QDesignerWidgetDataBaseInterface *db = core->widgetDataBase();
|
||||
const int dbIndex = db->indexOfObject(o, true);
|
||||
if (dbIndex == -1)
|
||||
return QString();
|
||||
QString className = db->item(dbIndex)->name();
|
||||
if (className == QLatin1String("Line"))
|
||||
className = QLatin1String("QFrame");
|
||||
else if (className == QLatin1String("Spacer"))
|
||||
className = QLatin1String("QSpacerItem");
|
||||
else if (className == QLatin1String("QLayoutWidget"))
|
||||
className = QLatin1String("QLayout");
|
||||
return className;
|
||||
}
|
||||
|
@@ -63,7 +63,6 @@ class EditorWidget;
|
||||
class FormWindowEditor : public Core::IEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FormWindowEditor(const QList<int> &context,
|
||||
QDesignerFormWindowInterface *form,
|
||||
@@ -84,8 +83,9 @@ public:
|
||||
bool restoreState(const QByteArray &state);
|
||||
|
||||
// ContextInterface
|
||||
QList<int> context() const;
|
||||
QWidget *widget();
|
||||
virtual QList<int> context() const;
|
||||
virtual QWidget *widget();
|
||||
virtual QString contextHelpId() const;
|
||||
|
||||
QDesignerFormWindowInterface *formWindow() const;
|
||||
QWidget *integrationContainer();
|
||||
|
@@ -207,20 +207,20 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
QStringList arguments;
|
||||
arguments << QLatin1String("diff") << diffArgs;
|
||||
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
|
||||
command->addJob(arguments);
|
||||
command->addJob(arguments, m_settings.timeout);
|
||||
} else {
|
||||
// Files diff.
|
||||
if (!unstagedFileNames.empty()) {
|
||||
QStringList arguments;
|
||||
arguments << QLatin1String("diff") << diffArgs << QLatin1String("--") << unstagedFileNames;
|
||||
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
|
||||
command->addJob(arguments);
|
||||
command->addJob(arguments, m_settings.timeout);
|
||||
}
|
||||
if (!stagedFileNames.empty()) {
|
||||
QStringList arguments;
|
||||
arguments << QLatin1String("diff") << QLatin1String("--cached") << diffArgs << QLatin1String("--") << stagedFileNames;
|
||||
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
|
||||
command->addJob(arguments);
|
||||
command->addJob(arguments, m_settings.timeout);
|
||||
}
|
||||
}
|
||||
command->execute();
|
||||
@@ -503,7 +503,7 @@ void GitClient::executeGit(const QString &workingDirectory,
|
||||
{
|
||||
m_plugin->outputWindow()->append(formatCommand(QLatin1String(Constants::GIT_BINARY), arguments));
|
||||
GitCommand *command = createCommand(workingDirectory, editor, outputToWindow);
|
||||
command->addJob(arguments);
|
||||
command->addJob(arguments, m_settings.timeout);
|
||||
command->execute();
|
||||
}
|
||||
|
||||
|
@@ -55,8 +55,9 @@ static inline QStringList environmentToList(const ProjectExplorer::Environment &
|
||||
return ProjectExplorer::Environment::systemEnvironment().toStringList();
|
||||
}
|
||||
|
||||
GitCommand::Job::Job(const QStringList &a) :
|
||||
arguments(a)
|
||||
GitCommand::Job::Job(const QStringList &a, int t) :
|
||||
arguments(a),
|
||||
timeout(t)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -67,9 +68,9 @@ GitCommand::GitCommand(const QString &workingDirectory,
|
||||
{
|
||||
}
|
||||
|
||||
void GitCommand::addJob(const QStringList &arguments)
|
||||
void GitCommand::addJob(const QStringList &arguments, int timeout)
|
||||
{
|
||||
m_jobs.push_back(Job(arguments));
|
||||
m_jobs.push_back(Job(arguments, timeout));
|
||||
}
|
||||
|
||||
void GitCommand::execute()
|
||||
@@ -109,7 +110,7 @@ void GitCommand::run()
|
||||
qDebug() << "GitCommand::run" << j << '/' << count << m_jobs.at(j).arguments;
|
||||
|
||||
process.start(QLatin1String(Constants::GIT_BINARY), m_jobs.at(j).arguments);
|
||||
if (!process.waitForFinished()) {
|
||||
if (!process.waitForFinished(m_jobs.at(j).timeout * 1000)) {
|
||||
ok = false;
|
||||
error += QLatin1String("Error: Git timed out");
|
||||
break;
|
||||
|
@@ -49,7 +49,7 @@ public:
|
||||
ProjectExplorer::Environment &environment);
|
||||
|
||||
|
||||
void addJob(const QStringList &arguments);
|
||||
void addJob(const QStringList &arguments, int timeout);
|
||||
void execute();
|
||||
|
||||
private:
|
||||
@@ -61,9 +61,10 @@ Q_SIGNALS:
|
||||
|
||||
private:
|
||||
struct Job {
|
||||
explicit Job(const QStringList &a);
|
||||
explicit Job(const QStringList &a, int t);
|
||||
|
||||
QStringList arguments;
|
||||
int timeout;
|
||||
};
|
||||
|
||||
QStringList environment() const;
|
||||
|
@@ -38,9 +38,13 @@ namespace Git {
|
||||
namespace Constants {
|
||||
|
||||
const char * const GIT_COMMAND_LOG_EDITOR_KIND = "Git Command Log Editor";
|
||||
const char * const C_GIT_COMMAND_LOG_EDITOR = "Git Command Log Editor";
|
||||
const char * const GIT_LOG_EDITOR_KIND = "Git File Log Editor";
|
||||
const char * const C_GIT_LOG_EDITOR = "Git File Log Editor";
|
||||
const char * const GIT_BLAME_EDITOR_KIND = "Git Annotation Editor";
|
||||
const char * const C_GIT_BLAME_EDITOR = "Git Annotation Editor";
|
||||
const char * const GIT_DIFF_EDITOR_KIND = "Git Diff Editor";
|
||||
const char * const C_GIT_DIFF_EDITOR = "Git Diff Editor";
|
||||
|
||||
const char * const C_GITSUBMITEDITOR = "Git Submit Editor";
|
||||
const char * const GITSUBMITEDITOR_KIND = "Git Submit Editor";
|
||||
|
@@ -73,22 +73,22 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
VCSBase::RegularCommandOutput,
|
||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_COMMAND_LOG_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_commandlog",
|
||||
"gitlog"},
|
||||
{ VCSBase::LogOutput,
|
||||
Git::Constants::GIT_LOG_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_LOG_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_filelog",
|
||||
"gitfilelog"},
|
||||
{ VCSBase::AnnotateOutput,
|
||||
Git::Constants::GIT_BLAME_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_BLAME_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_annotation",
|
||||
"gitsannotate"},
|
||||
{ VCSBase::DiffOutput,
|
||||
Git::Constants::GIT_DIFF_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_DIFF_EDITOR,
|
||||
"text/x-patch","diff"}
|
||||
};
|
||||
|
||||
|
@@ -40,15 +40,17 @@ static const char *groupC = "Git";
|
||||
static const char *sysEnvKeyC = "SysEnv";
|
||||
static const char *pathKeyC = "Path";
|
||||
static const char *logCountKeyC = "LogCount";
|
||||
static const char *timeoutKeyC = "TimeOut";
|
||||
|
||||
enum { defaultLogCount = 10 };
|
||||
enum { defaultLogCount = 10 , defaultTimeOut = 30};
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
GitSettings::GitSettings() :
|
||||
adoptPath(false),
|
||||
logCount(defaultLogCount)
|
||||
logCount(defaultLogCount),
|
||||
timeout(defaultTimeOut)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -58,6 +60,7 @@ void GitSettings::fromSettings(QSettings *settings)
|
||||
adoptPath = settings->value(QLatin1String(sysEnvKeyC), false).toBool();
|
||||
path = settings->value(QLatin1String(pathKeyC), QString()).toString();
|
||||
logCount = settings->value(QLatin1String(logCountKeyC), defaultLogCount).toInt();
|
||||
timeout = settings->value(QLatin1String(timeoutKeyC), defaultTimeOut).toInt();
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
@@ -67,12 +70,13 @@ void GitSettings::toSettings(QSettings *settings) const
|
||||
settings->setValue(QLatin1String(sysEnvKeyC), adoptPath);
|
||||
settings->setValue(QLatin1String(pathKeyC), path);
|
||||
settings->setValue(QLatin1String(logCountKeyC), logCount);
|
||||
settings->setValue(QLatin1String(timeoutKeyC), timeout);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
bool GitSettings::equals(const GitSettings &s) const
|
||||
{
|
||||
return adoptPath == s.adoptPath && path == s.path && logCount == s.logCount;
|
||||
return adoptPath == s.adoptPath && path == s.path && logCount == s.logCount && timeout == s.timeout;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -56,6 +56,7 @@ struct GitSettings
|
||||
bool adoptPath;
|
||||
QString path;
|
||||
int logCount;
|
||||
int timeout;
|
||||
};
|
||||
|
||||
inline bool operator==(const GitSettings &p1, const GitSettings &p2)
|
||||
|
@@ -52,6 +52,7 @@ GitSettings SettingsPageWidget::settings() const
|
||||
rc.path = m_ui.pathLineEdit->text();
|
||||
rc.adoptPath = m_ui.environmentGroupBox->isChecked() && !rc.path.isEmpty();
|
||||
rc.logCount = m_ui.logCountSpinBox->value();
|
||||
rc.timeout = m_ui.timeoutSpinBox->value();
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -60,6 +61,7 @@ void SettingsPageWidget::setSettings(const GitSettings &s)
|
||||
m_ui.environmentGroupBox->setChecked(s.adoptPath);
|
||||
m_ui.pathLineEdit->setText(s.path);
|
||||
m_ui.logCountSpinBox->setValue(s.logCount);
|
||||
m_ui.timeoutSpinBox->setValue(s.timeout);
|
||||
}
|
||||
|
||||
void SettingsPageWidget::setSystemPath()
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>403</width>
|
||||
<height>183</height>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -69,10 +69,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="logFormLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="logCountLabel">
|
||||
<property name="text">
|
||||
<string>Log commit display count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="logCountSpinBox">
|
||||
<property name="toolTip">
|
||||
@@ -83,10 +87,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="logCountLabel">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="timeoutLabel">
|
||||
<property name="text">
|
||||
<string>Log commit display count:</string>
|
||||
<string>Timeout (seconds):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSpinBox">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>300</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@@ -404,6 +404,7 @@ void Qt4Project::scheduleUpdateCodeModel()
|
||||
|
||||
ProjectExplorer::ToolChain *Qt4Project::toolChain(const QString &buildConfiguration) const
|
||||
{
|
||||
if (debug)
|
||||
qDebug()<<"Qt4Project::toolChain() for buildconfiguration:"<<buildConfiguration;
|
||||
Q_UNUSED(buildConfiguration);
|
||||
ToolChain *m_test= 0;
|
||||
|
@@ -241,12 +241,17 @@ void QtVersionManager::addNewVersionsFromInstaller()
|
||||
// or NewQtVersions="qt 4.3.2=c:\\qt\\qt432=c:\\qtcreator\\mingw\\=prependToPath;
|
||||
// Duplicate entries are not added, the first new version is set as default.
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
if (!settings->contains(newQtVersionsKey))
|
||||
|
||||
if (!settings->contains(newQtVersionsKey) &&
|
||||
!settings->contains(QLatin1String("Installer/")+newQtVersionsKey))
|
||||
return;
|
||||
|
||||
// qDebug()<<"QtVersionManager::addNewVersionsFromInstaller()";
|
||||
|
||||
QString newVersionsValue = settings->value(newQtVersionsKey).toString();
|
||||
if (newVersionsValue.isEmpty())
|
||||
newVersionsValue = settings->value(QLatin1String("Installer/")+newQtVersionsKey).toString();
|
||||
|
||||
QStringList newVersionsList = newVersionsValue.split(';', QString::SkipEmptyParts);
|
||||
bool defaultVersionWasReset = false;
|
||||
foreach (QString newVersion, newVersionsList) {
|
||||
@@ -281,6 +286,7 @@ void QtVersionManager::addNewVersionsFromInstaller()
|
||||
}
|
||||
}
|
||||
settings->remove(newQtVersionsKey);
|
||||
settings->remove(QLatin1String("Installer/")+newQtVersionsKey);
|
||||
updateUniqueIdToIndexMap();
|
||||
}
|
||||
|
||||
|
@@ -70,13 +70,6 @@ void QtScriptEditorActionHandler::createActions()
|
||||
}
|
||||
|
||||
|
||||
void QtScriptEditorActionHandler::updateActions(UpdateMode um)
|
||||
{
|
||||
TextEditor::TextEditorActionHandler::updateActions(um);
|
||||
if (m_runAction)
|
||||
m_runAction->setEnabled(um != NoEditor);
|
||||
}
|
||||
|
||||
void QtScriptEditorActionHandler::run()
|
||||
{
|
||||
typedef Core::ScriptManager::Stack Stack;
|
||||
|
@@ -48,7 +48,6 @@ public:
|
||||
|
||||
private:
|
||||
virtual void createActions();
|
||||
virtual void updateActions(UpdateMode um);
|
||||
|
||||
private slots:
|
||||
void run();
|
||||
|
@@ -103,23 +103,23 @@ const char * const SubversionPlugin::DESCRIBE = "Subversion.Describe";
|
||||
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
VCSBase::RegularCommandOutput,
|
||||
"Subversion Command Log Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion Command Log Editor", // kind
|
||||
"Subversion Command Log Editor", // context
|
||||
"application/vnd.nokia.text.scs_svn_commandlog",
|
||||
"scslog"},
|
||||
{ VCSBase::LogOutput,
|
||||
"Subversion File Log Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion File Log Editor", // kind
|
||||
"Subversion File Log Editor", // context
|
||||
"application/vnd.nokia.text.scs_svn_filelog",
|
||||
"scsfilelog"},
|
||||
{ VCSBase::AnnotateOutput,
|
||||
"Subversion Annotation Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion Annotation Editor", // kind
|
||||
"Subversion Annotation Editor", // context
|
||||
"application/vnd.nokia.text.scs_svn_annotation",
|
||||
"scsannotate"},
|
||||
{ VCSBase::DiffOutput,
|
||||
"Subversion Diff Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion Diff Editor", // kind
|
||||
"Subversion Diff Editor", // context
|
||||
"text/x-patch","diff"}
|
||||
};
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
**
|
||||
** 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
|
||||
** 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:
|
||||
**
|
||||
@@ -91,8 +91,8 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context,
|
||||
|
||||
m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context);
|
||||
|
||||
connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)),
|
||||
this, SLOT(updateCurrentEditor(Core::IContext *)));
|
||||
connect(Core::ICore::instance()->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
this, SLOT(updateCurrentEditor(Core::IEditor *)));
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::setupActions(BaseTextEditor *editor)
|
||||
@@ -282,48 +282,30 @@ QAction *TextEditorActionHandler::registerNewAction(const QString &id,
|
||||
|
||||
TextEditorActionHandler::UpdateMode TextEditorActionHandler::updateMode() const
|
||||
{
|
||||
if (!m_currentEditor)
|
||||
return NoEditor;
|
||||
Q_ASSERT(m_currentEditor != 0);
|
||||
return m_currentEditor->file()->isReadOnly() ? ReadOnlyMode : WriteMode;
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::updateActions()
|
||||
{
|
||||
if (!m_currentEditor || !m_initialized)
|
||||
return;
|
||||
updateActions(updateMode());
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::updateActions(UpdateMode um)
|
||||
{
|
||||
if (!m_initialized)
|
||||
return;
|
||||
m_pasteAction->setEnabled(um != NoEditor);
|
||||
m_selectAllAction->setEnabled(um != NoEditor);
|
||||
m_gotoAction->setEnabled(um != NoEditor);
|
||||
m_selectEncodingAction->setEnabled(um != NoEditor);
|
||||
m_printAction->setEnabled(um != NoEditor);
|
||||
m_formatAction->setEnabled((m_optionalActions & Format) && um != NoEditor);
|
||||
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection) && um != NoEditor);
|
||||
m_collapseAction->setEnabled(um != NoEditor);
|
||||
m_expandAction->setEnabled(um != NoEditor);
|
||||
m_unCollapseAllAction->setEnabled((m_optionalActions & UnCollapseAll) && um != NoEditor);
|
||||
m_decreaseFontSizeAction->setEnabled(um != NoEditor);
|
||||
m_increaseFontSizeAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockStartAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockStartWithSelectionAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockEndAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockEndWithSelectionAction->setEnabled(um != NoEditor);
|
||||
m_selectBlockUpAction->setEnabled(um != NoEditor);
|
||||
m_selectBlockDownAction->setEnabled(um != NoEditor);
|
||||
m_moveLineUpAction->setEnabled(um != NoEditor);
|
||||
m_moveLineDownAction->setEnabled(um != NoEditor);
|
||||
m_pasteAction->setEnabled(um != ReadOnlyMode);
|
||||
m_formatAction->setEnabled((m_optionalActions & Format) && um != ReadOnlyMode);
|
||||
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection) && um != ReadOnlyMode);
|
||||
m_moveLineUpAction->setEnabled(um != ReadOnlyMode);
|
||||
m_moveLineDownAction->setEnabled(um != ReadOnlyMode);
|
||||
|
||||
m_visualizeWhitespaceAction->setEnabled(um != NoEditor);
|
||||
if (m_currentEditor)
|
||||
m_formatAction->setEnabled((m_optionalActions & Format));
|
||||
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection));
|
||||
m_unCollapseAllAction->setEnabled((m_optionalActions & UnCollapseAll));
|
||||
m_visualizeWhitespaceAction->setChecked(m_currentEditor->displaySettings().m_visualizeWhitespace);
|
||||
m_cleanWhitespaceAction->setEnabled(um != NoEditor);
|
||||
if (m_textWrappingAction) {
|
||||
m_textWrappingAction->setEnabled(um != NoEditor);
|
||||
if (m_currentEditor)
|
||||
m_textWrappingAction->setChecked(m_currentEditor->displaySettings().m_textWrapping);
|
||||
}
|
||||
|
||||
@@ -349,8 +331,9 @@ void TextEditorActionHandler::updateCopyAction()
|
||||
const bool hasCopyableText = m_currentEditor && m_currentEditor->textCursor().hasSelection();
|
||||
if (m_cutAction)
|
||||
m_cutAction->setEnabled(hasCopyableText && updateMode() == WriteMode);
|
||||
if (m_copyAction)
|
||||
if (m_copyAction) {
|
||||
m_copyAction->setEnabled(hasCopyableText);
|
||||
}
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::gotoAction()
|
||||
@@ -422,37 +405,19 @@ FUNCTION(selectBlockDown)
|
||||
FUNCTION(moveLineUp)
|
||||
FUNCTION(moveLineDown)
|
||||
|
||||
void TextEditorActionHandler::updateCurrentEditor(Core::IContext *object)
|
||||
void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
|
||||
{
|
||||
do {
|
||||
if (!object) {
|
||||
if (!m_currentEditor)
|
||||
m_currentEditor = 0;
|
||||
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
m_currentEditor = 0;
|
||||
break;
|
||||
}
|
||||
BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(object->widget());
|
||||
if (!editor) {
|
||||
if (!m_currentEditor)
|
||||
return;
|
||||
BaseTextEditor *baseEditor = qobject_cast<BaseTextEditor *>(editor->widget());
|
||||
|
||||
m_currentEditor = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (editor == m_currentEditor)
|
||||
return;
|
||||
|
||||
if (editor->actionHack() != this) {
|
||||
m_currentEditor = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
m_currentEditor = editor;
|
||||
|
||||
} while (false);
|
||||
if (baseEditor && baseEditor->actionHack() == this) {
|
||||
m_currentEditor = baseEditor;
|
||||
updateActions();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -78,7 +78,7 @@ protected:
|
||||
QAction *registerNewAction(const QString &id, QObject *receiver, const char *slot,
|
||||
const QString &title = QString());
|
||||
|
||||
enum UpdateMode { NoEditor , ReadOnlyMode, WriteMode };
|
||||
enum UpdateMode { ReadOnlyMode, WriteMode };
|
||||
UpdateMode updateMode() const;
|
||||
|
||||
virtual void createActions();
|
||||
@@ -114,7 +114,7 @@ private slots:
|
||||
void selectBlockDown();
|
||||
void moveLineUp();
|
||||
void moveLineDown();
|
||||
void updateCurrentEditor(Core::IContext *object);
|
||||
void updateCurrentEditor(Core::IEditor *editor);
|
||||
|
||||
private:
|
||||
QAction *m_undoAction;
|
||||
|
@@ -56,7 +56,7 @@ BaseVCSEditorFactoryPrivate::BaseVCSEditorFactoryPrivate(const VCSBaseEditorPara
|
||||
m_type(t),
|
||||
m_kind(QLatin1String(t->kind)),
|
||||
m_mimeTypes(QStringList(QLatin1String(t->mimeType))),
|
||||
m_editorHandler(new TextEditor::TextEditorActionHandler(t->kind))
|
||||
m_editorHandler(new TextEditor::TextEditorActionHandler(t->context))
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user