forked from qt-creator/qt-creator
Debugger: DebuggerSettings and QmlJSPropertyInspector
QmlJSPropertyInspector is a part of the debugger view and has dependencies on some of the actions in DebuggerSettings. Add the needed actions to the object pool so that QmlJSPropertyInspector can access them. Change-Id: Iad492f1195721b5e3a9033584b1a3bf64e320b18 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "debuggeractions.h"
|
||||
#include "debuggerconstants.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "registerpostmortemaction.h"
|
||||
#endif
|
||||
@@ -39,6 +41,8 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QVariant>
|
||||
#include <QSettings>
|
||||
@@ -98,9 +102,13 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
|
||||
SavedAction *item = 0;
|
||||
|
||||
//The Actions that are accessed by QML Inspector are added to PluginManager
|
||||
//Needed by QML Inspector
|
||||
item = new SavedAction(this);
|
||||
insertItem(SettingsDialog, item);
|
||||
item->setText(tr("Debugger Properties..."));
|
||||
item->setObjectName(QLatin1String(Constants::SETTINGS_DIALOG));
|
||||
ExtensionSystem::PluginManager::instance()->addObject(item);
|
||||
|
||||
//
|
||||
// View
|
||||
@@ -168,12 +176,15 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
QLatin1String("AlwaysAdjustModulesColumnWidths"));
|
||||
insertItem(AlwaysAdjustModulesColumnWidths, item);
|
||||
|
||||
//Needed by QML Inspector
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Use Alternating Row Colors"));
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("UseAlternatingRowColours"));
|
||||
item->setCheckable(true);
|
||||
item->setDefaultValue(false);
|
||||
insertItem(UseAlternatingRowColors, item);
|
||||
item->setObjectName(QLatin1String(Constants::USE_ALTERNATING_ROW_COLORS));
|
||||
ExtensionSystem::PluginManager::instance()->addObject(item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setText(tr("Debugger Font Size Follows Main Editor"));
|
||||
@@ -246,6 +257,7 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
item->setValue(true);
|
||||
insertItem(ShowQtNamespace, item);
|
||||
|
||||
//Needed by QML Inspector
|
||||
item = new SavedAction(this);
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("SortStructMembers"));
|
||||
item->setText(tr("Sort Members of Classes and Structs Alphabetically"));
|
||||
@@ -253,6 +265,8 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
item->setDefaultValue(true);
|
||||
item->setValue(true);
|
||||
insertItem(SortStructMembers, item);
|
||||
item->setObjectName(QLatin1String(Constants::SORT_STRUCT_MEMBERS));
|
||||
ExtensionSystem::PluginManager::instance()->addObject(item);
|
||||
|
||||
//
|
||||
// DebuggingHelper
|
||||
@@ -539,6 +553,18 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
||||
|
||||
DebuggerSettings::~DebuggerSettings()
|
||||
{
|
||||
ExtensionSystem::PluginManager *pluginManager =
|
||||
ExtensionSystem::PluginManager::instance();
|
||||
QObject *o = pluginManager->getObjectByName(Constants::SETTINGS_DIALOG);
|
||||
if (o)
|
||||
pluginManager->removeObject(o);
|
||||
o = pluginManager->getObjectByName(Constants::USE_ALTERNATING_ROW_COLORS);
|
||||
if (o)
|
||||
pluginManager->removeObject(o);
|
||||
o = pluginManager->getObjectByName(Constants::SORT_STRUCT_MEMBERS);
|
||||
if (o)
|
||||
pluginManager->removeObject(o);
|
||||
|
||||
qDeleteAll(m_items);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user