Revision: 2571
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2571&view=rev
Author:   ulteq
Date:     2012-05-15 17:08:41 +0000 (Tue, 15 May 2012)
Log Message:
-----------
-Codechange: Changed std::string to Ogre::String

Modified Paths:
--------------
    trunk/source/main/gui/LobbyGUI.cpp
    trunk/source/main/gui/LobbyGUI.h
    trunk/source/main/network/IRCWrapper.cpp
    trunk/source/main/network/IRCWrapper.h
    trunk/source/main/network/network.cpp

Modified: trunk/source/main/gui/LobbyGUI.cpp
===================================================================
--- trunk/source/main/gui/LobbyGUI.cpp  2012-05-14 22:47:00 UTC (rev 2570)
+++ trunk/source/main/gui/LobbyGUI.cpp  2012-05-15 17:08:41 UTC (rev 2571)
@@ -23,6 +23,8 @@
 #include "Scripting.h"
 #include "InputEngine.h"
 
+using namespace Ogre;
+
 LobbyGUI::LobbyGUI() : current_tab(0), rotatingWait(0)
 {
        initialiseByAttributes(this);
@@ -54,7 +56,7 @@
        MyGUI::UString message = _sender->getCaption();
        if(!sendMessage(message))
        {
-               std::string fmt = "<" + nick + "> " + message;
+               String fmt = "<" + nick + "> " + message;
                addTextToChatWindow(fmt);
        } else
        {
@@ -64,7 +66,7 @@
 }
 */
 
-void LobbyGUI::addTab(Ogre::String name)
+void LobbyGUI::addTab(String name)
 {
        /*
        <Widget type="TabItem" skin="" position="2 24 304 193">
@@ -80,9 +82,9 @@
        </Widget>
        */
 
-       Ogre::String realName = name;
+       String realName = name;
 
-       name = Ogre::StringUtil::replaceAll(name, "#", "##");
+       name = StringUtil::replaceAll(name, "#", "##");
 
        tabctx_t *t = &tabs[name];
 
@@ -138,68 +140,68 @@
        {
        case MT_Channel:
                {
-                       std::string fmt = "<" + msg.nick + "> " + msg.message;
+                       String fmt = "<" + msg.nick + "> " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_JoinChannelSelf:
                {
-                       std::string fmt = "joined channel " + msg.channel + " 
as " + msg.nick + "";
+                       String fmt = "joined channel " + msg.channel + " as " + 
msg.nick + "";
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_JoinChannelOther:
                {
-                       std::string fmt = "*** " + msg.nick + " has joined " + 
msg.channel;
+                       String fmt = "*** " + msg.nick + " has joined " + 
msg.channel;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_PartChannelOther:
                {
-                       std::string fmt = "*** " + msg.nick + " has left " + 
msg.channel;
+                       String fmt = "*** " + msg.nick + " has left " + 
msg.channel;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_QuitOther:
                {
-                       std::string fmt = "*** " + msg.nick + " has quit (" + 
msg.message + ")";
+                       String fmt = "*** " + msg.nick + " has quit (" + 
msg.message + ")";
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_PartChannelSelf:
                {
-                       std::string fmt = "*** you left the channel " + 
msg.channel;
+                       String fmt = "*** you left the channel " + msg.channel;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_ChangedChannelTopic:
                {
-                       std::string fmt = "*** " + msg.nick + " has changed the 
channel topic of " + msg.channel + " to " + msg.message;
+                       String fmt = "*** " + msg.nick + " has changed the 
channel topic of " + msg.channel + " to " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_WeGotKicked:
                {
-                       std::string fmt = "*** we got kicked from " + 
msg.channel + " with the reason " + msg.message;
+                       String fmt = "*** we got kicked from " + msg.channel + 
" with the reason " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_SomeoneGotKicked:
                {
-                       std::string fmt = "*** " + msg.nick + " got kicked from 
" + msg.channel + " with the reason " + msg.message;
+                       String fmt = "*** " + msg.nick + " got kicked from " + 
msg.channel + " with the reason " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_GotPrivateMessage:
                {
-                       std::string fmt = "(private) <" + msg.nick + "> " + 
msg.message;
+                       String fmt = "(private) <" + msg.nick + "> " + 
msg.message;
                        addTextToChatWindow(fmt, msg.nick);
                }
                break;
        case MT_GotNotice:
        case MT_VerboseMessage:
                {
-                       std::string fmt;
+                       String fmt;
                        if(msg.nick.empty())
                                fmt = "(NOTICE) " + msg.message;
                        else
@@ -209,19 +211,19 @@
                break;
        case MT_GotInvitation:
                {
-                       std::string fmt = "*** " + msg.nick + " invited you to 
channel " + msg.message;
+                       String fmt = "*** " + msg.nick + " invited you to 
channel " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_TopicInfo:
                {
-                       std::string fmt = "*** Topic is " + msg.message;
+                       String fmt = "*** Topic is " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
        case MT_ErrorAuth:
                {
-                       std::string fmt = "*** ERROR: " + msg.message;
+                       String fmt = "*** ERROR: " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
@@ -229,13 +231,13 @@
        case MT_NameList:
                {
                        /*
-                       Ogre::StringVector v = 
Ogre::StringUtil::split(msg.message, " ");
+                       StringVector v = StringUtil::split(msg.message, " ");
                        for(int i=0; i<v.size(); i++)
                        {
 
                        }
                        */
-                       std::string fmt = "*** Users are: " + msg.message;
+                       String fmt = "*** Users are: " + msg.message;
                        addTextToChatWindow(fmt, msg.channel);
                }
                break;
@@ -259,16 +261,16 @@
        }
 }
 
-void LobbyGUI::addTextToChatWindow(std::string txt, std::string channel)
+void LobbyGUI::addTextToChatWindow(String txt, String channel)
 {
        //catch special case that channel is empty -> Status Channel
        if(channel.empty())
                channel = "Status";
-       Ogre::String realchannel = channel;
+       String realchannel = channel;
 
        // escape #
-       channel =Ogre::StringUtil::replaceAll(channel, "#", "##");
-       txt = Ogre::StringUtil::replaceAll(txt, "#", "##");
+       channel =StringUtil::replaceAll(channel, "#", "##");
+       txt = StringUtil::replaceAll(txt, "#", "##");
 
 
        if(tabs.find(channel) == tabs.end())
@@ -307,7 +309,7 @@
                // rotate the hour glass
                float angle = rotatingWait->getAngle();
                angle += dt * 0.001f;
-               if(angle > 2 * Ogre::Math::PI) angle -= 2 * Ogre::Math::PI; // 
prevent overflowing
+               if(angle > 2 * Math::PI) angle -= 2 * Math::PI; // prevent 
overflowing
                rotatingWait->setAngle(angle);
        }
 
@@ -366,9 +368,9 @@
 void LobbyGUI::eventCommandAccept(MyGUI::Edit* _sender)
 {
        if(!current_tab) return;
-       Ogre::String command = _sender->getCaption();
+       String command = _sender->getCaption();
 
-       Ogre::StringUtil::trim(command);
+       StringUtil::trim(command);
 
        if(command.empty())
        {
@@ -377,7 +379,7 @@
        }
 
        // unescape #
-       command = Ogre::StringUtil::replaceAll(command, "##", "#");
+       command = StringUtil::replaceAll(command, "##", "#");
 
        if(current_tab->name.substr(0, 1) == "#")
        {
@@ -387,7 +389,7 @@
                if(command.substr(0, 1) == "/")
                {
                        // command there!
-                       Ogre::StringVector v = Ogre::StringUtil::split(command, 
" ");
+                       StringVector v = StringUtil::split(command, " ");
 
                        if(v.size() >= 2 && v[0] == "/me")
                                sendMeMessage(v[1], 
v.size()>2?v[2]:current_tab->name);
@@ -413,7 +415,7 @@
                        sendMessage(command, current_tab->realName);
                }
                // add our message to the textbox
-               std::string fmt = "<" + nick + "> " + command;
+               String fmt = "<" + nick + "> " + command;
                addTextToChatWindow(fmt, current_tab->realName); // use 
realName here!
        }
 
@@ -427,7 +429,7 @@
 void LobbyGUI::eventChangeTab(MyGUI::TabControl* _sender, size_t _index)
 {
        MyGUI::TabItemPtr tab = _sender->getItemAt(_index);
-       Ogre::String n = _sender->getItemNameAt(_index);
+       String n = _sender->getItemNameAt(_index);
        if(!tab) return;
        if(tabs.find(n) == tabs.end())
                return;
@@ -439,5 +441,4 @@
        current_tab = &tabs[n];
 }
 
-
 #endif // USE_MYGUI

Modified: trunk/source/main/gui/LobbyGUI.h
===================================================================
--- trunk/source/main/gui/LobbyGUI.h    2012-05-14 22:47:00 UTC (rev 2570)
+++ trunk/source/main/gui/LobbyGUI.h    2012-05-15 17:08:41 UTC (rev 2571)
@@ -85,7 +85,7 @@
        bool waitingAnimation;
 
        void processIRCEvent(message_t &msg);
-       void addTextToChatWindow(std::string, std::string channel);
+       void addTextToChatWindow(Ogre::String, Ogre::String channel);
        void addTab(Ogre::String name);
 
        void eventCommandAccept(MyGUI::Edit* _sender);

Modified: trunk/source/main/network/IRCWrapper.cpp
===================================================================
--- trunk/source/main/network/IRCWrapper.cpp    2012-05-14 22:47:00 UTC (rev 
2570)
+++ trunk/source/main/network/IRCWrapper.cpp    2012-05-15 17:08:41 UTC (rev 
2571)
@@ -751,5 +751,4 @@
        return 0;
 }
 
-
 #endif // USE_SOCKETW

Modified: trunk/source/main/network/IRCWrapper.h
===================================================================
--- trunk/source/main/network/IRCWrapper.h      2012-05-14 22:47:00 UTC (rev 
2570)
+++ trunk/source/main/network/IRCWrapper.h      2012-05-15 17:08:41 UTC (rev 
2571)
@@ -109,4 +109,5 @@
 };
 
 #endif // __IRCWrapper_H_
+
 #endif // USE_SOCKETW

Modified: trunk/source/main/network/network.cpp
===================================================================
--- trunk/source/main/network/network.cpp       2012-05-14 22:47:00 UTC (rev 
2570)
+++ trunk/source/main/network/network.cpp       2012-05-15 17:08:41 UTC (rev 
2571)
@@ -79,7 +79,7 @@
 Timer Network::timer = Ogre::Timer();
 unsigned int Network::myuid=0;
 
-Network::Network(std::string servername, long sport, RoRFrameListener *efl): 
lagDataClients(), initiated(false)
+Network::Network(String servername, long sport, RoRFrameListener *efl): 
lagDataClients(), initiated(false)
 {
        // update factories network objects
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to