Skip to content

Commit 29aa511

Browse files
committed
changed icon sorting function to be compatible with old compilers
1 parent c22800b commit 29aa511

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

main/WebServer.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9834,18 +9834,19 @@ namespace http {
98349834
}
98359835
}
98369836

9837+
bool compareIconsByName(const http::server::CWebServer::_tCustomIcon &a, const http::server::CWebServer::_tCustomIcon &b)
9838+
{
9839+
return a.Title < b.Title;
9840+
}
9841+
98379842
void CWebServer::RType_CustomLightIcons(Json::Value &root)
98389843
{
98399844
std::vector<_tCustomIcon>::const_iterator itt;
98409845
int ii = 0;
98419846

98429847
std::vector<_tCustomIcon> temp_custom_light_icons = m_custom_light_icons;
98439848
//Sort by name
9844-
sort(temp_custom_light_icons.begin(), temp_custom_light_icons.end(),
9845-
[](const _tCustomIcon & a, const _tCustomIcon & b) -> bool
9846-
{
9847-
return a.Title < b.Title;
9848-
});
9849+
std::sort(temp_custom_light_icons.begin(), temp_custom_light_icons.end(), compareIconsByName);
98499850

98509851
for (itt = temp_custom_light_icons.begin(); itt != temp_custom_light_icons.end(); ++itt)
98519852
{

main/WebServer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ namespace http {
1414
struct _tWebUserPassword;
1515
class CWebServer
1616
{
17+
typedef boost::function< void(Json::Value &root) > webserver_response_function;
18+
public:
1719
struct _tCustomIcon
1820
{
1921
int idx;
2022
std::string RootFile;
2123
std::string Title;
2224
std::string Description;
2325
};
24-
typedef boost::function< void(Json::Value &root) > webserver_response_function;
25-
public:
2626
CWebServer(void);
2727
~CWebServer(void);
2828
bool StartServer(const std::string &listenaddress, const std::string &listenport, const std::string &serverpath, const bool bIgnoreUsernamePassword);

0 commit comments

Comments
 (0)