diff options
author | Alexander Tkachev | 2016-07-20 19:51:39 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06 (patch) | |
tree | 510e5c6e81976262498835066cd94a21b42b4f69 /backends/networking/sdl_net/handlers | |
parent | b180c73675846f45abab2190b39e0b9d0d6addbf (diff) | |
download | scummvm-rg350-01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06.tar.gz scummvm-rg350-01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06.tar.bz2 scummvm-rg350-01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06.zip |
CLOUD: Do some refactoring/cleanup in Networking
Diffstat (limited to 'backends/networking/sdl_net/handlers')
5 files changed, 9 insertions, 9 deletions
diff --git a/backends/networking/sdl_net/handlers/filespagehandler.cpp b/backends/networking/sdl_net/handlers/filespagehandler.cpp index 5ead4f31d9..2e934a31c6 100644 --- a/backends/networking/sdl_net/handlers/filespagehandler.cpp +++ b/backends/networking/sdl_net/handlers/filespagehandler.cpp @@ -168,7 +168,7 @@ bool FilesPageHandler::listDirectory(Common::String path, Common::String &conten return true; } -FilesPageHandler::ItemType FilesPageHandler::detectType(bool isDirectory, const Common::String &name) const { +FilesPageHandler::ItemType FilesPageHandler::detectType(bool isDirectory, const Common::String &name) { if (isDirectory) return IT_DIRECTORY; if (name.hasSuffix(".txt")) return IT_TXT; if (name.hasSuffix(".zip")) return IT_ZIP; @@ -176,7 +176,7 @@ FilesPageHandler::ItemType FilesPageHandler::detectType(bool isDirectory, const return IT_UNKNOWN; } -void FilesPageHandler::addItem(Common::String &content, const Common::String &itemTemplate, ItemType itemType, Common::String path, Common::String name, Common::String size) { +void FilesPageHandler::addItem(Common::String &content, const Common::String &itemTemplate, ItemType itemType, Common::String path, Common::String name, Common::String size) const { Common::String item = itemTemplate, icon; bool isDirectory = (itemType == IT_DIRECTORY || itemType == IT_PARENT_DIRECTORY); switch (itemType) { diff --git a/backends/networking/sdl_net/handlers/filespagehandler.h b/backends/networking/sdl_net/handlers/filespagehandler.h index f102acd9fc..c66b79e093 100644 --- a/backends/networking/sdl_net/handlers/filespagehandler.h +++ b/backends/networking/sdl_net/handlers/filespagehandler.h @@ -47,10 +47,10 @@ class FilesPageHandler: public FilesBaseHandler { bool listDirectory(Common::String path, Common::String &content, const Common::String &itemTemplate); /** Helper method for detecting items' type. */ - ItemType detectType(bool isDirectory, const Common::String &name) const; + static ItemType detectType(bool isDirectory, const Common::String &name); /** Helper method for adding items into the files list. */ - void addItem(Common::String &content, const Common::String &itemTemplate, ItemType itemType, Common::String path, Common::String name, Common::String size = ""); + void addItem(Common::String &content, const Common::String &itemTemplate, ItemType itemType, Common::String path, Common::String name, Common::String size = "") const; public: FilesPageHandler(); diff --git a/backends/networking/sdl_net/handlers/indexpagehandler.cpp b/backends/networking/sdl_net/handlers/indexpagehandler.cpp index 9208cd0b15..e12016acba 100644 --- a/backends/networking/sdl_net/handlers/indexpagehandler.cpp +++ b/backends/networking/sdl_net/handlers/indexpagehandler.cpp @@ -36,7 +36,7 @@ void IndexPageHandler::handle(Client &client) { Common::String code = client.queryParameter("code"); if (code == "") { - // redirect to "/files" + // redirect to "/filesAJAX" HandlerUtils::setMessageHandler( client, Common::String::format( @@ -45,7 +45,7 @@ void IndexPageHandler::handle(Client &client) { client.queryParameter("path").c_str(), _("Open Files manager") ), - "/files" + "/filesAJAX" ); return; } diff --git a/backends/networking/sdl_net/handlers/listajaxhandler.cpp b/backends/networking/sdl_net/handlers/listajaxhandler.cpp index 8657ab52ed..6319485e3d 100644 --- a/backends/networking/sdl_net/handlers/listajaxhandler.cpp +++ b/backends/networking/sdl_net/handlers/listajaxhandler.cpp @@ -96,7 +96,7 @@ Common::JSONObject ListAjaxHandler::listDirectory(Common::String path) { return successResult; } -ListAjaxHandler::ItemType ListAjaxHandler::detectType(bool isDirectory, const Common::String &name) const { +ListAjaxHandler::ItemType ListAjaxHandler::detectType(bool isDirectory, const Common::String &name) { if (isDirectory) return IT_DIRECTORY; if (name.hasSuffix(".txt")) return IT_TXT; if (name.hasSuffix(".zip")) return IT_ZIP; diff --git a/backends/networking/sdl_net/handlers/listajaxhandler.h b/backends/networking/sdl_net/handlers/listajaxhandler.h index cef6a071a7..c157e1b0ba 100644 --- a/backends/networking/sdl_net/handlers/listajaxhandler.h +++ b/backends/networking/sdl_net/handlers/listajaxhandler.h @@ -48,10 +48,10 @@ class ListAjaxHandler: public FilesBaseHandler { Common::JSONObject listDirectory(Common::String path); /** Helper method for detecting items' type. */ - ItemType detectType(bool isDirectory, const Common::String &name) const; + static ItemType detectType(bool isDirectory, const Common::String &name); /** Helper method for adding items into the files list. */ - void addItem(Common::JSONArray &responseItemsList, ItemType itemType, Common::String path, Common::String name, Common::String size = ""); + static void addItem(Common::JSONArray &responseItemsList, ItemType itemType, Common::String path, Common::String name, Common::String size = ""); public: ListAjaxHandler(); |