QString::replace cleanup

Marc Mutz Marc.Mutz at uni-bielefeld.de
Sun Jul 13 10:32:24 BST 2003


On Saturday 12 July 2003 16:42, Zack Rusin wrote:
<snip>
> -  p.replace( QRegExp("/"), "_" );
> +  p.replace( "/", "_" );
<snip>

These should use the replace(QChar,QChar) overload, so make that
 p.replace( '/'. '_' );

> -         QRegExp re("%P");
> +         QString re("%P");

This seems unneccessary.

> -               points.replace(QRegExp(","), " ");
> +               points.replace(",", " ");
<snip>
> -               s.replace(QRegExp("-"),"_");
> +               s.replace("-","_");

See above

>                 points.replace(QRegExp("\r"), "");
>                 points.replace(QRegExp("\n"), "");

What about those? ;-)

> -               ent->m_args["rp"] = printer->device().path().replace(QRegExp("/"),QString::fromLatin1(""));
> +               ent->m_args["rp"] = printer->device().path().replace("/",QString::fromLatin1(""));

What about using remove( '/' ) here (and everywhere where "" is substituted)?

Marc

-- 
Military justice is to justice what military music is to music.
                                                  -- Groucho Marx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030713/e33f60ac/attachment.sig>


More information about the kde-core-devel mailing list