Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1025


Ignore:
Timestamp:
Apr 10, 2008, 5:53:20 PM (17 years ago)
Author:
landauf
Message:

fixed another bug.
always remember: no matter how cool your feature is, it won't work as long as you execute it after a 'return' statement…

Location:
code/branches/core2/src/orxonox/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/ConfigFileManager.cc

    r1023 r1025  
    104104    {
    105105        if (this->additionalComment_ == "" || this->additionalComment_.size() == 0)
    106             return (this->name_);
     106            return ("[" + this->name_ + "]");
    107107        else
    108             return (this->name_ + " " + this->additionalComment_);
     108            return ("[" + this->name_ + "] " + this->additionalComment_);
    109109    }
    110110
     
    183183                    std::string comment = temp.substr(pos2 + 1);
    184184                    if (isComment(comment))
    185                         newsection = new ConfigFileSection(line.substr(pos1, pos2 - pos1 + 1), comment);
     185                        newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
    186186                    else
    187                         newsection = new ConfigFileSection(line.substr(pos1, pos2 - pos1 + 1));
     187                        newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
    188188                    this->sections_.insert(this->sections_.end(), newsection);
    189189                    continue;
  • code/branches/core2/src/orxonox/core/ConfigFileManager.h

    r1023 r1025  
    211211                { this->getSection(section)->setValue(name, value); this->save(); }
    212212            inline const std::string& getValue(const std::string& section, const std::string& name, const std::string& fallback)
    213                 { return this->getSection(section)->getValue(name, fallback); this->saveIfUpdated(); }
     213                { const std::string& output = this->getSection(section)->getValue(name, fallback); this->saveIfUpdated(); return output; }
    214214
    215215            inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value)
    216216                { this->getSection(section)->setValue(name, index, value); this->save(); }
    217217            inline const std::string& getValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback)
    218                 { return this->getSection(section)->getValue(name, index, fallback); this->saveIfUpdated(); }
     218                { const std::string& output = this->getSection(section)->getValue(name, index, fallback); this->saveIfUpdated(); return output; }
    219219
    220220        private:
Note: See TracChangeset for help on using the changeset viewer.