return DebuggerPlugin::instance();
}
-void DebuggerEngine::openFile(const QString &fileName, int lineNumber)
-{
- plugin()->gotoLocation(fileName, lineNumber, false);
-}
-
bool DebuggerEngine::isReverseDebugging() const
{
return plugin()->isReverseDebugging();
Q_SLOT void showStatusMessage(const QString &msg, int timeout = -1) const;
void resetLocation();
- void openFile(const QString &fileName, int lineNumber = -1);
virtual void gotoLocation(const QString &fileName, int lineNumber, bool setMarker);
virtual void gotoLocation(const Internal::StackFrame &frame, bool setMarker);
virtual void quitDebugger(); // called by DebuggerRunControl
// void runTest(const QString &fileName);
void showMessage(const QString &msg, int channel, int timeout = -1);
- void gotoLocation(const QString &fileName, int lineNumber, bool setMarker);
+ void gotoLocation(const QString &fileName, int lineNumber = -1,
+ bool setMarker = false);
private:
friend class DebuggerEngine;
namespace Debugger {
namespace Internal {
+static DebuggerPlugin *plugin()
+{
+ return DebuggerPlugin::instance();
+}
+
static DebuggerEngine *currentEngine()
{
return DebuggerPlugin::instance()->currentEngine();
void ModulesWindow::moduleActivated(const QModelIndex &index)
{
- currentEngine()->openFile(index.data().toString());
+ plugin()->gotoLocation(index.data().toString());
}
void ModulesWindow::resizeEvent(QResizeEvent *event)
} else if (act == actLoadSymbolsForModule) {
engine->loadSymbols(name);
} else if (act == actEditFile) {
- engine->openFile(name);
+ plugin()->gotoLocation(name);
} else if (act == actShowSymbols) {
// FIXME setModelData(RequestModuleSymbolsRole, name);
}
namespace Debugger {
namespace Internal {
+static DebuggerPlugin *plugin()
+{
+ return DebuggerPlugin::instance();
+}
+
static DebuggerEngine *currentEngine()
{
return DebuggerPlugin::instance()->currentEngine();
void SourceFilesWindow::sourceFileActivated(const QModelIndex &index)
{
- currentEngine()->openFile(index.data().toString());
+ plugin()->gotoLocation(index.data().toString());
}
void SourceFilesWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == act1)
currentEngine()->reloadSourceFiles();
else if (act == act2)
- currentEngine()->openFile(name);
-}
-
-void SourceFilesWindow::setModelData
- (int role, const QVariant &value, const QModelIndex &index)
-{
- QTC_ASSERT(model(), return);
- model()->setData(index, value, role);
+ plugin()->gotoLocation(name);
}
} // namespace Internal
#ifndef DEBUGGER_SOURCEFILEWINDOW_H
#define DEBUGGER_SOURCEFILEWINDOW_H
-
#include <QtGui/QTreeView>
namespace Debugger {
private:
void contextMenuEvent(QContextMenuEvent *ev);
- void setModelData(int role, const QVariant &value = QVariant(),
- const QModelIndex &index = QModelIndex());
};
} // namespace Internal