diff options
author | Peter Bozsó | 2016-07-30 08:45:11 +0200 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | a1de322c18d9efdf885ea5b760a404237dcdc0a8 (patch) | |
tree | e4f6e1ed65e2198f9420a86800c2cc5276351ef1 /backends/networking/sdl_net/handlers/listajaxhandler.cpp | |
parent | 712410496e4e59fe1ee1968a94eeb73b51223996 (diff) | |
download | scummvm-rg350-a1de322c18d9efdf885ea5b760a404237dcdc0a8.tar.gz scummvm-rg350-a1de322c18d9efdf885ea5b760a404237dcdc0a8.tar.bz2 scummvm-rg350-a1de322c18d9efdf885ea5b760a404237dcdc0a8.zip |
CLOUD: Use overriden handle() instead of ClientHandlerCallback in page handlers
Using a dedicated callback object for this was an unnecessary overhead.
Diffstat (limited to 'backends/networking/sdl_net/handlers/listajaxhandler.cpp')
-rw-r--r-- | backends/networking/sdl_net/handlers/listajaxhandler.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/backends/networking/sdl_net/handlers/listajaxhandler.cpp b/backends/networking/sdl_net/handlers/listajaxhandler.cpp index de349bd6ef..f0bf792aa6 100644 --- a/backends/networking/sdl_net/handlers/listajaxhandler.cpp +++ b/backends/networking/sdl_net/handlers/listajaxhandler.cpp @@ -32,13 +32,6 @@ ListAjaxHandler::ListAjaxHandler() {} ListAjaxHandler::~ListAjaxHandler() {} -void ListAjaxHandler::handle(Client &client) { - Common::String path = client.queryParameter("path"); - Common::JSONValue jsonResponse = listDirectory(path); - Common::String response = jsonResponse.stringify(true); - LocalWebserver::setClientGetHandler(client, response); -} - Common::JSONObject ListAjaxHandler::listDirectory(Common::String path) { Common::JSONArray itemsList; Common::JSONObject errorResult; @@ -145,8 +138,11 @@ void ListAjaxHandler::addItem(Common::JSONArray &responseItemsList, ItemType ite /// public -ClientHandlerCallback ListAjaxHandler::getHandler() { - return new Common::Callback<ListAjaxHandler, Client &>(this, &ListAjaxHandler::handle); +void ListAjaxHandler::handle(Client &client) { + Common::String path = client.queryParameter("path"); + Common::JSONValue jsonResponse = listDirectory(path); + Common::String response = jsonResponse.stringify(true); + LocalWebserver::setClientGetHandler(client, response); } } // End of namespace Networking |