mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-21 03:55:41 -04:00
SettingsInterface: Add Error to Save()
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#include "layered_settings_interface.h"
|
||||
@ -9,7 +9,7 @@ LayeredSettingsInterface::LayeredSettingsInterface() = default;
|
||||
|
||||
LayeredSettingsInterface::~LayeredSettingsInterface() = default;
|
||||
|
||||
bool LayeredSettingsInterface::Save()
|
||||
bool LayeredSettingsInterface::Save(Error* error /* = nullptr */)
|
||||
{
|
||||
Panic("Attempting to save layered settings interface");
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#pragma once
|
||||
@ -23,7 +23,7 @@ public:
|
||||
SettingsInterface* GetLayer(Layer layer) const { return m_layers[layer]; }
|
||||
void SetLayer(Layer layer, SettingsInterface* sif) { m_layers[layer] = sif; }
|
||||
|
||||
bool Save() override;
|
||||
bool Save(Error* error = nullptr) override;
|
||||
|
||||
void Clear() override;
|
||||
|
||||
|
@ -1,16 +1,19 @@
|
||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#include "memory_settings_interface.h"
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/error.h"
|
||||
#include "common/string_util.h"
|
||||
|
||||
MemorySettingsInterface::MemorySettingsInterface() = default;
|
||||
|
||||
MemorySettingsInterface::~MemorySettingsInterface() = default;
|
||||
|
||||
bool MemorySettingsInterface::Save()
|
||||
bool MemorySettingsInterface::Save(Error* error /* = nullptr */)
|
||||
{
|
||||
Error::SetStringView(error, "Memory settings cannot be saved.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#pragma once
|
||||
@ -12,7 +12,7 @@ public:
|
||||
MemorySettingsInterface();
|
||||
~MemorySettingsInterface();
|
||||
|
||||
bool Save() override;
|
||||
bool Save(Error* error = nullptr) override;
|
||||
|
||||
void Clear() override;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#pragma once
|
||||
@ -8,12 +8,14 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Error;
|
||||
|
||||
class SettingsInterface
|
||||
{
|
||||
public:
|
||||
virtual ~SettingsInterface() = default;
|
||||
|
||||
virtual bool Save() = 0;
|
||||
virtual bool Save(Error* error = nullptr) = 0;
|
||||
virtual void Clear() = 0;
|
||||
|
||||
virtual bool GetIntValue(const char* section, const char* key, s32* value) const = 0;
|
||||
|
Reference in New Issue
Block a user