From c6f377413d77920eec7222df770e8d4b77bf95ef Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 20 May 2008 01:24:15 +0000 Subject: [PATCH] Changed some const char* to const std::string& . git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1951 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/gui/char_sel.cpp | 2 +- src/kart_properties.hpp | 6 +++--- src/main.cpp | 2 +- src/widget.cpp | 2 +- src/widget.hpp | 2 +- src/widget_manager.cpp | 4 ++-- src/widget_manager.hpp | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/char_sel.cpp b/src/gui/char_sel.cpp index 1c63bc8ef..b0835e635 100644 --- a/src/gui/char_sel.cpp +++ b/src/gui/char_sel.cpp @@ -82,7 +82,7 @@ CharSel::CharSel(int whichPlayer) if(unlock_manager->isLocked(kp->getIdent())) continue; widget_manager->addImgButtonWgt( WTOK_RACER0 + i, 8, 11, - kp->getIconFile() ); + kp->getIconFile() ); } } diff --git a/src/kart_properties.hpp b/src/kart_properties.hpp index 45360c26d..23e735573 100644 --- a/src/kart_properties.hpp +++ b/src/kart_properties.hpp @@ -118,9 +118,9 @@ public: Material* getIconMaterial () const {return m_icon_material; } ssgEntity* getModel () const {return m_model; } const std::string& getName () const {return m_name; } - const char* getIdent () const {return m_ident.c_str(); } - const char* getShadowFile () const {return m_shadow_file.c_str(); } - const char* getIconFile () const {return m_icon_file.c_str(); } + const std::string& getIdent () const {return m_ident; } + const std::string& getShadowFile () const {return m_shadow_file; } + const std::string& getIconFile () const {return m_icon_file; } const sgVec3* getColor () const {return &m_color; } float getMass () const {return m_mass; } float getKartLength () const {return m_kart_length; } diff --git a/src/main.cpp b/src/main.cpp index 2ef32bd8f..b57286717 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -238,7 +238,7 @@ int handleCmdLine(int argc, char **argv) for (unsigned int i = 0; NULL != kart_properties_manager->getKartById(i); i++) { const KartProperties* KP= kart_properties_manager->getKartById(i); - fprintf (stdout, "\t%10s: %s\n", KP->getIdent(), KP->getName().c_str()); + fprintf (stdout, "\t%10s: %s\n", KP->getIdent().c_str(), KP->getName().c_str()); } fprintf ( stdout, "\n" ); diff --git a/src/widget.cpp b/src/widget.cpp index 8db5bc0f7..f6e10318f 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -250,7 +250,7 @@ void Widget::setFont( const WidgetFont FONT ) } //----------------------------------------------------------------------------- -void Widget::setTexture( const char* FILENAME, bool is_full_path ) +void Widget::setTexture( const std::string& FILENAME, bool is_full_path ) { Material *m = material_manager->getMaterial( FILENAME, is_full_path ); m_texture = m->getState()->getTextureHandle(); diff --git a/src/widget.hpp b/src/widget.hpp index 8a6b8f09c..c30c62b8f 100644 --- a/src/widget.hpp +++ b/src/widget.hpp @@ -205,7 +205,7 @@ class Widget void darkenColor(); void setFont( const WidgetFont FONT ); - void setTexture( const char* FILENAME, const bool is_full_path=true ); + void setTexture( const std::string& FILENAME, const bool is_full_path=true ); /* Functions created simply to organize the code */ bool createRect(); diff --git a/src/widget_manager.cpp b/src/widget_manager.cpp index e04c81a47..b37a61d2a 100644 --- a/src/widget_manager.cpp +++ b/src/widget_manager.cpp @@ -1047,7 +1047,7 @@ bool WidgetManager::addImgButtonWgt const int TOKEN, const int MIN_WIDTH, const int MIN_HEIGHT, - const char* FILENAME + const std::string& FILENAME ) { if( !( addWgt( TOKEN, MIN_WIDTH, MIN_HEIGHT ))) return false; @@ -1376,7 +1376,7 @@ void WidgetManager::setWgtTexture(const int TOKEN, const int TEXTURE) } //----------------------------------------------------------------------------- -void WidgetManager::setWgtTexture(const int TOKEN, const char* FILENAME, +void WidgetManager::setWgtTexture(const int TOKEN, const std::string& FILENAME, const bool is_full_path) { const int ID = findId(TOKEN); diff --git a/src/widget_manager.hpp b/src/widget_manager.hpp index f3234e86e..c4858ffef 100644 --- a/src/widget_manager.hpp +++ b/src/widget_manager.hpp @@ -271,7 +271,7 @@ public: const int TOKEN, const int MIN_WIDTH, const int MIN_HEIGHT, - const char* FILENAME + const std::string& FILENAME ); /* On/off widget switch features. They are all disabled/hidden initially. */ @@ -349,7 +349,7 @@ public: //TODO: add initial border colors, if I don't erase those functions. void setWgtTexture(const int TOKEN, const int TEXTURE); - void setWgtTexture(const int TOKEN, const char* FILENAME, const bool is_full_path=true); + void setWgtTexture(const int TOKEN, const std::string& FILENAME, const bool is_full_path=true); void showWgtTexture(const int TOKEN); void hideWgtTexture(const int TOKEN);