From 2b25fa110619a854b35d01d7952f95b9c1f3893c Mon Sep 17 00:00:00 2001 From: Rejean Loyer Date: Fri, 16 Sep 2011 07:56:45 -0400 Subject: [PATCH] libede:FileSystemBox: added FileSystemNode::label --- libede/src/FileSystemBox.ec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libede/src/FileSystemBox.ec b/libede/src/FileSystemBox.ec index aa2d304..f21d8a6 100644 --- a/libede/src/FileSystemBox.ec +++ b/libede/src/FileSystemBox.ec @@ -600,7 +600,7 @@ private: if(isRoot) { root.type = computer; - root.name = rootName; + root.label = rootName; } list.Sort(nameField, 1); @@ -1784,6 +1784,7 @@ public: int indent; char * path; char * name; + char * label; char * extension; char * info; DataRow row; @@ -1800,7 +1801,8 @@ public: FileSystemNode up; if(parent) { - strcpy(outputPath, name); + if(name) + strcpy(outputPath, name); for(up = parent; up; up = up.parent) { char temp[MAX_LOCATION]; @@ -1871,6 +1873,7 @@ public: } //if(name) delete name; + delete label; delete info; } @@ -1889,7 +1892,7 @@ public: int len; int w, h; //int textOffset; - char label[MAX_FILENAME]; + char string[MAX_FILENAME]; Bitmap icon; @@ -1904,10 +1907,10 @@ public: return; if(info) - sprintf(label, "%s [%s]", name, info); + sprintf(string, "%s [%s]", label ? label : name, info); else - strcpy(label, name); - len = strlen(label); + strcpy(string, label ? label : name); + len = strlen(string); if(!icon) { @@ -1919,7 +1922,7 @@ public: //textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0); surface.TextOpacity(false); - surface.TextExtent(label, len, &w, &h); + surface.TextExtent(string, len, &w, &h); h = Max(h, 16); // Draw the current row stipple @@ -1929,7 +1932,7 @@ public: surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1); //surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, name, strlen(name)); - surface.WriteTextDots(alignment, xStart, y + 2, width, label, len); + surface.WriteTextDots(alignment, xStart, y + 2, width, string, len); if(!guiApp.textMode) { -- 1.8.3.1