diff --git a/src/handler/eventHandler.cpp b/src/handler/eventHandler.cpp index cdb2b34..c8e520a 100644 --- a/src/handler/eventHandler.cpp +++ b/src/handler/eventHandler.cpp @@ -25,7 +25,7 @@ EventHandler::EventHandler() //create a event to create handlers _eventHandlerStatic = this; - _menu = new MenuHandler("nextcloud"); + _menu = new MenuHandler("Nextcloud"); _nextcloud = new Nextcloud(); _loginView = nullptr; _listView = nullptr; diff --git a/src/ui/listView.cpp b/src/ui/listView.cpp index 09ebfec..433f384 100644 --- a/src/ui/listView.cpp +++ b/src/ui/listView.cpp @@ -79,7 +79,7 @@ void ListView::drawHeader(string headerText) void ListView::drawFooter() { - string footer = Util::intToString(_shownPage) + "/" + Util::intToString(_page); + string footer = Util::valueToString(_shownPage) + "/" + Util::valueToString(_page); SetFont(_font, WHITE); FillAreaRect(&_pageButton, BLACK); DrawTextRect2(&_pageButton, footer.c_str()); diff --git a/src/util/util.cpp b/src/util/util.cpp index 3851115..0237f15 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -9,20 +9,10 @@ #include "inkview.h" #include -#include #include -#include -using std::ostringstream; using std::string; -string Util::intToString(const int value) -{ - ostringstream stm; - stm << value; - return stm.str(); -} - size_t Util::writeCallback(void *contents, size_t size, size_t nmemb, void *userp) { ((string *)userp)->append((char *)contents, size * nmemb); diff --git a/src/util/util.h b/src/util/util.h index eb87cbb..4c439a2 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -12,6 +12,10 @@ #include "inkview.h" #include +#include +#include + +using std::ostringstream; using std::string; @@ -19,12 +23,18 @@ class Util { public: /** - * Converts an int to an string, as C++11 command is not supported + * Converts an value to an string, as C++11 command is not supported * * @param value the int value that shall be converted * @return same value in string format */ - static string intToString(const int value); + template + static string valueToString(const T value) + { + ostringstream stm; + stm << value; + return stm.str(); + }; /** * Handles the return of curl command @@ -57,7 +67,7 @@ public: */ static string getXMLAttribute(const string &buffer, const string &name); - static string replaceString(string item,const string& find,const string& to); + static string replaceString(string item, const string &find, const string &to); private: Util() {}