Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 30, 2007, 6:56:58 PM (17 years ago)
Author:
nicolasc
Message:
  • various cleanup
  • improved readability in PI
  • fixed iterator in language
Location:
code/branches/FICN/src/orxonox/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/CorePrereqs.h

    r708 r728  
    2727
    2828/**
    29  @file  OrxonoxPrereq.cc
     29 @file  OrxonoxPrereq.h
    3030 @brief Contains all the necessary forward declarations for all classes, structs and enums.
    3131 */
  • code/branches/FICN/src/orxonox/core/Language.cc

    r725 r728  
    142142
    143143        // Make sure we don't create a duplicate entry
    144         if (!it->second)
     144        if (it == this->languageEntries_.end())
    145145        {
    146146            LanguageEntry* newEntry = new LanguageEntry(entry);
     
    161161    void Language::addEntry(const LanguageEntryName& name, const std::string& entry)
    162162    {
     163        COUT(5) << "Called addEntry with\n  name: " << name << "\n  entry: " <<  entry << std::endl;
    163164        std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name);
    164         if (!it->second)
     165        if (it == this->languageEntries_.end())
    165166        {
    166167            // The entry isn't available yet, meaning it's new, so create it
     
    180181        // Write the default language file because either a new entry was created or an existing entry has changed
    181182        this->writeDefaultLanguageFile();
     183
    182184    }
    183185
     
    190192    {
    191193        std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name);
    192         if (it->second)
     194        if (it != this->languageEntries_.end())
    193195            return it->second->getTranslation();
    194196        else
     
    294296
    295297                    // Check if the entry exists
    296                     if (it->second)
     298                    if (it != this->languageEntries_.end())
    297299                        it->second->setTranslation(lineString.substr(pos + 1));
    298300                    else
  • code/branches/FICN/src/orxonox/core/Language.h

    r725 r728  
    6363            void setDefault(const std::string& fallbackEntry);
    6464
    65             /** @brief Returns the translated entry in the configured language. @return The translated entry */
     65            /**
     66              @brief Returns the translated entry in the configured language.
     67              @return The translated entry
     68            */
    6669            inline const std::string& getTranslation()
    6770                { return this->translatedEntry_; }
    6871
    69             /** @brief Returns the default entry. @return The default entry */
     72            /**
     73              @brief Returns the default entry.
     74              @return The default entry
     75            */
    7076            inline const std::string& getDefault()
    7177                { return this->fallbackEntry_; }
Note: See TracChangeset for help on using the changeset viewer.