X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=ede;a=blobdiff_plain;f=libede%2Fsrc%2FFileSystemBox.ec;fp=libede%2Fsrc%2FFileSystemBox.ec;h=f21d8a6cd70007e4a8db4c60bc011b22ad30b1f5;hp=aa2d30440a478f8eaa4926a43e55d3683b6454d3;hb=2b25fa110619a854b35d01d7952f95b9c1f3893c;hpb=af726215c6576ef2134150ca2c4a4f2f12d9f4eb 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) {