Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (15 years ago)
Author:
rgrieder
Message:

std::string tweaks:

  • Declared BLANKSTRING in UtilPrereqs.h as well (removed obsolete StringUtils.h includes to avoid dependencies)
  • Using BLANKSTRING if const std::string& return type is possible
  • Replaced a few (const) std::string arguments with const std::string&
  • if (str == "") —> if (str.empty())
  • std::string msg = name + "adsf"; —> const std::string& msg = name + "asdf";
  • std::string asdf = object→getFooBar(); —> const std::string& asdf = object→getFooBar();
  • std::string asdf = "asdf"; —> std::string asdf("asdf");
  • ostream << "."; and name + "." —> ostream << '.'; and name + '.'
  • str = ""; —> str.clear()
  • std::string asdf = ""; —> std::string asdf;
  • asdf_ = ""; (in c'tor) —> delete line
Location:
code/branches/presentation2/src/orxonox/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/pickup/DroppedItem.cc

    r5929 r6394  
    8383        if (this->item_)
    8484        {
    85             COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'" << std::endl;
     85            COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << '\'' << std::endl;
    8686            this->item_->destroy();
    8787        }
     
    112112        drop->createTimer();
    113113
    114         COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << "," << position.y << "," << position.z << ")." << std::endl;
     114        COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << ',' << position.y << ',' << position.z << ")." << std::endl;
    115115
    116116        return drop;
  • code/branches/presentation2/src/orxonox/pickup/PickupInventory.cc

    r6150 r6394  
    196196            return "";
    197197
    198         std::string name = "pickup_" + item->getGUIImage();
     198        const std::string& name = "pickup_" + item->getGUIImage();
    199199
    200200        if(!CEGUI::ImagesetManager::getSingletonPtr()->isImagesetPresent(name))
     
    203203        }
    204204
    205         return "set:" + name + " image:full_image";
     205        return ("set:" + name + " image:full_image");
    206206    }
    207207
     
    332332        txt->setVisible(true);
    333333        txt->setProperty("Text", item->getGUIText());
    334         txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour + "");
    335 
    336         std::string image = PickupInventory::getImageForItem(item);
     334        txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour);
     335
     336        const std::string& image = PickupInventory::getImageForItem(item);
    337337        btn->setVisible(true);
    338338        btn->setProperty("NormalImage", image);
Note: See TracChangeset for help on using the changeset viewer.