1
0

Fixed WebAdmin showing tab names (thanks for pointing it out Lapayo)

Changed some std::string to AString

git-svn-id: http://mc-server.googlecode.com/svn/trunk@780 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth 2012-08-22 23:29:15 +00:00
parent 49a4613d94
commit eba0437d68
3 changed files with 14 additions and 17 deletions

View File

@ -195,14 +195,11 @@ void cWebAdmin::Request_Handler(webserver::http_request* r)
Content = (*itr)->HandleWebRequest( &Request );
cWebPlugin* WebPlugin = *itr;
FoundPlugin = WebPlugin->GetName();
/*
TODO: Is this needed anymore?
cWebPlugin_Lua* LuaPlugin = dynamic_cast< cWebPlugin_Lua* >( WebPlugin );
if( LuaPlugin )
AString TabName = WebPlugin->GetTabNameForRequest( &Request ).first;
if( TabName.empty() == false )
{
FoundPlugin += " - " + LuaPlugin->GetTabNameForRequest( &Request ).first;
FoundPlugin += " - " + TabName;
}
*/
break;
}
}

View File

@ -38,12 +38,12 @@ cWebPlugin::~cWebPlugin()
std::list< std::pair<std::string, std::string> > cWebPlugin::GetTabNames()
std::list< std::pair<AString, AString> > cWebPlugin::GetTabNames()
{
std::list< std::pair< std::string, std::string > > NameList;
std::list< std::pair< AString, AString > > NameList;
for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr )
{
std::pair< std::string, std::string > StringPair;
std::pair< AString, AString > StringPair;
StringPair.first = (*itr)->Title;
StringPair.second = (*itr)->SafeTitle;
NameList.push_back( StringPair );
@ -55,9 +55,9 @@ std::list< std::pair<std::string, std::string> > cWebPlugin::GetTabNames()
std::pair< std::string, std::string > cWebPlugin::GetTabNameForRequest( HTTPRequest* a_Request )
std::pair< AString, AString > cWebPlugin::GetTabNameForRequest( HTTPRequest* a_Request )
{
std::pair< std::string, std::string > Names;
std::pair< AString, AString > Names;
AStringVector Split = StringSplit(a_Request->Path, "/");
if( Split.size() > 1 )
@ -95,7 +95,7 @@ std::pair< std::string, std::string > cWebPlugin::GetTabNameForRequest( HTTPRequ
AString cWebPlugin::SafeString( const AString & a_String )
{
std::string RetVal;
AString RetVal;
for( unsigned int i = 0; i < a_String.size(); ++i )
{
char c = a_String[i];

View File

@ -11,9 +11,9 @@ public:
virtual ~cWebPlugin();
void SetName( std::string a_Name ) { m_Name = a_Name; }
std::string GetName() { return m_Name; }
AString GetName() { return m_Name; }
virtual std::string HandleWebRequest( HTTPRequest* a_Request ) = 0;
virtual AString HandleWebRequest( HTTPRequest* a_Request ) = 0;
static AString SafeString( const AString & a_String );
//tolua_end
@ -29,10 +29,10 @@ public:
typedef std::list< sWebPluginTab* > TabList;
TabList & GetTabs() { return m_Tabs; }
std::list< std::pair<std::string, std::string> > GetTabNames();
std::pair< std::string, std::string > GetTabNameForRequest( HTTPRequest* a_Request );
std::list< std::pair<AString, AString> > GetTabNames();
std::pair< AString, AString > GetTabNameForRequest( HTTPRequest* a_Request );
private:
TabList m_Tabs;
std::string m_Name;
AString m_Name;
}; //tolua_export