Commit 00de9f13 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

pass strings by reference

parent 84375ebb
......@@ -21,7 +21,7 @@ public:
~PIMPL(void) {};
struct codechandle {
codechandle(gem::plugins::record*h, const std::string c):handle(h), codec(c) {}
codechandle(gem::plugins::record*h, const std::string&c):handle(h), codec(c) {}
gem::plugins::record*handle;
std::string codec;
......@@ -29,7 +29,7 @@ public:
std::map<std::string, std::vector<codechandle> >m_codechandle;
std::vector<std::string>m_codecs;
void addCodecHandle(gem::plugins::record*handle, const std::string codec) {
void addCodecHandle(gem::plugins::record*handle, const std::string&codec) {
#ifdef __GNUC__
# warning better handling of duplicate codecs
#endif
......
......@@ -31,7 +31,7 @@ gem::BasePluginFactory::~BasePluginFactory(void) {
delete m_pimpl; m_pimpl=NULL;
}
int gem::BasePluginFactory::doLoadPlugins(std::string basename, std::string path) {
int gem::BasePluginFactory::doLoadPlugins(const std::string&basename, const std::string&path_) {
int already=m_pimpl->p_loaded.size();
if(already>0) {
int once=1;
......@@ -46,6 +46,7 @@ int gem::BasePluginFactory::doLoadPlugins(std::string basename, std::string path
return 0;
}
}
std::string path = path_;
if(path.empty()){
gem::Settings::get("gem.path", path);
}
......
......@@ -15,7 +15,7 @@ namespace gem {
class GEM_EXTERN BasePluginFactory {
protected:
int doLoadPlugins(std::string basename, std::string path);
int doLoadPlugins(const std::string&basename, const std::string&path);
BasePluginFactory(void);
virtual ~BasePluginFactory(void);
......
......@@ -144,7 +144,7 @@ namespace gem { namespace plugins {
//e2m["xwd"]="image/x-xwindowdump";
}
static const std::string imgName2Mime(const std::string filename) {
static const std::string imgName2Mime(const std::string&filename) {
std::string empty;
if(NULL==s_extension2mime) {
build_extension2mime();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment