From 2423fbf2efa39e28cc348acc11b9269e573dcdef Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 22:15:34 +0200 Subject: Normalized comments. This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign. --- src/Bindings/WebPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Bindings/WebPlugin.cpp') diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index bf45405ba..bc1a9ac8c 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -71,7 +71,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest { for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { - if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr + if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr { Tab = *itr; break; -- cgit v1.2.3 From 5e198c673009cf8ca9d92cf59848999bc96bbc37 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 22:50:58 +0200 Subject: Basic style fixes. --- src/Bindings/WebPlugin.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/Bindings/WebPlugin.cpp') diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index bc1a9ac8c..57ed9f6a4 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -64,27 +64,27 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest std::pair< AString, AString > Names; AStringVector Split = StringSplit(a_Request->Path, "/"); - if( Split.size() > 1 ) + if (Split.size() > 1) { - sWebPluginTab* Tab = 0; - if( Split.size() > 2 ) // If we got the tab name, show that page + sWebPluginTab * Tab = NULL; + if (Split.size() > 2) // If we got the tab name, show that page { for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { - if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr + if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { Tab = *itr; break; } } } - else // Otherwise show the first tab + else // Otherwise show the first tab { if( GetTabs().size() > 0 ) Tab = *GetTabs().begin(); } - if( Tab ) + if (Tab != NULL) { Names.first = Tab->Title; Names.second = Tab->SafeTitle; @@ -97,13 +97,13 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest -AString cWebPlugin::SafeString( const AString & a_String ) +AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; for( unsigned int i = 0; i < a_String.size(); ++i ) { char c = a_String[i]; - if( c == ' ' ) + if( c == ' ' ) { c = '_'; } @@ -111,3 +111,7 @@ AString cWebPlugin::SafeString( const AString & a_String ) } return RetVal; } + + + + -- cgit v1.2.3 From 6be79575fd50e37ac275bd0cb9d16f9e51e8a225 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 20 Jul 2014 23:10:31 +0200 Subject: Style: Normalized spaces after if, for and while. --- src/Bindings/WebPlugin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Bindings/WebPlugin.cpp') diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index 57ed9f6a4..a22826d1b 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -45,7 +45,7 @@ cWebPlugin::~cWebPlugin() std::list > cWebPlugin::GetTabNames(void) { std::list< std::pair< AString, AString > > NameList; - for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { std::pair< AString, AString > StringPair; StringPair.first = (*itr)->Title; @@ -69,7 +69,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest sWebPluginTab * Tab = NULL; if (Split.size() > 2) // If we got the tab name, show that page { - for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) { if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { @@ -80,7 +80,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest } else // Otherwise show the first tab { - if( GetTabs().size() > 0 ) + if (GetTabs().size() > 0 ) Tab = *GetTabs().begin(); } @@ -100,10 +100,10 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; - for( unsigned int i = 0; i < a_String.size(); ++i ) + for (unsigned int i = 0; i < a_String.size(); ++i ) { char c = a_String[i]; - if( c == ' ' ) + if (c == ' ' ) { c = '_'; } -- cgit v1.2.3 From 93d29555e58df172bafba530afbc593c16ec66a3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:19:48 +0200 Subject: Style: Normalized to no spaces before closing parenthesis. --- src/Bindings/WebPlugin.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Bindings/WebPlugin.cpp') diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index a22826d1b..1178c127a 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -45,12 +45,12 @@ cWebPlugin::~cWebPlugin() std::list > cWebPlugin::GetTabNames(void) { std::list< std::pair< AString, AString > > NameList; - for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr) { std::pair< AString, AString > StringPair; StringPair.first = (*itr)->Title; StringPair.second = (*itr)->SafeTitle; - NameList.push_back( StringPair ); + NameList.push_back( StringPair); } return NameList; } @@ -69,7 +69,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest sWebPluginTab * Tab = NULL; if (Split.size() > 2) // If we got the tab name, show that page { - for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr) { if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { @@ -80,7 +80,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest } else // Otherwise show the first tab { - if (GetTabs().size() > 0 ) + if (GetTabs().size() > 0) Tab = *GetTabs().begin(); } @@ -100,14 +100,14 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; - for (unsigned int i = 0; i < a_String.size(); ++i ) + for (unsigned int i = 0; i < a_String.size(); ++i) { char c = a_String[i]; - if (c == ' ' ) + if (c == ' ') { c = '_'; } - RetVal.push_back( c ); + RetVal.push_back( c); } return RetVal; } -- cgit v1.2.3