[PATCH] auto-completing URLs on Ctrl-Enter

Thiago Macieira thiago at kde.org
Fri Feb 3 08:35:45 GMT 2006


Tony wrote:
>+        static QStringList suffixes;
>+        QStringList::const_iterator it;
>+
>+        if (!suffixes.count())
>+        {
>+            suffixes << ".com" << ".org" << ".net";
>+            suffixes += getExtraURLSuffixes();
>+        }

Don't do that. That isn't thread-safe at all.

Do it like this:
  static const QStringList suffixes = getExtraURLSuffixes();

getExtraURLSuffixes must return the full list. It's also const so that you 
don't modify it later by accident.

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

3. Ac seo woruld wearð geborod, swá se Scieppend cwæð "Gewurde Unix" and 
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060203/41f837d7/attachment.sig>


More information about the kfm-devel mailing list