Git commit 035d5c9731fb77901d1d1c97189ddfb9c0f7998d by Valentin Rusu. Committed on 11/08/2015 at 14:07. Pushed by vrusu into branch 'master'. Do not use a base class for the time stamps reviewed by: dvratil M +7 -32 src/runtime/ksecrets_store/ksecrets_backend.h http://commits.kde.org/ksecrets/035d5c9731fb77901d1d1c97189ddfb9c0f7998d diff --git a/src/runtime/ksecrets_store/ksecrets_backend.h b/src/runtime/ks= ecrets_store/ksecrets_backend.h index 59ee479..c7068e1 100644 --- a/src/runtime/ksecrets_store/ksecrets_backend.h +++ b/src/runtime/ksecrets_store/ksecrets_backend.h @@ -76,36 +76,6 @@ class KSECRETS_BACKEND_EXPORT KSecretsBackend { public: using AttributesMap =3D std::map; = - /** - * This base class is not directly used by client applications. - * - * This class provides basic timestamp operations - */ - class TimeStamped { - std::time_t createTime() const noexcept; - std::time_t modifiedTime() const noexcept; - - protected: - TimeStamped() - : createdTime_(std::time(nullptr)) - , modifiedTime_(std::time(nullptr)) - { - } - virtual ~TimeStamped() =3D default; - TimeStamped(const TimeStamped&) =3D default; - TimeStamped& operator=3D(const TimeStamped&) =3D default; - - template void modify(FUNC func) - { - func(); - modifiedTime =3D std::time(nullptr); - }; - - private: - std::time_t createdTime_; - std::time_t modifiedTime_; - }; - struct ItemValue { std::string contentType; std::vector contents; @@ -119,7 +89,7 @@ public: * * @see Collection */ - class Item : public TimeStamped { + class Item { Item(const Item&) =3D default; Item& operator=3D(const Item&) =3D default; = @@ -132,6 +102,8 @@ public: ItemValue value() const noexcept; bool setValue(ItemValue&&) noexcept; = + std::time_t createdTime() const noexcept; + std::time_t modifiedTime() const noexcept; protected: Item(); friend class KSecretsBackend; @@ -163,13 +135,16 @@ public: * the items having attribute value containing that partially specified *value. */ - class Collection : public TimeStamped { + class Collection { Collection(const Collection&) =3D default; Collection& operator=3D(const Collection&) =3D default; = std::string label() const noexcept; bool setLabel(std::string&&) noexcept; = + std::time_t createdTime() const noexcept; + std::time_t modifiedTime() const noexcept; + using ItemList =3D std::vector; ItemList searchItems(AttributesMap&&) noexcept; ItemList searchItems(std::string&&) noexcept;