From e8c7df1d674dcb19f61487d9b6659dcff5d5c0e5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 10 Dec 2016 13:24:43 +0100 Subject: [PATCH] minor improvements --- src/App/Extension.cpp | 2 +- src/App/Extension.h | 4 ++-- src/App/ExtensionContainer.cpp | 4 ++-- src/App/ExtensionContainer.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App/Extension.cpp b/src/App/Extension.cpp index 4a348b53c3..35637df6d3 100644 --- a/src/App/Extension.cpp +++ b/src/App/Extension.cpp @@ -113,7 +113,7 @@ std::string Extension::name() const { std::string temp(m_extensionType.getName()); std::string::size_type pos = temp.find_last_of(":"); - if(pos != std::string::npos) + if(pos != std::string::npos) return temp.substr(pos+1); else return std::string(); diff --git a/src/App/Extension.h b/src/App/Extension.h index fe68c58628..1dfc8dab80 100644 --- a/src/App/Extension.h +++ b/src/App/Extension.h @@ -255,8 +255,8 @@ public: /** @name Persistance */ //@{ - virtual void extensionSave(Base::Writer&) const {}; - virtual void extensionRestore(Base::XMLReader&) {}; + virtual void extensionSave(Base::Writer&) const {} + virtual void extensionRestore(Base::XMLReader&) {} //@} /** @name TypeHandling */ diff --git a/src/App/ExtensionContainer.cpp b/src/App/ExtensionContainer.cpp index 47f100555a..1b5ef4f49d 100644 --- a/src/App/ExtensionContainer.cpp +++ b/src/App/ExtensionContainer.cpp @@ -83,7 +83,7 @@ bool ExtensionContainer::hasExtension(Base::Type t) const { return true; } -bool ExtensionContainer::hasExtension(std::string name) const { +bool ExtensionContainer::hasExtension(const std::string& name) const { //and for types derived from it, as they can be cast to the extension for(auto entry : _extensions) { @@ -115,7 +115,7 @@ bool ExtensionContainer::hasExtensions() const { return !_extensions.empty(); } -Extension* ExtensionContainer::getExtension(std::string name) { +Extension* ExtensionContainer::getExtension(const std::string& name) { //and for types derived from it, as they can be cast to the extension for(auto entry : _extensions) { diff --git a/src/App/ExtensionContainer.h b/src/App/ExtensionContainer.h index 303f0e27c6..2c81784ae9 100644 --- a/src/App/ExtensionContainer.h +++ b/src/App/ExtensionContainer.h @@ -125,10 +125,10 @@ public: void registerExtension(Base::Type extension, App::Extension* ext); bool hasExtension(Base::Type) const; //returns first of type (or derived from) and throws otherwise - bool hasExtension(std::string name) const; //this version does not check derived classes + bool hasExtension(const std::string& name) const; //this version does not check derived classes bool hasExtensions() const; App::Extension* getExtension(Base::Type); //returns first of type (or derived from) and throws otherwise - App::Extension* getExtension(std::string name); //this version does not check derived classes + App::Extension* getExtension(const std::string& name); //this version does not check derived classes //returns first of type (or derived from) and throws otherwise template