Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
142 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/scripttools/debugging/debugging.pri

    r2 r561  
    112112    $$PWD/qscriptbreakpointsmodel.cpp \
    113113    $$PWD/qscripterrorlogwidgetinterface.cpp \
    114     $$PWD/qscripterrorlogwidget.cpp
     114    $$PWD/qscripterrorlogwidget.cpp \
     115    $$PWD/qscriptdebuggerstandardwidgetfactory.cpp
    115116
    116117HEADERS += \
     
    149150    $$PWD/qscripterrorlogwidgetinterface_p.h \
    150151    $$PWD/qscripterrorlogwidget_p.h \
    151     $$PWD/qscriptdebuggerwidgetfactoryinterface_p.h
     152    $$PWD/qscriptdebuggerwidgetfactoryinterface_p.h \
     153    $$PWD/qscriptdebuggerstandardwidgetfactory_p.h
    152154
    153155SOURCES += \
  • trunk/src/scripttools/debugging/qscriptbreakpointdata.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    137137QScriptBreakpointData::~QScriptBreakpointData()
    138138{
    139     delete d_ptr;
    140139}
    141140
     
    356355QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data)
    357356{
    358     const QScriptBreakpointDataPrivate *d = data.d_ptr;
     357    const QScriptBreakpointDataPrivate *d = data.d_ptr.data();
    359358    out << d->scriptId;
    360359    out << d->fileName;
     
    378377QDataStream &operator>>(QDataStream &in, QScriptBreakpointData &data)
    379378{
    380     QScriptBreakpointDataPrivate *d = data.d_ptr;
     379    QScriptBreakpointDataPrivate *d = data.d_ptr.data();
    381380    in >> d->scriptId;
    382381    in >> d->fileName;
  • trunk/src/scripttools/debugging/qscriptbreakpointdata_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/qscopedpointer.h>
    5858#include <QtCore/qmap.h>
    5959
     
    115115
    116116private:
    117     QScriptBreakpointDataPrivate *d_ptr;
     117    QScopedPointer<QScriptBreakpointDataPrivate> d_ptr;
    118118
    119119    Q_DECLARE_PRIVATE(QScriptBreakpointData)
  • trunk/src/scripttools/debugging/qscriptbreakpointsmodel.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4848
    4949#include <QtCore/qpair.h>
     50#include <QtCore/qcoreapplication.h>
    5051#include <QtGui/qicon.h>
    5152#include <QtCore/qdebug.h>
     
    452453        if (role == Qt::DisplayRole) {
    453454            if (section == 0)
    454                 return QObject::tr("ID");
     455                return QCoreApplication::translate("QScriptBreakpointsModel", "ID");
    455456            else if (section == 1)
    456                 return QObject::tr("Location");
     457                return QCoreApplication::translate("QScriptBreakpointsModel", "Location");
    457458            else if (section == 2)
    458                 return QObject::tr("Condition");
     459                return QCoreApplication::translate("QScriptBreakpointsModel", "Condition");
    459460            else if (section == 3)
    460                 return QObject::tr("Ignore-count");
     461                return QCoreApplication::translate("QScriptBreakpointsModel", "Ignore-count");
    461462            else if (section == 4)
    462                 return QObject::tr("Single-shot");
     463                return QCoreApplication::translate("QScriptBreakpointsModel", "Single-shot");
    463464            else if (section == 5)
    464                 return QObject::tr("Hit-count");
     465                return QCoreApplication::translate("QScriptBreakpointsModel", "Hit-count");
    465466        }
    466467    }
  • trunk/src/scripttools/debugging/qscriptbreakpointsmodel_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptbreakpointswidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7979        toolClose->setIcon(QIcon(QString::fromUtf8(":/qt/scripttools/debugging/images/%1/closetab.png").arg(system)));
    8080        toolClose->setAutoRaise(true);
    81         toolClose->setText(QObject::tr("Close"));
     81        toolClose->setText(tr("Close"));
    8282        hboxLayout->addWidget(toolClose);
    8383
     
    226226    bool eventFilter(QObject *editor, QEvent *event)
    227227    {
    228 #if QT_VERSION >= 0x040500
    229228        if (QLineEdit *le = qobject_cast<QLineEdit*>(editor)) {
    230229            if (event->type() == QEvent::KeyPress) {
     
    238237            }
    239238        }
    240 #endif
    241239        return QStyledItemDelegate::eventFilter(editor, event);
    242240    }
     
    245243                      const QModelIndex &index) const
    246244    {
    247 #if QT_VERSION >= 0x040500
    248245        if (index.column() == 2) {
    249246            // check that the syntax is OK
     
    252249                return;
    253250        }
    254 #endif
    255251        QStyledItemDelegate::setModelData(editor, model, index);
    256252    }
     
    262258        QPalette pal = editor->palette();
    263259        QColor col;
    264 #if QT_VERSION >= 0x040500
    265260        bool ok = (QScriptEngine::checkSyntax(text).state() == QScriptSyntaxCheckResult::Valid);
    266 #else
    267         bool ok = true;
    268 #endif
    269261        if (ok) {
    270262            col = Qt::white;
     
    304296    QIcon newBreakpointIcon;
    305297    newBreakpointIcon.addPixmap(d->pixmap(QString::fromLatin1("new.png")), QIcon::Normal);
    306     QAction *newBreakpointAction = new QAction(newBreakpointIcon, QObject::tr("New"), this);
     298    QAction *newBreakpointAction = new QAction(newBreakpointIcon, tr("New"), this);
    307299    QObject::connect(newBreakpointAction, SIGNAL(triggered()),
    308300                     this, SLOT(_q_newBreakpoint()));
     
    310302    QIcon deleteBreakpointIcon;
    311303    deleteBreakpointIcon.addPixmap(d->pixmap(QString::fromLatin1("delete.png")), QIcon::Normal);
    312     d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, QObject::tr("Delete"), this);
     304    d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, tr("Delete"), this);
    313305    d->deleteBreakpointAction->setEnabled(false);
    314306    QObject::connect(d->deleteBreakpointAction, SIGNAL(triggered()),
    315307                     this, SLOT(_q_deleteBreakpoint()));
    316308
     309#ifndef QT_NO_TOOLBAR
    317310    QToolBar *toolBar = new QToolBar();
    318311    toolBar->addAction(newBreakpointAction);
    319312    toolBar->addAction(d->deleteBreakpointAction);
     313#endif
    320314
    321315    QVBoxLayout *vbox = new QVBoxLayout(this);
    322316    vbox->setMargin(0);
     317#ifndef QT_NO_TOOLBAR
    323318    vbox->addWidget(toolBar);
     319#endif
    324320    vbox->addWidget(d->newBreakpointWidget);
    325321    vbox->addWidget(d->view);
  • trunk/src/scripttools/debugging/qscriptbreakpointswidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptbreakpointswidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptbreakpointswidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptbreakpointswidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptcompletionproviderinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptcompletiontask.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4545#include "qscriptdebuggerconsolecommand_p.h"
    4646#include "qscriptdebuggerconsolecommandmanager_p.h"
    47 
    48 #include "qscriptenginedebuggerfrontend_p.h" // ### kill
    49 #include "qscriptdebuggerbackend_p.h" // ### kill
    50 #include <QtScript/qscriptcontext.h>
    51 #include <QtScript/qscriptvalue.h>
    52 #include <QtScript/qscriptvalueiterator.h>
     47#include "qscriptdebuggercommandschedulerjob_p.h"
     48#include "qscriptdebuggercommandschedulerfrontend_p.h"
     49#include "qscriptdebuggerjobschedulerinterface_p.h"
     50#include "qscriptdebuggerresponse_p.h"
    5351
    5452#include "private/qobject_p.h"
     
    6866
    6967    void completeScriptExpression();
     68    void emitFinished();
    7069
    7170    QString contents;
    7271    int cursorPosition;
    7372    int frameIndex;
    74     QScriptDebuggerFrontend *frontend;
     73    QScriptDebuggerCommandSchedulerInterface *commandScheduler;
     74    QScriptDebuggerJobSchedulerInterface *jobScheduler;
    7575    QScriptDebuggerConsole *console;
    7676};
    7777
    7878QScriptCompletionTaskPrivate::QScriptCompletionTaskPrivate()
     79    : cursorPosition(0), frameIndex(0), commandScheduler(0),
     80      jobScheduler(0), console(0)
    7981{
    8082}
     
    8486}
    8587
    86 QScriptCompletionTask::QScriptCompletionTask(
    87     const QString &contents, int cursorPosition,
    88     int frameIndex, QScriptDebuggerFrontend *frontend,
    89     QScriptDebuggerConsole *console,
    90     QObject *parent)
    91     : QScriptCompletionTaskInterface(
    92         *new QScriptCompletionTaskPrivate, parent)
    93 {
    94     Q_D(QScriptCompletionTask);
    95     d->contents = contents;
    96     d->cursorPosition = cursorPosition;
    97     if ((frameIndex == -1) && console)
    98         d->frameIndex = console->currentFrameIndex();
    99     else
    100         d->frameIndex = frameIndex;
    101     d->frontend = frontend;
    102     d->console = console;
    103 }
    104 
    105 QScriptCompletionTask::~QScriptCompletionTask()
    106 {
    107 }
     88class QScriptCompleteExpressionJob : public QScriptDebuggerCommandSchedulerJob
     89{
     90public:
     91    QScriptCompleteExpressionJob(int frameIndex, const QStringList &path,
     92                                 QScriptCompletionTaskPrivate *task,
     93                                 QScriptDebuggerCommandSchedulerInterface *scheduler)
     94        : QScriptDebuggerCommandSchedulerJob(scheduler),
     95          m_frameIndex(frameIndex), m_path(path), m_task(task)
     96        {}
     97
     98    void start()
     99    {
     100        QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this);
     101        frontend.scheduleGetCompletions(m_frameIndex, m_path);
     102    }
     103    void handleResponse(const QScriptDebuggerResponse &response, int /*commandId*/)
     104    {
     105        m_task->results = response.result().toStringList();
     106        m_task->emitFinished();
     107        finish();
     108    }
     109
     110private:
     111    int m_frameIndex;
     112    QStringList m_path;
     113    QScriptCompletionTaskPrivate *m_task;
     114};
    108115
    109116namespace {
     
    122129
    123130} // namespace
     131
     132class QScriptCompleteScriptsJob : public QScriptDebuggerCommandSchedulerJob
     133{
     134public:
     135    QScriptCompleteScriptsJob(const QString &prefix, QScriptCompletionTaskPrivate *task,
     136                              QScriptDebuggerCommandSchedulerInterface *scheduler)
     137        : QScriptDebuggerCommandSchedulerJob(scheduler),
     138          m_prefix(prefix), m_task(task)
     139        {}
     140
     141    void start()
     142    {
     143        QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this);
     144        frontend.scheduleGetScripts();
     145    }
     146    void handleResponse(const QScriptDebuggerResponse &response, int /*commandId*/)
     147    {
     148        QScriptScriptMap scripts = response.resultAsScripts();
     149        QScriptScriptMap::const_iterator it;
     150        for (it = scripts.constBegin(); it != scripts.constEnd(); ++it) {
     151            QString fileName = it.value().fileName();
     152            if (isPrefixOf(m_prefix, fileName))
     153                m_task->results.append(fileName);
     154        }
     155        m_task->emitFinished();
     156        finish();
     157    }
     158private:
     159    QString m_prefix;
     160    QScriptCompletionTaskPrivate *m_task;
     161};
    124162
    125163void QScriptCompletionTaskPrivate::completeScriptExpression()
     
    128166    if ((pos > 0) && contents.at(pos-1).isNumber()) {
    129167        // completion of numbers is pointless
     168        emitFinished();
    130169        return;
    131170    }
     
    133172    while ((pos > 0) && isIdentChar(contents.at(pos-1)))
    134173        --pos;
    135     int pos2 = cursorPosition;
     174    int pos2 = cursorPosition - 1;
    136175    while ((pos2 < contents.size()-1) && isIdentChar(contents.at(pos2+1)))
    137176        ++pos2;
     
    149188    }
    150189
    151     // ### super-cheating for now; have to use the async API
    152     QScriptEngineDebuggerFrontend *edf = static_cast<QScriptEngineDebuggerFrontend*>(frontend);
    153     QScriptDebuggerBackend *backend = edf->backend();
    154     QScriptContext *ctx = backend->context(frameIndex);
    155     QScriptValueList objects;
    156     QString prefix = path.last();
    157     QSet<QString> matches;
    158     if (path.size() > 1) {
    159         const QString &topLevelIdent = path.at(0);
    160         QScriptValue obj;
    161         if (topLevelIdent == QString::fromLatin1("this")) {
    162             obj = ctx->thisObject();
    163         } else {
    164             QScriptValueList scopeChain;
    165 #if QT_VERSION >= 0x040500
    166             scopeChain = ctx->scopeChain();
    167 #else
    168             scopeChain.append(ctx->activationObject());
    169 #endif
    170             for (int i = 0; i < scopeChain.size(); ++i) {
    171                 QScriptValue oo = scopeChain.at(i).property(topLevelIdent);
    172                 if (oo.isObject()) {
    173                     obj = oo;
    174                     break;
    175                 }
    176             }
    177         }
    178         for (int i = 1; obj.isObject() && (i < path.size()-1); ++i)
    179             obj = obj.property(path.at(i));
    180         if (obj.isValid())
    181             objects.append(obj);
    182     } else {
    183 #if QT_VERSION >= 0x040500
    184         objects << ctx->scopeChain();
    185 #else
    186         objects.append(ctx->activationObject());
    187 #endif
    188         QStringList keywords;
    189         keywords.append(QString::fromLatin1("this"));
    190         keywords.append(QString::fromLatin1("true"));
    191         keywords.append(QString::fromLatin1("false"));
    192         keywords.append(QString::fromLatin1("null"));
    193         for (int i = 0; i < keywords.size(); ++i) {
    194             const QString &kwd = keywords.at(i);
    195             if (isPrefixOf(prefix, kwd))
    196                 matches.insert(kwd);
    197         }
    198     }
    199 
    200     for (int i = 0; i < objects.size(); ++i) {
    201         QScriptValue obj = objects.at(i);
    202         while (obj.isObject()) {
    203             QScriptValueIterator it(obj);
    204             while (it.hasNext()) {
    205                 it.next();
    206                 QString propertyName = it.name();
    207                 if (isPrefixOf(prefix, propertyName))
    208                     matches.insert(propertyName);
    209             }
    210             obj = obj.prototype();
    211         }
    212     }
    213     results = matches.toList();
    214     qStableSort(results);
    215 
    216     length = prefix.length();
     190    length = path.last().length();
    217191    type = QScriptCompletionTask::ScriptIdentifierCompletion;
     192
     193    QScriptDebuggerJob *job = new QScriptCompleteExpressionJob(frameIndex, path, this, commandScheduler);
     194    jobScheduler->scheduleJob(job);
     195}
     196
     197void QScriptCompletionTaskPrivate::emitFinished()
     198{
     199    emit q_func()->finished();
     200}
     201
     202QScriptCompletionTask::QScriptCompletionTask(
     203    const QString &contents, int cursorPosition, int frameIndex,
     204    QScriptDebuggerCommandSchedulerInterface *commandScheduler,
     205    QScriptDebuggerJobSchedulerInterface *jobScheduler,
     206    QScriptDebuggerConsole *console,
     207    QObject *parent)
     208    : QScriptCompletionTaskInterface(
     209        *new QScriptCompletionTaskPrivate, parent)
     210{
     211    Q_D(QScriptCompletionTask);
     212    d->contents = contents;
     213    d->cursorPosition = cursorPosition;
     214    if ((frameIndex == -1) && console)
     215        d->frameIndex = console->currentFrameIndex();
     216    else
     217        d->frameIndex = frameIndex;
     218    d->commandScheduler = commandScheduler;
     219    d->jobScheduler = jobScheduler;
     220    d->console = console;
     221}
     222
     223QScriptCompletionTask::~QScriptCompletionTask()
     224{
    218225}
    219226
     
    232239            // editing command --> get command completions
    233240            d->results = d->console->commandManager()->completions(prefix);
    234             qStableSort(d->results);
    235241            d->position = cmdRx.pos(1);
    236242            d->length = prefix.length();
     
    265271            QString argType = cmd->argumentTypes().value(argNum);
    266272            if (!argType.isEmpty()) {
    267                 if (argType == QString::fromLatin1("command-or-group-name")) {
     273                if (argType == QLatin1String("command-or-group-name")) {
    268274                    d->results = d->console->commandManager()->completions(arg);
    269                 } else if (argType == QString::fromLatin1("script-filename")) {
    270                     // ### super-cheating for now; have to use the async API
    271                     QScriptEngineDebuggerFrontend *edf = static_cast<QScriptEngineDebuggerFrontend*>(d->frontend);
    272                     QScriptDebuggerBackend *backend = edf->backend();
    273                     QScriptScriptMap scripts = backend->scripts();
    274                     QScriptScriptMap::const_iterator it;
    275                     for (it = scripts.constBegin(); it != scripts.constEnd(); ++it) {
    276                         QString fileName = it.value().fileName();
    277                         if (isPrefixOf(arg, fileName))
    278                             d->results.append(fileName);
    279                     }
    280                 } else if (argType == QString::fromLatin1("subcommand-name")) {
     275                } else if (argType == QLatin1String("script-filename")) {
     276                    d->position = pos;
     277                    d->length = arg.length();
     278                    d->type = CommandArgumentCompletion;
     279                    QScriptDebuggerJob *job = new QScriptCompleteScriptsJob(arg, d, d->commandScheduler);
     280                    d->jobScheduler->scheduleJob(job);
     281                } else if (argType == QLatin1String("subcommand-name")) {
    281282                    for (int i = 0; i < cmd->subCommands().size(); ++i) {
    282283                        QString name = cmd->subCommands().at(i);
     
    284285                            d->results.append(name);
    285286                    }
    286                 } else if (argType == QString::fromLatin1("script")) {
     287                    qStableSort(d->results);
     288                } else if (argType == QLatin1String("script")) {
    287289                    d->completeScriptExpression();
     290                } else {
     291                    emit finished();
    288292                }
    289293                if ((d->type == NoCompletion) && !d->results.isEmpty()) {
    290                     qStableSort(d->results);
    291294                    d->position = pos;
    292295                    d->length = arg.length();
    293296                    d->type = CommandArgumentCompletion;
     297                    emit finished();
    294298                }
    295299            }
    296             emit finished();
    297300        }
    298301    } else {
    299302        // assume it's an eval expression
    300303        d->completeScriptExpression();
    301         emit finished();
    302304    }
    303305}
  • trunk/src/scripttools/debugging/qscriptcompletiontask_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6161QT_BEGIN_NAMESPACE
    6262
    63 class QScriptDebuggerFrontend;
     63class QScriptDebuggerCommandSchedulerInterface;
     64class QScriptDebuggerJobSchedulerInterface;
    6465class QScriptDebuggerConsole;
    6566
     
    7172public:
    7273    QScriptCompletionTask(
    73         const QString &contents, int cursorPosition,
    74         int frameIndex,
    75         QScriptDebuggerFrontend *frontend,
     74        const QString &contents, int cursorPosition, int frameIndex,
     75        QScriptDebuggerCommandSchedulerInterface *commandScheduler,
     76        QScriptDebuggerJobSchedulerInterface *jobScheduler,
    7677        QScriptDebuggerConsole *console,
    7778        QObject *parent = 0);
  • trunk/src/scripttools/debugging/qscriptcompletiontaskinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptcompletiontaskinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptcompletiontaskinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebugger.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7676#include "qscriptxmlparser_p.h"
    7777
    78 #include "qscriptenginedebuggerfrontend_p.h"
    79 #include "qscriptdebuggerbackend_p.h"
    80 #include <QtScript/qscriptengine.h>
    81 
    8278#include "private/qobject_p.h"
    8379
     
    9591#include <QtGui/qicon.h>
    9692#include <QtGui/qinputdialog.h>
     93#include <QtGui/qmenu.h>
     94#include <QtGui/qtoolbar.h>
     95#include <QtGui/qtooltip.h>
    9796
    9897QT_BEGIN_NAMESPACE
     
    138137  \brief The QScriptDebugger class provides a Qt Script debugger.
    139138
    140   \ingroup scripttools
    141   \mainclass
     139  \ingroup script
     140
    142141*/
    143142
     
    172171        const QString &contents, int cursorPosition, int frameIndex, int options);
    173172
    174     QString toolTip(int frameIndex, int lineNumber,
    175                     const QStringList &path);
     173    void showToolTip(const QPoint &pos, int frameIndex,
     174                     int lineNumber, const QStringList &path);
    176175
    177176    static QPixmap pixmap(const QString &path);
     
    634633}
    635634
     635class QScriptToolTipJob : public QScriptDebuggerCommandSchedulerJob
     636{
     637public:
     638    QScriptToolTipJob(const QPoint &pos, int frameIndex,
     639                      int lineNumber, const QStringList &path,
     640                      QScriptDebuggerCommandSchedulerInterface *scheduler)
     641        : QScriptDebuggerCommandSchedulerJob(scheduler), m_pos(pos),
     642          m_frameIndex(frameIndex), m_lineNumber(lineNumber), m_path(path)
     643        {}
     644
     645    void start()
     646    {
     647        QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this);
     648        frontend.scheduleGetPropertyExpressionValue(m_frameIndex, m_lineNumber, m_path);
     649    }
     650    void handleResponse(const QScriptDebuggerResponse &response, int /*commandId*/)
     651    {
     652        QString tip = response.result().toString();
     653        if (tip.indexOf(QLatin1Char('\n')) != -1) {
     654            QStringList lines = tip.split(QLatin1Char('\n'));
     655            int lineCount = lines.size();
     656            if (lineCount > 5) {
     657                lines = lines.mid(0, 5);
     658                lines.append(QString::fromLatin1("(... %0 more lines ...)").arg(lineCount - 5));
     659            }
     660            tip = lines.join(QLatin1String("\n"));
     661        }
     662        QToolTip::showText(m_pos, tip);
     663        finish();
     664    }
     665
     666private:
     667    QPoint m_pos;
     668    int m_frameIndex;
     669    int m_lineNumber;
     670    QStringList m_path;
     671};
     672
    636673/*!
    637674  \reimp
    638675*/
    639 QString QScriptDebuggerPrivate::toolTip(int frameIndex, int lineNumber,
    640                                         const QStringList &path)
     676void QScriptDebuggerPrivate::showToolTip(const QPoint &pos, int frameIndex,
     677                                         int lineNumber, const QStringList &path)
    641678{
    642679    if (frameIndex == -1) {
     
    646683            frameIndex = console->currentFrameIndex();
    647684    }
    648     // ### cheating for now, need to use async API
    649     QScriptEngineDebuggerFrontend *edf = static_cast<QScriptEngineDebuggerFrontend*>(frontend);
    650     QScriptDebuggerBackend *backend = edf->backend();
    651     QScriptContext *ctx = backend->context(frameIndex);
    652     if (!ctx || path.isEmpty())
    653         return QString();
    654     QScriptContextInfo ctxInfo(ctx);
    655     if (ctx->callee().isValid()
    656         && ((lineNumber < ctxInfo.functionStartLineNumber())
    657             || (lineNumber > ctxInfo.functionEndLineNumber()))) {
    658         return QString();
    659     }
    660     QScriptValueList objects;
    661     int pathIndex = 0;
    662     if (path.at(0) == QLatin1String("this")) {
    663         objects.append(ctx->thisObject());
    664         ++pathIndex;
    665     } else {
    666 #if QT_VERSION >= 0x040500
    667         objects << ctx->scopeChain();
    668 #else
    669         objects.append(ctx->activationObject());
    670 #endif
    671     }
    672     for (int i = 0; i < objects.size(); ++i) {
    673         QScriptValue val = objects.at(i);
    674         for (int j = pathIndex; val.isValid() && (j < path.size()); ++j) {
    675             val = val.property(path.at(j));
    676         }
    677         if (val.isValid()) {
    678             bool hadException = (ctx->state() == QScriptContext::ExceptionState);
    679             QString str = val.toString();
    680             if (!hadException && backend->engine()->hasUncaughtException())
    681                 backend->engine()->clearExceptions();
    682             return str;
    683         }
    684     }
    685     return QString();
     685    QScriptDebuggerJob *job = new QScriptToolTipJob(pos, frameIndex, lineNumber, path, this);
     686    scheduleJob(job);
    686687}
    687688
     
    693694{
    694695    return new QScriptCompletionTask(
    695         contents, cursorPosition, frameIndex, frontend,
     696        contents, cursorPosition, frameIndex, this, this,
    696697        (options & QScriptCompletionProviderInterface::ConsoleCommandCompletion) ? console : 0);
    697698}
     
    882883        return;
    883884    bool ok = false;
    884     int lineNumber = QInputDialog::getInteger(0, QObject::tr("Go to Line"),
    885                                               QObject::tr("Line:"),
     885    int lineNumber = QInputDialog::getInteger(0, QScriptDebugger::tr("Go to Line"),
     886                                              QScriptDebugger::tr("Line:"),
    886887                                              view->cursorLineNumber(),
    887888                                              1, INT_MAX, 1, &ok);
     
    992993            m_debugger->scriptsModel->addScript(scriptId, data);
    993994
    994 #if QT_VERSION >= 0x040500
    995995            // ### could be slow, might want to do this in a separate thread
    996             QString xml = qt_scriptToXml(data.contents(), data.baseLineNumber());
     996//            Q_ASSERT_X(false, Q_FUNC_INFO, "implement me");
     997            QString xml; // = qt_scriptToXml(data.contents(), data.baseLineNumber());
    997998            QScriptXmlParser::Result extraInfo = QScriptXmlParser::parse(xml);
    998999            m_debugger->scriptsModel->addExtraScriptInfo(
    9991000                scriptId, extraInfo.functionsInfo, extraInfo.executableLineNumbers);
    1000 #endif
    10011001
    10021002            if (++m_index < m_added.size())
     
    10201020    SyncBreakpointsJob(QScriptDebuggerPrivate *debugger)
    10211021        : QScriptDebuggerCommandSchedulerJob(debugger),
    1022           m_debugger(debugger) {}
     1022          m_debugger(debugger), m_index(-1) {}
    10231023    void start()
    10241024    {
     
    10791079    LoadLocalsJob(QScriptDebuggerPrivate *debugger, int frameIndex)
    10801080        : QScriptDebuggerCommandSchedulerJob(debugger),
    1081           m_debugger(debugger), m_frameIndex(frameIndex), m_state(0) {}
     1081          m_debugger(debugger), m_frameIndex(frameIndex) {}
    10821082
    10831083    void start()
     
    11111111    QScriptDebuggerPrivate *m_debugger;
    11121112    int m_frameIndex;
    1113     int m_state;
    11141113};
    11151114
     
    13381337}
    13391338
     1339QAction *QScriptDebugger::action(DebuggerAction action, QObject *parent)
     1340{
     1341    switch (action) {
     1342    case InterruptAction:
     1343        return interruptAction(parent);
     1344    case ContinueAction:
     1345        return continueAction(parent);
     1346    case StepIntoAction:
     1347        return stepIntoAction(parent);
     1348    case StepOverAction:
     1349        return stepOverAction(parent);
     1350    case StepOutAction:
     1351        return stepOutAction(parent);
     1352    case RunToCursorAction:
     1353        return runToCursorAction(parent);
     1354    case RunToNewScriptAction:
     1355        return runToNewScriptAction(parent);
     1356    case ToggleBreakpointAction:
     1357        return toggleBreakpointAction(parent);
     1358    case ClearDebugOutputAction:
     1359        return clearDebugOutputAction(parent);
     1360    case ClearErrorLogAction:
     1361        return clearErrorLogAction(parent);
     1362    case ClearConsoleAction:
     1363        return clearConsoleAction(parent);
     1364    case FindInScriptAction:
     1365        return findInScriptAction(parent);
     1366    case FindNextInScriptAction:
     1367        return findNextInScriptAction(parent);
     1368    case FindPreviousInScriptAction:
     1369        return findPreviousInScriptAction(parent);
     1370    case GoToLineAction:
     1371        return goToLineAction(parent);
     1372    }
     1373    return 0;
     1374}
     1375
     1376QWidget *QScriptDebugger::widget(DebuggerWidget widget)
     1377{
     1378    switch (widget) {
     1379    case ConsoleWidget: {
     1380        QScriptDebuggerConsoleWidgetInterface *w = consoleWidget();
     1381        if (!w && widgetFactory()) {
     1382            w = widgetFactory()->createConsoleWidget();
     1383            setConsoleWidget(w);
     1384        }
     1385        return w;
     1386    }
     1387    case StackWidget: {
     1388        QScriptDebuggerStackWidgetInterface *w = stackWidget();
     1389        if (!w && widgetFactory()) {
     1390            w = widgetFactory()->createStackWidget();
     1391            setStackWidget(w);
     1392        }
     1393        return w;
     1394    }
     1395    case ScriptsWidget: {
     1396        QScriptDebuggerScriptsWidgetInterface *w = scriptsWidget();
     1397        if (!w && widgetFactory()) {
     1398            w = widgetFactory()->createScriptsWidget();
     1399            setScriptsWidget(w);
     1400        }
     1401        return w;
     1402    }
     1403    case LocalsWidget: {
     1404        QScriptDebuggerLocalsWidgetInterface *w = localsWidget();
     1405        if (!w && widgetFactory()) {
     1406            w = widgetFactory()->createLocalsWidget();
     1407            setLocalsWidget(w);
     1408        }
     1409        return w;
     1410    }
     1411    case CodeWidget: {
     1412        QScriptDebuggerCodeWidgetInterface *w = codeWidget();
     1413        if (!w && widgetFactory()) {
     1414            w = widgetFactory()->createCodeWidget();
     1415            setCodeWidget(w);
     1416        }
     1417        return w;
     1418    }
     1419    case CodeFinderWidget: {
     1420        QScriptDebuggerCodeFinderWidgetInterface *w = codeFinderWidget();
     1421        if (!w && widgetFactory()) {
     1422            w = widgetFactory()->createCodeFinderWidget();
     1423            setCodeFinderWidget(w);
     1424        }
     1425        return w;
     1426    }
     1427    case BreakpointsWidget: {
     1428        QScriptBreakpointsWidgetInterface *w = breakpointsWidget();
     1429        if (!w && widgetFactory()) {
     1430            w = widgetFactory()->createBreakpointsWidget();
     1431            setBreakpointsWidget(w);
     1432        }
     1433        return w;
     1434    }
     1435    case DebugOutputWidget: {
     1436        QScriptDebugOutputWidgetInterface *w = debugOutputWidget();
     1437        if (!w && widgetFactory()) {
     1438            w = widgetFactory()->createDebugOutputWidget();
     1439            setDebugOutputWidget(w);
     1440        }
     1441        return w;
     1442    }
     1443    case ErrorLogWidget: {
     1444        QScriptErrorLogWidgetInterface *w = errorLogWidget();
     1445        if (!w && widgetFactory()) {
     1446            w = widgetFactory()->createErrorLogWidget();
     1447            setErrorLogWidget(w);
     1448        }
     1449        return w;
     1450    }
     1451    }
     1452    return 0;
     1453}
     1454
    13401455QScriptDebuggerConsoleWidgetInterface *QScriptDebugger::consoleWidget() const
    13411456{
     
    15601675        interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_interrupt.png")), QIcon::Disabled);
    15611676        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1562         that->d_func()->interruptAction = new QAction(interruptIcon, QObject::tr("Interrupt"), parent);
     1677        that->d_func()->interruptAction = new QAction(interruptIcon, QScriptDebugger::tr("Interrupt"), parent);
    15631678        d->interruptAction->setEnabled(!d->interactive);
    1564         d->interruptAction->setShortcut(QObject::tr("Shift+F5"));
     1679        d->interruptAction->setShortcut(QScriptDebugger::tr("Shift+F5"));
    15651680        QObject::connect(d->interruptAction, SIGNAL(triggered()),
    15661681                         that, SLOT(_q_interrupt()));
     
    15771692        continueIcon.addPixmap(d->pixmap(QString::fromLatin1("d_play.png")), QIcon::Disabled);
    15781693        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1579         that->d_func()->continueAction = new QAction(continueIcon, QObject::tr("Continue"), parent);
     1694        that->d_func()->continueAction = new QAction(continueIcon, QScriptDebugger::tr("Continue"), parent);
    15801695        d->continueAction->setEnabled(d->interactive);
    1581         d->continueAction->setShortcut(QObject::tr("F5"));
     1696        d->continueAction->setShortcut(QScriptDebugger::tr("F5"));
    15821697        QObject::connect(d->continueAction, SIGNAL(triggered()),
    15831698                         that, SLOT(_q_continue()));
     
    15941709        stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepinto.png")), QIcon::Disabled);
    15951710        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1596         that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QObject::tr("Step Into"), parent);
     1711        that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QScriptDebugger::tr("Step Into"), parent);
    15971712        d->stepIntoAction->setEnabled(d->interactive);
    1598         d->stepIntoAction->setShortcut(QObject::tr("F11"));
     1713        d->stepIntoAction->setShortcut(QScriptDebugger::tr("F11"));
    15991714        QObject::connect(d->stepIntoAction, SIGNAL(triggered()),
    16001715                         that, SLOT(_q_stepInto()));
     
    16111726        stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepover.png")), QIcon::Disabled);
    16121727        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1613         that->d_func()->stepOverAction = new QAction(stepOverIcon, QObject::tr("Step Over"), parent);
     1728        that->d_func()->stepOverAction = new QAction(stepOverIcon, QScriptDebugger::tr("Step Over"), parent);
    16141729        d->stepOverAction->setEnabled(d->interactive);
    1615         d->stepOverAction->setShortcut(QObject::tr("F10"));
     1730        d->stepOverAction->setShortcut(QScriptDebugger::tr("F10"));
    16161731        QObject::connect(d->stepOverAction, SIGNAL(triggered()),
    16171732                         that, SLOT(_q_stepOver()));
     
    16281743        stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepout.png")), QIcon::Disabled);
    16291744        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1630         that->d_func()->stepOutAction = new QAction(stepOutIcon, QObject::tr("Step Out"), parent);
     1745        that->d_func()->stepOutAction = new QAction(stepOutIcon, QScriptDebugger::tr("Step Out"), parent);
    16311746        d->stepOutAction->setEnabled(d->interactive);
    1632         d->stepOutAction->setShortcut(QObject::tr("Shift+F11"));
     1747        d->stepOutAction->setShortcut(QScriptDebugger::tr("Shift+F11"));
    16331748        QObject::connect(d->stepOutAction, SIGNAL(triggered()),
    16341749                         that, SLOT(_q_stepOut()));
     
    16451760        runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("d_runtocursor.png")), QIcon::Disabled);
    16461761        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1647         that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QObject::tr("Run to Cursor"), parent);
     1762        that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QScriptDebugger::tr("Run to Cursor"), parent);
    16481763        d->runToCursorAction->setEnabled(d->interactive);
    1649         d->runToCursorAction->setShortcut(QObject::tr("Ctrl+F10"));
     1764        d->runToCursorAction->setShortcut(QScriptDebugger::tr("Ctrl+F10"));
    16501765        QObject::connect(d->runToCursorAction, SIGNAL(triggered()),
    16511766                         that, SLOT(_q_runToCursor()));
     
    16631778        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    16641779        that->d_func()->runToNewScriptAction = new QAction(runToNewScriptIcon,
    1665                                                            QObject::tr("Run to New Script"), parent);
     1780                                                           QScriptDebugger::tr("Run to New Script"), parent);
    16661781        d->runToNewScriptAction->setEnabled(d->interactive);
    16671782        QObject::connect(d->runToNewScriptAction, SIGNAL(triggered()),
     
    16781793        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    16791794        that->d_func()->toggleBreakpointAction = new QAction(toggleBreakpointIcon,
    1680                                                              QObject::tr("Toggle Breakpoint"), parent);
    1681         d->toggleBreakpointAction->setShortcut(QObject::tr("F9"));
     1795                                                             QScriptDebugger::tr("Toggle Breakpoint"), parent);
     1796        d->toggleBreakpointAction->setShortcut(QScriptDebugger::tr("F9"));
    16821797        d->toggleBreakpointAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0));
    16831798        QObject::connect(d->toggleBreakpointAction, SIGNAL(triggered()),
     
    16931808        QIcon clearDebugOutputIcon;
    16941809        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1695         that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QObject::tr("Clear Debug Output"), parent);
     1810        that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QScriptDebugger::tr("Clear Debug Output"), parent);
    16961811        QObject::connect(d->clearDebugOutputAction, SIGNAL(triggered()),
    16971812                         that, SLOT(_q_clearDebugOutput()));
     
    17061821        QIcon clearErrorLogIcon;
    17071822        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1708         that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QObject::tr("Clear Error Log"), parent);
     1823        that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QScriptDebugger::tr("Clear Error Log"), parent);
    17091824        QObject::connect(d->clearErrorLogAction, SIGNAL(triggered()),
    17101825                         that, SLOT(_q_clearErrorLog()));
     
    17191834        QIcon clearConsoleIcon;
    17201835        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1721         that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QObject::tr("Clear Console"), parent);
     1836        that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QScriptDebugger::tr("Clear Console"), parent);
    17221837        QObject::connect(d->clearConsoleAction, SIGNAL(triggered()),
    17231838                         that, SLOT(_q_clearConsole()));
     
    17331848        findInScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("find.png")), QIcon::Normal);
    17341849        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1735         that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QObject::tr("&Find in Script..."), parent);
    1736         d->findInScriptAction->setShortcut(QObject::tr("Ctrl+F"));
     1850        that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QScriptDebugger::tr("&Find in Script..."), parent);
     1851        d->findInScriptAction->setShortcut(QScriptDebugger::tr("Ctrl+F"));
    17371852        d->findInScriptAction->setEnabled(
    17381853            (d->codeFinderWidget != 0)
     
    17511866        QIcon findNextInScriptIcon;
    17521867        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1753         that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QObject::tr("Find &Next"), parent);
     1868        that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QScriptDebugger::tr("Find &Next"), parent);
    17541869        d->findNextInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty());
    1755         d->findNextInScriptAction->setShortcut(QObject::tr("F3"));
     1870        d->findNextInScriptAction->setShortcut(QScriptDebugger::tr("F3"));
    17561871        QObject::connect(d->findNextInScriptAction, SIGNAL(triggered()),
    17571872                         that, SLOT(_q_findNextInScript()));
     
    17661881        QIcon findPreviousInScriptIcon;
    17671882        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1768         that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QObject::tr("Find &Previous"), parent);
     1883        that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QScriptDebugger::tr("Find &Previous"), parent);
    17691884        d->findPreviousInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty());
    1770         d->findPreviousInScriptAction->setShortcut(QObject::tr("Shift+F3"));
     1885        d->findPreviousInScriptAction->setShortcut(QScriptDebugger::tr("Shift+F3"));
    17711886        QObject::connect(d->findPreviousInScriptAction, SIGNAL(triggered()),
    17721887                         that, SLOT(_q_findPreviousInScript()));
     
    17811896        QIcon goToLineIcon;
    17821897        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1783         that->d_func()->goToLineAction = new QAction(goToLineIcon, QObject::tr("Go to Line"), parent);
    1784         d->goToLineAction->setShortcut(QObject::tr("Ctrl+G"));
     1898        that->d_func()->goToLineAction = new QAction(goToLineIcon, QScriptDebugger::tr("Go to Line"), parent);
     1899        d->goToLineAction->setShortcut(QScriptDebugger::tr("Ctrl+G"));
    17851900        d->goToLineAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0));
    17861901        QObject::connect(d->goToLineAction, SIGNAL(triggered()),
     
    17881903    }
    17891904    return d->goToLineAction;
     1905}
     1906
     1907QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actionParent)
     1908{
     1909    QMenu *menu = new QMenu(widgetParent);
     1910    menu->setTitle(QScriptDebugger::tr("Debug"));
     1911    menu->addAction(action(ContinueAction, actionParent));
     1912    menu->addAction(action(InterruptAction, actionParent));
     1913    menu->addAction(action(StepIntoAction, actionParent));
     1914    menu->addAction(action(StepOverAction, actionParent));
     1915    menu->addAction(action(StepOutAction, actionParent));
     1916    menu->addAction(action(RunToCursorAction, actionParent));
     1917    menu->addAction(action(RunToNewScriptAction, actionParent));
     1918
     1919    menu->addSeparator();
     1920    menu->addAction(action(ToggleBreakpointAction, actionParent));
     1921
     1922    menu->addSeparator();
     1923    menu->addAction(action(ClearDebugOutputAction, actionParent));
     1924    menu->addAction(action(ClearErrorLogAction, actionParent));
     1925    menu->addAction(action(ClearConsoleAction, actionParent));
     1926
     1927    return menu;
     1928}
     1929
     1930#ifndef QT_NO_TOOLBAR
     1931QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject *actionParent)
     1932{
     1933    QToolBar *tb = new QToolBar(widgetParent);
     1934    tb->setObjectName(QLatin1String("qtscriptdebugger_standardToolBar"));
     1935    tb->addAction(action(ContinueAction, actionParent));
     1936    tb->addAction(action(InterruptAction, actionParent));
     1937    tb->addAction(action(StepIntoAction, actionParent));
     1938    tb->addAction(action(StepOverAction, actionParent));
     1939    tb->addAction(action(StepOutAction, actionParent));
     1940    tb->addAction(action(RunToCursorAction, actionParent));
     1941    tb->addAction(action(RunToNewScriptAction, actionParent));
     1942    tb->addSeparator();
     1943    tb->addAction(action(FindInScriptAction, actionParent));
     1944    return tb;
     1945}
     1946#endif
     1947
     1948bool QScriptDebugger::isInteractive() const
     1949{
     1950    Q_D(const QScriptDebugger);
     1951    return d->interactive;
    17901952}
    17911953
  • trunk/src/scripttools/debugging/qscriptdebugger_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7171class QAction;
    7272class QEvent;
     73class QMenu;
     74#ifndef QT_NO_TOOLBAR
     75class QToolBar;
     76#endif
    7377
    7478class QScriptDebuggerPrivate;
     
    7781    Q_OBJECT
    7882public:
     83    // mirrors QScriptEngineDebugger::DebuggerWidget
     84    enum DebuggerWidget {
     85        ConsoleWidget,
     86        StackWidget,
     87        ScriptsWidget,
     88        LocalsWidget,
     89        CodeWidget,
     90        CodeFinderWidget,
     91        BreakpointsWidget,
     92        DebugOutputWidget,
     93        ErrorLogWidget
     94    };
     95    // mirrors QScriptEngineDebugger::DebuggerAction
     96    enum DebuggerAction {
     97        InterruptAction,
     98        ContinueAction,
     99        StepIntoAction,
     100        StepOverAction,
     101        StepOutAction,
     102        RunToCursorAction,
     103        RunToNewScriptAction,
     104        ToggleBreakpointAction,
     105        ClearDebugOutputAction,
     106        ClearErrorLogAction,
     107        ClearConsoleAction,
     108        FindInScriptAction,
     109        FindNextInScriptAction,
     110        FindPreviousInScriptAction,
     111        GoToLineAction
     112    };
     113
    79114    QScriptDebugger(QObject *parent = 0);
    80115    ~QScriptDebugger();
     
    82117    QScriptDebuggerFrontend *frontend() const;
    83118    void setFrontend(QScriptDebuggerFrontend *frontend);
     119
     120    QWidget *widget(DebuggerWidget widget);
     121    QAction *action(DebuggerAction action, QObject *parent);
    84122
    85123    QScriptDebuggerConsoleWidgetInterface *consoleWidget() const;
     
    132170    QAction *clearErrorLogAction(QObject *parent) const;
    133171
     172    QMenu *createStandardMenu(QWidget *widgetParent, QObject *actionParent);
     173#ifndef QT_NO_TOOLBAR
     174    QToolBar *createStandardToolBar(QWidget *widgetParent, QObject *actionParent);
     175#endif
    134176    bool eventFilter(QObject *, QEvent *e);
     177
     178    bool isInteractive() const;
    135179
    136180Q_SIGNALS:
  • trunk/src/scripttools/debugging/qscriptdebuggeragent.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6262
    6363QScriptDebuggerAgentPrivate::QScriptDebuggerAgentPrivate()
    64 {
    65     state = NoState;
    66     nextBreakpointId = 1;
    67     nextContextId = 0;
    68     statementCounter = 0;
     64    : state(NoState), stepDepth(0), stepCount(0),
     65        targetScriptId(-1), targetLineNumber(-1), returnCounter(0),
     66        nextBreakpointId(1), hitBreakpointId(0),
     67        nextContextId(0), statementCounter(0)
     68{
    6969}
    7070
     
    8989QScriptDebuggerAgent::QScriptDebuggerAgent(
    9090    QScriptDebuggerBackendPrivate *backend, QScriptEngine *engine)
    91 #if QT_VERSION >= 0x040500
    92     : QScriptEngineAgent(*new QScriptDebuggerAgentPrivate, engine)
    93 #else
    94     : QScriptEngineAgent(engine), d_ptr(new QScriptDebuggerAgentPrivate)
    95 #endif
    96 {
    97     Q_D(QScriptDebuggerAgent);
    98 #if QT_VERSION < 0x040500
    99     d_ptr->q_ptr = this;
    100 #endif
     91    : QScriptEngineAgent(engine), d_ptr(new QScriptDebuggerAgentPrivate())
     92{
     93    Q_D(QScriptDebuggerAgent);
    10194    d->backend = backend;
    10295
     
    118111    if (d->backend)
    119112        d->backend->agentDestroyed(this);
    120 #if QT_VERSION < 0x040500
    121     delete d_ptr;
    122 #endif
     113    delete d;
    123114}
    124115
     
    713704bool QScriptDebuggerAgent::supportsExtension(Extension extension) const
    714705{
    715 #if QT_VERSION >= 0x040500
    716706    return (extension == DebuggerInvocationRequest);
    717 #else
    718     Q_UNUSED(extension);
    719     return false;
    720 #endif
    721707}
    722708
     
    728714{
    729715    Q_UNUSED(extension);
    730 #if QT_VERSION >= 0x040500
    731716    Q_D(QScriptDebuggerAgent);
    732717    Q_ASSERT(extension == DebuggerInvocationRequest);
     
    740725            scriptId, lineNumber, columnNumber);
    741726    }
    742 #else
    743     Q_UNUSED(argument);
    744 #endif
    745727    return QVariant();
    746728}
  • trunk/src/scripttools/debugging/qscriptdebuggeragent_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    126126
    127127private:
    128 #if QT_VERSION < 0x040500
    129128    QScriptDebuggerAgentPrivate *d_ptr;
    130 #endif
    131129    Q_DECLARE_PRIVATE(QScriptDebuggerAgent)
    132130    Q_DISABLE_COPY(QScriptDebuggerAgent)
  • trunk/src/scripttools/debugging/qscriptdebuggeragent_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5454//
    5555
    56 #include <private/qscriptengineagent_p.h>
    57 
    5856#include <QtScript/qscriptvalue.h>
    5957#include <QtCore/qdatetime.h>
     
    6967class QScriptDebuggerAgent;
    7068class QScriptDebuggerAgentPrivate
    71 #if QT_VERSION >= 0x040500
    72     : public QScriptEngineAgentPrivate
    73 #endif
    7469{
    75     Q_DECLARE_PUBLIC(QScriptDebuggerAgent)
    7670public:
    7771    enum State {
     
    126120
    127121    QScriptDebuggerBackendPrivate *backend;
    128 
    129 #if QT_VERSION < 0x040500
    130     QScriptDebuggerAgent *q_ptr;
    131 #endif
    132122};
    133123
  • trunk/src/scripttools/debugging/qscriptdebuggerbackend.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    132132
    133133QScriptDebuggerBackendPrivate::QScriptDebuggerBackendPrivate()
    134 {
    135     eventReceiver = 0;
    136     agent = 0;
    137     commandExecutor = 0;
    138     pendingEvaluateLineNumber = -1;
    139     ignoreExceptions = false;
    140     nextScriptValueIteratorId = 0;
    141     nextScriptObjectSnapshotId = 0;
     134    : agent(0), commandExecutor(0),
     135        pendingEvaluateContextIndex(-1), pendingEvaluateLineNumber(-1),
     136        ignoreExceptions(false),
     137        nextScriptValueIteratorId(0), nextScriptObjectSnapshotId(0),
     138        eventReceiver(0),
     139        q_ptr(0) // q_ptr will be set later by QScriptDebuggerBackend constructor
     140{
    142141}
    143142
     
    293292    for (int i = 0; i < context->argumentCount(); ++i) {
    294293        if (i > 0)
    295             str.append(QLatin1String(" "));
     294            str.append(QLatin1Char(' '));
    296295        str.append(context->argument(i).toString());
    297296    }
     
    386385{
    387386    detach();
    388     delete d_ptr;
    389387}
    390388
     
    413411    d->agent = new QScriptDebuggerAgent(d, engine);
    414412    QScriptValue global = engine->globalObject();
     413    d->origTraceFunction = global.property(QString::fromLatin1("print"));
    415414    global.setProperty(QString::fromLatin1("print"), traceFunction());
    416415//    global.setProperty(QString::fromLatin1("qAssert"), assertFunction());
     416    d->origFileNameFunction = global.property(QString::fromLatin1("__FILE__"));
    417417    global.setProperty(QString::fromLatin1("__FILE__"), fileNameFunction(),
    418                        QScriptValue::PropertyGetter | QScriptValue::PropertySetter
    419                        | QScriptValue::ReadOnly);
     418                       QScriptValue::PropertyGetter | QScriptValue::ReadOnly);
     419    d->origLineNumberFunction = global.property(QString::fromLatin1("__LINE__"));
    420420    global.setProperty(QString::fromLatin1("__LINE__"), lineNumberFunction(),
    421                        QScriptValue::PropertyGetter | QScriptValue::PropertySetter
    422                        | QScriptValue::ReadOnly);
     421                       QScriptValue::PropertyGetter | QScriptValue::ReadOnly);
    423422    engine->setAgent(d->agent);
    424423}
     
    434433{
    435434    Q_D(QScriptDebuggerBackend);
    436     if (!d->agent)
    437         return;
    438     QScriptEngine *eng = d->agent->engine();
    439     if (eng && eng->agent() == d->agent) {
    440         eng->setAgent(0);
    441         QScriptValue global = eng->globalObject();
    442         if (global.property(QString::fromLatin1("print")).strictlyEquals(traceFunction()))
    443             global.setProperty(QString::fromLatin1("print"), QScriptValue());
    444 //        global.setProperty(QString::fromLatin1("qAssert"), QScriptValue());
    445         if (global.property(QString::fromLatin1("__FILE__")).strictlyEquals(fileNameFunction()))
    446             global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue());
    447         if (global.property(QString::fromLatin1("__LINE__")).strictlyEquals(lineNumberFunction()))
    448             global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue());
    449         d->agent->nullifyBackendPointer();
    450         d->agent = 0; // agent is owned by engine
     435    if (d->agent) {
     436        QScriptEngine *eng = d->agent->engine();
     437        if (eng && eng->agent() == d->agent) {
     438            eng->setAgent(0);
     439            QScriptValue global = eng->globalObject();
     440            global.setProperty(QString::fromLatin1("print"), d->origTraceFunction);
     441            d->origTraceFunction = QScriptValue();
     442//            global.setProperty(QString::fromLatin1("qAssert"), QScriptValue());
     443            global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue(),
     444                               QScriptValue::PropertyGetter);
     445            global.setProperty(QString::fromLatin1("__FILE__"), d->origFileNameFunction);
     446            d->origFileNameFunction = QScriptValue();
     447            global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue(),
     448                               QScriptValue::PropertyGetter);
     449            global.setProperty(QString::fromLatin1("__LINE__"), d->origLineNumberFunction);
     450            d->origLineNumberFunction = QScriptValue();
     451            d->agent->nullifyBackendPointer();
     452            d->agent = 0; // agent is owned by engine
     453        }
    451454    }
    452455
     
    616619    {
    617620        QScriptContext *evalContext = engine()->pushContext();
    618 #if QT_VERSION >= 0x040500
    619621        QScriptValueList scopeChain = ctx->scopeChain();
    620622        if (scopeChain.isEmpty())
     
    622624        while (!scopeChain.isEmpty())
    623625            evalContext->pushScope(scopeChain.takeLast());
    624 #endif
    625626        evalContext->setActivationObject(ctx->activationObject());
    626627        evalContext->setThisObject(ctx->thisObject());
     
    805806    if (!engine())
    806807        return 0;
    807     int count = 0;
    808     QScriptContext *ctx = engine()->currentContext();
    809     while (ctx) {
    810         ++count;
    811         ctx = ctx->parentContext();
    812     }
    813     return count;
     808    return contextIds().count();
    814809}
    815810
  • trunk/src/scripttools/debugging/qscriptdebuggerbackend_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    145145protected:
    146146    QScriptDebuggerBackend(QScriptDebuggerBackendPrivate &dd);
    147     QScriptDebuggerBackendPrivate *d_ptr;
     147    QScopedPointer<QScriptDebuggerBackendPrivate> d_ptr;
    148148
    149149private:
  • trunk/src/scripttools/debugging/qscriptdebuggerbackend_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5858#include <QtCore/qhash.h>
    5959#include <QtCore/qlist.h>
     60#include <QtScript/qscriptvalue.h>
    6061
    6162#include "qscriptdebuggerbackend_p.h"
     
    6768class QScriptContext;
    6869class QScriptEngine;
    69 class QScriptValue;
    7070class QScriptValueIterator;
    7171class QScriptObjectSnapshot;
     
    127127
    128128    QScriptDebuggerBackend *q_ptr;
     129
     130    QScriptValue origTraceFunction;
     131    QScriptValue origFileNameFunction;
     132    QScriptValue origLineNumberFunction;
    129133};
    130134
  • trunk/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    139139    d->toolClose->setIcon(QIcon(QString::fromUtf8(":/qt/scripttools/debugging/images/%1/closetab.png").arg(system)));
    140140    d->toolClose->setAutoRaise(true);
    141     d->toolClose->setText(QObject::tr("Close"));
     141    d->toolClose->setText(tr("Close"));
    142142    hboxLayout->addWidget(d->toolClose);
    143143
    144144    d->editFind = new QLineEdit(this);
    145145    d->editFind->setMinimumSize(QSize(150, 0));
    146     connect(d->editFind, SIGNAL(textChanged(const QString&)),
     146    connect(d->editFind, SIGNAL(textChanged(QString)),
    147147            this, SLOT(_q_updateButtons()));
    148148    connect(d->editFind, SIGNAL(returnPressed()),
  • trunk/src/scripttools/debugging/qscriptdebuggercodefinderwidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodefinderwidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodefinderwidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodefinderwidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodeview.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    215215            return false;
    216216        int linePosition = cursor.position() - block.position();
    217         linePosition -= 3;
    218217        if (linePosition < 0)
    219218            linePosition = 0;
     
    234233            return false;
    235234        }
    236         int pos2 = linePosition;
     235        int pos2 = linePosition - 1;
    237236        while ((pos2 < contents.size()-1) && isIdentChar(contents.at(pos2+1)))
    238237            ++pos2;
  • trunk/src/scripttools/debugging/qscriptdebuggercodeview_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodeviewinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodeviewinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodeviewinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodewidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5050#include <QtGui/qboxlayout.h>
    5151#include <QtGui/qstackedwidget.h>
    52 #include <QtGui/qtooltip.h>
    5352
    5453QT_BEGIN_NAMESPACE
     
    198197    const QPoint &pos, int lineNumber, const QStringList &path)
    199198{
    200     QString tip = toolTipProvider->toolTip(/*frameIndex=*/-1, lineNumber, path);
    201     if (tip.indexOf(QLatin1Char('\n')) != -1) {
    202         QStringList lines = tip.split(QLatin1Char('\n'));
    203         int lineCount = lines.size();
    204         if (lineCount > 5) {
    205             lines = lines.mid(0, 5);
    206             lines.append(QString::fromLatin1("(... %0 more lines ...)").arg(lineCount - 5));
    207         }
    208         tip = lines.join(QLatin1String("\n"));
    209     }
    210     QToolTip::showText(pos, tip);
     199    toolTipProvider->showToolTip(pos, /*frameIndex=*/-1, lineNumber, path);
    211200}
    212201
  • trunk/src/scripttools/debugging/qscriptdebuggercodewidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodewidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodewidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercodewidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercommand.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4646#include <QtCore/qhash.h>
    4747#include <QtCore/qdatastream.h>
     48#include <QtCore/qstringlist.h>
    4849
    4950Q_DECLARE_METATYPE(QScriptBreakpointData)
     
    119120QScriptDebuggerCommand::~QScriptDebuggerCommand()
    120121{
    121     delete d_ptr;
    122122}
    123123
     
    559559}
    560560
     561QScriptDebuggerCommand QScriptDebuggerCommand::getPropertyExpressionValue(
     562    int contextIndex, int lineNumber, const QStringList &path)
     563{
     564    QScriptDebuggerCommand cmd(GetPropertyExpressionValue);
     565    cmd.setContextIndex(contextIndex);
     566    cmd.setLineNumber(lineNumber);
     567    cmd.setAttribute(UserAttribute, path);
     568    return cmd;
     569}
     570
     571QScriptDebuggerCommand QScriptDebuggerCommand::getCompletions(
     572    int contextIndex, const QStringList &path)
     573{
     574    QScriptDebuggerCommand cmd(GetCompletions);
     575    cmd.setContextIndex(contextIndex);
     576    cmd.setAttribute(UserAttribute, path);
     577    return cmd;
     578}
     579
    561580QScriptDebuggerCommand QScriptDebuggerCommand::newScriptObjectSnapshotCommand()
    562581{
     
    647666QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command)
    648667{
    649     const QScriptDebuggerCommandPrivate *d = command.d_ptr;
     668    const QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
    650669    out << (quint32)d->type;
    651670    out << (qint32)d->attributes.size();
     
    667686QDataStream &operator>>(QDataStream &in, QScriptDebuggerCommand &command)
    668687{
    669     QScriptDebuggerCommandPrivate *d = command.d_ptr;
     688    QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
    670689
    671690    quint32 type;
  • trunk/src/scripttools/debugging/qscriptdebuggercommand_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/qscopedpointer.h>
    5858#include <QtCore/qhash.h>
    5959#include <QtCore/qvariant.h>
     
    107107        GetScopeChain,
    108108        ContextsCheckpoint,
     109        GetPropertyExpressionValue,
     110        GetCompletions,
    109111
    110112        NewScriptObjectSnapshot,
     
    230232    static QScriptDebuggerCommand getScopeChainCommand(int contextIndex);
    231233    static QScriptDebuggerCommand contextsCheckpoint();
     234    static QScriptDebuggerCommand getPropertyExpressionValue(int contextIndex, int lineNumber,
     235                                                             const QStringList &path);
     236    static QScriptDebuggerCommand getCompletions(int contextIndex, const QStringList &path);
    232237
    233238    static QScriptDebuggerCommand newScriptObjectSnapshotCommand();
     
    251256
    252257private:
    253     QScriptDebuggerCommandPrivate *d_ptr;
     258    QScopedPointer<QScriptDebuggerCommandPrivate> d_ptr;
    254259
    255260    Q_DECLARE_PRIVATE(QScriptDebuggerCommand)
  • trunk/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    9999QScriptDebuggerCommandExecutor::~QScriptDebuggerCommandExecutor()
    100100{
    101     delete d_ptr;
     101}
     102
     103static bool isPrefixOf(const QString &prefix, const QString &what)
     104{
     105    return ((what.length() > prefix.length())
     106            && what.startsWith(prefix));
    102107}
    103108
     
    106111*/
    107112QScriptDebuggerResponse QScriptDebuggerCommandExecutor::execute(
    108         QScriptDebuggerBackend *backend,
    109         const QScriptDebuggerCommand &command)
     113    QScriptDebuggerBackend *backend,
     114    const QScriptDebuggerCommand &command)
    110115{
    111116    QScriptDebuggerResponse response;
     
    288293        if (ctx) {
    289294            QScriptDebuggerValueList dest;
    290 #if QT_VERSION >= 0x040500
    291295            QScriptValueList src = ctx->scopeChain();
    292296            for (int i = 0; i < src.size(); ++i)
    293297                dest.append(src.at(i));
    294 #else
    295             dest.append(ctx->activationObject());
    296 #endif
    297298            response.setResult(dest);
    298299        } else {
     
    303304    case QScriptDebuggerCommand::ContextsCheckpoint: {
    304305        response.setResult(qVariantFromValue(backend->contextsCheckpoint()));
     306    }   break;
     307
     308    case QScriptDebuggerCommand::GetPropertyExpressionValue: {
     309        QScriptContext *ctx = backend->context(command.contextIndex());
     310        int lineNumber = command.lineNumber();
     311        QVariant attr = command.attribute(QScriptDebuggerCommand::UserAttribute);
     312        QStringList path = attr.toStringList();
     313        if (!ctx || path.isEmpty())
     314            break;
     315        QScriptContextInfo ctxInfo(ctx);
     316        if (ctx->callee().isValid()
     317            && ((lineNumber < ctxInfo.functionStartLineNumber())
     318                || (lineNumber > ctxInfo.functionEndLineNumber()))) {
     319            break;
     320        }
     321        QScriptValueList objects;
     322        int pathIndex = 0;
     323        if (path.at(0) == QLatin1String("this")) {
     324            objects.append(ctx->thisObject());
     325            ++pathIndex;
     326        } else {
     327            objects << ctx->scopeChain();
     328        }
     329        for (int i = 0; i < objects.size(); ++i) {
     330            QScriptValue val = objects.at(i);
     331            for (int j = pathIndex; val.isValid() && (j < path.size()); ++j) {
     332                val = val.property(path.at(j));
     333            }
     334            if (val.isValid()) {
     335                bool hadException = (ctx->state() == QScriptContext::ExceptionState);
     336                QString str = val.toString();
     337                if (!hadException && backend->engine()->hasUncaughtException())
     338                    backend->engine()->clearExceptions();
     339                response.setResult(str);
     340                break;
     341            }
     342        }
     343    }   break;
     344
     345    case QScriptDebuggerCommand::GetCompletions: {
     346        QScriptContext *ctx = backend->context(command.contextIndex());
     347        QVariant attr = command.attribute(QScriptDebuggerCommand::UserAttribute);
     348        QStringList path = attr.toStringList();
     349        if (!ctx || path.isEmpty())
     350            break;
     351        QScriptValueList objects;
     352        QString prefix = path.last();
     353        QSet<QString> matches;
     354        if (path.size() > 1) {
     355            const QString &topLevelIdent = path.at(0);
     356            QScriptValue obj;
     357            if (topLevelIdent == QLatin1String("this")) {
     358                obj = ctx->thisObject();
     359            } else {
     360                QScriptValueList scopeChain;
     361                scopeChain = ctx->scopeChain();
     362                for (int i = 0; i < scopeChain.size(); ++i) {
     363                    QScriptValue oo = scopeChain.at(i).property(topLevelIdent);
     364                    if (oo.isObject()) {
     365                        obj = oo;
     366                        break;
     367                    }
     368                }
     369            }
     370            for (int i = 1; obj.isObject() && (i < path.size()-1); ++i)
     371                obj = obj.property(path.at(i));
     372            if (obj.isValid())
     373                objects.append(obj);
     374        } else {
     375            objects << ctx->scopeChain();
     376            QStringList keywords;
     377            keywords.append(QString::fromLatin1("this"));
     378            keywords.append(QString::fromLatin1("true"));
     379            keywords.append(QString::fromLatin1("false"));
     380            keywords.append(QString::fromLatin1("null"));
     381            for (int i = 0; i < keywords.size(); ++i) {
     382                const QString &kwd = keywords.at(i);
     383                if (isPrefixOf(prefix, kwd))
     384                    matches.insert(kwd);
     385            }
     386        }
     387
     388        for (int i = 0; i < objects.size(); ++i) {
     389            QScriptValue obj = objects.at(i);
     390            while (obj.isObject()) {
     391                QScriptValueIterator it(obj);
     392                while (it.hasNext()) {
     393                    it.next();
     394                    QString propertyName = it.name();
     395                    if (isPrefixOf(prefix, propertyName))
     396                        matches.insert(propertyName);
     397                }
     398                obj = obj.prototype();
     399            }
     400        }
     401        QStringList matchesList = matches.toList();
     402        qStableSort(matchesList);
     403        response.setResult(matchesList);
    305404    }   break;
    306405
  • trunk/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
     57#include <QtCore/qscopedpointer.h>
    5758
    5859QT_BEGIN_NAMESPACE
     
    7576protected:
    7677    QScriptDebuggerCommandExecutor(QScriptDebuggerCommandExecutorPrivate &dd);
    77     QScriptDebuggerCommandExecutorPrivate *d_ptr;
     78    QScopedPointer<QScriptDebuggerCommandExecutorPrivate> d_ptr;
    7879
    7980private:
  • trunk/src/scripttools/debugging/qscriptdebuggercommandschedulerfrontend.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    252252}
    253253
     254int QScriptDebuggerCommandSchedulerFrontend::scheduleGetPropertyExpressionValue(
     255    int contextIndex, int lineNumber, const QStringList &path)
     256{
     257    return scheduleCommand(QScriptDebuggerCommand::getPropertyExpressionValue(contextIndex, lineNumber, path));
     258}
     259
     260int QScriptDebuggerCommandSchedulerFrontend::scheduleGetCompletions(int contextIndex, const QStringList &path)
     261{
     262    return scheduleCommand(QScriptDebuggerCommand::getCompletions(contextIndex, path));
     263}
     264
    254265int QScriptDebuggerCommandSchedulerFrontend::scheduleEvaluate(int contextIndex,
    255266                                              const QString &program,
  • trunk/src/scripttools/debugging/qscriptdebuggercommandschedulerfrontend_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    110110     int scheduleGetScopeChain(int contextIndex);
    111111     int scheduleContextsCheckpoint();
     112     int scheduleGetPropertyExpressionValue(int contextIndex, int lineNumber,
     113                                            const QStringList &path);
     114     int scheduleGetCompletions(int contextIndex, const QStringList &path);
    112115
    113116     // iteration
  • trunk/src/scripttools/debugging/qscriptdebuggercommandschedulerinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercommandschedulerjob.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercommandschedulerjob_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggercommandschedulerjob_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsole.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    164164                for (int j = 0; j < completions.size(); ++j) {
    165165                    if (j > 0)
    166                         msg.append(QString::fromLatin1(", "));
     166                        msg.append(QLatin1String(", "));
    167167                    msg.append(completions.at(j));
    168168                }
    169                 msg.append(QString::fromLatin1("."));
     169                msg.append(QLatin1Char('.'));
    170170                messageHandler->message(QtWarningMsg, msg);
    171171                return 0;
     
    200200QScriptDebuggerConsole::~QScriptDebuggerConsole()
    201201{
    202     delete d_ptr;
    203202}
    204203
  • trunk/src/scripttools/debugging/qscriptdebuggerconsole_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
     57#include <QtCore/qscopedpointer.h>
    5758
    5859#include "qscriptdebuggerconsolehistorianinterface_p.h"
     
    110111
    111112private:
    112     QScriptDebuggerConsolePrivate *d_ptr;
     113    QScopedPointer<QScriptDebuggerConsolePrivate> d_ptr;
    113114
    114115    Q_DECLARE_PRIVATE(QScriptDebuggerConsole)
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7373QScriptDebuggerConsoleCommand::~QScriptDebuggerConsoleCommand()
    7474{
    75     delete d_ptr;
    7675}
    7776
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/qscopedpointer.h>
    5858#include <QtCore/qlist.h>
    5959
     
    9292protected:
    9393    QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd);
    94     QScriptDebuggerConsoleCommandPrivate *d_ptr;
     94    QScopedPointer<QScriptDebuggerConsoleCommandPrivate> d_ptr;
    9595
    9696private:
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommand_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    9191QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
    9292    const QScriptDebuggerConsoleCommandGroupData &other)
    93     : d_ptr(other.d_ptr)
     93    : d_ptr(other.d_ptr.data())
    9494{
    9595    if (d_ptr)
     
    9999QScriptDebuggerConsoleCommandGroupData::~QScriptDebuggerConsoleCommandGroupData()
    100100{
    101     if (d_ptr && !d_ptr->ref.deref()) {
    102         delete d_ptr;
    103         d_ptr = 0;
    104     }
    105101}
    106102
     
    108104    const QScriptDebuggerConsoleCommandGroupData &other)
    109105{
    110     if (d_ptr == other.d_ptr)
    111         return *this;
    112     if (d_ptr && !d_ptr->ref.deref())
    113         delete d_ptr;
    114     d_ptr = other.d_ptr;
    115     if (d_ptr)
    116         d_ptr->ref.ref();
     106    d_ptr.assign(other.d_ptr.data());
    117107    return *this;
    118108}
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/private/qscopedpointer_p.h>
    5858#include <QtCore/qmap.h>
    5959
     
    8383
    8484private:
    85     QScriptDebuggerConsoleCommandGroupDataPrivate *d_ptr;
     85    QScopedSharedPointer<QScriptDebuggerConsoleCommandGroupDataPrivate> d_ptr;
    8686
    8787private:
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandjob.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandjob_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandjob_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    106106QScriptDebuggerConsoleCommandManager::~QScriptDebuggerConsoleCommandManager()
    107107{
    108     delete d_ptr;
    109108}
    110109
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/qscopedpointer.h>
    5858#include <QtCore/qmap.h>
    5959#include <QtCore/qlist.h>
     
    8787
    8888private:
    89     QScriptDebuggerConsoleCommandManagerPrivate *d_ptr;
     89    QScopedPointer<QScriptDebuggerConsoleCommandManagerPrivate> d_ptr;
    9090
    9191    Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandManager)
  • trunk/src/scripttools/debugging/qscriptdebuggerconsoleglobalobject.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    362362{
    363363    Q_D(QScriptDebuggerConsoleGlobalObject);
     364    Q_ASSERT(d->messageHandler != 0);
    364365    d->messageHandler->message(QtWarningMsg, text, fileName, lineNumber, columnNumber);
    365366}
     
    370371{
    371372    Q_D(QScriptDebuggerConsoleGlobalObject);
     373    Q_ASSERT(d->messageHandler != 0);
    372374    d->messageHandler->message(QtDebugMsg, text, fileName, lineNumber, columnNumber);
    373375}
     
    378380{
    379381    Q_D(QScriptDebuggerConsoleGlobalObject);
     382    Q_ASSERT(d->messageHandler != 0);
    380383    d->messageHandler->message(QtCriticalMsg, text, fileName, lineNumber, columnNumber);
    381384}
     
    449452bool QScriptDebuggerConsoleGlobalObject::checkSyntax(const QString &program)
    450453{
    451 #if QT_VERSION >= 0x040500
    452454    return (QScriptEngine::checkSyntax(program).state() == QScriptSyntaxCheckResult::Valid);
    453 #else
    454     Q_UNUSED(program);
    455     return true;
    456 #endif
    457455}
    458456
  • trunk/src/scripttools/debugging/qscriptdebuggerconsoleglobalobject_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolehistorianinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolewidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolewidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolewidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerconsolewidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerevent.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6161
    6262QScriptDebuggerEventPrivate::QScriptDebuggerEventPrivate()
     63    : type(QScriptDebuggerEvent::None)
    6364{
    6465}
     
    9899QScriptDebuggerEvent::~QScriptDebuggerEvent()
    99100{
    100     delete d_ptr;
    101101}
    102102
     
    277277QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event)
    278278{
    279     const QScriptDebuggerEventPrivate *d = event.d_ptr;
     279    const QScriptDebuggerEventPrivate *d = event.d_ptr.data();
    280280    out << (quint32)d->type;
    281281    out << (qint32)d->attributes.size();
     
    297297QDataStream &operator>>(QDataStream &in, QScriptDebuggerEvent &event)
    298298{
    299     QScriptDebuggerEventPrivate *d = event.d_ptr;
     299    QScriptDebuggerEventPrivate *d = event.d_ptr.data();
    300300
    301301    quint32 type;
  • trunk/src/scripttools/debugging/qscriptdebuggerevent_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5858#include <QtCore/qhash.h>
    5959#include <QtCore/qvariant.h>
     60#include <QtCore/qscopedpointer.h>
    6061
    6162QT_BEGIN_NAMESPACE
     
    138139
    139140private:
    140     QScriptDebuggerEventPrivate *d_ptr;
     141    QScopedPointer<QScriptDebuggerEventPrivate> d_ptr;
    141142
    142143    Q_DECLARE_PRIVATE(QScriptDebuggerEvent)
  • trunk/src/scripttools/debugging/qscriptdebuggereventhandlerinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerfrontend.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    144144QScriptDebuggerFrontend::~QScriptDebuggerFrontend()
    145145{
    146     delete d_ptr;
    147146}
    148147
  • trunk/src/scripttools/debugging/qscriptdebuggerfrontend_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/qscopedpointer.h>
    5858#include <QtCore/qstring.h>
    5959
     
    9191protected:
    9292    QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd);
    93     QScriptDebuggerFrontendPrivate *d_ptr;
     93    QScopedPointer<QScriptDebuggerFrontendPrivate> d_ptr;
    9494
    9595private:
  • trunk/src/scripttools/debugging/qscriptdebuggerfrontend_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerjob.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    8686QScriptDebuggerJob::~QScriptDebuggerJob()
    8787{
    88     delete d_ptr;
    8988}
    9089
  • trunk/src/scripttools/debugging/qscriptdebuggerjob_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
     57#include <QtCore/qscopedpointer.h>
    5758
    5859QT_BEGIN_NAMESPACE
     
    7778protected:
    7879    QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd);
    79     QScriptDebuggerJobPrivate *d_ptr;
     80    QScopedPointer<QScriptDebuggerJobPrivate> d_ptr;
    8081
    8182private:
  • trunk/src/scripttools/debugging/qscriptdebuggerjob_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerjobschedulerinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5454
    5555#include <QtCore/qdebug.h>
     56#include <QtCore/qcoreapplication.h>
    5657#include <QtGui/qbrush.h>
    5758#include <QtGui/qfont.h>
     
    137138
    138139    void deleteObjectSnapshots(const QList<qint64> &snapshotIds);
     140    void deleteAllObjectSnapshots();
    139141
    140142    QScriptDebuggerJobSchedulerInterface *jobScheduler;
     
    239241    for (int i = 0; i < snapshotIds.size(); ++i)
    240242        frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(i));
     243}
     244
     245void QScriptDebuggerLocalsModelPrivate::deleteAllObjectSnapshots()
     246{
     247    QList<qint64> snapshotIds;
     248    for (int i = 0; i < invisibleRootNode->children.count(); ++i)
     249        snapshotIds += findSnapshotIdsRecursively(invisibleRootNode->children.at(i));
     250    deleteObjectSnapshots(snapshotIds);
    241251}
    242252
     
    443453QScriptDebuggerLocalsModel::~QScriptDebuggerLocalsModel()
    444454{
    445     Q_D(QScriptDebuggerLocalsModel);
    446     QList<qint64> snapshotIds;
    447     for (int i = 0; i < d->invisibleRootNode->children.count(); ++i)
    448         snapshotIds += findSnapshotIdsRecursively(d->invisibleRootNode->children.at(i));
    449     QScriptDebuggerCommandSchedulerFrontend frontend(d->commandScheduler, 0);
    450     for (int j = 0; j < snapshotIds.size(); ++j)
    451         frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(j));
    452455}
    453456
     
    808811            if (node->property.value().type() == QScriptDebuggerValue::StringValue) {
    809812                // escape
    810                 str.replace(QLatin1String("\""), QLatin1String("\\\""));
     813                str.replace(QLatin1Char('\"'), QLatin1String("\\\""));
    811814                str.prepend(QLatin1Char('\"'));
    812815                str.append(QLatin1Char('\"'));
     
    867870        if (role == Qt::DisplayRole) {
    868871            if (section == 0)
    869                 return QObject::tr("Name");
     872                return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Name");
    870873            else if (section == 1)
    871                 return QObject::tr("Value");
     874                return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Value");
    872875        }
    873876    }
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalsmodel_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    207207        QPalette pal = editor->palette();
    208208        QColor col;
    209 #if QT_VERSION >= 0x040500
    210209        bool ok = (QScriptEngine::checkSyntax(text).state() == QScriptSyntaxCheckResult::Valid);
    211 #else
    212         bool ok = true;
    213 #endif
    214210        if (ok) {
    215211            col = Qt::white;
     
    278274    QKeyEvent *ke = static_cast<QKeyEvent*>(event);
    279275    if ((ke->key() == Qt::Key_Enter) || (ke->key() == Qt::Key_Return)) {
    280 #if QT_VERSION >= 0x040500
    281276        if (QScriptEngine::checkSyntax(le->text()).state() != QScriptSyntaxCheckResult::Valid) {
    282277            // ignore when script contains syntax error
    283278            return true;
    284279        }
    285 #endif
    286280    }
    287281    if (ke->key() != Qt::Key_Tab)
     
    297291    const QModelIndex &index) const
    298292{
    299 #if QT_VERSION >= 0x040500
    300293    if (index.column() == 1) {
    301294        // check that the syntax is OK
     
    304297            return;
    305298    }
    306 #endif
    307299    QStyledItemDelegate::setModelData(editor, model, index);
    308300}
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalswidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalswidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalswidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerlocalswidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerobjectsnapshotdelta_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6161QT_BEGIN_NAMESPACE
    6262
     63class QDataStream;
     64
    6365class Q_AUTOTEST_EXPORT QScriptDebuggerObjectSnapshotDelta
    6466{
     
    6971};
    7072
     73Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptDebuggerObjectSnapshotDelta &);
     74Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptDebuggerObjectSnapshotDelta &);
     75
    7176QT_END_NAMESPACE
    7277
  • trunk/src/scripttools/debugging/qscriptdebuggerresponse.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    102102QScriptDebuggerResponse::~QScriptDebuggerResponse()
    103103{
    104     delete d_ptr;
    105104}
    106105
     
    321320QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &response)
    322321{
    323     const QScriptDebuggerResponsePrivate *d = response.d_ptr;
     322    const QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
    324323    out << (quint32)d->error;
    325324    out << d->result;
     
    337336QDataStream &operator>>(QDataStream &in, QScriptDebuggerResponse &response)
    338337{
    339     QScriptDebuggerResponsePrivate *d = response.d_ptr;
     338    QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
    340339
    341340    quint32 error;
  • trunk/src/scripttools/debugging/qscriptdebuggerresponse_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/qscopedpointer.h>
    5858#include <QtCore/qmap.h>
    5959#include <QtCore/qvariant.h>
     
    128128
    129129private:
    130     QScriptDebuggerResponsePrivate *d_ptr;
     130    QScopedPointer<QScriptDebuggerResponsePrivate> d_ptr;
    131131
    132132    Q_DECLARE_PRIVATE(QScriptDebuggerResponse)
  • trunk/src/scripttools/debugging/qscriptdebuggerresponsehandlerinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    368368{
    369369public:
    370     QScriptDebuggerScriptedConsoleCommandJobPrivate() {}
     370    QScriptDebuggerScriptedConsoleCommandJobPrivate() : command(0), commandCount(0) {}
    371371    ~QScriptDebuggerScriptedConsoleCommandJobPrivate() {}
    372372
     
    411411        args.append(QScriptValue(engine, d->arguments.at(i)));
    412412    QScriptDebuggerConsoleGlobalObject *global;
    413 #if QT_VERSION >= 0x040500
    414413    global = qobject_cast<QScriptDebuggerConsoleGlobalObject*>(engine->globalObject().toQObject());
    415 #else
    416     global = qobject_cast<QScriptDebuggerConsoleGlobalObject*>(engine->globalObject().scope().toQObject());
    417 #endif
    418414    Q_ASSERT(global != 0);
    419415    global->setScheduler(this);
     
    445441    args.append(QScriptValue(engine, commandId));
    446442    QScriptDebuggerConsoleGlobalObject *global;
    447 #if QT_VERSION >= 0x040500
    448443    global = qobject_cast<QScriptDebuggerConsoleGlobalObject*>(engine->globalObject().toQObject());
    449 #else
    450     global = qobject_cast<QScriptDebuggerConsoleGlobalObject*>(engine->globalObject().scope().toQObject());
    451 #endif
    452444    Q_ASSERT(global != 0);
    453445    global->setScheduler(this);
     
    469461
    470462/*!
    471   \reimp
     463  \internal
    472464*/
    473465QString QScriptDebuggerScriptedConsoleCommand::name() const
     
    478470
    479471/*!
    480   \reimp
     472  \internal
    481473*/
    482474QString QScriptDebuggerScriptedConsoleCommand::group() const
     
    487479
    488480/*!
    489   \reimp
     481  \internal
    490482*/
    491483QString QScriptDebuggerScriptedConsoleCommand::shortDescription() const
     
    496488
    497489/*!
    498   \reimp
     490  \internal
    499491*/
    500492QString QScriptDebuggerScriptedConsoleCommand::longDescription() const
     
    505497
    506498/*!
    507   \reimp
     499  \internal
    508500*/
    509501QStringList QScriptDebuggerScriptedConsoleCommand::aliases() const
     
    514506
    515507/*!
    516   \reimp
     508  \internal
    517509*/
    518510QStringList QScriptDebuggerScriptedConsoleCommand::seeAlso() const
     
    523515
    524516/*!
    525   \reimp
     517  \internal
    526518*/
    527519QStringList QScriptDebuggerScriptedConsoleCommand::argumentTypes() const
     
    532524
    533525/*!
    534   \reimp
     526  \internal
    535527*/
    536528QStringList QScriptDebuggerScriptedConsoleCommand::subCommands() const
     
    541533
    542534/*!
    543   \reimp
     535  \internal
    544536*/
    545537QScriptDebuggerConsoleCommandJob *QScriptDebuggerScriptedConsoleCommand::createJob(
     
    567559    QScriptValue global = engine->newQObject(cppGlobal,
    568560                                             QScriptEngine::ScriptOwnership,
    569 #if QT_VERSION >= 0x040500
    570561                                             QScriptEngine::ExcludeSuperClassContents);
    571 #else
    572                                              QScriptEngine::ExcludeSuperClassMethods
    573                                              | QScriptEngine::ExcludeSuperClassProperties);
    574 #endif
    575562    {
    576563        QScriptValueIterator it(engine->globalObject());
     
    580567        }
    581568    }
    582 #if QT_VERSION >= 0x040500
    583569    engine->setGlobalObject(global);
    584 #else
    585     engine->globalObject().setScope(global);
    586     global = engine->globalObject();
    587 #endif
    588570
    589571    cppGlobal->setMessageHandler(messageHandler);
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptsmodel.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptsmodel_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptswidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptswidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptswidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptswidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerscriptswidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4646#include <QtScript/qscriptcontextinfo.h>
    4747#include <QtCore/qfileinfo.h>
     48#include <QtCore/qcoreapplication.h>
    4849
    4950QT_BEGIN_NAMESPACE
     
    132133            return name;
    133134        } else if (index.column() == 2) {
    134             if (info.lineNumber() == -1)
    135                 return QString::fromLatin1("<native>");
    136135            QString fn = QFileInfo(info.fileName()).fileName();
    137             if (fn.isEmpty())
    138                 fn = QString::fromLatin1("<anonymous script, id=%0>").arg(info.scriptId());
     136            if (fn.isEmpty()) {
     137                if (info.functionType() == QScriptContextInfo::ScriptFunction)
     138                    fn = QString::fromLatin1("<anonymous script, id=%0>").arg(info.scriptId());
     139                else
     140                    fn = QString::fromLatin1("<native>");
     141
     142            }
    139143            return QString::fromLatin1("%0:%1").arg(fn).arg(info.lineNumber());
    140144        }
     
    155159    if (role == Qt::DisplayRole) {
    156160        if (section == 0)
    157             return QObject::tr("Level");
     161            return QCoreApplication::translate("QScriptDebuggerStackModel", "Level");
    158162        else if (section == 1)
    159             return QObject::tr("Name");
     163            return QCoreApplication::translate("QScriptDebuggerStackModel", "Name");
    160164        else if (section == 2)
    161             return QObject::tr("Location");
     165            return QCoreApplication::translate("QScriptDebuggerStackModel", "Location");
    162166    }
    163167    return QVariant();
  • trunk/src/scripttools/debugging/qscriptdebuggerstackmodel_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerstackwidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerstackwidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerstackwidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerstackwidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggerstackwidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebuggervalue.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    9595{
    9696    if (value.isValid()) {
    97         d_ptr = new QScriptDebuggerValuePrivate;
     97        d_ptr.reset(new QScriptDebuggerValuePrivate);
    9898        if (value.isUndefined())
    9999            d_ptr->type = UndefinedValue;
     
    158158
    159159QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other)
    160     : d_ptr(other.d_ptr)
     160    : d_ptr(other.d_ptr.data())
    161161{
    162162    if (d_ptr)
     
    166166QScriptDebuggerValue::~QScriptDebuggerValue()
    167167{
    168     if (d_ptr && !d_ptr->ref.deref()) {
    169         delete d_ptr;
    170         d_ptr = 0;
    171     }
    172168}
    173169
    174170QScriptDebuggerValue &QScriptDebuggerValue::operator=(const QScriptDebuggerValue &other)
    175171{
    176     if (d_ptr == other.d_ptr)
    177         return *this;
    178     if (d_ptr && !d_ptr->ref.deref())
    179         delete d_ptr;
    180     d_ptr = other.d_ptr;
    181     if (d_ptr)
    182         d_ptr->ref.ref();
     172    d_ptr.assign(other.d_ptr.data());
    183173    return *this;
    184174}
  • trunk/src/scripttools/debugging/qscriptdebuggervalue_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/private/qscopedpointer_p.h>
    5858#include <QtCore/qlist.h>
    5959
     
    104104
    105105private:
    106     QScriptDebuggerValuePrivate *d_ptr;
     106    QScopedSharedPointer<QScriptDebuggerValuePrivate> d_ptr;
    107107
    108108    Q_DECLARE_PRIVATE(QScriptDebuggerValue)
  • trunk/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4242#include "qscriptdebuggervalueproperty_p.h"
    4343#include "qscriptdebuggervalue_p.h"
     44#include "qscriptdebuggerobjectsnapshotdelta_p.h"
    4445
    4546#include <QtCore/qatomic.h>
     
    106107*/
    107108QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebuggerValueProperty &other)
    108     : d_ptr(other.d_ptr)
     109    : d_ptr(other.d_ptr.data())
    109110{
    110111    if (d_ptr)
     
    117118QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty()
    118119{
    119     if (d_ptr && !d_ptr->ref.deref()) {
    120         delete d_ptr;
    121         d_ptr = 0;
    122     }
    123120}
    124121
     
    128125QScriptDebuggerValueProperty &QScriptDebuggerValueProperty::operator=(const QScriptDebuggerValueProperty &other)
    129126{
    130     if (d_ptr == other.d_ptr)
    131         return *this;
    132     if (d_ptr && !d_ptr->ref.deref())
    133         delete d_ptr;
    134     d_ptr = other.d_ptr;
    135     if (d_ptr)
    136         d_ptr->ref.ref();
     127    d_ptr.assign(other.d_ptr.data());
    137128    return *this;
    138129}
     
    226217}
    227218
     219QDataStream &operator<<(QDataStream &out, const QScriptDebuggerObjectSnapshotDelta &delta)
     220{
     221    out << delta.removedProperties;
     222    out << delta.changedProperties;
     223    out << delta.addedProperties;
     224    return out;
     225}
     226
     227QDataStream &operator>>(QDataStream &in, QScriptDebuggerObjectSnapshotDelta &delta)
     228{
     229    in >> delta.removedProperties;
     230    in >> delta.changedProperties;
     231    in >> delta.addedProperties;
     232    return in;
     233}
     234
    228235QT_END_NAMESPACE
  • trunk/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5656#include <QtCore/qobjectdefs.h>
    5757#include <QtCore/qlist.h>
     58#include <QtCore/private/qscopedpointer_p.h>
    5859#include <QtScript/qscriptvalue.h>
    5960
     
    8687
    8788private:
    88     QScriptDebuggerValuePropertyPrivate *d_ptr;
     89    QScopedSharedPointer<QScriptDebuggerValuePropertyPrivate> d_ptr;
    8990
    9091    Q_DECLARE_PRIVATE(QScriptDebuggerValueProperty)
  • trunk/src/scripttools/debugging/qscriptdebuggerwidgetfactoryinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6262class QScriptErrorLogWidgetInterface;
    6363class QScriptDebuggerCodeFinderWidgetInterface;
     64class QScriptDebuggerStackWidgetInterface;
     65class QScriptDebuggerScriptsWidgetInterface;
     66class QScriptDebuggerLocalsWidgetInterface;
     67class QScriptDebuggerCodeWidgetInterface;
     68class QScriptBreakpointsWidgetInterface;
    6469
    6570class Q_AUTOTEST_EXPORT QScriptDebuggerWidgetFactoryInterface
     
    7277    virtual QScriptErrorLogWidgetInterface *createErrorLogWidget() = 0;
    7378    virtual QScriptDebuggerCodeFinderWidgetInterface *createCodeFinderWidget() = 0;
     79    virtual QScriptDebuggerStackWidgetInterface *createStackWidget() = 0;
     80    virtual QScriptDebuggerScriptsWidgetInterface *createScriptsWidget() = 0;
     81    virtual QScriptDebuggerLocalsWidgetInterface *createLocalsWidget() = 0;
     82    virtual QScriptDebuggerCodeWidgetInterface *createCodeWidget() = 0;
     83    virtual QScriptBreakpointsWidgetInterface *createBreakpointsWidget() = 0;
    7484};
    7585
  • trunk/src/scripttools/debugging/qscriptdebugoutputwidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebugoutputwidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebugoutputwidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebugoutputwidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptdebugoutputwidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptedit.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    111111    QObject::connect(this, SIGNAL(blockCountChanged(int)),
    112112                     this, SLOT(updateExtraAreaWidth()));
    113     QObject::connect(this, SIGNAL(updateRequest(const QRect &, int)),
    114                      this, SLOT(updateExtraArea(const QRect &, int)));
     113    QObject::connect(this, SIGNAL(updateRequest(QRect,int)),
     114                     this, SLOT(updateExtraArea(QRect,int)));
    115115    QObject::connect(this, SIGNAL(cursorPositionChanged()),
    116116                     this, SLOT(highlightCurrentLine()));
     
    155155{
    156156    m_executableLineNumbers = lineNumbers;
     157}
     158
     159bool QScriptEdit::isExecutableLine(int lineNumber) const
     160{
     161#if 0 // ### enable me once we have information about the script again
     162    return m_executableLineNumbers.contains(lineNumber);
     163#else
     164    Q_UNUSED(lineNumber);
     165    return true;
     166#endif
    157167}
    158168
     
    343353            }
    344354
    345 #if QT_VERSION >= 0x040500
    346             if (!m_executableLineNumbers.contains(lineNumber))
     355            if (!isExecutableLine(lineNumber))
    347356                painter.setPen(pal.color(QPalette::Mid));
    348357            else
    349 #endif
    350358                painter.setPen(QColor(Qt::darkCyan));
    351359            QString number = QString::number(lineNumber);
     
    371379    if (e->type() == QEvent::MouseMove && e->buttons() == 0) { // mouse tracking
    372380        bool hand = (e->pos().x() <= markWidth);
    373 #if QT_VERSION >= 0x040500
    374381        int lineNumber = cursor.blockNumber() + m_baseLineNumber;
    375         hand = hand && m_executableLineNumbers.contains(lineNumber);
    376 #endif
     382        hand = hand && isExecutableLine(lineNumber);
    377383#ifndef QT_NO_CURSOR
    378384        if (hand != (m_extraArea->cursor().shape() == Qt::PointingHandCursor))
     
    383389    if (e->type() == QEvent::MouseButtonPress) {
    384390        if (e->button() == Qt::LeftButton) {
    385 #if QT_VERSION >= 0x040500
    386391            int lineNumber = cursor.blockNumber() + m_baseLineNumber;
    387             bool executable = m_executableLineNumbers.contains(lineNumber);
    388 #else
    389             bool executable = true;
    390 #endif
     392            bool executable = isExecutableLine(lineNumber);
    391393            if ((e->pos().x() <= markWidth) && executable)
    392394                m_extraAreaToggleBlockNumber = cursor.blockNumber();
     
    403405        } else if (e->button() == Qt::RightButton) {
    404406            int lineNumber = cursor.blockNumber() + m_baseLineNumber;
    405 #if QT_VERSION >= 0x040500
    406             if (!m_executableLineNumbers.contains(lineNumber))
     407            if (!isExecutableLine(lineNumber))
    407408                return;
    408 #endif
    409409            bool has = m_breakpoints.contains(lineNumber);
    410410            QMenu *popup = new QMenu();
    411             QAction *toggleAct = new QAction(QObject::tr("Toggle Breakpoint"), popup);
     411            QAction *toggleAct = new QAction(tr("Toggle Breakpoint"), popup);
    412412            popup->addAction(toggleAct);
    413             QAction *disableAct = new QAction(QObject::tr("Disable Breakpoint"), popup);
    414             QAction *enableAct = new QAction(QObject::tr("Enable Breakpoint"), popup);
     413            QAction *disableAct = new QAction(tr("Disable Breakpoint"), popup);
     414            QAction *enableAct = new QAction(tr("Enable Breakpoint"), popup);
    415415            QWidget *conditionWidget = new QWidget();
    416416            {
    417417                QHBoxLayout *hbox = new QHBoxLayout(conditionWidget);
    418                 hbox->addWidget(new QLabel(QObject::tr("Breakpoint Condition:")));
     418                hbox->addWidget(new QLabel(tr("Breakpoint Condition:")));
    419419                hbox->addWidget(new QLineEdit());
    420420            }
  • trunk/src/scripttools/debugging/qscriptedit_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7676    void setExecutionLineNumber(int lineNumber, bool error);
    7777    void setExecutableLineNumbers(const QSet<int> &lineNumbers);
     78    bool isExecutableLine(int lineNumber) const;
    7879
    7980    int currentLineNumber() const;
  • trunk/src/scripttools/debugging/qscriptenginedebugger.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4343#include "qscriptdebugger_p.h"
    4444#include "qscriptenginedebuggerfrontend_p.h"
    45 #include "qscriptdebuggerconsolewidget_p.h"
    46 #include "qscriptdebuggerstackwidget_p.h"
    47 #include "qscriptdebuggerscriptswidget_p.h"
    48 #include "qscriptdebuggerlocalswidget_p.h"
    49 #include "qscriptdebuggercodewidget_p.h"
    50 #include "qscriptdebuggercodefinderwidget_p.h"
    51 #include "qscriptbreakpointswidget_p.h"
    52 #include "qscriptdebugoutputwidget_p.h"
    53 #include "qscripterrorlogwidget_p.h"
    54 #include "qscriptdebuggerwidgetfactoryinterface_p.h"
     45#include "qscriptdebuggerstandardwidgetfactory_p.h"
    5546#include <private/qobject_p.h>
    5647
     
    5950#include <QtGui/qdockwidget.h>
    6051#include <QtGui/qmainwindow.h>
    61 #include <QtGui/qmenu.h>
    6252#include <QtGui/qmenubar.h>
    63 #include <QtGui/qtoolbar.h>
    6453#include <QtGui/qboxlayout.h>
     54
     55// this has to be outside the namespace
     56static void initScriptEngineDebuggerResources()
     57{
     58    Q_INIT_RESOURCE(scripttools_debugging);
     59}
     60
     61QT_BEGIN_NAMESPACE
    6562
    6663class QtScriptDebuggerResourceInitializer
     
    6865public:
    6966    QtScriptDebuggerResourceInitializer() {
    70         Q_INIT_RESOURCE(scripttools_debugging);
     67        // call outside-the-namespace function
     68        initScriptEngineDebuggerResources();
    7169    }
    7270};
    7371
    74 QT_BEGIN_NAMESPACE
    75 
    7672/*!
    7773  \since 4.5
     
    8076  \brief The QScriptEngineDebugger class provides a QScriptEngine debugger.
    8177
    82   \ingroup scripttools
    83   \mainclass
     78  \ingroup script
     79
    8480
    8581  The QScriptEngineDebugger class provides a debugger that can be
     
    131127  evaluationResumed() signal is emitted when script evaluation is
    132128  resumed, i.e, when execution control is given back to the script
    133   engine.
     129  engine. The state() function returns the debugger's current state.
    134130
    135131  When calling QScriptEngine::evaluate() it is useful to pass a
     
    231227*/
    232228
     229/*!
     230    \enum QScriptEngineDebugger::DebuggerState
     231    \since 4.6
     232
     233    This enum specifies the current state of the debugger.
     234
     235    \value RunningState   The debugger is running.  (Script evaluation is allowed.)
     236    \value SuspendedState The debugger has suspended script evaluation.
     237*/
     238
    233239class QScriptEngineDebuggerPrivate
    234     : public QObjectPrivate,
    235       public QScriptDebuggerWidgetFactoryInterface
     240    : public QObjectPrivate
    236241{
    237242    Q_DECLARE_PUBLIC(QScriptEngineDebugger)
     
    240245    ~QScriptEngineDebuggerPrivate();
    241246
    242     QScriptDebugOutputWidgetInterface *createDebugOutputWidget();
    243     QScriptDebuggerConsoleWidgetInterface *createConsoleWidget();
    244     QScriptErrorLogWidgetInterface *createErrorLogWidget();
    245     QScriptDebuggerCodeFinderWidgetInterface *createCodeFinderWidget();
    246 
    247247    // private slots
    248248    void _q_showStandardWindow();
     
    252252    QScriptDebugger *debugger;
    253253    QScriptEngineDebuggerFrontend *frontend;
     254#ifndef QT_NO_MAINWINDOW
    254255    QMainWindow *standardWindow;
     256#endif
    255257    bool autoShow;
    256258
     
    295297    debugger = 0;
    296298    frontend = 0;
     299#ifndef QT_NO_MAINWINDOW
    297300    standardWindow = 0;
     301#endif
    298302    autoShow = true;
    299303}
     
    303307    delete debugger;
    304308    delete frontend;
     309#ifndef QT_NO_MAINWINDOW
    305310    if (standardWindow) {
    306311        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
     
    312317            delete standardWindow;
    313318    }
    314 }
    315 
    316 QScriptDebugOutputWidgetInterface *QScriptEngineDebuggerPrivate::createDebugOutputWidget()
    317 {
    318     return new QScriptDebugOutputWidget();
    319 }
    320 
    321 QScriptDebuggerConsoleWidgetInterface *QScriptEngineDebuggerPrivate::createConsoleWidget()
    322 {
    323     return new QScriptDebuggerConsoleWidget();
    324 }
    325 
    326 QScriptErrorLogWidgetInterface *QScriptEngineDebuggerPrivate::createErrorLogWidget()
    327 {
    328     return new QScriptErrorLogWidget();
    329 }
    330 
    331 QScriptDebuggerCodeFinderWidgetInterface *QScriptEngineDebuggerPrivate::createCodeFinderWidget()
    332 {
    333     return new QScriptDebuggerCodeFinderWidget();
    334 }
    335 
     319#endif
     320}
     321
     322#ifndef QT_NO_MAINWINDOW
    336323void QScriptEngineDebuggerPrivate::_q_showStandardWindow()
    337324{
     
    340327    standardWindow->show();
    341328}
     329#endif
    342330
    343331void QScriptEngineDebuggerPrivate::createDebugger()
     
    346334    if (!debugger) {
    347335        debugger = new QScriptDebugger();
    348         debugger->setWidgetFactory(this);
     336        debugger->setWidgetFactory(new QScriptDebuggerStandardWidgetFactory(q));
    349337        QObject::connect(debugger, SIGNAL(started()),
    350338                         q, SIGNAL(evaluationResumed()));
     
    418406
    419407/*!
     408  \since 4.6
     409
     410  Returns the current state of the debugger.
     411
     412  \sa evaluationResumed()
     413  \sa evaluationSuspended()
     414*/
     415QScriptEngineDebugger::DebuggerState QScriptEngineDebugger::state() const
     416{
     417    Q_D(const QScriptEngineDebugger);
     418    return !d->debugger || !d->debugger->isInteractive() ? SuspendedState : RunningState;
     419}
     420
     421/*!
    420422
    421423    Returns a pointer to the instance of the specified standard \a
     
    441443    Q_D(const QScriptEngineDebugger);
    442444    const_cast<QScriptEngineDebuggerPrivate*>(d)->createDebugger();
    443     switch (widget) {
    444     case ConsoleWidget: {
    445         QScriptDebuggerConsoleWidgetInterface *w = d->debugger->consoleWidget();
    446         if (!w) {
    447             w = new QScriptDebuggerConsoleWidget();
    448             d->debugger->setConsoleWidget(w);
    449         }
    450         return w;
    451     }
    452     case StackWidget: {
    453         QScriptDebuggerStackWidgetInterface *w = d->debugger->stackWidget();
    454         if (!w) {
    455             w = new QScriptDebuggerStackWidget();
    456             d->debugger->setStackWidget(w);
    457         }
    458         return w;
    459     }
    460     case ScriptsWidget: {
    461         QScriptDebuggerScriptsWidgetInterface *w = d->debugger->scriptsWidget();
    462         if (!w) {
    463             w = new QScriptDebuggerScriptsWidget();
    464             d->debugger->setScriptsWidget(w);
    465         }
    466         return w;
    467     }
    468     case LocalsWidget: {
    469         QScriptDebuggerLocalsWidgetInterface *w = d->debugger->localsWidget();
    470         if (!w) {
    471             w = new QScriptDebuggerLocalsWidget();
    472             d->debugger->setLocalsWidget(w);
    473         }
    474         return w;
    475     }
    476     case CodeWidget: {
    477         QScriptDebuggerCodeWidgetInterface *w = d->debugger->codeWidget();
    478         if (!w) {
    479             w = new QScriptDebuggerCodeWidget();
    480             d->debugger->setCodeWidget(w);
    481         }
    482         return w;
    483     }
    484     case CodeFinderWidget: {
    485         QScriptDebuggerCodeFinderWidgetInterface *w = d->debugger->codeFinderWidget();
    486         if (!w) {
    487             w = new QScriptDebuggerCodeFinderWidget();
    488             d->debugger->setCodeFinderWidget(w);
    489         }
    490         return w;
    491     }
    492     case BreakpointsWidget: {
    493         QScriptBreakpointsWidgetInterface *w = d->debugger->breakpointsWidget();
    494         if (!w) {
    495             w = new QScriptBreakpointsWidget();
    496             d->debugger->setBreakpointsWidget(w);
    497         }
    498         return w;
    499     }
    500     case DebugOutputWidget: {
    501         QScriptDebugOutputWidgetInterface *w = d->debugger->debugOutputWidget();
    502         if (!w) {
    503             w = new QScriptDebugOutputWidget();
    504             d->debugger->setDebugOutputWidget(w);
    505         }
    506         return w;
    507     }
    508     case ErrorLogWidget: {
    509         QScriptErrorLogWidgetInterface *w = d->debugger->errorLogWidget();
    510         if (!w) {
    511             w = new QScriptErrorLogWidget();
    512             d->debugger->setErrorLogWidget(w);
    513         }
    514         return w;
    515     }
    516     }
    517     return 0;
     445    return d->debugger->widget(static_cast<QScriptDebugger::DebuggerWidget>(static_cast<int>(widget)));
    518446}
    519447
     
    539467    QScriptEngineDebugger *that = const_cast<QScriptEngineDebugger*>(this);
    540468    that->d_func()->createDebugger();
    541     switch (action) {
    542     case InterruptAction:
    543         return d->debugger->interruptAction(that);
    544     case ContinueAction:
    545         return d->debugger->continueAction(that);
    546     case StepIntoAction:
    547         return d->debugger->stepIntoAction(that);
    548     case StepOverAction:
    549         return d->debugger->stepOverAction(that);
    550     case StepOutAction:
    551         return d->debugger->stepOutAction(that);
    552     case RunToCursorAction:
    553         return d->debugger->runToCursorAction(that);
    554     case RunToNewScriptAction:
    555         return d->debugger->runToNewScriptAction(that);
    556     case ToggleBreakpointAction:
    557         return d->debugger->toggleBreakpointAction(that);
    558     case ClearDebugOutputAction:
    559         return d->debugger->clearDebugOutputAction(that);
    560     case ClearErrorLogAction:
    561         return d->debugger->clearErrorLogAction(that);
    562     case ClearConsoleAction:
    563         return d->debugger->clearConsoleAction(that);
    564     case FindInScriptAction:
    565         return d->debugger->findInScriptAction(that);
    566     case FindNextInScriptAction:
    567         return d->debugger->findNextInScriptAction(that);
    568     case FindPreviousInScriptAction:
    569         return d->debugger->findPreviousInScriptAction(that);
    570     case GoToLineAction:
    571         return d->debugger->goToLineAction(that);
    572     }
    573     return 0;
     469    return d->debugger->action(static_cast<QScriptDebugger::DebuggerAction>(static_cast<int>(action)), that);
    574470}
    575471
     
    612508  \sa createStandardMenu(), createStandardToolBar()
    613509*/
     510#ifndef QT_NO_MAINWINDOW
    614511QMainWindow *QScriptEngineDebugger::standardWindow() const
    615512{
     
    624521    QDockWidget *scriptsDock = new QDockWidget(win);
    625522    scriptsDock->setObjectName(QLatin1String("qtscriptdebugger_scriptsDockWidget"));
    626     scriptsDock->setWindowTitle(QObject::tr("Loaded Scripts"));
     523    scriptsDock->setWindowTitle(tr("Loaded Scripts"));
    627524    scriptsDock->setWidget(widget(ScriptsWidget));
    628525    win->addDockWidget(Qt::LeftDockWidgetArea, scriptsDock);
     
    630527    QDockWidget *breakpointsDock = new QDockWidget(win);
    631528    breakpointsDock->setObjectName(QLatin1String("qtscriptdebugger_breakpointsDockWidget"));
    632     breakpointsDock->setWindowTitle(QObject::tr("Breakpoints"));
     529    breakpointsDock->setWindowTitle(tr("Breakpoints"));
    633530    breakpointsDock->setWidget(widget(BreakpointsWidget));
    634531    win->addDockWidget(Qt::LeftDockWidgetArea, breakpointsDock);
     
    636533    QDockWidget *stackDock = new QDockWidget(win);
    637534    stackDock->setObjectName(QLatin1String("qtscriptdebugger_stackDockWidget"));
    638     stackDock->setWindowTitle(QObject::tr("Stack"));
     535    stackDock->setWindowTitle(tr("Stack"));
    639536    stackDock->setWidget(widget(StackWidget));
    640537    win->addDockWidget(Qt::RightDockWidgetArea, stackDock);
     
    642539    QDockWidget *localsDock = new QDockWidget(win);
    643540    localsDock->setObjectName(QLatin1String("qtscriptdebugger_localsDockWidget"));
    644     localsDock->setWindowTitle(QObject::tr("Locals"));
     541    localsDock->setWindowTitle(tr("Locals"));
    645542    localsDock->setWidget(widget(LocalsWidget));
    646543    win->addDockWidget(Qt::RightDockWidgetArea, localsDock);
     
    648545    QDockWidget *consoleDock = new QDockWidget(win);
    649546    consoleDock->setObjectName(QLatin1String("qtscriptdebugger_consoleDockWidget"));
    650     consoleDock->setWindowTitle(QObject::tr("Console"));
     547    consoleDock->setWindowTitle(tr("Console"));
    651548    consoleDock->setWidget(widget(ConsoleWidget));
    652549    win->addDockWidget(Qt::BottomDockWidgetArea, consoleDock);
     
    654551    QDockWidget *debugOutputDock = new QDockWidget(win);
    655552    debugOutputDock->setObjectName(QLatin1String("qtscriptdebugger_debugOutputDockWidget"));
    656     debugOutputDock->setWindowTitle(QObject::tr("Debug Output"));
     553    debugOutputDock->setWindowTitle(tr("Debug Output"));
    657554    debugOutputDock->setWidget(widget(DebugOutputWidget));
    658555    win->addDockWidget(Qt::BottomDockWidgetArea, debugOutputDock);
     
    660557    QDockWidget *errorLogDock = new QDockWidget(win);
    661558    errorLogDock->setObjectName(QLatin1String("qtscriptdebugger_errorLogDockWidget"));
    662     errorLogDock->setWindowTitle(QObject::tr("Error Log"));
     559    errorLogDock->setWindowTitle(tr("Error Log"));
    663560    errorLogDock->setWidget(widget(ErrorLogWidget));
    664561    win->addDockWidget(Qt::BottomDockWidgetArea, errorLogDock);
     
    672569    win->menuBar()->addMenu(that->createStandardMenu(win));
    673570
    674     QMenu *editMenu = win->menuBar()->addMenu(QObject::tr("Search"));
     571    QMenu *editMenu = win->menuBar()->addMenu(tr("Search"));
    675572    editMenu->addAction(action(FindInScriptAction));
    676573    editMenu->addAction(action(FindNextInScriptAction));
     
    679576    editMenu->addAction(action(GoToLineAction));
    680577
    681     QMenu *viewMenu = win->menuBar()->addMenu(QObject::tr("View"));
     578    QMenu *viewMenu = win->menuBar()->addMenu(tr("View"));
    682579    viewMenu->addAction(scriptsDock->toggleViewAction());
    683580    viewMenu->addAction(breakpointsDock->toggleViewAction());
     
    697594    win->setCentralWidget(central);
    698595
    699     win->setWindowTitle(QObject::tr("Qt Script Debugger"));
     596    win->setWindowTitle(tr("Qt Script Debugger"));
    700597    win->setUnifiedTitleAndToolBarOnMac(true);
    701598
     
    715612    return win;
    716613}
     614#endif // QT_NO_MAINWINDOW
    717615
    718616/*!
     
    724622QMenu *QScriptEngineDebugger::createStandardMenu(QWidget *parent)
    725623{
    726     QMenu *menu = new QMenu(parent);
    727     menu->setTitle(QObject::tr("Debug"));
    728     menu->addAction(action(ContinueAction));
    729     menu->addAction(action(InterruptAction));
    730     menu->addAction(action(StepIntoAction));
    731     menu->addAction(action(StepOverAction));
    732     menu->addAction(action(StepOutAction));
    733     menu->addAction(action(RunToCursorAction));
    734     menu->addAction(action(RunToNewScriptAction));
    735 
    736     menu->addSeparator();
    737     menu->addAction(action(ToggleBreakpointAction));
    738 
    739     menu->addSeparator();
    740     menu->addAction(action(ClearDebugOutputAction));
    741     menu->addAction(action(ClearErrorLogAction));
    742     menu->addAction(action(ClearConsoleAction));
    743 
    744     return menu;
     624    Q_D(QScriptEngineDebugger);
     625    d->createDebugger();
     626    return d->debugger->createStandardMenu(parent, this);
    745627}
    746628
     
    751633  \sa createStandardMenu()
    752634*/
     635#ifndef QT_NO_TOOLBAR
    753636QToolBar *QScriptEngineDebugger::createStandardToolBar(QWidget *parent)
    754637{
    755     QToolBar *tb = new QToolBar(parent);
    756     tb->setObjectName(QLatin1String("qtscriptdebugger_standardToolBar"));
    757     tb->addAction(action(ContinueAction));
    758     tb->addAction(action(InterruptAction));
    759     tb->addAction(action(StepIntoAction));
    760     tb->addAction(action(StepOverAction));
    761     tb->addAction(action(StepOutAction));
    762     tb->addAction(action(RunToCursorAction));
    763     tb->addAction(action(RunToNewScriptAction));
    764     tb->addSeparator();
    765     tb->addAction(action(FindInScriptAction));
    766     return tb;
    767 }
     638    Q_D(QScriptEngineDebugger);
     639    d->createDebugger();
     640    return d->debugger->createStandardToolBar(parent, this);
     641}
     642#endif
    768643
    769644/*!
  • trunk/src/scripttools/debugging/qscriptenginedebugger.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4949QT_BEGIN_NAMESPACE
    5050
    51 #if QT_VERSION >= 0x040500
    5251QT_MODULE(ScriptTools)
    53 #else
    54 #  define Q_SCRIPTTOOLS_EXPORT
    55 #endif
    5652
    5753class QAction;
    5854class QScriptEngine;
    5955class QWidget;
     56#ifndef QT_NO_MAINWINDOW
    6057class QMainWindow;
     58#endif
    6159class QMenu;
    6260class QToolBar;
     
    9795    };
    9896
     97    enum DebuggerState {
     98        RunningState,
     99        SuspendedState
     100    };
     101
    99102    QScriptEngineDebugger(QObject *parent = 0);
    100103    ~QScriptEngineDebugger();
     
    106109    void setAutoShowStandardWindow(bool autoShow);
    107110
     111#ifndef QT_NO_MAINWINDOW
    108112    QMainWindow *standardWindow() const;
     113#endif
    109114    QToolBar *createStandardToolBar(QWidget *parent = 0);
    110115    QMenu *createStandardMenu(QWidget *parent = 0);
     
    112117    QWidget *widget(DebuggerWidget widget) const;
    113118    QAction *action(DebuggerAction action) const;
     119
     120    DebuggerState state() const;
    114121
    115122Q_SIGNALS:
  • trunk/src/scripttools/debugging/qscriptenginedebuggerfrontend.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    324324
    325325/*!
    326   \reimp
     326  \internal
    327327*/
    328328void QScriptEngineDebuggerFrontend::processCommand(int id, const QScriptDebuggerCommand &command)
  • trunk/src/scripttools/debugging/qscriptenginedebuggerfrontend_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscripterrorlogwidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscripterrorlogwidget_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscripterrorlogwidgetinterface.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscripterrorlogwidgetinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscripterrorlogwidgetinterface_p_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptmessagehandlerinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptobjectsnapshot.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptobjectsnapshot_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptscriptdata.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    9999
    100100QScriptScriptData::QScriptScriptData(const QScriptScriptData &other)
    101     : d_ptr(other.d_ptr)
     101    : d_ptr(other.d_ptr.data())
    102102{
    103103    if (d_ptr)
     
    107107QScriptScriptData::~QScriptScriptData()
    108108{
    109     if (d_ptr && !d_ptr->ref.deref()) {
    110         delete d_ptr;
    111         d_ptr = 0;
    112     }
    113109}
    114110
    115111QScriptScriptData &QScriptScriptData::operator=(const QScriptScriptData &other)
    116112{
    117     if (d_ptr == other.d_ptr)
    118         return *this;
    119     if (d_ptr && !d_ptr->ref.deref())
    120         delete d_ptr;
    121     d_ptr = other.d_ptr;
    122     if (d_ptr)
    123         d_ptr->ref.ref();
     113    d_ptr.assign(other.d_ptr.data());
    124114    return *this;
    125115}
     
    192182QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data)
    193183{
    194     const QScriptScriptDataPrivate *d = data.d_ptr;
     184    const QScriptScriptDataPrivate *d = data.d_ptr.data();
    195185    if (d) {
    196186        out << d->contents;
     
    208198{
    209199    if (!data.d_ptr) {
    210         data.d_ptr = new QScriptScriptDataPrivate();
     200        data.d_ptr.reset(new QScriptScriptDataPrivate());
    211201        data.d_ptr->ref.ref();
    212202    }
    213     QScriptScriptDataPrivate *d = data.d_ptr;
     203    QScriptScriptDataPrivate *d = data.d_ptr.data();
    214204    in >> d->contents;
    215205    in >> d->fileName;
  • trunk/src/scripttools/debugging/qscriptscriptdata_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtCore/qobjectdefs.h>
    57 
     57#include <QtCore/private/qscopedpointer_p.h>
    5858#include <QtCore/qdatetime.h>
    5959#include <QtCore/qmap.h>
     
    9292
    9393private:
    94     QScriptScriptDataPrivate *d_ptr;
     94    QScopedSharedPointer<QScriptScriptDataPrivate> d_ptr;
    9595
    9696    Q_DECLARE_PRIVATE(QScriptScriptData)
  • trunk/src/scripttools/debugging/qscriptstdmessagehandler.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6767QScriptStdMessageHandler::~QScriptStdMessageHandler()
    6868{
    69     delete d_ptr;
    7069}
    7170
     
    9392    msg.append(text);
    9493
    95     FILE *fp = 0;
    96     switch (type) {
    97     case QtDebugMsg:
    98         fp = stdout;
    99         break;
    100     case QtWarningMsg:
    101     case QtCriticalMsg:
    102     case QtFatalMsg:
    103         fp = stderr;
    104         break;
    105     }
    106 
     94    FILE *fp = (type == QtDebugMsg) ? stdout : stderr;
    10795    fprintf(fp, "%s\n", msg.toLatin1().constData());
    10896    fflush(fp);
  • trunk/src/scripttools/debugging/qscriptstdmessagehandler_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5353// We mean it.
    5454//
     55
     56#include <QtCore/qscopedpointer.h>
    5557
    5658#include "qscriptmessagehandlerinterface_p.h"
     
    7274
    7375private:
    74     QScriptStdMessageHandlerPrivate *d_ptr;
     76    QScopedPointer<QScriptStdMessageHandlerPrivate> d_ptr;
    7577
    7678private:
  • trunk/src/scripttools/debugging/qscriptsyntaxhighlighter.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptsyntaxhighlighter_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscripttooltipproviderinterface_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5858QT_BEGIN_NAMESPACE
    5959
     60class QPoint;
    6061class QStringList;
    6162
     
    6566    virtual ~QScriptToolTipProviderInterface() {}
    6667
    67     virtual QString toolTip(int frameIndex, int lineNumber,
    68                             const QStringList &path) = 0;
     68    virtual void showToolTip(const QPoint &pos, int frameIndex,
     69                             int lineNumber, const QStringList &path) = 0;
    6970};
    7071
  • trunk/src/scripttools/debugging/qscriptvalueproperty.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    9696*/
    9797QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other)
    98     : d_ptr(other.d_ptr)
     98    : d_ptr(other.d_ptr.data())
    9999{
    100100    if (d_ptr)
     
    107107QScriptValueProperty::~QScriptValueProperty()
    108108{
    109     if (d_ptr && !d_ptr->ref.deref()) {
    110         delete d_ptr;
    111         d_ptr = 0;
    112     }
    113109}
    114110
     
    118114QScriptValueProperty &QScriptValueProperty::operator=(const QScriptValueProperty &other)
    119115{
    120     if (d_ptr == other.d_ptr)
    121         return *this;
    122     if (d_ptr && !d_ptr->ref.deref())
    123         delete d_ptr;
    124     d_ptr = other.d_ptr;
    125     if (d_ptr)
    126         d_ptr->ref.ref();
     116    d_ptr.assign(other.d_ptr.data());
    127117    return *this;
    128118}
  • trunk/src/scripttools/debugging/qscriptvalueproperty_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5656#include <QtCore/qobjectdefs.h>
    5757#include <QtCore/qlist.h>
     58#include <QtCore/private/qscopedpointer_p.h>
    5859#include <QtScript/qscriptvalue.h>
    5960
     
    8283
    8384private:
    84     QScriptValuePropertyPrivate *d_ptr;
     85    QScopedSharedPointer<QScriptValuePropertyPrivate> d_ptr;
    8586
    8687    Q_DECLARE_PRIVATE(QScriptValueProperty)
  • trunk/src/scripttools/debugging/qscriptxmlparser.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/scripttools/debugging/qscriptxmlparser_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
Note: See TracChangeset for help on using the changeset viewer.