Commit 5d206e09 authored by hjk's avatar hjk

debugger: set default values for all saved options

parent a6b92801
......@@ -64,7 +64,10 @@ DebuggerSettings::~DebuggerSettings()
void DebuggerSettings::insertItem(int code, SavedAction *item)
{
QTC_ASSERT(!m_items.contains(code), qDebug() << code << item->toString(); return);
QTC_ASSERT(!m_items.contains(code),
qDebug() << code << item->toString(); return);
QTC_ASSERT(item->settingsKey().isEmpty() || item->defaultValue().isValid(),
qDebug() << "NO DEFAULT VALUE FOR " << item->settingsKey());
m_items[code] = item;
}
......@@ -90,9 +93,13 @@ QString DebuggerSettings::dump() const
{
QString out;
QTextStream ts(&out);
ts << "Debugger settings: ";
foreach (SavedAction *item, m_items)
ts << '\n' << item->value().toString();
ts << "Debugger settings: ";
foreach (SavedAction *item, m_items) {
QString key = item->settingsKey();
if (!key.isEmpty())
ts << '\n' << key << ": " << item->value().toString()
<< " (default: " << item->defaultValue().toString() << ")";
}
return out;
}
......@@ -171,18 +178,22 @@ DebuggerSettings *DebuggerSettings::instance()
instance->insertItem(UseDebuggingHelpers, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("CustomDebuggingHelperLocation"));
instance->insertItem(UseCustomDebuggingHelperLocation, item);
item->setSettingsKey(debugModeGroup, QLatin1String("UseCustomDebuggingHelperLocation"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(UseCustomDebuggingHelperLocation, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("CustomDebuggingHelperLocation"));
item->setCheckable(true);
item->setDefaultValue(QString());
instance->insertItem(CustomDebuggingHelperLocation, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("DebugDebuggingHelpers"));
item->setText(tr("Debug debugging helper"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(DebugDebuggingHelpers, item);
......@@ -210,6 +221,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setCheckable(true);
item->setSettingsKey(debugModeGroup, QLatin1String("FormatHexadecimal"));
item->setChecked(true);
item->setDefaultValue(false);
item->setData(FormatHexadecimal);
instance->insertItem(FormatHexadecimal, item);
instance->m_registerFormatGroup->addAction(item);
......@@ -218,6 +230,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Decimal"));
item->setCheckable(true);
item->setSettingsKey(debugModeGroup, QLatin1String("FormatDecimal"));
item->setDefaultValue(false);
item->setData(FormatDecimal);
instance->insertItem(FormatDecimal, item);
instance->m_registerFormatGroup->addAction(item);
......@@ -226,6 +239,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Octal"));
item->setCheckable(true);
item->setSettingsKey(debugModeGroup, QLatin1String("FormatOctal"));
item->setDefaultValue(false);
item->setData(FormatOctal);
instance->insertItem(FormatOctal, item);
instance->m_registerFormatGroup->addAction(item);
......@@ -234,6 +248,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Binary"));
item->setCheckable(true);
item->setSettingsKey(debugModeGroup, QLatin1String("FormatBinary"));
item->setDefaultValue(false);
item->setData(FormatBinary);
instance->insertItem(FormatBinary, item);
instance->m_registerFormatGroup->addAction(item);
......@@ -242,6 +257,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Raw"));
item->setCheckable(true);
item->setSettingsKey(debugModeGroup, QLatin1String("FormatRaw"));
item->setDefaultValue(false);
item->setData(FormatRaw);
instance->insertItem(FormatRaw, item);
instance->m_registerFormatGroup->addAction(item);
......@@ -250,6 +266,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Natural"));
item->setCheckable(true);
item->setSettingsKey(debugModeGroup, QLatin1String("FormatNatural"));
item->setDefaultValue(true);
item->setData(FormatNatural);
instance->insertItem(FormatNatural, item);
instance->m_registerFormatGroup->addAction(item);
......@@ -264,40 +281,47 @@ DebuggerSettings *DebuggerSettings::instance()
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("Environment"));
item->setDefaultValue(QString());
instance->insertItem(GdbEnvironment, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("ScriptFile"));
item->setDefaultValue(QString());
instance->insertItem(GdbScriptFile, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("AutoQuit"));
item->setText(tr("Automatically quit debugger"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(AutoQuit, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("UseToolTips"));
item->setText(tr("Use tooltips when debugging"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(UseToolTips, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("ListSourceFiles"));
item->setText(tr("List source files"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(ListSourceFiles, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("SkipKnownFrames"));
item->setText(tr("Skip known frames"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(SkipKnownFrames, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("EnableReverseDebugging"));
item->setText(tr("Enable reverse debugging"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(EnableReverseDebugging, item);
item = new SavedAction(instance);
......@@ -307,14 +331,17 @@ DebuggerSettings *DebuggerSettings::instance()
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("SelectedPluginBreakpoints"));
item->setDefaultValue(false);
instance->insertItem(SelectedPluginBreakpoints, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("NoPluginBreakpoints"));
item->setDefaultValue(false);
instance->insertItem(NoPluginBreakpoints, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("SelectedPluginBreakpointsPattern"));
item->setDefaultValue(QString(".*"));
instance->insertItem(SelectedPluginBreakpointsPattern, item);
item = new SavedAction(instance);
......
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