From 3a62c6a25b4437a772fd0a58aa91948f29c8e7ee Mon Sep 17 00:00:00 2001 From: JuanJakobo <34421964+JuanJakobo@users.noreply.github.com> Date: Sat, 13 Feb 2021 12:13:06 +0100 Subject: [PATCH] add some logging for debugging --- src/handler/eventHandler.cpp | 6 +++++- src/util/nextcloud.cpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/handler/eventHandler.cpp b/src/handler/eventHandler.cpp index f636fa2..578e678 100644 --- a/src/handler/eventHandler.cpp +++ b/src/handler/eventHandler.cpp @@ -11,6 +11,7 @@ #include "menuHandler.h" #include "listView.h" #include "util.h" +#include "log.h" #include #include @@ -222,6 +223,9 @@ int EventHandler::pointerHandler(const int type, const int par1, const int par2) if (_loginView->logginClicked(par1, par2) == 2) { _menu.drawLoadingScreen(); + + Log::writeLog("Start Login from loginscreen"); + //TODO use progressbar and log (check what can go wrong?) catch? if (_nextcloud.login(_loginView->getURL(), _loginView->getUsername(), _loginView->getPassword())) { @@ -230,7 +234,7 @@ int EventHandler::pointerHandler(const int type, const int par1, const int par2) } else { - //redraw login screen so that loading disappears + //TODO redraw login screen so that loading disappears Message(ICON_WARNING, "Warning", "Something went wrong...", 1200); } FullUpdate(); diff --git a/src/util/nextcloud.cpp b/src/util/nextcloud.cpp index 522e24e..d9ee47c 100644 --- a/src/util/nextcloud.cpp +++ b/src/util/nextcloud.cpp @@ -110,6 +110,8 @@ bool Nextcloud::login(const string &Url, const string &Username, const string &P string tempPath = NEXTCLOUD_ROOT_PATH + Username + "/"; if (setItems(getDataStructure(tempPath, Username, Pass))) { + Log::writeLog("Got items"); + if (iv_access(NEXTCLOUD_CONFIG_PATH.c_str(), W_OK) != 0) iv_buildpath(NEXTCLOUD_CONFIG_PATH.c_str()); this->setUsername(Username); @@ -264,6 +266,9 @@ vector Nextcloud::getDataStructure(const string &pathUrl, const string &Us return {}; } + Log::writeLog("Starting download of DataStructure"); + + string readBuffer; CURLcode res; CURL *curl = curl_easy_init();