From kde-commits Wed Aug 12 11:26:27 2015 From: Valentin Rusu Date: Wed, 12 Aug 2015 11:26:27 +0000 To: kde-commits Subject: [ksecrets] src/runtime/ksecrets_store: Replace all string params with const char* Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=143937880230998 Git commit e4475540c1772e562cd6eb88ae01b4f184759b41 by Valentin Rusu. Committed on 11/08/2015 at 20:59. Pushed by vrusu into branch 'master'. Replace all string params with const char* reviewed-by: dvratil This will prevent problems when going from QString M +19 -26 src/runtime/ksecrets_store/ksecrets_store.h http://commits.kde.org/ksecrets/e4475540c1772e562cd6eb88ae01b4f184759b41 diff --git a/src/runtime/ksecrets_store/ksecrets_store.h b/src/runtime/ksec= rets_store/ksecrets_store.h index db6d65a..b7d0440 100644 --- a/src/runtime/ksecrets_store/ksecrets_store.h +++ b/src/runtime/ksecrets_store/ksecrets_store.h @@ -94,7 +94,7 @@ public: Item& operator=3D(const Item&) =3D default; = std::string label() const noexcept; - bool setLabel(std::string&&) noexcept; + bool setLabel(const char*) noexcept; = AttributesMap attributes() const; void setAttributes(AttributesMap&&) noexcept; @@ -116,55 +116,48 @@ public: /** * Each application organizes it's secrets in collections. * - * Typical applications will only use one collection. A collection can - *store - * an arbitrary amount of Items. Each Item has a label, custom attribu= tes - *and + * Typical applications will only use one collection. A collection can= store + * an arbitrary amount of Items. Each Item has a label, custom attribu= tes and * a secret value. * - * The custom attributes are application-defined. This API would store - *these + * The custom attributes are application-defined. This API would store= these * attributes as they are provided. * - * Search methods are provided to let application locate items by - *specifying - * only a subset of these custom attributes. When searching, partial - *matching is - * used, so you could only provide part of the value of an attribute a= nd - *get all - * the items having attribute value containing that partially specified - *value. + * Search methods are provided to let application locate items by spec= ifying + * only a subset of these custom attributes. When searching, partial m= atching is + * used, so you could only provide part of the value of an attribute a= nd get all + * the items having attribute value containing that partially specifie= d value. */ class Collection { Collection(const Collection&) =3D default; Collection& operator=3D(const Collection&) =3D default; = std::string label() const noexcept; - bool setLabel(std::string&&) noexcept; + bool setLabel(const char*) 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; - ItemList searchItems(std::string&&, AttributesMap&&) noexcept; + ItemList searchItems(const char*) noexcept; + ItemList searchItems(const char*, AttributesMap&&) noexcept; = /** * @return ItemPtr which can be empty if creating the item was not - * possible. So please check if via it's operator bool() before us= ing + * possible. So please check it via it's operator bool() before us= ing * it. */ - ItemPtr createItem(std::string&& label, AttributesMap&&, ItemValue= &&) noexcept; + ItemPtr createItem(const char*, AttributesMap&&, ItemValue&&) noex= cept; /* * Convenience method for creating items without supplemental * attributes. * * @return ItemPtr which can be empty if creating the item was not - * possible. So please check if via it's operator bool() before us= ing + * possible. So please check it via it's operator bool() before us= ing * it. */ - ItemPtr createItem(std::string&& label, ItemValue&&) noexcept; + ItemPtr createItem(const char *label, ItemValue&&) noexcept; = protected: Collection(); @@ -209,7 +202,7 @@ public: * @parameter readOnly set it to true if you only intend reading to sp= eed * things-up */ - std::future open(std::string&& path, bool readOnly =3D tru= e) noexcept; + std::future open(const char* path, bool readOnly =3D true)= noexcept; = constexpr static auto SALT_SIZE =3D 56; /** @@ -225,16 +218,16 @@ public: * If it fails, have you already called open()? * */ - CollectionPtr createCollection(std::string&&) noexcept; + CollectionPtr createCollection(const char*) noexcept; /* * @return CollectionPtr which can empty if the call did not succeed, = e.g. * the collection was not found. * Please check that with operator bool() */ - CollectionPtr readCollection(std::string&&) const noexcept; + CollectionPtr readCollection(const char*) const noexcept; = bool deleteCollection(CollectionPtr) noexcept; - bool deleteCollection(std::string&&) noexcept; + bool deleteCollection(const char*) noexcept; = private: std::unique_ptr d;