Skip to content

Commit

Permalink
Merge pull request #14049 from a1rwulf/fix-settings-regression
Browse files Browse the repository at this point in the history
Revert "utils/IXmlDeserializable: drop useless interface"
  • Loading branch information
ksooo committed Jun 15, 2018
2 parents c51ed07 + 9321025 commit c14e34d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion xbmc/settings/lib/SettingConditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CSettingConditionItem : public CBooleanLogicValue, public ISettingConditio
{ }
~CSettingConditionItem() override = default;

bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;
const char* GetTag() const override { return SETTING_XML_ELM_CONDITION; }
bool Check() const override;

Expand Down
6 changes: 3 additions & 3 deletions xbmc/settings/lib/SettingDependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CSettingDependencyCondition : public CSettingConditionItem
CSettingsManager *settingsManager = nullptr);
~CSettingDependencyCondition() override = default;

bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;
bool Check() const override;

const std::string& GetName() const { return m_name; }
Expand Down Expand Up @@ -94,7 +94,7 @@ class CSettingDependencyConditionCombination : public CSettingConditionCombinati
}
~CSettingDependencyConditionCombination() override = default;

bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;

const std::set<std::string>& GetSettings() const { return m_settings; }

Expand All @@ -115,7 +115,7 @@ class CSettingDependency : public CSettingCondition
CSettingDependency(SettingDependencyType type, CSettingsManager *settingsManager = nullptr);
~CSettingDependency() override = default;

bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;

SettingDependencyType GetType() const { return m_type; }
std::set<std::string> GetSettings() const;
Expand Down
14 changes: 7 additions & 7 deletions xbmc/utils/BooleanLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@

#include <memory>

class TiXmlNode;
#include "utils/IXmlDeserializable.h"

typedef enum {
BooleanLogicOperationOr = 0,
BooleanLogicOperationAnd
} BooleanLogicOperation;

class CBooleanLogicValue
class CBooleanLogicValue : public IXmlDeserializable
{
public:
CBooleanLogicValue(const std::string &value = "", bool negated = false)
: m_value(value), m_negated(negated)
{ }
virtual ~CBooleanLogicValue() = default;

bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;

virtual const std::string& GetValue() const { return m_value; }
virtual bool IsNegated() const { return m_negated; }
Expand All @@ -61,15 +61,15 @@ class CBooleanLogicOperation;
typedef std::shared_ptr<CBooleanLogicOperation> CBooleanLogicOperationPtr;
typedef std::vector<CBooleanLogicOperationPtr> CBooleanLogicOperations;

class CBooleanLogicOperation
class CBooleanLogicOperation : public IXmlDeserializable
{
public:
explicit CBooleanLogicOperation(BooleanLogicOperation op = BooleanLogicOperationAnd)
: m_operation(op)
{ }
virtual ~CBooleanLogicOperation() = default;

bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;

virtual BooleanLogicOperation GetOperation() const { return m_operation; }
virtual const CBooleanLogicOperations& GetOperations() const { return m_operations; }
Expand All @@ -86,14 +86,14 @@ class CBooleanLogicOperation
CBooleanLogicValues m_values;
};

class CBooleanLogic
class CBooleanLogic : public IXmlDeserializable
{
protected:
/* make sure nobody deletes a pointer to this class */
~CBooleanLogic() = default;

public:
bool Deserialize(const TiXmlNode *node);
bool Deserialize(const TiXmlNode *node) override;

const CBooleanLogicOperationPtr& Get() const { return m_operation; }
CBooleanLogicOperationPtr Get() { return m_operation; }
Expand Down
1 change: 1 addition & 0 deletions xbmc/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ set(HEADERS ActorProtocol.h
IRssObserver.h
ISerializable.h
ISortable.h
IXmlDeserializable.h
Job.h
JobManager.h
JSONVariantParser.h
Expand Down
31 changes: 31 additions & 0 deletions xbmc/utils/IXmlDeserializable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2012-2013 Team XBMC
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/

#pragma once

class TiXmlNode;

class IXmlDeserializable
{
public:
virtual ~IXmlDeserializable() = default;

virtual bool Deserialize(const TiXmlNode *node) = 0;
};

0 comments on commit c14e34d

Please sign in to comment.