Author: rmottola
Date: Mon Mar  7 14:59:35 2016
New Revision: 39475

URL: http://svn.gna.org/viewcvs/gnustep?rev=39475&view=rev
Log:
Localize the node name only if it is a directory

Modified:
    apps/gworkspace/trunk/ChangeLog
    apps/gworkspace/trunk/FSNode/FSNode.m

Modified: apps/gworkspace/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/ChangeLog?rev=39475&r1=39474&r2=39475&view=diff
==============================================================================
--- apps/gworkspace/trunk/ChangeLog     (original)
+++ apps/gworkspace/trunk/ChangeLog     Mon Mar  7 14:59:35 2016
@@ -1,3 +1,8 @@
+2016-03-07 Riccardo Mottola <[email protected]>
+
+       * FSNode/FSNode.m
+       Localize the node name only if it is a directory.
+
 2016-03-02 Riccardo Mottola <[email protected]>
 
        * Inspector/Attributes.m

Modified: apps/gworkspace/trunk/FSNode/FSNode.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/FSNode/FSNode.m?rev=39475&r1=39474&r2=39475&view=diff
==============================================================================
--- apps/gworkspace/trunk/FSNode/FSNode.m       (original)
+++ apps/gworkspace/trunk/FSNode/FSNode.m       Mon Mar  7 14:59:35 2016
@@ -35,7 +35,7 @@
 - (void)dealloc
 {
   RELEASE (path);
-  RELEASE (relativePath);  
+  RELEASE (relativePath);
   RELEASE (name);  
   RELEASE (attributes);  
   RELEASE (fileType);
@@ -70,13 +70,16 @@
   self = [super init];
     
   if (self) {
+    NSString *lastPathComponent;
+    
     fsnodeRep = [FSNodeRep sharedInstance];
     fm = [NSFileManager defaultManager];
     ws = [NSWorkspace sharedWorkspace];
     
     parent = aparent;
     ASSIGN (relativePath, rpath);
-    ASSIGN (name, [relativePath lastPathComponent]);
+    lastPathComponent = [[relativePath lastPathComponent] retain];
+    name = nil;
     
     if (parent) {
       NSString *parentPath = [parent path];
@@ -85,12 +88,10 @@
         parentPath = @"";
       }
       ASSIGN (path, ([NSString stringWithFormat: @"%@%@%@", 
-                                      parentPath, path_separator(), name]));
+                                      parentPath, path_separator(), 
lastPathComponent]));
     } else {
       ASSIGN (path, relativePath);
     }
-    ASSIGN (name, NSLocalizedStringFromTableInBundle(name, nil, [NSBundle 
bundleForClass:[self class]], @""));
-
         
     flags.readable = -1;
     flags.writable = -1;
@@ -124,6 +125,14 @@
                                       
     attributes = [fm fileAttributesAtPath: path traverseLink: NO];
     RETAIN (attributes);
+
+    /* we localize only directories which could be special */
+    if ([self isDirectory])
+      ASSIGN (name, NSLocalizedStringFromTableInBundle(lastPathComponent, nil, 
[NSBundle bundleForClass:[self class]], @""));
+    else
+      ASSIGN (name, lastPathComponent);
+    
+    [lastPathComponent release];
   }
     
   return self;


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to