Commit 97dfdebf authored by hjk's avatar hjk

Fixes: debugger: reduce header dependencies

parent 19637bd3
......@@ -61,6 +61,7 @@
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/session.h>
......@@ -85,8 +86,6 @@
#include <QtGui/QTextCursor>
namespace ExtensionSystem { class PluginManager; }
using namespace Core;
using namespace Debugger::Constants;
using namespace Debugger::Internal;
......@@ -144,6 +143,11 @@ const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q";
} // namespace Debugger
static ProjectExplorer::SessionManager *sessionManager()
{
return ProjectExplorer::ProjectExplorerPlugin::instance()->session();
}
///////////////////////////////////////////////////////////////////////
//
// DebugMode
......@@ -660,9 +664,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
//
// ProjectExplorer
connect(projectExplorer()->session(), SIGNAL(sessionLoaded()),
connect(sessionManager(), SIGNAL(sessionLoaded()),
m_manager, SLOT(sessionLoaded()));
connect(projectExplorer()->session(), SIGNAL(aboutToSaveSession()),
connect(sessionManager(), SIGNAL(aboutToSaveSession()),
m_manager, SLOT(aboutToSaveSession()));
// EditorManager
......@@ -703,11 +707,6 @@ void DebuggerPlugin::extensionsInitialized()
{
}
ProjectExplorer::ProjectExplorerPlugin *DebuggerPlugin::projectExplorer() const
{
return ProjectExplorer::ProjectExplorerPlugin::instance();
}
/*! Activates the previous mode when the current mode is the debug mode. */
void DebuggerPlugin::activatePreviousMode()
{
......@@ -819,17 +818,14 @@ void DebuggerPlugin::showToolTip(TextEditor::ITextEditor *editor,
void DebuggerPlugin::setSessionValue(const QString &name, const QVariant &value)
{
//qDebug() << "SET SESSION VALUE" << name << value;
ProjectExplorerPlugin *pe = projectExplorer();
if (pe->session())
pe->session()->setValue(name, value);
else
qDebug() << "FIXME: Session does not exist yet";
QTC_ASSERT(sessionManager(), return);
sessionManager()->setValue(name, value);
}
void DebuggerPlugin::querySessionValue(const QString &name, QVariant *value)
{
ProjectExplorerPlugin *pe = projectExplorer();
*value = pe->session()->value(name);
QTC_ASSERT(sessionManager(), return);
*value = sessionManager()->value(name);
//qDebug() << "GET SESSION VALUE: " << name << value;
}
......
......@@ -34,19 +34,26 @@
#ifndef DEBUGGERPLUGIN_H
#define DEBUGGERPLUGIN_H
#include <projectexplorer/projectexplorer.h>
#include <extensionsystem/iplugin.h>
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
class QAbstractItemView;
class QAction;
class QCursor;
class QAbstractItemView;
class QMenu;
class QPoint;
QT_END_NAMESPACE
namespace Core { class IEditor; }
namespace TextEditor { class ITextEditor; }
namespace Core {
class IEditor;
class IMode;
}
namespace TextEditor {
class ITextEditor;
}
namespace Debugger {
namespace Internal {
......@@ -99,8 +106,6 @@ private:
friend class GdbOptionPage;
friend class DebugMode; // FIXME: Just a hack now so that it can access the views
ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
DebuggerManager *m_manager;
DebugMode *m_debugMode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment