Commit 9d90df88 authored by dt's avatar dt
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents f6aa5056 8f84f81e
......@@ -1147,6 +1147,8 @@
is interrupted. To do so, click on the \gui Value column, modify the value
with the inplace editor, and hit \key Enter (or \key Return).
\note The set of watched items is saved within your session.
\section2 Modules
......
......@@ -296,7 +296,6 @@ private:
void notImplementedYet();
void updateMiniBuffer();
void updateSelection();
void quit();
QWidget *editor() const;
QChar characterAtCursor() const
{ return m_tc.document()->characterAt(m_tc.position()); }
......@@ -479,7 +478,6 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
KEY_DEBUG("PASSING PLAIN KEY..." << ev->key() << ev->text());
//if (key == ',') { // use ',,' to leave, too.
// qDebug() << "FINISHED...";
// quit();
// return EventHandled;
//}
m_passing = false;
......@@ -1695,7 +1693,8 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
showBlackMessage(QString());
enterCommandMode();
} else if (cmd == "q!" || cmd == "q") { // :q
quit();
showBlackMessage(QString());
q->quitRequested(cmd == "q!");
} else if (reDelete.indexIn(cmd) != -1) { // :d
selectRange(beginLine, endLine);
QString reg = reDelete.cap(2);
......@@ -1799,6 +1798,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
enterCommandMode();
updateMiniBuffer();
} else if (reSet.indexIn(cmd) != -1) { // :set
showBlackMessage(QString());
QString arg = reSet.cap(2);
SavedAction *act = theFakeVimSettings()->item(arg);
if (arg.isEmpty()) {
......@@ -2452,13 +2452,6 @@ void FakeVimHandler::Private::enterExMode()
m_mode = ExMode;
}
void FakeVimHandler::Private::quit()
{
EDITOR(setCursorWidth(m_cursorWidth));
EDITOR(setOverwriteMode(false));
q->quitRequested();
}
void FakeVimHandler::Private::recordJump()
{
m_jumpListUndo.append(position());
......@@ -2531,11 +2524,6 @@ void FakeVimHandler::handleCommand(const QString &cmd)
d->handleExCommand(cmd);
}
void FakeVimHandler::quit()
{
d->quit();
}
void FakeVimHandler::setCurrentFileName(const QString &fileName)
{
d->m_currentFileName = fileName;
......
......@@ -54,7 +54,6 @@ public slots:
// This executes an "ex" style command taking context
// information from widget;
void handleCommand(const QString &cmd);
void quit();
void installEventFilter();
......@@ -66,7 +65,7 @@ signals:
void commandBufferChanged(const QString &msg);
void statusDataChanged(const QString &msg);
void extraInformationChanged(const QString &msg);
void quitRequested();
void quitRequested(bool force);
void selectionChanged(const QList<QTextEdit::ExtraSelection> &selection);
void writeFileRequested(bool *handled,
const QString &fileName, const QString &contents);
......
......@@ -229,7 +229,7 @@ private slots:
void editorAboutToClose(Core::IEditor *);
void setUseFakeVim(const QVariant &value);
void quit();
void quitFakeVim();
void triggerCompletions();
void showSettingsDialog();
......@@ -237,6 +237,7 @@ private slots:
void showExtraInformation(const QString &msg);
void changeSelection(const QList<QTextEdit::ExtraSelection> &selections);
void writeFile(bool *handled, const QString &fileName, const QString &contents);
void quitFile(bool forced);
void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor);
void indentRegion(int *amount, int beginLine, int endLine, QChar typedChar);
......@@ -331,8 +332,8 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor)
this, SLOT(showExtraInformation(QString)));
connect(handler, SIGNAL(commandBufferChanged(QString)),
this, SLOT(showCommandBuffer(QString)));
connect(handler, SIGNAL(quitRequested()),
this, SLOT(quit()), Qt::QueuedConnection);
connect(handler, SIGNAL(quitRequested(bool)),
this, SLOT(quitFile(bool)), Qt::QueuedConnection);
connect(handler, SIGNAL(writeFileRequested(bool*,QString,QString)),
this, SLOT(writeFile(bool*,QString,QString)));
connect(handler, SIGNAL(selectionChanged(QList<QTextEdit::ExtraSelection>)),
......@@ -346,6 +347,10 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor)
handler->setCurrentFileName(editor->file()->fileName());
handler->installEventFilter();
// pop up the bar
if (theFakeVimSetting(ConfigUseFakeVim)->value().toBool())
showCommandBuffer("");
}
void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor)
......@@ -356,21 +361,20 @@ void FakeVimPluginPrivate::editorAboutToClose(Core::IEditor *editor)
void FakeVimPluginPrivate::setUseFakeVim(const QVariant &value)
{
//qDebug() << "SET USE FAKEVIM" << value;
bool on = value.toBool();
if (on) {
Core::EditorManager::instance()->showEditorStatusBar(
QLatin1String(Constants::MINI_BUFFER),
"vi emulation mode. Type :q to leave. Use , Ctrl-R to trigger run.",
tr("Quit FakeVim"), this, SLOT(quit()));
tr("Quit FakeVim"), this, SLOT(quitFakeVim()));
foreach (Core::IEditor *editor, m_editorToHandler.keys())
m_editorToHandler[editor]->setupWidget();
//qDebug() << "SETTING" << m_editorToHandler.keys();
} else {
Core::EditorManager::instance()->hideEditorStatusBar(
QLatin1String(Constants::MINI_BUFFER));
foreach (Core::IEditor *editor, m_editorToHandler.keys())
m_editorToHandler[editor]->restoreWidget();
//qDebug() << "REMOVING" << m_editorToHandler.keys();
}
}
......@@ -385,6 +389,16 @@ void FakeVimPluginPrivate::triggerCompletions()
// bt->triggerCompletions();
}
void FakeVimPluginPrivate::quitFile(bool forced)
{
FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender());
if (!handler)
return;
QList<Core::IEditor *> editors;
editors.append(m_editorToHandler.key(handler));
Core::EditorManager::instance()->closeEditors(editors, !forced);
}
void FakeVimPluginPrivate::writeFile(bool *handled,
const QString &fileName, const QString &contents)
{
......@@ -484,12 +498,8 @@ void FakeVimPluginPrivate::indentRegion(int *amount, int beginLine, int endLine,
} while (cur != end);
}
void FakeVimPluginPrivate::quit()
void FakeVimPluginPrivate::quitFakeVim()
{
//if (FakeVimHandler *handler = qobject_cast<FakeVimHandler *>(sender())) {
// handler->restoreWidget();
// handler->deleteLater();
//}
setUseFakeVim(false);
}
......@@ -498,7 +508,7 @@ void FakeVimPluginPrivate::showCommandBuffer(const QString &contents)
//qDebug() << "SHOW COMMAND BUFFER" << contents;
Core::EditorManager::instance()->showEditorStatusBar(
QLatin1String(Constants::MINI_BUFFER), contents,
tr("Quit FakeVim"), this, SLOT(quit()));
tr("Quit FakeVim"), this, SLOT(quitFakeVim()));
}
void FakeVimPluginPrivate::showExtraInformation(const QString &text)
......
s/#include "qscriptcontext_p.h"//g
s/#include "qscriptcontext.h"//g
s/#include "qscriptengine.h"//g
s/#include "qscriptmember_p.h"//g
s/#include "qscriptobject_p.h"//g
s/#include "qscriptvalueimpl_p.h"//g
s/#ifndef QT_NO_SCRIPT//g
s,#endif // QT_NO_SCRIPT,,g
s/QScript/JavaScript/g
s/QSCRIPT/JAVASCRIPT/g
s/qscript/javascript/g
s/Q_SCRIPT/J_SCRIPT/g
s/qsreal/qjsreal/g
\ No newline at end of file
#!/bin/sh
me=$(dirname $0)
rm -f javascript.g
rm -f javascriptast.cpp
rm -f javascriptast_p.h
rm -f javascriptastfwd_p.h
rm -f javascriptastvisitor.cpp
rm -f javascriptastvisitor_p.h
rm -f javascriptlexer.cpp
rm -f javascriptlexer_p.h
rm -f javascriptmemorypool_p.h
rm -f javascriptnodepool_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscript.g > javascript.g
sed -f $me/cmd.sed $QTDIR/src/script/qscriptast.cpp > javascriptast.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscriptast_p.h > javascriptast_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptastfwd_p.h > javascriptastfwd_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor.cpp > javascriptastvisitor.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor_p.h > javascriptastvisitor_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer_p.h > javascriptlexer_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer.cpp > javascriptlexer.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscriptmemorypool_p.h > javascriptmemorypool_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptnodepool_p.h > javascriptnodepool_p.h
qlalr $me/javascript.g
chmod ugo-w javascript.g
chmod ugo-w javascriptast.cpp
chmod ugo-w javascriptast_p.h
chmod ugo-w javascriptastfwd_p.h
chmod ugo-w javascriptastvisitor.cpp
chmod ugo-w javascriptastvisitor_p.h
chmod ugo-w javascriptlexer_p.h
chmod ugo-w javascriptlexer.cpp
chmod ugo-w javascriptmemorypool_p.h
chmod ugo-w javascriptnodepool_p.h
chmod ugo-w javascriptgrammar_p.h
chmod ugo-w javascriptgrammar.cpp
chmod ugo-w javascriptparser_p.h
chmod ugo-w javascriptparser.cpp
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the QtScript module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the either Technology Preview License Agreement or the
** Beta Release License Agreement.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain
** additional rights. These rights are described in the Nokia Qt LGPL
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
** package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 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 the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#include "javascriptast_p.h"
#include "javascriptastvisitor_p.h"
QT_BEGIN_NAMESPACE
namespace JavaScript { namespace AST {
ExpressionNode *Node::expressionCast()
{
return 0;
}
BinaryExpression *Node::binaryExpressionCast()
{
return 0;
}
Statement *Node::statementCast()
{
return 0;
}
ExpressionNode *ExpressionNode::expressionCast()
{
return this;
}
BinaryExpression *BinaryExpression::binaryExpressionCast()
{
return this;
}
Statement *Statement::statementCast()
{
return this;
}
void ThisExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void IdentifierExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void NullExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void TrueLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void FalseLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void StringLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void NumericLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void RegExpLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void ArrayLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(elements, visitor);
acceptChild(elision, visitor);
}
visitor->endVisit(this);
}
void ObjectLiteral::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(properties, visitor);
}
visitor->endVisit(this);
}
void ElementList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
ElementList *it = this;
do {
acceptChild(it->elision, visitor);
acceptChild(it->expression, visitor);
it = it->next;
} while (it);
}
visitor->endVisit(this);
}
void Elision::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
// ###
}
visitor->endVisit(this);
}
void PropertyNameAndValueList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
PropertyNameAndValueList *it = this;
do {
acceptChild(it->name, visitor);
acceptChild(it->value, visitor);
it = it->next;
} while (it);
}
visitor->endVisit(this);
}
void IdentifierPropertyName::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void StringLiteralPropertyName::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void NumericLiteralPropertyName::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
}
visitor->endVisit(this);
}
void ArrayMemberExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(base, visitor);
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void FieldMemberExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(base, visitor);
}
visitor->endVisit(this);
}
void NewMemberExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(base, visitor);
acceptChild(arguments, visitor);
}
visitor->endVisit(this);
}
void NewExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void CallExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(base, visitor);
acceptChild(arguments, visitor);
}
visitor->endVisit(this);
}
void ArgumentList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
ArgumentList *it = this;
do {
acceptChild(it->expression, visitor);
it = it->next;
} while (it);
}
visitor->endVisit(this);
}
void PostIncrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(base, visitor);
}
visitor->endVisit(this);
}
void PostDecrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(base, visitor);
}
visitor->endVisit(this);
}
void DeleteExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void VoidExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void TypeOfExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void PreIncrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void PreDecrementExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}
void UnaryPlusExpression::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
acceptChild(expression, visitor);
}
visitor->endVisit(this);
}