[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/kioslave/man
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2005-07-30 20:41:43
Message-ID: 1122756103.179277.27040.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 440565 by goutte:

Use QByteArray instead of QString as we do not know the encoding, so we must be
encoding-neutral.
(This cannot be backported as is to Qt3. Tested only with SIMPLE_MAN2HTML.)


 M  +13 -10    man2html.cpp  


--- trunk/KDE/kdebase/kioslave/man/man2html.cpp #440564:440565
@@ -821,13 +821,12 @@
 		}
 		if (isalnum(*h)) {
 		    char t,sec, *e;
-                    QString subsec; // ### TODO avoid using QString, as we do not \
                know the encoding
-                    QString fstr(f); // ### TODO avoid using QString, as we do not \
know the encoding +                    QByteArray fstr(f);
 		    e=h+1;
 		    sec=f[1];
-		    subsec=f[2];
-		    int index = fstr.find(')', 2);
-		    if (index != -1)
+		    const int index = fstr.find(')', 2);
+                    QByteArray subsec;
+                    if (index != -1)
 		      subsec = fstr.mid(2, index - 2);
 		    else // No closing ')' found, take first character as subsection.
 		      subsec = fstr.mid(2, 1);
@@ -840,11 +839,15 @@
 		    *h=t;
 		    t=*e;
 		    *e='\0';
-                    Q3CString str;
-		    if (subsec.isEmpty())
-                        str.sprintf("<A HREF=\"man:%s(%c)\">%s</A>", h, sec, h);
-		    else
-                        str.sprintf("<A HREF=\"man:%s(%c%s)\">%s</A>", h, sec, \
subsec.lower().latin1(), h); +                    QByteArray str("<a href=\"man:");
+                    str += h;
+                    str += "(";
+                    str += char( sec );
+                    if ( !subsec.isEmpty() )
+                        str += subsec.lower();
+                    str += ")\">";
+                    str += h;
+                    str += "</a>";
                     output_real(str.data());
 		    *e=t;
 		    c=e;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic