diff --git a/src/handler/eventHandler.cpp b/src/handler/eventHandler.cpp index a35f38e..bd1d89c 100644 --- a/src/handler/eventHandler.cpp +++ b/src/handler/eventHandler.cpp @@ -17,12 +17,12 @@ using std::string; -EventHandler *EventHandler::_eventHandlerStatic; +std::unique_ptrEventHandler::_eventHandlerStatic; EventHandler::EventHandler() { //create a event to create handlers - _eventHandlerStatic = this; + _eventHandlerStatic = std::unique_ptr(this); _loginView = nullptr; _listView = nullptr; @@ -95,7 +95,6 @@ void EventHandler::mainMenuHandler(const int index) //} _nextcloud.logout(); _listView.reset(); - _loginView = std::unique_ptr(new LoginView(_menu.getContentRect())); FullUpdate(); break; @@ -154,7 +153,8 @@ int EventHandler::pointerHandler(const int type, const int par1, const int par2) if (!_nextcloud.downloadItem(itemID)) { CloseProgressbar(); - Message(ICON_WARNING, "Warning", "Could not download the file, please try again.", 600); + if(!_nextcloud.isWorkOffline()) + Message(ICON_WARNING, "Warning", "Could not download the file, please try again.", 600); } else { diff --git a/src/handler/eventHandler.h b/src/handler/eventHandler.h index 99b4e11..7474950 100644 --- a/src/handler/eventHandler.h +++ b/src/handler/eventHandler.h @@ -37,11 +37,11 @@ public: int eventDistributor(const int type, const int par1, const int par2); private: - static EventHandler *_eventHandlerStatic; - MenuHandler _menu = MenuHandler("Nextcloud"); - Nextcloud _nextcloud = Nextcloud(); + static std::unique_ptr _eventHandlerStatic; std::unique_ptr _listView; std::unique_ptr _loginView; + MenuHandler _menu = MenuHandler("Nextcloud"); + Nextcloud _nextcloud = Nextcloud(); /** * Functions needed to call C function, redirects to real function