[PATCH] auto-completing URLs on Ctrl-Enter

Tony tonys111 at comcast.net
Sat Feb 4 17:33:37 GMT 2006


Thiago Macieira wrote:
> 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.
>
>   
Ooops. Fixed.

-Tony


-------------- next part --------------
A non-text attachment was scrubbed...
Name: konq_combo-autowrap.4.diff
Type: text/x-patch
Size: 2915 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060204/21ef8631/attachment.bin>


More information about the kfm-devel mailing list