Skip to content

Commit

Permalink
Prevent ICON0 in browser setting from crashing within File Browswer (…
Browse files Browse the repository at this point in the history
… CL )
  • Loading branch information
krazynez committed Nov 14, 2024
1 parent ba2f30a commit d22dd4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions extras/menus/arkMenu/src/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ void Browser::drawScreen(){
common::printText(xoffset, yoffset, e->getName().c_str(), LITEGRAY, SIZE_BIG, focused, (focused)? &scroll : NULL, 0);
if (common::getConf()->browser_icon0){
Image* icon = e->getIcon();
if (icon){
icon->draw(320, 21);
if (icon && e->getName().c_str()[0] != '.'){ // Prevent ../ from displaying ICON0
icon->draw(320, 21);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions extras/menus/arkMenu/src/browser_entries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ BrowserFile::BrowserFile(string path, string shortname){
size_t lastSlash = path.rfind('/', string::npos);
this->path = path;
this->name = path.substr(lastSlash+1, string::npos);
this->parent = path.substr(0, lastSlash) + '/';
this->parent = path.substr(0, lastSlash);
this->icon0 = NULL;
this->selected = false;
this->filetype = FOLDER;
Expand Down Expand Up @@ -158,7 +158,7 @@ BrowserFolder::BrowserFolder(string path, string shortname){
this->selected = false;
this->fileSize = "Folder";
this->filetype = FOLDER;
if (shortname.size() > 0) shortname += '/';
if (shortname.size() > 0) shortname;
this->setShortName(shortname);
}

Expand All @@ -170,7 +170,7 @@ BrowserFolder::BrowserFolder(string parent, string name, string shortname){
this->selected = false;
this->fileSize = "Folder";
this->filetype = FOLDER;
if (shortname.size() > 0) shortname += '/';
if (shortname.size() > 0) shortname;
this->setShortName(shortname);
}

Expand Down

0 comments on commit d22dd4f

Please sign in to comment.