forked from qt-creator/qt-creator
Fixes: debugger: reduce header dependencies
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user