Skip to content

readAFolder and folder browser bug fix

Compare
Choose a tag to compare
@TheJaredWilcurt TheJaredWilcurt released this 18 Oct 20:38
· 59 commits to master since this release

While working on the API documentation I found a bug with reading contents of folders and ended up improving some stuff while fixing it. πŸ“‚πŸͺ²


Fixes:

Now when you use a folder browse element or the helper function we accurately return the file size for files in the contents object.

//Read the contents of a specific folder and store them in a variable
var catPics = ugui.helpers.readAFolder("C:/pictures/cats");
//Returns an object of each item in the root of the folder with size and isFolder properties
catPics.contents;

Breaking Changes:

Previously to get the array of item names from a folder you'd need to do:

//Returns an array of the names of all items in the root of the folder
catPics.contents._folder_contents_array;

Which was confusing and bad, so if you were using that you'll need to change it to

//Returns an array of the names of all items in the root of the folder
catPics.contentsList;

I'm not bumping this from 1.1.2 to 2.0.0 because this is a very minor breaking change that likely no one was using anyway.