fixed warnings

pull/23/head
JuanJakobo 2021-03-03 23:51:21 +01:00
parent 8ce0d9dc6f
commit e3379d6e28
8 changed files with 39 additions and 15 deletions

View File

@ -118,7 +118,7 @@ void EventHandler::mainMenuHandler(const int index)
//Info
case 104:
{
DialogSynchro(ICON_INFORMATION, "Information", "Version 0.62 \n For support please open a ticket at https://github.com/JuanJakobo/Pocketbook-Nextcloud-Client/issues", "", "", "Close");
Message(ICON_INFORMATION, "Warning", "Version 0.62 \n For support please open a ticket at https://github.com/JuanJakobo/Pocketbook-Nextcloud-Client/issues", 1200);
break;
}
//Exit
@ -254,5 +254,6 @@ void EventHandler::DialogHandlerStatic(const int clicked)
{
//TODO cannot interact with it
// make download in different thread https://github.com/pmartin/pocketbook-demo/blob/master/demo08-pthreads/demo08.cpp
//CloseProgressbar();
if (clicked == 1)
CloseProgressbar();
}

View File

@ -43,6 +43,12 @@ MenuHandler::~MenuHandler()
{
CloseFont(_menuFont);
CloseFont(_loadingFont);
delete _text;
delete _menu;
delete _makeStartfolder;
delete _logout;
delete _info;
delete _exit;
}
void MenuHandler::panelHandlerStatic()
@ -53,20 +59,22 @@ void MenuHandler::panelHandlerStatic()
int MenuHandler::createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler)
{
char *text = "Work offline";
string text = "Work offline";
if (workOffline)
text = "Work online";
_text = strdup(text.c_str());
imenu mainMenu[] =
{
{ITEM_HEADER, 0, "Menu", NULL},
{ITEM_HEADER, 0, _menu, NULL},
//show logged in
{loggedIn ? ITEM_ACTIVE : ITEM_HIDDEN, 101, text, NULL},
{loggedIn ? ITEM_ACTIVE : ITEM_HIDDEN, 102, "Make startfolder", NULL},
{loggedIn ? ITEM_ACTIVE : ITEM_HIDDEN, 103, "Logout", NULL},
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 101, _text, NULL},
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 102, _makeStartfolder, NULL},
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 103, _logout, NULL},
//show always
{ITEM_ACTIVE, 104, "Info"},
{ITEM_ACTIVE, 105, "Exit"},
{ITEM_ACTIVE, 104, _info, NULL},
{ITEM_ACTIVE, 105, _exit, NULL},
{0, 0, NULL, NULL}};
if (loggedIn)
@ -92,6 +100,6 @@ void MenuHandler::drawLoadingScreen()
void MenuHandler::clearLoadingScreen()
{
FillArea(_loadingScreenRect.x, _loadingScreenRect.y, _loadingScreenRect.w, _loadingScreenRect.h/4, WHITE);
FillArea(_loadingScreenRect.x, _loadingScreenRect.y, _loadingScreenRect.w, _loadingScreenRect.h / 4, WHITE);
PartialUpdate(_loadingScreenRect.x, _loadingScreenRect.y, _loadingScreenRect.w, _loadingScreenRect.h);
}

View File

@ -55,6 +55,14 @@ private:
imenu _mainMenu;
irect _contentRect;
char *_text;
char *_menu = strdup("Menu");
char *_makeStartfolder = strdup("Make startfolder");
char *_logout = strdup("Logout");
char *_info = strdup("Info");
char *_exit = strdup("Close App");
/**
* Functions needed to call C function, handles the panel
*

View File

@ -74,6 +74,7 @@ ListView::ListView(const irect *contentRect, const vector<Item> &items) : _conte
ListView::~ListView()
{
delete _contentRect;
CloseFont(_entryFont);
CloseFont(_entryFontBold);
CloseFont(_headerFont);
@ -115,7 +116,7 @@ void ListView::drawEntry(int itemID)
void ListView::drawEntries()
{
for (auto i = 0; i < _entries.size(); i++)
for (unsigned int i = 0; i < _entries.size(); i++)
{
if (_entries[i].getPage() == _shownPage)
_entries[i].draw(_items->at(i), _entryFont, _entryFontBold, _entryFontHeight);

View File

@ -55,6 +55,8 @@ LoginView::LoginView(const irect *contentRect) : _contentRect(contentRect)
LoginView::~LoginView()
{
delete _contentRect;
delete _loginViewStatic;
CloseFont(_loginFont);
}
@ -90,7 +92,7 @@ void LoginView::keyboardHandler(char *text)
FillAreaRect(&_passwordButton, WHITE);
string pass;
for (auto i = 0; i < s.length(); i++)
for (unsigned int i = 0; i < s.length(); i++)
{
pass += "*";
}

View File

@ -79,10 +79,10 @@ public:
private:
string _path;
Itemtype _type;
string _title;
FileState _state{FileState::ICLOUD};
string _localPath;
FileState _state{FileState::ICLOUD};
Itemtype _type;
string _lastEditDate{"Error"};
double _size;
string _fileType;

View File

@ -501,7 +501,7 @@ void Nextcloud::getLocalFileStructure(vector<Item> &tempItems, const string &loc
const bool isDirectory = (st.st_mode & S_IFDIR) != 0;
bool found = false;
for (auto i = 1; i < tempItems.size(); i++)
for (unsigned int i = 1; i < tempItems.size(); i++)
{
if (tempItems.at(i).getLocalPath().compare(fullFileName) == 0)
{

View File

@ -11,6 +11,7 @@
#include <string>
#include <math.h>
#include <curl/curl.h>
#include <tuple>
using std::string;
@ -48,6 +49,9 @@ bool Util::connectToNetwork()
int Util::progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
{
std::ignore = ultotal;
std::ignore = ulnow;
free(clientp);
if (dltotal <= 0.0)
return 0;