Fixes: debugger: reduce header dependencies

This commit is contained in:
hjk
2009-01-28 14:29:54 +01:00
parent 19637bd37f
commit 97dfdebf07
2 changed files with 23 additions and 22 deletions

View File

@@ -61,6 +61,7 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
@@ -85,8 +86,6 @@
#include <QtGui/QTextCursor> #include <QtGui/QTextCursor>
namespace ExtensionSystem { class PluginManager; }
using namespace Core; using namespace Core;
using namespace Debugger::Constants; using namespace Debugger::Constants;
using namespace Debugger::Internal; using namespace Debugger::Internal;
@@ -144,6 +143,11 @@ const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q";
} // namespace Debugger } // namespace Debugger
static ProjectExplorer::SessionManager *sessionManager()
{
return ProjectExplorer::ProjectExplorerPlugin::instance()->session();
}
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
// DebugMode // DebugMode
@@ -660,9 +664,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
// //
// ProjectExplorer // ProjectExplorer
connect(projectExplorer()->session(), SIGNAL(sessionLoaded()), connect(sessionManager(), SIGNAL(sessionLoaded()),
m_manager, SLOT(sessionLoaded())); m_manager, SLOT(sessionLoaded()));
connect(projectExplorer()->session(), SIGNAL(aboutToSaveSession()), connect(sessionManager(), SIGNAL(aboutToSaveSession()),
m_manager, SLOT(aboutToSaveSession())); m_manager, SLOT(aboutToSaveSession()));
// EditorManager // 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. */ /*! Activates the previous mode when the current mode is the debug mode. */
void DebuggerPlugin::activatePreviousMode() void DebuggerPlugin::activatePreviousMode()
{ {
@@ -819,17 +818,14 @@ void DebuggerPlugin::showToolTip(TextEditor::ITextEditor *editor,
void DebuggerPlugin::setSessionValue(const QString &name, const QVariant &value) void DebuggerPlugin::setSessionValue(const QString &name, const QVariant &value)
{ {
//qDebug() << "SET SESSION VALUE" << name << value; //qDebug() << "SET SESSION VALUE" << name << value;
ProjectExplorerPlugin *pe = projectExplorer(); QTC_ASSERT(sessionManager(), return);
if (pe->session()) sessionManager()->setValue(name, value);
pe->session()->setValue(name, value);
else
qDebug() << "FIXME: Session does not exist yet";
} }
void DebuggerPlugin::querySessionValue(const QString &name, QVariant *value) void DebuggerPlugin::querySessionValue(const QString &name, QVariant *value)
{ {
ProjectExplorerPlugin *pe = projectExplorer(); QTC_ASSERT(sessionManager(), return);
*value = pe->session()->value(name); *value = sessionManager()->value(name);
//qDebug() << "GET SESSION VALUE: " << name << value; //qDebug() << "GET SESSION VALUE: " << name << value;
} }

View File

@@ -34,19 +34,26 @@
#ifndef DEBUGGERPLUGIN_H #ifndef DEBUGGERPLUGIN_H
#define DEBUGGERPLUGIN_H #define DEBUGGERPLUGIN_H
#include <projectexplorer/projectexplorer.h>
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <QtCore/QObject> #include <QtCore/QObject>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QAbstractItemView;
class QAction; class QAction;
class QCursor; class QCursor;
class QAbstractItemView; class QMenu;
class QPoint;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { class IEditor; } namespace Core {
namespace TextEditor { class ITextEditor; } class IEditor;
class IMode;
}
namespace TextEditor {
class ITextEditor;
}
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -99,8 +106,6 @@ private:
friend class GdbOptionPage; friend class GdbOptionPage;
friend class DebugMode; // FIXME: Just a hack now so that it can access the views friend class DebugMode; // FIXME: Just a hack now so that it can access the views
ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
DebuggerManager *m_manager; DebuggerManager *m_manager;
DebugMode *m_debugMode; DebugMode *m_debugMode;