OSDN Git Service

Remove a grossly heuristic list view hack.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 9 Oct 2012 12:23:09 +0000 (13:23 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 9 Oct 2012 12:23:09 +0000 (13:23 +0100)
ChangeLog
src/pkglist.cpp

index add16c9..c6bd290 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-10-09  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Remove a grossly heuristic list view hack.
+
+       * src/pkglist.cpp (pkgListViewMaker::GetTitle): Remove code for the
+       heuristic deletion of any redundant package name prefixes from package
+       title attributes; by now, all such prefixes should have been removed
+       from the catalogue, explicitly, at source.
+
 2012-10-08  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Implement GUI list view compiler for XML catalogue.
index c22d6f8..d96314a 100644 (file)
@@ -260,41 +260,12 @@ char *pkgListViewMaker::GetTitle( pkgXmlNode *pkg, const pkgXmlNode *xml_root )
      */
     const char *title;
     if( (title = desc->GetPropVal( title_key, NULL )) != NULL )
-    {
-      /* As soon as we find a description element with an
-       * assigned title attribute...
-       */
-#if 0
-      /* ...and noting that some package descriptions may
-       * redundantly respecify the package name as a colon
-       * delimited prefix to this title attribute...
-       *
-       * FIXME: ultimately, I'd like to remove this hack;
-       * package descriptions have no need to redundantly
-       * specify the package name as a prefix to the title,
-       * (since mingw-get can retrieve it from the package
-       * element containing the description anyway), and
-       * package maintainers should not rely on this
-       * hack to clean up the redundancy.
-       */
-      for( const char *prefix = title; *prefix != '\0'; prefix++ )
-       if( *prefix == ':' )
-       {
-         /* ...we strip that redundant prefix away...
-          */
-         title = ++prefix;
-         prefix = "";
-       }
-      /* ...then trim away any leading white space...
-       */
-      while( isspace( *title ) )
-       ++title;
-#endif
-      /* ...before immediately returning the title, (with the
-       * required cast to non-const).
+      /*
+       * As soon as we find a description element with an
+       * assigned title attribute, immediately return it,
+       * (with the required cast to non-const).
        */
       return (char *)(title);
-    }
 
     /* If we haven't yet found any title attribute, check for any
      * further description elements at the current XML nesting level.