Don't show warning when only removing an empty DKDM folder (#2541).
[dcpomatic.git] / src / lib / dkdm_wrapper.h
index 0c2992bc41f6f1d413b8eefce6a90b3a1a3a80f6..7182e5e85794d7c401c851b58e8fd36103d48430 100644 (file)
@@ -38,6 +38,8 @@ public:
        virtual ~DKDMBase () {}
        virtual std::string name () const = 0;
        virtual void as_xml (xmlpp::Element *) const = 0;
+       /** @return true if this thing is, or contains, any actual DKDM */
+       virtual bool contains_dkdm() const = 0;
 
        static std::shared_ptr<DKDMBase> read (cxml::ConstNodePtr node);
 
@@ -61,8 +63,11 @@ public:
                : _dkdm (k)
        {}
 
-       std::string name () const;
-       void as_xml (xmlpp::Element *) const;
+       std::string name () const override;
+       void as_xml (xmlpp::Element *) const override;
+       bool contains_dkdm() const override {
+               return true;
+       }
 
        dcp::EncryptedKDM dkdm () const {
                return _dkdm;
@@ -80,11 +85,13 @@ public:
                : _name (name)
        {}
 
-       std::string name () const {
+       std::string name () const override {
                return _name;
        }
 
-       void as_xml (xmlpp::Element *) const;
+       void as_xml (xmlpp::Element *) const override;
+
+       bool contains_dkdm() const override;
 
        std::list<std::shared_ptr<DKDMBase>> children () const {
                return _children;
@@ -93,6 +100,8 @@ public:
        void add (std::shared_ptr<DKDMBase> child, std::shared_ptr<DKDM> previous = std::shared_ptr<DKDM>());
         void remove (std::shared_ptr<DKDMBase> child);
 
+       bool contains(std::string dkdm_id) const;
+
 private:
        std::string _name;
        std::list<std::shared_ptr<DKDMBase>> _children;