Debugger: Paddle back on multiple inheritance for settings

This is fairly close to the new "standard" pattern for an
individual page but still allows flat access using the same
'settings().' stanza.

Change-Id: I1edbbd64a857a3d3936fb2c21fdc7e3c8ae7a44c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-07-17 17:20:59 +02:00
parent 2a31f17354
commit e157ac82a1
6 changed files with 77 additions and 14 deletions

View File

@@ -3,6 +3,8 @@
#include "gdbsettings.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <debugger/commonoptionspage.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggerconstants.h>
@@ -18,11 +20,15 @@ using namespace Utils;
namespace Debugger::Internal {
GdbSettings &gdbSettings()
{
static GdbSettings settings;
return settings;
}
GdbSettings::GdbSettings()
{
setId("M.Gdb");
setDisplayName(Tr::tr("GDB"));
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
setAutoApply(false);
setSettingsGroup("DebugMode");
useMessageBoxForSignals.setSettingsKey("UseMessageBoxForSignals");
@@ -250,4 +256,20 @@ GdbSettings::GdbSettings()
readSettings();
}
// GdbSettingsPage
class GdbSettingsPage final : public Core::IOptionsPage
{
public:
GdbSettingsPage()
{
setId("M.Gdb");
setDisplayName(Tr::tr("GDB"));
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
setSettingsProvider([] { return &gdbSettings(); });
}
};
const GdbSettingsPage settingsPage;
} // Debugger::Internal