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

List:       kde-devel
Subject:    Re: [PATCH] Bug 113177: Trim whitespace for "open selection as URL"
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-06-04 19:48:33
Message-ID: 200706042148.40414.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Andreas Hartmetz wrote:
>> > +    url.replace(QRegExp("[\\ ]*\\n+[\\ ]*"),"");
>
>How about
>url = url.trimmed();
>?
>
>Faster, easier, safer. C++ is, fortunately, not Perl x)
>
>Good catch by the way. I've had to redo a selection to make konqueror
>recognize an URL more than once.

I thought the same thing when I read the email first, but that's not what 
the regexp is doing.

It's removing any newlines, including the spaces around it, wherever they 
are located (including the middle of the string).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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