summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-01-28 14:04:39 +0100
committerhjk <qtc-committer@nokia.com>2009-01-28 14:04:39 +0100
commit8ef4f166e7c1373f5d4d2cf74879d00a3ae08ebf (patch)
treef7b47b1092384a9235e43bfd73a2e2e2787f915d /src/plugins/coreplugin
parentf6f1721a64d13c68f04a7180e5932de34ded74ab (diff)
downloadqt-creator-8ef4f166e7c1373f5d4d2cf74879d00a3ae08ebf.tar.gz
Fixes: coreplugin: remove another cached core instance singleton
pointer
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp2
-rw-r--r--src/plugins/coreplugin/scriptmanager/scriptmanager.cpp9
-rw-r--r--src/plugins/coreplugin/scriptmanager/scriptmanager_p.h14
3 files changed, 8 insertions, 17 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 97648813d0..91c2756d31 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -120,7 +120,7 @@ MainWindow::MainWindow() :
m_editorManager(0),
m_fileManager(new FileManager(this)),
m_progressManager(new ProgressManagerPrivate()),
- m_scriptManager(new ScriptManagerPrivate(this, m_coreImpl)),
+ m_scriptManager(new ScriptManagerPrivate(this)),
m_variableManager(new VariableManager(this)),
m_vcsManager(new VCSManager()),
m_viewManager(0),
diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp
index 937af4f66a..74f04c2a46 100644
--- a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp
+++ b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp
@@ -181,10 +181,8 @@ static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine)
namespace Core {
namespace Internal {
-ScriptManagerPrivate::ScriptManagerPrivate(QObject *parent, ICore *core) :
- ScriptManager(parent),
- m_core(core),
- m_initialized(false)
+ScriptManagerPrivate::ScriptManagerPrivate(QObject *parent)
+ : ScriptManager(parent), m_initialized(false)
{
}
@@ -250,7 +248,6 @@ void ScriptManagerPrivate::ensureEngineInitialized()
{
if (m_initialized)
return;
- QTC_ASSERT(m_core, return);
// register QObjects that occur as properties
SharedTools::registerQObject<QMainWindow>(m_engine);
SharedTools::registerQObject<QStatusBar>(m_engine);
@@ -274,7 +271,7 @@ void ScriptManagerPrivate::ensureEngineInitialized()
// SharedTools::registerQObjectInterface<Core::ICore, CorePrototype>(m_engine);
// Make "core" available
- m_engine.globalObject().setProperty(QLatin1String("core"), qScriptValueFromValue(&m_engine, m_core));
+ m_engine.globalObject().setProperty(QLatin1String("core"), qScriptValueFromValue(&m_engine, Core::ICore::instance()));
// CLASSIC: registerInterfaceWithDefaultPrototype<Core::MessageManager, MessageManagerPrototype>(m_engine);
diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h b/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h
index e05778a832..b8acddf90d 100644
--- a/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h
+++ b/src/plugins/coreplugin/scriptmanager/scriptmanager_p.h
@@ -37,13 +37,9 @@
#include <coreplugin/scriptmanager/scriptmanager.h>
#include <QtCore/QObject>
-#include <QtCore/QList>
#include <QtScript/QScriptEngine>
namespace Core {
-
-class ICore;
-
namespace Internal {
class ScriptManagerPrivate : public Core::ScriptManager
@@ -51,12 +47,11 @@ class ScriptManagerPrivate : public Core::ScriptManager
Q_OBJECT
public:
- ScriptManagerPrivate(QObject *parent, ICore *core);
-
- virtual QScriptEngine &scriptEngine();
+ explicit ScriptManagerPrivate(QObject *parent);
- virtual bool runScript(const QString &script, QString *errorMessage, Stack *stack);
- virtual bool runScript(const QString &script, QString *errorMessage);
+ QScriptEngine &scriptEngine();
+ bool runScript(const QString &script, QString *errorMessage, Stack *stack);
+ bool runScript(const QString &script, QString *errorMessage);
static QString engineError(QScriptEngine &scriptEngine);
@@ -64,7 +59,6 @@ private:
void ensureEngineInitialized();
QScriptEngine m_engine;
- ICore *m_core;
bool m_initialized;
};