Merge commit 'origin/master'

This commit is contained in:
dt
2009-01-08 18:30:23 +01:00
14 changed files with 394 additions and 196 deletions

View File

@@ -1,9 +1,9 @@
unix { unix {
QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/doc/html $$(QTDIR)/tools/qdoc3/qdoc3 QDOC = SRCDIR=$$PWD OUTDIR=$$OUT_PWD/doc/html $$(QTDIR)/tools/qdoc3/qdoc3
HELPGENERATOR = qhelpgenerator HELPGENERATOR = $$(QTDIR)/bin/qhelpgenerator
} else { } else {
QDOC = $$(QTDIR)\tools\qdoc3\release\qdoc3.exe QDOC = $$(QTDIR)\tools\qdoc3\release\qdoc3.exe
HELPGENERATOR = qhelpgenerator HELPGENERATOR = $$(QTDIR)\bin\qhelpgenerator.exe
} }
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp

View File

@@ -68,6 +68,7 @@ Parser::Parser(TranslationUnit *unit)
_tokenIndex(1), _tokenIndex(1),
_templateArguments(0), _templateArguments(0),
_qtMocRunEnabled(false), _qtMocRunEnabled(false),
_objcEnabled(false),
_inFunctionBody(false) _inFunctionBody(false)
{ } { }
@@ -2532,7 +2533,16 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
case T_SLOT: case T_SLOT:
return parseQtMethod(node); return parseQtMethod(node);
case T_AT_ENCODE:
case T_AT_PROTOCOL:
case T_AT_SELECTOR:
case T_AT_STRING_LITERAL:
return parseObjCExpression(node);
default: { default: {
if (_objcEnabled && LA() == T_LBRACKET)
return parseObjCExpression(node);
unsigned startOfName = cursor(); unsigned startOfName = cursor();
NameAST *name = 0; NameAST *name = 0;
if (parseName(name)) { if (parseName(name)) {
@@ -3296,17 +3306,17 @@ bool Parser::parseObjCClassDeclaration(DeclarationAST *&node)
return true; return true;
} }
bool Parser::parseObjCInterfaceDeclaration(DeclarationAST *&node) bool Parser::parseObjCInterfaceDeclaration(DeclarationAST *&)
{ {
if (LA() != T_AT_INTERFACE) if (LA() != T_AT_INTERFACE)
return false; return false;
unsigned interface_token = consumeToken(); /*unsigned interface_token = */ consumeToken();
unsigned interface_name_token = 0; unsigned interface_name_token = 0;
match(T_IDENTIFIER, &interface_name_token); match(T_IDENTIFIER, &interface_name_token);
if (LA() == T_LPAREN) { if (LA() == T_LPAREN) {
// category interface // category interface
unsigned lparen_token = consumeToken(); /*unsigned lparen_token = */ consumeToken();
unsigned catagory_name_token = 0; unsigned catagory_name_token = 0;
if (LA() == T_IDENTIFIER) if (LA() == T_IDENTIFIER)
catagory_name_token = consumeToken(); catagory_name_token = consumeToken();
@@ -3335,27 +3345,27 @@ bool Parser::parseObjCInterfaceDeclaration(DeclarationAST *&node)
return false; return false;
} }
bool Parser::parseObjCProtocolDeclaration(DeclarationAST *&node) bool Parser::parseObjCProtocolDeclaration(DeclarationAST *&)
{ {
return false; return false;
} }
bool Parser::parseObjCEndDeclaration(DeclarationAST *&node) bool Parser::parseObjCEndDeclaration(DeclarationAST *&)
{ {
return false; return false;
} }
bool Parser::parseObjCAliasDeclaration(DeclarationAST *&node) bool Parser::parseObjCAliasDeclaration(DeclarationAST *&)
{ {
return false; return false;
} }
bool Parser::parseObjCPropertySynthesize(DeclarationAST *&node) bool Parser::parseObjCPropertySynthesize(DeclarationAST *&)
{ {
return false; return false;
} }
bool Parser::parseObjCPropertyDynamic(DeclarationAST *&node) bool Parser::parseObjCPropertyDynamic(DeclarationAST *&)
{ {
return false; return false;
} }
@@ -3376,6 +3386,7 @@ bool Parser::parseObjCIdentifierList(IdentifierListAST *&node)
*it = id; *it = id;
} }
} }
return true;
} }
return false; return false;
} }
@@ -3418,15 +3429,16 @@ bool Parser::parseObjCInterfaceMemberDeclaration()
default: { default: {
DeclarationAST *declaration = 0; DeclarationAST *declaration = 0;
parseDeclaration(declaration); if (parseDeclaration(declaration))
return true;
} // default } // default
} // switch } // switch
return true; return false;
} }
bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&ast) bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&)
{ {
return false; return false;
} }
@@ -3437,8 +3449,7 @@ bool Parser::parseObjCMethodPrototype()
return false; return false;
// instance or class method? // instance or class method?
unsigned method_type_token = consumeToken(); /*unsigned method_type_token = */ consumeToken();
SpecifierAST *attributes = 0, **attr = &attributes; SpecifierAST *attributes = 0, **attr = &attributes;
while (parseAttributeSpecifier(*attr)) while (parseAttributeSpecifier(*attr))
@@ -3447,6 +3458,135 @@ bool Parser::parseObjCMethodPrototype()
return false; return false;
} }
bool Parser::parseObjCExpression(ExpressionAST *&node)
{
switch (LA()) {
case T_LBRACKET:
return parseObjCMessageExpression(node);
case T_AT_STRING_LITERAL:
return parseObjCStringLiteral(node);
case T_AT_ENCODE:
return parseObjCEncodeExpression(node);
case T_AT_PROTOCOL:
return parseObjCProtocolExpression(node);
case T_AT_SELECTOR:
return parseObjCSelectorExpression(node);
}
return false;
}
bool Parser::parseObjCMessageExpression(ExpressionAST *&)
{
if (LA() != T_LBRACKET)
return false;
/*unsigned lbracket_token = */ consumeToken();
ExpressionAST *receiver = 0;
parseObjCMessageReceiver(receiver);
parseObjCMessageArguments();
unsigned rbracket_token = 0;
match(T_RBRACKET, &rbracket_token);
return true;
}
bool Parser::parseObjCStringLiteral(ExpressionAST *&)
{
if (LA() != T_AT_STRING_LITERAL)
return false;
do {
consumeToken();
} while (LA() == T_AT_STRING_LITERAL);
return true;
}
bool Parser::parseObjCEncodeExpression(ExpressionAST *&)
{
if (LA() != T_AT_ENCODE)
return false;
/*unsigned encode_token = */ consumeToken();
unsigned lparen_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
SpecifierAST *type_specifier = 0;
parseSimpleTypeSpecifier(type_specifier);
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseObjCProtocolExpression(ExpressionAST *&)
{
if (LA() != T_AT_PROTOCOL)
return false;
/*unsigned protocol_token = */ consumeToken();
unsigned protocol_name_token = 0, lparen_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
match(T_IDENTIFIER, &protocol_name_token);
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseObjCSelectorExpression(ExpressionAST *&)
{
if (LA() != T_AT_SELECTOR)
return false;
/*unsigned selector_token = */ consumeToken();
unsigned lparen_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
while (LA(1) == T_IDENTIFIER && LA(2) == T_COLON) {
/*unsigned identifier_token = */ consumeToken();
/*unsigned colon_token = */ consumeToken();
}
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseObjCMessageReceiver(ExpressionAST *&node)
{
// ### expression or simple-type-specifier.
return parseExpression(node);
}
bool Parser::parseObjCMessageArguments()
{
if (LA() != T_IDENTIFIER && LA() != T_COLON)
return false;
unsigned selector_name_token = 0;
if (LA() == T_IDENTIFIER)
selector_name_token = consumeToken();
if (LA() == T_COLON) {
/*unsigned colon_token = */ consumeToken();
ExpressionAST *expr = 0;
parseAssignmentExpression(expr);
while ((LA() == T_IDENTIFIER && LA(2) == T_COLON) || LA() == T_COLON) {
if (LA() == T_IDENTIFIER)
consumeToken();
if (LA() == T_COLON)
consumeToken();
parseAssignmentExpression(expr);
}
while (LA() == T_COMMA) {
consumeToken();
parseAssignmentExpression(expr);
}
}
return true;
}
CPLUSPLUS_END_NAMESPACE CPLUSPLUS_END_NAMESPACE

View File

@@ -214,13 +214,23 @@ public:
bool parseObjCIdentifierList(IdentifierListAST *&node); bool parseObjCIdentifierList(IdentifierListAST *&node);
bool parseObjCPropertyDeclaration(DeclarationAST *&ast); bool parseObjCPropertyDeclaration(DeclarationAST *&node);
bool parseObjCProtocolRefs(); bool parseObjCProtocolRefs();
bool parseObjCClassInstanceVariables(); bool parseObjCClassInstanceVariables();
bool parseObjCInterfaceMemberDeclaration(); bool parseObjCInterfaceMemberDeclaration();
bool parseObjCInterfaceDeclList(); bool parseObjCInterfaceDeclList();
bool parseObjCMethodPrototype(); bool parseObjCMethodPrototype();
bool parseObjCExpression(ExpressionAST *&node);
bool parseObjCMessageExpression(ExpressionAST *&node);
bool parseObjCStringLiteral(ExpressionAST *&node);
bool parseObjCEncodeExpression(ExpressionAST *&node);
bool parseObjCProtocolExpression(ExpressionAST *&node);
bool parseObjCSelectorExpression(ExpressionAST *&node);
bool parseObjCMessageReceiver(ExpressionAST *&node);
bool parseObjCMessageArguments();
// Qt MOC run // Qt MOC run
bool parseQtMethod(ExpressionAST *&node); bool parseQtMethod(ExpressionAST *&node);
@@ -245,8 +255,8 @@ private:
bool switchTemplateArguments(bool templateArguments); bool switchTemplateArguments(bool templateArguments);
bool blockErrors(bool block); bool blockErrors(bool block);
inline const Token &tok() const inline const Token &tok(int i = 1) const
{ return _translationUnit->tokenAt(_tokenIndex); } { return _translationUnit->tokenAt(_tokenIndex + i - 1); }
inline int LA(int n = 1) const inline int LA(int n = 1) const
{ return _translationUnit->tokenKind(_tokenIndex + n - 1); } { return _translationUnit->tokenKind(_tokenIndex + n - 1); }
@@ -267,6 +277,7 @@ private:
unsigned _tokenIndex; unsigned _tokenIndex;
bool _templateArguments: 1; bool _templateArguments: 1;
bool _qtMocRunEnabled: 1; bool _qtMocRunEnabled: 1;
bool _objcEnabled: 1;
bool _inFunctionBody: 1; bool _inFunctionBody: 1;
private: private:

View File

@@ -723,7 +723,7 @@ bool CppCodeCompletion::completeScope(const QList<TypeOfExpression::Result> &res
return false; // nothing to do. return false; // nothing to do.
// Search for a class or a namespace. // Search for a class or a namespace.
TypeOfExpression::Result result(FullySpecifiedType(), 0); TypeOfExpression::Result result;
foreach (result, results) { foreach (result, results) {
FullySpecifiedType ty = result.first; FullySpecifiedType ty = result.first;
@@ -751,8 +751,7 @@ bool CppCodeCompletion::completeScope(const QList<TypeOfExpression::Result> &res
} else if (Symbol *symbol = result.second) { } else if (Symbol *symbol = result.second) {
if (symbol->isTypedef()) { if (symbol->isTypedef()) {
ResolveClass resolveClass; ResolveClass resolveClass;
const QList<Symbol *> candidates = resolveClass(result, const QList<Symbol *> candidates = resolveClass(result, context);
context);
completeClass(candidates, context); completeClass(candidates, context);
} }
} }

View File

@@ -36,10 +36,12 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QFile> #include <QtCore/QFile>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QProcess>
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include <QtCore/QStack> #include <QtCore/QStack>
#include <QtGui/QApplication>
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <QtGui/QPlainTextEdit> #include <QtGui/QPlainTextEdit>
@@ -90,6 +92,7 @@ enum SubMode
RegisterSubMode, RegisterSubMode,
ChangeSubMode, ChangeSubMode,
DeleteSubMode, DeleteSubMode,
FilterSubMode,
ZSubMode, ZSubMode,
}; };
@@ -98,7 +101,7 @@ enum SubSubMode
NoSubSubMode, NoSubSubMode,
FtSubSubMode, // used for f, F, t, T FtSubSubMode, // used for f, F, t, T
MarkSubSubMode, // used for m MarkSubSubMode, // used for m
BackTickSubSubMode, // used for ` BackTickSubSubMode, // used for `
TickSubSubMode // used for ' TickSubSubMode // used for '
}; };
@@ -146,11 +149,11 @@ private:
static int control(int key) { return key + 256; } static int control(int key) { return key + 256; }
void init(); void init();
void handleKey(int key, const QString &text); bool handleKey(int key, const QString &text);
void handleInsertMode(int key, const QString &text); bool handleInsertMode(int key, const QString &text);
void handleCommandMode(int key, const QString &text); bool handleCommandMode(int key, const QString &text);
void handleRegisterMode(int key, const QString &text); bool handleRegisterMode(int key, const QString &text);
void handleMiniBufferModes(int key, const QString &text); bool handleMiniBufferModes(int key, const QString &text);
void finishMovement(const QString &text = QString()); void finishMovement(const QString &text = QString());
void search(const QString &needle, bool forward); void search(const QString &needle, bool forward);
@@ -186,7 +189,8 @@ private:
public: public:
void enterInsertMode(); void enterInsertMode();
void enterCommandMode(); void enterCommandMode();
void showMessage(const QString &msg); void showRedMessage(const QString &msg);
void showBlackMessage(const QString &msg);
void updateMiniBuffer(); void updateMiniBuffer();
void updateSelection(); void updateSelection();
void quit(); void quit();
@@ -214,7 +218,7 @@ private:
bool isSearchMode() const bool isSearchMode() const
{ return m_mode == SearchForwardMode || m_mode == SearchBackwardMode; } { return m_mode == SearchForwardMode || m_mode == SearchBackwardMode; }
int m_gflag; // whether current command started with 'g' int m_gflag; // whether current command started with 'g'
QString m_commandBuffer; QString m_commandBuffer;
QString m_currentFileName; QString m_currentFileName;
QString m_currentMessage; QString m_currentMessage;
@@ -223,10 +227,12 @@ private:
QString m_lastInsertion; QString m_lastInsertion;
// undo handling // undo handling
void recordOperation(const EditOperation &op);
void recordInsert(int position, const QString &data); void recordInsert(int position, const QString &data);
void recordRemove(int position, const QString &data); void recordRemove(int position, const QString &data);
void recordRemove(int position, int length); void recordRemove(int position, int length);
void recordMove(int position, int nestedCount); void recordMove(int position, int nestedCount);
void removeSelectedText(QTextCursor &tc);
void undo(); void undo();
void redo(); void redo();
QStack<EditOperation> m_undoStack; QStack<EditOperation> m_undoStack;
@@ -299,7 +305,7 @@ bool FakeVimHandler::Private::eventFilter(QObject *ob, QEvent *ev)
key += 32; key += 32;
if ((keyEvent->modifiers() & Qt::ControlModifier) != 0) if ((keyEvent->modifiers() & Qt::ControlModifier) != 0)
key += 256; key += 256;
handleKey(key, keyEvent->text()); bool handled = handleKey(key, keyEvent->text());
// We fake vi-style end-of-line behaviour // We fake vi-style end-of-line behaviour
m_fakeEnd = (atEol() && m_mode == CommandMode); m_fakeEnd = (atEol() && m_mode == CommandMode);
@@ -309,29 +315,42 @@ bool FakeVimHandler::Private::eventFilter(QObject *ob, QEvent *ev)
EDITOR(setTextCursor(m_tc)); EDITOR(setTextCursor(m_tc));
EDITOR(ensureCursorVisible()); EDITOR(ensureCursorVisible());
return true; return handled;
} }
void FakeVimHandler::Private::handleKey(int key, const QString &text) bool FakeVimHandler::Private::handleKey(int key, const QString &text)
{ {
//qDebug() << "KEY: " << key << text << "POS: " << m_tc.position(); //qDebug() << "KEY: " << key << text << "POS: " << m_tc.position();
//qDebug() << "\nUNDO: " << m_undoStack << "\nREDO: " << m_redoStack; //qDebug() << "\nUNDO: " << m_undoStack << "\nREDO: " << m_redoStack;
if (m_mode == InsertMode) if (m_mode == InsertMode)
handleInsertMode(key, text); return handleInsertMode(key, text);
else if (m_mode == CommandMode) if (m_mode == CommandMode)
handleCommandMode(key, text); return handleCommandMode(key, text);
else if (m_mode == ExMode || m_mode == SearchForwardMode if (m_mode == ExMode || m_mode == SearchForwardMode
|| m_mode == SearchBackwardMode) || m_mode == SearchBackwardMode)
handleMiniBufferModes(key, text); return handleMiniBufferModes(key, text);
return false;
} }
void FakeVimHandler::Private::finishMovement(const QString &dotCommand) void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
{ {
if (m_submode == FilterSubMode) {
int beginLine = lineForPosition(m_tc.anchor());
int endLine = lineForPosition(m_tc.position());
m_tc.setPosition(qMin(m_tc.anchor(), m_tc.position()), MoveAnchor);
m_mode = ExMode;
m_commandBuffer = QString(".,+%1!").arg(qAbs(endLine - beginLine));
m_commandHistory.append(QString());
m_commandHistoryIndex = m_commandHistory.size() - 1;
updateMiniBuffer();
return;
}
if (m_submode == ChangeSubMode) { if (m_submode == ChangeSubMode) {
if (!dotCommand.isEmpty()) if (!dotCommand.isEmpty())
m_dotCommand = "c" + dotCommand; m_dotCommand = "c" + dotCommand;
m_registers[m_register] = m_tc.selectedText(); m_registers[m_register] = m_tc.selectedText();
m_tc.removeSelectedText(); removeSelectedText(m_tc);
m_mode = InsertMode; m_mode = InsertMode;
m_submode = NoSubMode; m_submode = NoSubMode;
} else if (m_submode == DeleteSubMode) { } else if (m_submode == DeleteSubMode) {
@@ -339,7 +358,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
m_dotCommand = "d" + dotCommand; m_dotCommand = "d" + dotCommand;
recordRemove(qMin(m_tc.position(), m_tc.anchor()), m_tc.selectedText()); recordRemove(qMin(m_tc.position(), m_tc.anchor()), m_tc.selectedText());
m_registers[m_register] = m_tc.selectedText(); m_registers[m_register] = m_tc.selectedText();
m_tc.removeSelectedText(); removeSelectedText(m_tc);
m_submode = NoSubMode; m_submode = NoSubMode;
if (atEol()) if (atEol())
m_tc.movePosition(Left, MoveAnchor, 1); m_tc.movePosition(Left, MoveAnchor, 1);
@@ -361,8 +380,10 @@ void FakeVimHandler::Private::updateSelection()
QTextEdit::ExtraSelection sel; QTextEdit::ExtraSelection sel;
sel.cursor = m_tc; sel.cursor = m_tc;
sel.format = m_tc.blockCharFormat(); sel.format = m_tc.blockCharFormat();
sel.format.setFontWeight(QFont::Bold); //sel.format.setFontWeight(QFont::Bold);
sel.format.setFontUnderline(true); //sel.format.setFontUnderline(true);
sel.format.setForeground(Qt::white);
sel.format.setBackground(Qt::black);
int cursorPos = m_tc.position(); int cursorPos = m_tc.position();
int anchorPos = m_marks['<']; int anchorPos = m_marks['<'];
//qDebug() << "POS: " << cursorPos << " ANCHOR: " << anchorPos; //qDebug() << "POS: " << cursorPos << " ANCHOR: " << anchorPos;
@@ -408,20 +429,22 @@ void FakeVimHandler::Private::updateMiniBuffer()
if (!m_currentMessage.isEmpty()) { if (!m_currentMessage.isEmpty()) {
msg = m_currentMessage; msg = m_currentMessage;
m_currentMessage.clear(); m_currentMessage.clear();
} else if (m_visualMode == VisualCharMode) { } else if (m_mode == CommandMode && m_visualMode != NoVisualMode) {
msg = "-- VISUAL --"; if (m_visualMode == VisualCharMode) {
} else if (m_visualMode == VisualLineMode) { msg = "-- VISUAL --";
msg = "-- VISUAL LINE --"; } else if (m_visualMode == VisualLineMode) {
} else if (m_visualMode == VisualBlockMode) { msg = "-- VISUAL LINE --";
msg = "-- VISUAL BLOCK --"; } else if (m_visualMode == VisualBlockMode) {
msg = "-- VISUAL BLOCK --";
}
} else if (m_mode == InsertMode) { } else if (m_mode == InsertMode) {
msg = "-- INSERT --"; msg = "-- INSERT --";
} else { } else {
if (m_mode == SearchForwardMode) if (m_mode == SearchForwardMode)
msg += '/'; msg += '/';
else if (m_mode == SearchBackwardMode) else if (m_mode == SearchBackwardMode)
msg += '?'; msg += '?';
else if (m_mode == ExMode) else if (m_mode == ExMode)
msg += ':'; msg += ':';
foreach (QChar c, m_commandBuffer) { foreach (QChar c, m_commandBuffer) {
if (c.unicode() < 32) { if (c.unicode() < 32) {
@@ -431,6 +454,8 @@ void FakeVimHandler::Private::updateMiniBuffer()
msg += c; msg += c;
} }
} }
if (!msg.isEmpty() && m_mode != CommandMode)
msg += QChar(10073); // '|'; // FIXME: Use a real "cursor"
} }
emit q->commandBufferChanged(msg); emit q->commandBufferChanged(msg);
@@ -449,14 +474,21 @@ void FakeVimHandler::Private::updateMiniBuffer()
emit q->statusDataChanged(status); emit q->statusDataChanged(status);
} }
void FakeVimHandler::Private::showMessage(const QString &msg) void FakeVimHandler::Private::showRedMessage(const QString &msg)
{ {
//qDebug() << "MSG: " << msg; //qDebug() << "MSG: " << msg;
m_currentMessage = msg; m_currentMessage = msg;
updateMiniBuffer(); updateMiniBuffer();
} }
void FakeVimHandler::Private::handleCommandMode(int key, const QString &text) void FakeVimHandler::Private::showBlackMessage(const QString &msg)
{
//qDebug() << "MSG: " << msg;
m_commandBuffer = msg;
updateMiniBuffer();
}
bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
{ {
Q_UNUSED(text) Q_UNUSED(text)
@@ -498,7 +530,7 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
moveToFirstNonBlankOnLine(); moveToFirstNonBlankOnLine();
finishMovement(); finishMovement();
} else { } else {
showMessage(tr("E20: Mark '%1' not set").arg(text)); showRedMessage(tr("E20: Mark '%1' not set").arg(text));
} }
m_subsubmode = NoSubSubMode; m_subsubmode = NoSubSubMode;
} else if (key >= '0' && key <= '9') { } else if (key >= '0' && key <= '9') {
@@ -532,6 +564,15 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
m_tc.movePosition(StartOfLine, KeepAnchor); m_tc.movePosition(StartOfLine, KeepAnchor);
m_tc.movePosition(Right, KeepAnchor, qMin(count(), rightDist()) - 1); m_tc.movePosition(Right, KeepAnchor, qMin(count(), rightDist()) - 1);
finishMovement(); finishMovement();
} else if (key == '!' && m_visualMode == NoVisualMode) {
m_submode = FilterSubMode;
} else if (key == '!' && m_visualMode == VisualLineMode) {
m_mode = ExMode;
m_marks['>'] = m_tc.position();
m_commandBuffer = "'<,'>!";
m_commandHistory.append(QString());
m_commandHistoryIndex = m_commandHistory.size() - 1;
updateMiniBuffer();
} else if (key == '"') { } else if (key == '"') {
m_submode = RegisterSubMode; m_submode = RegisterSubMode;
} else if (key == Key_Return) { } else if (key == Key_Return) {
@@ -580,7 +621,7 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
int beginLine = lineForPosition(m_marks['<']); int beginLine = lineForPosition(m_marks['<']);
int endLine = lineForPosition(m_marks['>']); int endLine = lineForPosition(m_marks['>']);
m_tc = selectRange(beginLine, endLine); m_tc = selectRange(beginLine, endLine);
m_tc.removeSelectedText(); removeSelectedText(m_tc);
} else if (key == 'D') { } else if (key == 'D') {
m_submode = DeleteSubMode; m_submode = DeleteSubMode;
m_tc.movePosition(Down, KeepAnchor, qMax(count() - 1, 0)); m_tc.movePosition(Down, KeepAnchor, qMax(count() - 1, 0));
@@ -668,16 +709,18 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
m_tc.movePosition(StartOfLine, MoveAnchor); m_tc.movePosition(StartOfLine, MoveAnchor);
m_tc.movePosition(Left, MoveAnchor, 1); m_tc.movePosition(Left, MoveAnchor, 1);
m_tc.insertText("\n"); m_tc.insertText("\n");
} else if (key == 'p') { } else if (key == 'p' || key == 'P') {
QString text = m_registers[m_register]; QString text = m_registers[m_register];
int n = text.count(QChar(ParagraphSeparator)); int n = text.count(QChar(ParagraphSeparator));
if (n > 0) { if (n > 0) {
m_tc.movePosition(StartOfLine); m_tc.movePosition(StartOfLine);
m_tc.movePosition(Down); if (key == 'p')
m_tc.movePosition(Down);
m_tc.insertText(text); m_tc.insertText(text);
m_tc.movePosition(Up, MoveAnchor, n); m_tc.movePosition(Up, MoveAnchor, n);
} else { } else {
m_tc.movePosition(Right); if (key == 'p')
m_tc.movePosition(Right);
m_tc.insertText(text); m_tc.insertText(text);
m_tc.movePosition(Left); m_tc.movePosition(Left);
} }
@@ -692,6 +735,10 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
m_subsubdata = key; m_subsubdata = key;
} else if (key == 'u') { } else if (key == 'u') {
undo(); undo();
} else if (key == 'U') {
// FIXME: this is non-vim, but as Ctrl-R is taken globally
// we have a substitute here
redo();
} else if (key == 'v') { } else if (key == 'v') {
enterVisualMode(VisualCharMode); enterVisualMode(VisualCharMode);
} else if (key == 'V') { } else if (key == 'V') {
@@ -741,11 +788,13 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
if (m_visualMode != NoVisualMode) if (m_visualMode != NoVisualMode)
leaveVisualMode(); leaveVisualMode();
} else { } else {
qDebug() << "Ignored" << key << text; qDebug() << "Ignored in command mode: " << key << text;
} return false;
}
return true;
} }
void FakeVimHandler::Private::handleInsertMode(int key, const QString &text) bool FakeVimHandler::Private::handleInsertMode(int key, const QString &text)
{ {
if (key == Key_Escape) { if (key == Key_Escape) {
// start with '1', as one instance was already physically inserted // start with '1', as one instance was already physically inserted
@@ -789,14 +838,17 @@ void FakeVimHandler::Private::handleInsertMode(int key, const QString &text)
m_lastInsertion.clear(); m_lastInsertion.clear();
} else if (key == Key_Backspace) { } else if (key == Key_Backspace) {
finishMovement(); finishMovement();
} else { } else if (!text.isEmpty()) {
m_lastInsertion.append(text); m_lastInsertion.append(text);
m_tc.insertText(text); m_tc.insertText(text);
} else {
return false;
} }
updateMiniBuffer(); updateMiniBuffer();
return true;
} }
void FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text) bool FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text)
{ {
Q_UNUSED(text) Q_UNUSED(text)
@@ -810,6 +862,11 @@ void FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text
else else
m_commandBuffer.chop(1); m_commandBuffer.chop(1);
updateMiniBuffer(); updateMiniBuffer();
} else if (key == Key_Left) {
// FIXME:
if (!m_commandBuffer.isEmpty())
m_commandBuffer.chop(1);
updateMiniBuffer();
} else if (key == Key_Return && m_mode == ExMode) { } else if (key == Key_Return && m_mode == ExMode) {
if (!m_commandBuffer.isEmpty()) { if (!m_commandBuffer.isEmpty()) {
m_commandHistory.takeLast(); m_commandHistory.takeLast();
@@ -830,26 +887,22 @@ void FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text
// takes only matching entires in the history into account. // takes only matching entires in the history into account.
if (m_searchHistoryIndex > 0) { if (m_searchHistoryIndex > 0) {
--m_searchHistoryIndex; --m_searchHistoryIndex;
m_commandBuffer = m_searchHistory.at(m_searchHistoryIndex); showBlackMessage(m_searchHistory.at(m_searchHistoryIndex));
updateMiniBuffer();
} }
} else if (key == Key_Up && m_mode == ExMode) { } else if (key == Key_Up && m_mode == ExMode) {
if (m_commandHistoryIndex > 0) { if (m_commandHistoryIndex > 0) {
--m_commandHistoryIndex; --m_commandHistoryIndex;
m_commandBuffer = m_commandHistory.at(m_commandHistoryIndex); showBlackMessage(m_commandHistory.at(m_commandHistoryIndex));
updateMiniBuffer();
} }
} else if (key == Key_Down && isSearchMode()) { } else if (key == Key_Down && isSearchMode()) {
if (m_searchHistoryIndex < m_searchHistory.size() - 1) { if (m_searchHistoryIndex < m_searchHistory.size() - 1) {
++m_searchHistoryIndex; ++m_searchHistoryIndex;
m_commandBuffer = m_searchHistory.at(m_searchHistoryIndex); showBlackMessage(m_searchHistory.at(m_searchHistoryIndex));
updateMiniBuffer();
} }
} else if (key == Key_Down && m_mode == ExMode) { } else if (key == Key_Down && m_mode == ExMode) {
if (m_commandHistoryIndex < m_commandHistory.size() - 1) { if (m_commandHistoryIndex < m_commandHistory.size() - 1) {
++m_commandHistoryIndex; ++m_commandHistoryIndex;
m_commandBuffer = m_commandHistory.at(m_commandHistoryIndex); showBlackMessage(m_commandHistory.at(m_commandHistoryIndex));
updateMiniBuffer();
} }
} else if (key == Key_Tab) { } else if (key == Key_Tab) {
m_commandBuffer += QChar(9); m_commandBuffer += QChar(9);
@@ -858,6 +911,7 @@ void FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text
m_commandBuffer += QChar(key); m_commandBuffer += QChar(key);
updateMiniBuffer(); updateMiniBuffer();
} }
return true;
} }
// 1 based. // 1 based.
@@ -881,10 +935,10 @@ int FakeVimHandler::Private::readLineCode(QString &cmd)
return cursorLineInDocument() + 1 + (n == -1 ? 1 : n); return cursorLineInDocument() + 1 + (n == -1 ? 1 : n);
} }
if (c == '\'' && !cmd.isEmpty()) { if (c == '\'' && !cmd.isEmpty()) {
int pos = m_marks.value(cmd.at(0).unicode()); int pos = m_marks.value(cmd.at(0).unicode(), -1);
qDebug() << " MARK: " << cmd.at(0) << pos << lineForPosition(pos); //qDebug() << " MARK: " << cmd.at(0) << pos << lineForPosition(pos);
if (!pos) { if (pos == -1) {
showMessage(tr("E20: Mark '%1' not set").arg(cmd.at(0))); showRedMessage(tr("E20: Mark '%1' not set").arg(cmd.at(0)));
return -1; return -1;
} }
cmd = cmd.mid(1); cmd = cmd.mid(1);
@@ -904,7 +958,7 @@ int FakeVimHandler::Private::readLineCode(QString &cmd)
} }
// not parsed // not parsed
cmd = c + cmd; cmd = c + cmd;
return -1; return -1;
} }
QTextCursor FakeVimHandler::Private::selectRange(int beginLine, int endLine) QTextCursor FakeVimHandler::Private::selectRange(int beginLine, int endLine)
@@ -925,14 +979,15 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
QString cmd = cmd0; QString cmd = cmd0;
if (cmd.startsWith("%")) if (cmd.startsWith("%"))
cmd = "1,$" + cmd.mid(1); cmd = "1,$" + cmd.mid(1);
m_marks['>'] = m_tc.position();
int beginLine = -1; int beginLine = -1;
int endLine = -1; int endLine = -1;
int line = readLineCode(cmd); int line = readLineCode(cmd);
if (line != -1) if (line != -1)
beginLine = line; beginLine = line;
if (cmd.startsWith(',')) { if (cmd.startsWith(',')) {
cmd = cmd.mid(1); cmd = cmd.mid(1);
line = readLineCode(cmd); line = readLineCode(cmd);
@@ -940,14 +995,14 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
endLine = line; endLine = line;
} }
qDebug() << "RANGE: " << beginLine << endLine << cmd << cmd0; //qDebug() << "RANGE: " << beginLine << endLine << cmd << cmd0;
static QRegExp reWrite("^w!?( (.*))?$"); static QRegExp reWrite("^w!?( (.*))?$");
static QRegExp reDelete("^d( (.*))?$"); static QRegExp reDelete("^d( (.*))?$");
if (cmd.isEmpty()) { if (cmd.isEmpty()) {
m_tc.setPosition(positionForLine(beginLine)); m_tc.setPosition(positionForLine(beginLine));
showMessage(QString()); showBlackMessage(QString());
} else if (cmd == "q!" || cmd == "q") { // :q } else if (cmd == "q!" || cmd == "q") { // :q
quit(); quit();
} else if (reDelete.indexIn(cmd) != -1) { // :d } else if (reDelete.indexIn(cmd) != -1) { // :d
@@ -975,7 +1030,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
QFile file(fileName); QFile file(fileName);
bool exists = file.exists(); bool exists = file.exists();
if (exists && !forced && !noArgs) { if (exists && !forced && !noArgs) {
showMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName));
} else if (file.open(QIODevice::ReadWrite)) { } else if (file.open(QIODevice::ReadWrite)) {
QTextCursor tc = selectRange(beginLine, endLine); QTextCursor tc = selectRange(beginLine, endLine);
qDebug() << "ANCHOR: " << tc.position() << tc.anchor() qDebug() << "ANCHOR: " << tc.position() << tc.anchor()
@@ -984,12 +1039,11 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
file.close(); file.close();
file.open(QIODevice::ReadOnly); file.open(QIODevice::ReadOnly);
QByteArray ba = file.readAll(); QByteArray ba = file.readAll();
m_commandBuffer = QString("\"%1\" %2 %3L, %4C written") showBlackMessage(tr("\"%1\" %2 %3L, %4C written")
.arg(fileName).arg(exists ? " " : " [New] ") .arg(fileName).arg(exists ? " " : " [New] ")
.arg(ba.count('\n')).arg(ba.size()); .arg(ba.count('\n')).arg(ba.size()));
updateMiniBuffer();
} else { } else {
showMessage(tr("Cannot open file '%1' for reading").arg(fileName)); showRedMessage(tr("Cannot open file '%1' for reading").arg(fileName));
} }
} else if (cmd.startsWith("r ")) { // :r } else if (cmd.startsWith("r ")) { // :r
m_currentFileName = cmd.mid(2); m_currentFileName = cmd.mid(2);
@@ -998,12 +1052,44 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
QTextStream ts(&file); QTextStream ts(&file);
QString data = ts.readAll(); QString data = ts.readAll();
EDITOR(setPlainText(data)); EDITOR(setPlainText(data));
m_commandBuffer = QString("\"%1\" %2L, %3C") enterCommandMode();
.arg(m_currentFileName).arg(data.count('\n')).arg(data.size()); showBlackMessage(tr("\"%1\" %2L, %3C")
.arg(m_currentFileName).arg(data.count('\n')).arg(data.size()));
} else if (cmd.startsWith("!")) {
if (beginLine == -1)
beginLine = cursorLineInDocument();
if (endLine == -1)
endLine = cursorLineInDocument();
QTextCursor tc = selectRange(beginLine, endLine);
QString text = tc.selection().toPlainText();
tc.removeSelectedText();
QString command = cmd.mid(1).trimmed();
QProcess proc;
proc.start(cmd.mid(1));
proc.waitForStarted();
proc.write(text.toUtf8());
proc.closeWriteChannel();
proc.waitForFinished();
QString result = QString::fromUtf8(proc.readAllStandardOutput());
m_tc.insertText(result);
leaveVisualMode();
m_tc.setPosition(positionForLine(beginLine));
EditOperation op;
// FIXME: broken for "upward selection"
op.m_position = m_tc.position();
op.m_from = text;
op.m_to = result;
recordOperation(op);
enterCommandMode();
showBlackMessage(tr("%1 lines filtered").arg(text.count('\n')));
} else if (cmd == "red" || cmd == "redo") { // :redo
redo();
enterCommandMode(); enterCommandMode();
updateMiniBuffer(); updateMiniBuffer();
} else { } else {
showMessage("E492: Not an editor command: " + cmd0); showRedMessage("E492: Not an editor command: " + cmd0);
} }
} }
@@ -1033,9 +1119,9 @@ void FakeVimHandler::Private::search(const QString &needle, bool forward)
// the qMax seems to be needed for QPlainTextEdit only // the qMax seems to be needed for QPlainTextEdit only
m_tc.movePosition(Left, MoveAnchor, qMax(1, needle.size() - 1)); m_tc.movePosition(Left, MoveAnchor, qMax(1, needle.size() - 1));
if (forward) if (forward)
showMessage("search hit BOTTOM, continuing at TOP"); showRedMessage("search hit BOTTOM, continuing at TOP");
else else
showMessage("search hit TOP, continuing at BOTTOM"); showRedMessage("search hit TOP, continuing at BOTTOM");
return; return;
} }
@@ -1247,24 +1333,27 @@ void FakeVimHandler::Private::undo()
#if 0 #if 0
EDITOR(undo()); EDITOR(undo());
#else #else
if (m_undoStack.isEmpty()) if (m_undoStack.isEmpty()) {
return; showBlackMessage(tr("Already at oldest change"));
EditOperation op = m_undoStack.pop();
//qDebug() << "UNDO " << op;
if (op.m_itemCount > 0) {
for (int i = op.m_itemCount; --i >= 0; )
undo();
} else { } else {
m_tc.setPosition(op.m_position, MoveAnchor); EditOperation op = m_undoStack.pop();
if (!op.m_to.isEmpty()) { //qDebug() << "UNDO " << op;
m_tc.setPosition(op.m_position + op.m_to.size(), KeepAnchor); if (op.m_itemCount > 0) {
m_tc.deleteChar(); for (int i = op.m_itemCount; --i >= 0; )
undo();
} else {
m_tc.setPosition(op.m_position, MoveAnchor);
if (!op.m_to.isEmpty()) {
m_tc.setPosition(op.m_position + op.m_to.size(), KeepAnchor);
m_tc.deleteChar();
}
if (!op.m_from.isEmpty())
m_tc.insertText(op.m_from);
m_tc.setPosition(op.m_position, MoveAnchor);
} }
if (!op.m_from.isEmpty()) m_redoStack.push(op);
m_tc.insertText(op.m_from); showBlackMessage(QString());
m_tc.setPosition(op.m_position, MoveAnchor);
} }
m_redoStack.push(op);
#endif #endif
} }
@@ -1273,34 +1362,51 @@ void FakeVimHandler::Private::redo()
#if 0 #if 0
EDITOR(redo()); EDITOR(redo());
#else #else
if (m_redoStack.isEmpty()) if (m_redoStack.isEmpty()) {
return; showBlackMessage(tr("Already at newest change"));
EditOperation op = m_redoStack.pop();
//qDebug() << "REDO " << op;
if (op.m_itemCount > 0) {
for (int i = op.m_itemCount; --i >= 0; )
redo();
} else { } else {
m_tc.setPosition(op.m_position, MoveAnchor); EditOperation op = m_redoStack.pop();
if (!op.m_from.isEmpty()) { //qDebug() << "REDO " << op;
m_tc.setPosition(op.m_position + op.m_from.size(), KeepAnchor); if (op.m_itemCount > 0) {
m_tc.deleteChar(); for (int i = op.m_itemCount; --i >= 0; )
redo();
} else {
m_tc.setPosition(op.m_position, MoveAnchor);
if (!op.m_from.isEmpty()) {
m_tc.setPosition(op.m_position + op.m_from.size(), KeepAnchor);
m_tc.deleteChar();
}
if (!op.m_to.isEmpty())
m_tc.insertText(op.m_to);
m_tc.setPosition(op.m_position, MoveAnchor);
} }
if (!op.m_to.isEmpty()) m_undoStack.push(op);
m_tc.insertText(op.m_to); showBlackMessage(QString());
m_tc.setPosition(op.m_position, MoveAnchor);
} }
m_undoStack.push(op);
#endif #endif
} }
void FakeVimHandler::Private::removeSelectedText(QTextCursor &tc)
{
EditOperation op;
op.m_position = qMin(tc.position(), tc.anchor());
op.m_from = tc.selection().toPlainText();
recordOperation(op);
tc.removeSelectedText();
}
void FakeVimHandler::Private::recordOperation(const EditOperation &op)
{
m_undoStack.push(op);
m_redoStack.clear();
}
void FakeVimHandler::Private::recordMove(int position, int nestedCount) void FakeVimHandler::Private::recordMove(int position, int nestedCount)
{ {
EditOperation op; EditOperation op;
op.m_position = position; op.m_position = position;
op.m_itemCount = nestedCount; op.m_itemCount = nestedCount;
m_undoStack.push(op); recordOperation(op);
m_redoStack.clear();
} }
void FakeVimHandler::Private::recordInsert(int position, const QString &data) void FakeVimHandler::Private::recordInsert(int position, const QString &data)
@@ -1308,8 +1414,7 @@ void FakeVimHandler::Private::recordInsert(int position, const QString &data)
EditOperation op; EditOperation op;
op.m_position = position; op.m_position = position;
op.m_to = data; op.m_to = data;
m_undoStack.push(op); recordOperation(op);
m_redoStack.clear();
} }
void FakeVimHandler::Private::recordRemove(int position, int length) void FakeVimHandler::Private::recordRemove(int position, int length)
@@ -1325,8 +1430,7 @@ void FakeVimHandler::Private::recordRemove(int position, const QString &data)
EditOperation op; EditOperation op;
op.m_position = position; op.m_position = position;
op.m_from = data; op.m_from = data;
m_undoStack.push(op); recordOperation(op);
m_redoStack.clear();
} }
void FakeVimHandler::Private::enterInsertMode() void FakeVimHandler::Private::enterInsertMode()
@@ -1345,7 +1449,7 @@ void FakeVimHandler::Private::enterCommandMode()
void FakeVimHandler::Private::quit() void FakeVimHandler::Private::quit()
{ {
showMessage(QString()); showBlackMessage(QString());
EDITOR(setOverwriteMode(false)); EDITOR(setOverwriteMode(false));
q->quitRequested(editor()); q->quitRequested(editor());
} }
@@ -1384,13 +1488,13 @@ void FakeVimHandler::addWidget(QWidget *widget)
//ed->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x'))); //ed->setCursorWidth(QFontMetrics(ed->font()).width(QChar('x')));
ed->setLineWrapMode(QPlainTextEdit::NoWrap); ed->setLineWrapMode(QPlainTextEdit::NoWrap);
} }
d->showMessage("vi emulation mode. Hit <Shift+Esc>:q<Return> to quit"); d->showBlackMessage("vi emulation mode. Hit <Shift+Esc>:q<Return> to quit");
d->updateMiniBuffer(); d->updateMiniBuffer();
} }
void FakeVimHandler::removeWidget(QWidget *widget) void FakeVimHandler::removeWidget(QWidget *widget)
{ {
d->showMessage(QString()); d->showBlackMessage(QString());
d->updateMiniBuffer(); d->updateMiniBuffer();
widget->removeEventFilter(this); widget->removeEventFilter(this);
} }
@@ -1402,7 +1506,6 @@ void FakeVimHandler::handleCommand(QWidget *widget, const QString &cmd)
d->handleExCommand(cmd); d->handleExCommand(cmd);
} }
void FakeVimHandler::quit() void FakeVimHandler::quit()
{ {
d->quit(); d->quit();

View File

@@ -33,6 +33,7 @@
#include "deployhelper.h" #include "deployhelper.h"
#include "qt4project.h" #include "qt4project.h"
#include "qt4projectmanagerconstants.h"
#include <QDebug> #include <QDebug>
#include <QDir> #include <QDir>
@@ -183,7 +184,7 @@ void DeployHelperRunStep::readyRead()
QString DeployHelperRunStep::name() QString DeployHelperRunStep::name()
{ {
return "trolltech.qt4projectmanager.deployhelperrunstep"; return Constants::DEPLOYHELPERRUNSTEP;
} }
QString DeployHelperRunStep::displayName() QString DeployHelperRunStep::displayName()

View File

@@ -132,8 +132,8 @@ void ProFileEditor::setFontSettings(const TextEditor::FontSettings &fs)
static QVector<QString> categories; static QVector<QString> categories;
if (categories.isEmpty()) { if (categories.isEmpty()) {
categories << QLatin1String(TextEditor::Constants::C_VARIABLE) categories << QLatin1String(TextEditor::Constants::C_TYPE)
<< QLatin1String(TextEditor::Constants::C_FUNCTION) << QLatin1String(TextEditor::Constants::C_KEYWORD)
<< QLatin1String(TextEditor::Constants::C_COMMENT); << QLatin1String(TextEditor::Constants::C_COMMENT);
} }

View File

@@ -36,7 +36,6 @@
#include "qt4projectmanager.h" #include "qt4projectmanager.h"
#include "qt4projectmanagerconstants.h" #include "qt4projectmanagerconstants.h"
#include "profileeditor.h" #include "profileeditor.h"
#include "qt4projectmanagerenums.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>

View File

@@ -34,8 +34,6 @@
#ifndef PROFILEHIGHLIGHTER_H #ifndef PROFILEHIGHLIGHTER_H
#define PROFILEHIGHLIGHTER_H #define PROFILEHIGHLIGHTER_H
#include "qt4projectmanagerenums.h"
#include <QtCore/QtAlgorithms> #include <QtCore/QtAlgorithms>
#include <QtGui/QSyntaxHighlighter> #include <QtGui/QSyntaxHighlighter>
#include <QtGui/QTextCharFormat> #include <QtGui/QTextCharFormat>
@@ -47,6 +45,13 @@ class ProFileHighlighter : public QSyntaxHighlighter
{ {
Q_OBJECT Q_OBJECT
public: public:
enum ProfileFormats {
ProfileVariableFormat,
ProfileFunctionFormat,
ProfileCommentFormat,
NumProfileFormats
};
ProFileHighlighter(QTextDocument *document = 0); ProFileHighlighter(QTextDocument *document = 0);
virtual void highlightBlock(const QString &text); virtual void highlightBlock(const QString &text);
@@ -58,7 +63,6 @@ public:
private: private:
QTextCharFormat m_formats[NumProfileFormats]; QTextCharFormat m_formats[NumProfileFormats];
}; };
} // namespace Internal } // namespace Internal

View File

@@ -5,7 +5,6 @@ include(../../qworkbenchplugin.pri)
include(qt4projectmanager_dependencies.pri) include(qt4projectmanager_dependencies.pri)
HEADERS = qt4projectmanagerplugin.h \ HEADERS = qt4projectmanagerplugin.h \
qt4projectmanager.h \ qt4projectmanager.h \
qt4projectmanagerenums.h \
qtversionmanager.h \ qtversionmanager.h \
qt4project.h \ qt4project.h \
qt4nodes.h \ qt4nodes.h \
@@ -45,7 +44,6 @@ HEADERS = qt4projectmanagerplugin.h \
projectloadwizard.h \ projectloadwizard.h \
directorywatcher.h \ directorywatcher.h \
gdbmacrosbuildstep.h gdbmacrosbuildstep.h
SOURCES = qt4projectmanagerplugin.cpp \ SOURCES = qt4projectmanagerplugin.cpp \
qt4projectmanager.cpp \ qt4projectmanager.cpp \
qtversionmanager.cpp \ qtversionmanager.cpp \
@@ -84,7 +82,6 @@ SOURCES = qt4projectmanagerplugin.cpp \
projectloadwizard.cpp \ projectloadwizard.cpp \
directorywatcher.cpp \ directorywatcher.cpp \
gdbmacrosbuildstep.cpp gdbmacrosbuildstep.cpp
FORMS = qtversionmanager.ui \ FORMS = qtversionmanager.ui \
envvariablespage.ui \ envvariablespage.ui \
enveditdialog.ui \ enveditdialog.ui \

View File

@@ -77,6 +77,7 @@ const char * const QMAKESTEP = "trolltech.qt4projectmanager.qmake";
const char * const MAKESTEP = "trolltech.qt4projectmanager.make"; const char * const MAKESTEP = "trolltech.qt4projectmanager.make";
const char * const GDBMACROSBUILDSTEP = "trolltech.qt4projectmanager.gdbmaros"; const char * const GDBMACROSBUILDSTEP = "trolltech.qt4projectmanager.gdbmaros";
const char * const QT4RUNSTEP = "trolltech.qt4projectmanager.qt4runstep"; const char * const QT4RUNSTEP = "trolltech.qt4projectmanager.qt4runstep";
const char * const DEPLOYHELPERRUNSTEP = "trolltech.qt4projectmanager.deployhelperrunstep";
// build parsers // build parsers
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC"; const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";

View File

@@ -1,50 +0,0 @@
/***************************************************************************
**
** 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.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef QT4PRO_ENUMS_H
#define QT4PRO_ENUMS_H
namespace Qt4ProjectManager {
namespace Internal {
enum ProfileFormats {
ProfileVariableFormat,
ProfileFunctionFormat,
ProfileCommentFormat,
NumProfileFormats
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // QT4PRO_ENUMS_H

View File

@@ -91,9 +91,6 @@ const char * const C_REMOVED_LINE = "RemovedLine";
const char * const C_DIFF_FILE = "DiffFile"; const char * const C_DIFF_FILE = "DiffFile";
const char * const C_DIFF_LOCATION = "DiffLocation"; const char * const C_DIFF_LOCATION = "DiffLocation";
const char * const C_VARIABLE = "Variable";
const char * const C_FUNCTION = "Function";
} // namespace Constants } // namespace Constants
} // namespace TextEditor } // namespace TextEditor

View File

@@ -91,10 +91,6 @@ TextEditorSettings::TextEditorSettings(Internal::TextEditorPlugin *plugin,
formatDescriptions.push_back(FormatDescription(QLatin1String(C_DIFF_FILE), tr("Diff File"), Qt::black)); formatDescriptions.push_back(FormatDescription(QLatin1String(C_DIFF_FILE), tr("Diff File"), Qt::black));
formatDescriptions.push_back(FormatDescription(QLatin1String(C_DIFF_LOCATION), tr("Diff Location"), Qt::green)); formatDescriptions.push_back(FormatDescription(QLatin1String(C_DIFF_LOCATION), tr("Diff Location"), Qt::green));
// Pro file categories
formatDescriptions.push_back(FormatDescription(QLatin1String(C_VARIABLE), tr("Variable"), Qt::blue));
formatDescriptions.push_back(FormatDescription(QLatin1String(C_FUNCTION), tr("Function"), Qt::green));
m_fontSettingsPage = new FontSettingsPage(formatDescriptions, m_fontSettingsPage = new FontSettingsPage(formatDescriptions,
QLatin1String("TextEditor"), QLatin1String("TextEditor"),
tr("Text Editor"), tr("Text Editor"),