rename variable tempPath

pull/23/head
JuanJakobo 2021-06-05 09:32:54 +02:00
parent 25edc2ba30
commit 8c7dd3e8ae
2 changed files with 20 additions and 20 deletions

View File

@ -146,7 +146,7 @@ void EventHandler::contextMenuHandler(const int index)
//Open //Open
case 101: case 101:
{ {
if (_nextcloud.getItems().at(tempItemID).getType() == Itemtype::IFOLDER) if (_nextcloud.getItems().at(_tempItemID).getType() == Itemtype::IFOLDER)
{ {
openFolder(); openFolder();
} }
@ -167,9 +167,9 @@ void EventHandler::contextMenuHandler(const int index)
case 103: case 103:
{ {
OpenProgressbar(1, "Removing...", "Removing Files.", 0, EventHandler::DialogHandlerStatic); OpenProgressbar(1, "Removing...", "Removing Files.", 0, EventHandler::DialogHandlerStatic);
if (_nextcloud.removeItem(tempItemID)) if (_nextcloud.removeItem(_tempItemID))
{ {
_listView->drawEntry(tempItemID); _listView->drawEntry(_tempItemID);
Util::updatePBLibrary(); Util::updatePBLibrary();
} }
else else
@ -181,7 +181,7 @@ void EventHandler::contextMenuHandler(const int index)
} }
default: default:
{ {
_listView->invertEntryColor(tempItemID); _listView->invertEntryColor(_tempItemID);
break; break;
} }
@ -196,14 +196,14 @@ int EventHandler::pointerHandler(const int type, const int par1, const int par2)
{ {
if (_listView != nullptr) if (_listView != nullptr)
{ {
tempItemID = _listView->listClicked(par1, par2); _tempItemID = _listView->listClicked(par1, par2);
_listView->invertEntryColor(tempItemID); _listView->invertEntryColor(_tempItemID);
if (tempItemID != -1) if (_tempItemID != -1)
{ {
if (_nextcloud.getItems().at(tempItemID).getTitle().compare("...") != 0) if (_nextcloud.getItems().at(_tempItemID).getTitle().compare("...") != 0)
{ {
_contextMenu = std::unique_ptr<ContextMenu>(new ContextMenu()); _contextMenu = std::unique_ptr<ContextMenu>(new ContextMenu());
_contextMenu->createMenu(par2, _nextcloud.getItems().at(tempItemID).getState(), EventHandler::contextMenuHandlerStatic); _contextMenu->createMenu(par2, _nextcloud.getItems().at(_tempItemID).getState(), EventHandler::contextMenuHandlerStatic);
} }
} }
} }
@ -218,17 +218,17 @@ int EventHandler::pointerHandler(const int type, const int par1, const int par2)
//if listView is shown //if listView is shown
else if (_listView != nullptr) else if (_listView != nullptr)
{ {
tempItemID = _listView->listClicked(par1, par2); _tempItemID = _listView->listClicked(par1, par2);
_listView->invertEntryColor(tempItemID); _listView->invertEntryColor(_tempItemID);
if (tempItemID != -1) if (_tempItemID != -1)
{ {
if (_nextcloud.getItems().at(tempItemID).getType() == Itemtype::IFOLDER) if (_nextcloud.getItems().at(_tempItemID).getType() == Itemtype::IFOLDER)
{ {
openFolder(); openFolder();
} }
else else
{ {
if (_nextcloud.getItems().at(tempItemID).getState() == FileState::ISYNCED || (_nextcloud.isWorkOffline() && _nextcloud.getItems().at(tempItemID).getState() == FileState::IOUTSYNCED)) if (_nextcloud.getItems().at(_tempItemID).getState() == FileState::ISYNCED || (_nextcloud.isWorkOffline() && _nextcloud.getItems().at(_tempItemID).getState() == FileState::IOUTSYNCED))
{ {
openItem(); openItem();
} }
@ -279,7 +279,7 @@ void EventHandler::startDownload()
OpenProgressbar(1, "Downloading...", "Check network connection", 0, EventHandler::DialogHandlerStatic); OpenProgressbar(1, "Downloading...", "Check network connection", 0, EventHandler::DialogHandlerStatic);
try try
{ {
_nextcloud.download(tempItemID); _nextcloud.download(_tempItemID);
} }
catch (const std::exception &e) catch (const std::exception &e)
{ {
@ -289,13 +289,13 @@ void EventHandler::startDownload()
Util::updatePBLibrary(); Util::updatePBLibrary();
CloseProgressbar(); CloseProgressbar();
_listView->drawEntry(tempItemID); _listView->drawEntry(_tempItemID);
} }
void EventHandler::openItem() void EventHandler::openItem()
{ {
_listView->invertEntryColor(tempItemID); _listView->invertEntryColor(_tempItemID);
_nextcloud.getItems().at(tempItemID).open(); _nextcloud.getItems().at(_tempItemID).open();
} }
void EventHandler::openFolder() void EventHandler::openFolder()
@ -303,7 +303,7 @@ void EventHandler::openFolder()
FillAreaRect(_menu.getContentRect(), WHITE); FillAreaRect(_menu.getContentRect(), WHITE);
ShowHourglassForce(); ShowHourglassForce();
_tempPath = _nextcloud.getItems().at(tempItemID).getPath(); _tempPath = _nextcloud.getItems().at(_tempItemID).getPath();
if (!_tempPath.empty()) if (!_tempPath.empty())
_nextcloud.setItems(_nextcloud.getDataStructure(_tempPath)); _nextcloud.setItems(_nextcloud.getDataStructure(_tempPath));
_listView.release(); _listView.release();

View File

@ -45,7 +45,7 @@ private:
MainMenu _menu = MainMenu("Nextcloud"); MainMenu _menu = MainMenu("Nextcloud");
Nextcloud _nextcloud = Nextcloud(); Nextcloud _nextcloud = Nextcloud();
std::string _tempPath; std::string _tempPath;
int tempItemID; int _tempItemID;
/** /**
* Function needed to call C function, redirects to real function * Function needed to call C function, redirects to real function