Use enum class over plain enum

master
JuanJakobo 2022-08-10 22:35:11 +02:00
parent 4f87eb6658
commit 34e766498f
6 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@
#include <string>
enum Type
enum class Type
{
FFOLDER,
FFILE

View File

@ -14,7 +14,7 @@
#include <string>
#include <memory>
enum KeyboardTarget
enum class KeyboardTarget
{
IURL,
IUSERNAME,

View File

@ -37,7 +37,7 @@ WebDAVView::WebDAVView(const irect &contentRect, vector<WebDAVItem> &items, int
{
auto entrySize = TextRectHeight(contentRect.w, item.title.c_str(), 0);
if (item.type == IFILE)
if (item.type == Itemtype::IFILE)
entrySize += _entryFontHeight;
entrySize += (item.title.find("click to go back") != std::string::npos) ? 0.5 * _entryFontHeight : 2.5 * _entryFontHeight;

View File

@ -35,7 +35,7 @@ void WebDAVViewEntry::draw(const ifont *entryFont, const ifont *entryFontBold, i
}
else
{
if (_entry.type == IFILE)
if (_entry.type == Itemtype::IFILE)
{
DrawTextRect(_position.x, _position.y + heightOfTitle, _position.w, fontHeight, _entry.fileType.c_str(), ALIGN_LEFT);

View File

@ -41,7 +41,7 @@ bool Util::connectToNetwork()
const char *network_name = nullptr;
int result = NetConnect2(network_name, 1);
if (result != 0)
if (result)
{
Message(ICON_WARNING, "Warning", "It was not possible to establish an internet connection.", 2000);
return false;

View File

@ -13,7 +13,7 @@
#include <string>
enum Action
enum class Action
{
IWriteSecret,
IReadSecret,