Commit 3006a136 authored by hjk's avatar hjk
Browse files

debugger: disentangle settings read and write code

parent 047847bd
...@@ -100,9 +100,6 @@ public: ...@@ -100,9 +100,6 @@ public:
virtual void resetLocation() = 0; virtual void resetLocation() = 0;
virtual void removeLocationMark() = 0; virtual void removeLocationMark() = 0;
virtual void readSettings() = 0;
virtual void writeSettings() const = 0;
virtual bool isReverseDebugging() const = 0; virtual bool isReverseDebugging() const = 0;
virtual void runControlStarted(DebuggerRunControl *runControl) = 0; virtual void runControlStarted(DebuggerRunControl *runControl) = 0;
virtual void runControlFinished(DebuggerRunControl *runControl) = 0; virtual void runControlFinished(DebuggerRunControl *runControl) = 0;
......
...@@ -902,6 +902,9 @@ public: ...@@ -902,6 +902,9 @@ public:
~DebuggerPluginPrivate(); ~DebuggerPluginPrivate();
bool initialize(const QStringList &arguments, QString *errorMessage); bool initialize(const QStringList &arguments, QString *errorMessage);
void extensionsInitialized();
void aboutToShutdown();
void connectEngine(DebuggerEngine *engine); void connectEngine(DebuggerEngine *engine);
void disconnectEngine() { connectEngine(0); } void disconnectEngine() { connectEngine(0); }
DebuggerEngine *currentEngine() const { return m_currentEngine; } DebuggerEngine *currentEngine() const { return m_currentEngine; }
...@@ -1025,9 +1028,6 @@ public slots: ...@@ -1025,9 +1028,6 @@ public slots:
void showStatusMessage(const QString &msg, int timeout = -1); void showStatusMessage(const QString &msg, int timeout = -1);
void openMemoryEditor(); void openMemoryEditor();
void readSettings();
void writeSettings() const;
const CPlusPlus::Snapshot &cppCodeModelSnapshot() const; const CPlusPlus::Snapshot &cppCodeModelSnapshot() const;
void showQtDumperLibraryWarning(const QString &details); void showQtDumperLibraryWarning(const QString &details);
...@@ -1045,7 +1045,6 @@ public slots: ...@@ -1045,7 +1045,6 @@ public slots:
void remoteCommand(const QStringList &options, const QStringList &); void remoteCommand(const QStringList &options, const QStringList &);
bool isReverseDebugging() const; bool isReverseDebugging() const;
void extensionsInitialized();
BreakHandler *breakHandler() const { return m_breakHandler; } BreakHandler *breakHandler() const { return m_breakHandler; }
SnapshotHandler *snapshotHandler() const { return m_snapshotHandler; } SnapshotHandler *snapshotHandler() const { return m_snapshotHandler; }
...@@ -2439,22 +2438,6 @@ void DebuggerPluginPrivate::coreShutdown() ...@@ -2439,22 +2438,6 @@ void DebuggerPluginPrivate::coreShutdown()
m_shuttingDown = true; m_shuttingDown = true;
} }
void DebuggerPluginPrivate::writeSettings() const
{
m_debuggerSettings->writeSettings();
m_mainWindow->writeSettings();
if (GdbOptionsPage::gdbBinariesChanged)
GdbOptionsPage::writeGdbBinarySettings();
}
void DebuggerPluginPrivate::readSettings()
{
//qDebug() << "PLUGIN READ SETTINGS";
m_debuggerSettings->readSettings();
m_mainWindow->readSettings();
GdbOptionsPage::readGdbBinarySettings();
}
const CPlusPlus::Snapshot &DebuggerPluginPrivate::cppCodeModelSnapshot() const const CPlusPlus::Snapshot &DebuggerPluginPrivate::cppCodeModelSnapshot() const
{ {
using namespace CppTools; using namespace CppTools;
...@@ -2868,7 +2851,9 @@ void DebuggerPluginPrivate::extensionsInitialized() ...@@ -2868,7 +2851,9 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_mainWindow->createDockWidget(CppLanguage, localsAndWatchers); m_mainWindow->createDockWidget(CppLanguage, localsAndWatchers);
m_mainWindow->createDockWidget(QmlLanguage, m_scriptConsoleWindow); m_mainWindow->createDockWidget(QmlLanguage, m_scriptConsoleWindow);
readSettings(); m_debuggerSettings->readSettings();
m_mainWindow->readSettings();
GdbOptionsPage::readGdbBinarySettings();
// Register factory of DebuggerRunControl. // Register factory of DebuggerRunControl.
m_debuggerRunControlFactory = new DebuggerRunControlFactory m_debuggerRunControlFactory = new DebuggerRunControlFactory
...@@ -3274,6 +3259,17 @@ void DebuggerPluginPrivate::showModuleSymbols(const QString &moduleName, ...@@ -3274,6 +3259,17 @@ void DebuggerPluginPrivate::showModuleSymbols(const QString &moduleName,
createNewDock(w); createNewDock(w);
} }
void DebuggerPluginPrivate::aboutToShutdown()
{
disconnect(sessionManager(),
SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
this, 0);
m_debuggerSettings->writeSettings();
m_mainWindow->writeSettings();
if (GdbOptionsPage::gdbBinariesChanged)
GdbOptionsPage::writeGdbBinarySettings();
}
} // namespace Internal } // namespace Internal
...@@ -3301,22 +3297,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess ...@@ -3301,22 +3297,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
return theDebuggerCore->initialize(arguments, errorMessage); return theDebuggerCore->initialize(arguments, errorMessage);
} }
void DebuggerPlugin::readSettings()
{
theDebuggerCore->readSettings();
}
void DebuggerPlugin::writeSettings() const
{
theDebuggerCore->writeSettings();
}
ExtensionSystem::IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown() ExtensionSystem::IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown()
{ {
disconnect(sessionManager(), theDebuggerCore->aboutToShutdown();
SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
theDebuggerCore, 0);
writeSettings();
return SynchronousShutdown; return SynchronousShutdown;
} }
......
...@@ -73,8 +73,7 @@ private: ...@@ -73,8 +73,7 @@ private:
void remoteCommand(const QStringList &options, const QStringList &arguments); void remoteCommand(const QStringList &options, const QStringList &arguments);
ShutdownFlag aboutToShutdown(); ShutdownFlag aboutToShutdown();
void extensionsInitialized(); void extensionsInitialized();
void readSettings();
void writeSettings() const;
void runControlStarted(DebuggerRunControl *runControl); void runControlStarted(DebuggerRunControl *runControl);
void runControlFinished(DebuggerRunControl *runControl); void runControlFinished(DebuggerRunControl *runControl);
}; };
......
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