diff --git a/Source/Backend/Crawler.d b/Source/Backend/Crawler.d index 72f0ae32..d331ed6f 100644 --- a/Source/Backend/Crawler.d +++ b/Source/Backend/Crawler.d @@ -134,17 +134,18 @@ private: immutable(FileInfo) buildFileInfo(DirEntry currentFile) const { - FileInfo f; - f.isDirectory = !currentFile.isDir(); - f.isDirectory = currentFile.isDir(); - f.fullPath = currentFile.name; - f.fileName = baseName(currentFile.name); - f.fileNameLower = toLower(f.fileName); - f.containingFolder = dirName(currentFile.name); - f.extension = extension(currentFile.name); - f.sizeString = humanSize(currentFile.size); - f.originalMountpoint = this.MOUNTPOINT; - f.dateModifiedString = toDateString(currentFile.timeLastModified()); + FileInfo f = { + this.MOUNTPOINT, + currentFile.isDir(), + !currentFile.isDir(), + toDateString(currentFile.timeLastModified()), + dirName(currentFile.name), + baseName(currentFile.name), + toLower(baseName(currentFile.name)), + extension(currentFile.name), + currentFile.name, + humanSize(currentFile.size) + }; return f; } diff --git a/Source/Backend/FileInfo.d b/Source/Backend/FileInfo.d index 798674fc..d2d52ac9 100644 --- a/Source/Backend/FileInfo.d +++ b/Source/Backend/FileInfo.d @@ -3,9 +3,8 @@ module FileInfo; /** FileInfo is a struct filled by the information a crawler can find about a file */ -struct FileInfo +immutable struct FileInfo { - /** The original mountpoint used by a crawler that found this file */ @@ -24,7 +23,7 @@ struct FileInfo /** true if is a symbolic link */ - bool isSymbolic; + //bool isSymbolic; /** string of the date modified @@ -39,14 +38,13 @@ struct FileInfo /** name of the icon to use on the left of the name */ - string iconName; + //string iconName; /** the filename with extension */ string fileName; - /** the filename with extension but lower string */ @@ -57,58 +55,13 @@ struct FileInfo */ string extension; - - + /** + Complete full path of the file + */ string fullPath; - - + /** + The size of the file, already converted as a human readable string + */ string sizeString; - - - - - } - -// this(DirEntry de) -// { - -// } - -// void isDirectory() -// { - -// } - -// string getDateModifiedString() -// { - -// } - -// void openContainingFolder() -// { - -// } - -// void openFile() -// { - -// } - -// string getContainingFolder() -// { - -// } - -// string getFileName() -// { - -// } - -// string getIconName() -// { - -// } - -// }