debugger: remove sessionengine

This commit is contained in:
hjk
2010-11-04 18:11:09 +01:00
parent 6d0f22b1bd
commit 91ba3949d5
10 changed files with 78 additions and 243 deletions

View File

@@ -41,7 +41,6 @@ HEADERS += breakhandler.h \
procinterrupt.h \ procinterrupt.h \
registerhandler.h \ registerhandler.h \
registerwindow.h \ registerwindow.h \
sessionengine.h \
snapshothandler.h \ snapshothandler.h \
snapshotwindow.h \ snapshotwindow.h \
sourcefileshandler.h \ sourcefileshandler.h \
@@ -79,7 +78,6 @@ SOURCES += breakhandler.cpp \
procinterrupt.cpp \ procinterrupt.cpp \
registerhandler.cpp \ registerhandler.cpp \
registerwindow.cpp \ registerwindow.cpp \
sessionengine.cpp \
snapshothandler.cpp \ snapshothandler.cpp \
snapshotwindow.cpp \ snapshotwindow.cpp \
sourcefileshandler.cpp \ sourcefileshandler.cpp \

View File

@@ -614,17 +614,6 @@ void DebuggerEngine::handleCommand(int role, const QVariant &value)
executeDebuggerCommand(value.toString()); executeDebuggerCommand(value.toString());
break; break;
/*
case RequestToggleBreakpointRole: {
QList<QVariant> list = value.toList();
QTC_ASSERT(list.size() == 2, break);
const QString fileName = list.at(0).toString();
const int lineNumber = list.at(1).toInt();
breakHandler()->toggleBreakpoint(fileName, lineNumber);
break;
}
*/
case RequestToolTipByExpressionRole: { case RequestToolTipByExpressionRole: {
QList<QVariant> list = value.toList(); QList<QVariant> list = value.toList();
QTC_ASSERT(list.size() == 3, break); QTC_ASSERT(list.size() == 3, break);
@@ -817,7 +806,7 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c
void DebuggerEngine::startDebugger(DebuggerRunControl *runControl) void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
{ {
if (!isSessionEngine() && !isSlaveEngine()) { if (!isSlaveEngine()) {
d->m_progress.setProgressRange(0, 1000); d->m_progress.setProgressRange(0, 1000);
Core::FutureProgress *fp = Core::ICore::instance()->progressManager() Core::FutureProgress *fp = Core::ICore::instance()->progressManager()
->addTask(d->m_progress.future(), ->addTask(d->m_progress.future(),
@@ -828,12 +817,6 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
QTC_ASSERT(runControl, notifyEngineSetupFailed(); return); QTC_ASSERT(runControl, notifyEngineSetupFailed(); return);
QTC_ASSERT(!d->m_runControl, notifyEngineSetupFailed(); return); QTC_ASSERT(!d->m_runControl, notifyEngineSetupFailed(); return);
DebuggerEngine *sessionTemplate = plugin()->sessionTemplate();
QTC_ASSERT(sessionTemplate, notifyEngineSetupFailed(); return);
QTC_ASSERT(sessionTemplate != this, notifyEngineSetupFailed(); return);
watchHandler()->initializeFromTemplate(sessionTemplate->watchHandler());
d->m_runControl = runControl; d->m_runControl = runControl;
d->m_inferiorPid = d->m_startParameters.attachPID > 0 d->m_inferiorPid = d->m_startParameters.attachPID > 0
@@ -1028,11 +1011,6 @@ void DebuggerEngine::handleFinished()
threadsHandler()->removeAll(); threadsHandler()->removeAll();
watchHandler()->cleanup(); watchHandler()->cleanup();
DebuggerEngine *sessionTemplate = plugin()->sessionTemplate();
QTC_ASSERT(sessionTemplate != this, /**/);
breakHandler()->storeToTemplate(sessionTemplate->breakHandler());
watchHandler()->storeToTemplate(sessionTemplate->watchHandler());
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished(); d->m_progress.reportFinished();
} }
@@ -1593,7 +1571,7 @@ bool DebuggerEngine::isReverseDebugging() const
bool DebuggerEngine::isActive() const bool DebuggerEngine::isActive() const
{ {
return d->m_isActive && !isSessionEngine(); return d->m_isActive;
} }
void DebuggerEngine::setActive(bool on) void DebuggerEngine::setActive(bool on)
@@ -1653,11 +1631,6 @@ void DebuggerEngine::updateWatchData(const Internal::WatchData &, const Internal
{ {
} }
bool DebuggerEngine::isSessionEngine() const
{
return false;
}
void DebuggerEngine::watchPoint(const QPoint &) void DebuggerEngine::watchPoint(const QPoint &)
{ {
} }

View File

@@ -154,7 +154,6 @@ public:
virtual void updateWatchData(const Internal::WatchData &data, virtual void updateWatchData(const Internal::WatchData &data,
const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags()); const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags());
void startDebugger(DebuggerRunControl *runControl); void startDebugger(DebuggerRunControl *runControl);
virtual bool isSessionEngine() const;
virtual void watchPoint(const QPoint &); virtual void watchPoint(const QPoint &);
virtual void fetchMemory(Internal::MemoryViewAgent *, QObject *, virtual void fetchMemory(Internal::MemoryViewAgent *, QObject *,

View File

@@ -51,9 +51,9 @@
#include "stackwindow.h" #include "stackwindow.h"
#include "sourcefileswindow.h" #include "sourcefileswindow.h"
#include "threadswindow.h" #include "threadswindow.h"
#include "watchhandler.h"
#include "watchwindow.h" #include "watchwindow.h"
#include "sessionengine.h"
#include "snapshothandler.h" #include "snapshothandler.h"
#include "threadshandler.h" #include "threadshandler.h"
@@ -853,7 +853,7 @@ public:
bool initialize(const QStringList &arguments, QString *errorMessage); bool initialize(const QStringList &arguments, QString *errorMessage);
void notifyCurrentEngine(int role, const QVariant &value = QVariant()); void notifyCurrentEngine(int role, const QVariant &value = QVariant());
void connectEngine(DebuggerEngine *engine, bool notify = true); void connectEngine(DebuggerEngine *engine, bool notify = true);
void disconnectEngine() { connectEngine(m_sessionEngine); } void disconnectEngine() { connectEngine(0); }
public slots: public slots:
void updateWatchersHeader(int section, int, int newSize) void updateWatchersHeader(int section, int, int newSize)
@@ -876,6 +876,16 @@ public slots:
} }
} }
void synchronizeWatchers()
{
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
if (DebuggerRunControl *runControl = m_snapshotHandler->at(i)) {
DebuggerEngine *engine = runControl->engine();
engine->watchHandler()->synchronizeWatchers();
}
}
}
void onAction(); void onAction();
void setSimpleDockWidgetArrangement(Debugger::DebuggerLanguages activeLanguages); void setSimpleDockWidgetArrangement(Debugger::DebuggerLanguages activeLanguages);
@@ -1008,8 +1018,6 @@ public:
LogWindow *m_logWindow; LogWindow *m_logWindow;
ScriptConsole *m_scriptConsoleWindow; ScriptConsole *m_scriptConsoleWindow;
SessionEngine *m_sessionEngine;
bool m_busy; bool m_busy;
QTimer m_statusTimer; QTimer m_statusTimer;
QString m_lastPermanentStatusMessage; QString m_lastPermanentStatusMessage;
@@ -1019,13 +1027,14 @@ public:
SnapshotHandler *m_snapshotHandler; SnapshotHandler *m_snapshotHandler;
bool m_shuttingDown; bool m_shuttingDown;
DebuggerEngine *m_currentEngine;
}; };
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) : DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
m_shuttingDown(false)
{ {
m_plugin = plugin; m_plugin = plugin;
m_shuttingDown = false;
m_statusLabel = 0; m_statusLabel = 0;
m_threadBox = 0; m_threadBox = 0;
@@ -1054,7 +1063,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_logWindow = 0; m_logWindow = 0;
m_scriptConsoleWindow = 0; m_scriptConsoleWindow = 0;
m_sessionEngine = 0;
m_debugMode = 0; m_debugMode = 0;
m_continuableContext = Core::Context(0); m_continuableContext = Core::Context(0);
@@ -1067,6 +1075,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_uiSwitcher = 0; m_uiSwitcher = 0;
m_state = DebuggerNotReady; m_state = DebuggerNotReady;
m_snapshotHandler = 0; m_snapshotHandler = 0;
m_currentEngine = 0;
} }
bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *errorMessage) bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *errorMessage)
@@ -1113,6 +1122,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
SLOT(synchronizeBreakpoints())); SLOT(synchronizeBreakpoints()));
m_breakWindow = new BreakWindow; m_breakWindow = new BreakWindow;
m_breakWindow->setObjectName(QLatin1String("CppDebugBreakpoints")); m_breakWindow->setObjectName(QLatin1String("CppDebugBreakpoints"));
m_breakWindow->setModel(m_breakHandler->model());
//m_consoleWindow = new ConsoleWindow; //m_consoleWindow = new ConsoleWindow;
//m_consoleWindow->setObjectName(QLatin1String("CppDebugConsole")); //m_consoleWindow->setObjectName(QLatin1String("CppDebugConsole"));
m_modulesWindow = new ModulesWindow; m_modulesWindow = new ModulesWindow;
@@ -1143,9 +1154,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
connect(m_scriptConsoleWindow, SIGNAL(expressionEntered(QString)), connect(m_scriptConsoleWindow, SIGNAL(expressionEntered(QString)),
SLOT(scriptExpressionEntered(QString))); SLOT(scriptExpressionEntered(QString)));
// Session related data
m_sessionEngine = new SessionEngine;
// Snapshot // Snapshot
m_snapshotHandler = new SnapshotHandler; m_snapshotHandler = new SnapshotHandler;
m_snapshotWindow->setModel(m_snapshotHandler->model()); m_snapshotWindow->setModel(m_snapshotHandler->model());
@@ -1652,7 +1660,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
SLOT(languagesChanged(Debugger::DebuggerLanguages))); SLOT(languagesChanged(Debugger::DebuggerLanguages)));
setInitialState(); setInitialState();
connectEngine(m_sessionEngine, false); connectEngine(0, false);
connect(sessionManager(), connect(sessionManager(),
SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
@@ -1758,7 +1766,8 @@ void DebuggerPluginPrivate::startExternalApplication()
void DebuggerPluginPrivate::notifyCurrentEngine(int role, const QVariant &value) void DebuggerPluginPrivate::notifyCurrentEngine(int role, const QVariant &value)
{ {
QTC_ASSERT(m_commandWindow && m_commandWindow->model(), return); QTC_ASSERT(m_commandWindow, return);
if (m_commandWindow->model())
m_commandWindow->model()->setData(QModelIndex(), value, role); m_commandWindow->model()->setData(QModelIndex(), value, role);
} }
@@ -2052,19 +2061,12 @@ void DebuggerPluginPrivate::startDebugger(RunControl *rc)
void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine, bool notify) void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine, bool notify)
{ {
const QAbstractItemModel *oldCommandModel = m_commandWindow->model(); if (m_currentEngine == engine)
if (oldCommandModel == engine->commandModel()) {
// qDebug("RECONNECTING ENGINE %s", qPrintable(engine->objectName()));
return; return;
}
if (engine) {
if (notify) if (notify)
notifyCurrentEngine(RequestActivationRole, false); notifyCurrentEngine(RequestActivationRole, false);
// qDebug("CONNECTING ENGINE %s (OLD ENGINE: %s)", qPrintable(engine->objectName()),
// (oldCommandModel ? qPrintable(oldCommandModel->objectName()) : ""));
m_breakWindow->setModel(m_breakHandler->model());
m_commandWindow->setModel(engine->commandModel()); m_commandWindow->setModel(engine->commandModel());
m_localsWindow->setModel(engine->localsModel()); m_localsWindow->setModel(engine->localsModel());
m_modulesWindow->setModel(engine->modulesModel()); m_modulesWindow->setModel(engine->modulesModel());
@@ -2078,6 +2080,19 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine, bool notify)
m_watchersWindow->setModel(engine->watchersModel()); m_watchersWindow->setModel(engine->watchersModel());
if (notify) if (notify)
notifyCurrentEngine(RequestActivationRole, true); notifyCurrentEngine(RequestActivationRole, true);
} else {
m_commandWindow->setModel(0);
m_localsWindow->setModel(0);
m_modulesWindow->setModel(0);
m_registerWindow->setModel(0);
m_returnWindow->setModel(0);
m_sourceFilesWindow->setModel(0);
m_stackWindow->setModel(0);
m_threadsWindow->setModel(0);
m_threadBox->setModel(0);
m_threadBox->setModelColumn(ThreadData::NameColumn);
m_watchersWindow->setModel(0);
}
} }
static void changeFontSize(QWidget *widget, qreal size) static void changeFontSize(QWidget *widget, qreal size)
@@ -2478,7 +2493,9 @@ void DebuggerPluginPrivate::activateDebugMode()
void DebuggerPluginPrivate::sessionLoaded() void DebuggerPluginPrivate::sessionLoaded()
{ {
m_sessionEngine->loadSessionData(); m_breakHandler->loadSessionData();
WatchHandler::loadSessionData();
synchronizeWatchers();
} }
void DebuggerPluginPrivate::aboutToUnloadSession() void DebuggerPluginPrivate::aboutToUnloadSession()
@@ -2494,7 +2511,8 @@ void DebuggerPluginPrivate::aboutToUnloadSession()
void DebuggerPluginPrivate::aboutToSaveSession() void DebuggerPluginPrivate::aboutToSaveSession()
{ {
m_sessionEngine->saveSessionData(); WatchHandler::saveSessionData();
m_breakHandler->saveSessionData();
} }
void DebuggerPluginPrivate::executeDebuggerCommand() void DebuggerPluginPrivate::executeDebuggerCommand()
@@ -2559,9 +2577,6 @@ DebuggerPlugin::DebuggerPlugin()
DebuggerPlugin::~DebuggerPlugin() DebuggerPlugin::~DebuggerPlugin()
{ {
delete d->m_sessionEngine;
d->m_sessionEngine = 0;
theInstance = 0; theInstance = 0;
delete DebuggerSettings::instance(); delete DebuggerSettings::instance();
@@ -2826,11 +2841,6 @@ DebuggerLanguages DebuggerPlugin::activeLanguages() const
return DebuggerUISwitcher::instance()->activeDebugLanguages(); return DebuggerUISwitcher::instance()->activeDebugLanguages();
} }
DebuggerEngine *DebuggerPlugin::sessionTemplate()
{
return d->m_sessionEngine;
}
bool DebuggerPlugin::isRegisterViewVisible() const bool DebuggerPlugin::isRegisterViewVisible() const
{ {
return d->m_registerDock->toggleViewAction()->isChecked(); return d->m_registerDock->toggleViewAction()->isChecked();

View File

@@ -56,7 +56,6 @@ class DebuggerRunControl;
class DebuggerStartParameters; class DebuggerStartParameters;
namespace Internal { namespace Internal {
class DebuggerListener;
class BreakHandler; class BreakHandler;
} }
@@ -116,10 +115,6 @@ private:
void runControlFinished(DebuggerRunControl *runControl); void runControlFinished(DebuggerRunControl *runControl);
DebuggerLanguages activeLanguages() const; DebuggerLanguages activeLanguages() const;
// This contains per-session data like breakpoints and watched
// expression. It serves as a template for new engine instantiations.
DebuggerEngine *sessionTemplate();
QMessageBox *showMessageBox(int icon, const QString &title, QMessageBox *showMessageBox(int icon, const QString &title,
const QString &text, int buttons = 0); const QString &text, int buttons = 0);

View File

@@ -1,77 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "sessionengine.h"
#include "breakhandler.h"
#include "watchhandler.h"
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
namespace Debugger {
namespace Internal {
// This class contains data serving as a template for debugger engines
// started during a session.
SessionEngine::SessionEngine()
: DebuggerEngine(DebuggerStartParameters())
{
setObjectName(QLatin1String("SessionEngine"));
}
void SessionEngine::executeDebuggerCommand(const QString &command)
{
QTC_ASSERT(false, qDebug() << command)
}
void SessionEngine::loadSessionData()
{
breakHandler()->loadSessionData();
watchHandler()->loadSessionData();
}
void SessionEngine::saveSessionData()
{
watchHandler()->saveSessionData();
breakHandler()->saveSessionData();
}
unsigned SessionEngine::debuggerCapabilities() const
{
return DebuggerEngine::debuggerCapabilities()
| AddWatcherCapability
| BreakOnThrowAndCatchCapability
| WatchpointCapability;
}
} // namespace Internal
} // namespace Debugger

View File

@@ -1,66 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef DEBUGGER_SESSIONENGINE_H
#define DEBUGGER_SESSIONENGINE_H
#include "debuggerengine.h"
namespace Debugger {
namespace Internal {
// This class contains data serving as a template for debugger engines
// started during a session.
class SessionEngine : public DebuggerEngine
{
Q_OBJECT
public:
SessionEngine();
virtual void setupEngine() {}
virtual void setupInferior() {}
virtual void runEngine() {}
virtual void shutdownEngine() {}
virtual void shutdownInferior() {}
virtual void executeDebuggerCommand(const QString &command);
virtual unsigned debuggerCapabilities() const;
virtual bool isSessionEngine() const { return true; }
void loadSessionData();
void saveSessionData();
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_SESSIONENGINE_H

View File

@@ -29,7 +29,6 @@
#include "snapshothandler.h" #include "snapshothandler.h"
#include "sessionengine.h"
#include "debuggerconstants.h" #include "debuggerconstants.h"
#include "debuggerengine.h" #include "debuggerengine.h"
#include "debuggerrunner.h" #include "debuggerrunner.h"

View File

@@ -78,6 +78,9 @@ static int generationCounter = 0;
static DebuggerPlugin *plugin() { return DebuggerPlugin::instance(); } static DebuggerPlugin *plugin() { return DebuggerPlugin::instance(); }
QHash<QByteArray, int> WatchHandler::m_watcherNames;
QHash<QByteArray, int> WatchHandler::m_typeFormats;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// //
// WatchItem // WatchItem
@@ -1383,7 +1386,7 @@ void WatchHandler::watchExpression(const QString &exp)
if (exp.isEmpty()) if (exp.isEmpty())
data.setAllUnneeded(); data.setAllUnneeded();
data.iname = watcherName(data.exp); data.iname = watcherName(data.exp);
if (m_engine->isSynchronous() && !m_engine->isSessionEngine()) if (m_engine->isSynchronous())
m_engine->updateWatchData(data); m_engine->updateWatchData(data);
else else
insertData(data); insertData(data);
@@ -1531,7 +1534,7 @@ void WatchHandler::loadWatchers()
//qDebug() << "LOAD WATCHERS: " << m_watchers; //qDebug() << "LOAD WATCHERS: " << m_watchers;
} }
QStringList WatchHandler::watchedExpressions() const QStringList WatchHandler::watchedExpressions()
{ {
// Filter out invalid watchers. // Filter out invalid watchers.
QStringList watcherNames; QStringList watcherNames;
@@ -1581,17 +1584,18 @@ void WatchHandler::saveTypeFormats()
void WatchHandler::saveSessionData() void WatchHandler::saveSessionData()
{ {
QTC_ASSERT(m_engine->isSessionEngine(), return);
saveWatchers(); saveWatchers();
saveTypeFormats(); saveTypeFormats();
} }
void WatchHandler::loadSessionData() void WatchHandler::loadSessionData()
{ {
QTC_ASSERT(m_engine->isSessionEngine(), return);
loadWatchers(); loadWatchers();
loadTypeFormats(); loadTypeFormats();
}
void WatchHandler::synchronizeWatchers()
{
foreach (const QByteArray &exp, m_watcherNames.keys()) { foreach (const QByteArray &exp, m_watcherNames.keys()) {
WatchData data; WatchData data;
data.iname = watcherName(exp); data.iname = watcherName(exp);
@@ -1600,7 +1604,6 @@ void WatchHandler::loadSessionData()
data.exp = exp; data.exp = exp;
insertData(data); insertData(data);
} }
updateWatchersWindow();
} }
void WatchHandler::initializeFromTemplate(WatchHandler *other) void WatchHandler::initializeFromTemplate(WatchHandler *other)

View File

@@ -153,8 +153,8 @@ public:
void removeData(const QByteArray &iname); void removeData(const QByteArray &iname);
WatchData *findItem(const QByteArray &iname) const; WatchData *findItem(const QByteArray &iname) const;
void loadSessionData(); static void loadSessionData();
void saveSessionData(); static void saveSessionData();
void removeTooltip(); void removeTooltip();
void initializeFromTemplate(WatchHandler *other); void initializeFromTemplate(WatchHandler *other);
@@ -164,8 +164,8 @@ public:
{ return m_expandedINames.contains(iname); } { return m_expandedINames.contains(iname); }
QSet<QByteArray> expandedINames() const QSet<QByteArray> expandedINames() const
{ return m_expandedINames; } { return m_expandedINames; }
QStringList watchedExpressions() const; static QStringList watchedExpressions();
QHash<QByteArray, int> watcherNames() const static QHash<QByteArray, int> watcherNames()
{ return m_watcherNames; } { return m_watcherNames; }
QByteArray expansionRequests() const; QByteArray expansionRequests() const;
@@ -177,15 +177,16 @@ public:
void addTypeFormats(const QByteArray &type, const QStringList &formats); void addTypeFormats(const QByteArray &type, const QStringList &formats);
QByteArray watcherName(const QByteArray &exp); QByteArray watcherName(const QByteArray &exp);
void synchronizeWatchers();
private: private:
friend class WatchModel; friend class WatchModel;
void loadWatchers(); static void loadWatchers();
void saveWatchers(); static void saveWatchers();
static void loadTypeFormats();
static void saveTypeFormats();
void loadTypeFormats();
void saveTypeFormats();
void setFormat(const QByteArray &type, int format); void setFormat(const QByteArray &type, int format);
void updateWatchersWindow(); void updateWatchersWindow();
void showInEditor(); void showInEditor();
@@ -197,8 +198,8 @@ private:
typedef QMap<QString, QPointer<QObject> > EditHandlers; typedef QMap<QString, QPointer<QObject> > EditHandlers;
EditHandlers m_editHandlers; EditHandlers m_editHandlers;
QHash<QByteArray, int> m_watcherNames; static QHash<QByteArray, int> m_watcherNames;
QHash<QByteArray, int> m_typeFormats; static QHash<QByteArray, int> m_typeFormats;
QHash<QByteArray, int> m_individualFormats; // Indexed by iname. QHash<QByteArray, int> m_individualFormats; // Indexed by iname.
QHash<QString, QStringList> m_reportedTypeFormats; QHash<QString, QStringList> m_reportedTypeFormats;