[patch] Re: kconfiggroup template 'mess'

Jarosław Staniek js at iidea.pl
Tue Oct 30 11:01:50 GMT 2007


Dirk Mueller said the following, On 2007-10-30 11:26:
> On Tuesday 30 October 2007, you wrote:
> 
> 
>> Dirk Mueller said the following, On 2007-10-30 09:06:
>>> On Thursday 25 October 2007, Jaroslaw Staniek wrote:
>>>> As Thiago and then I have mentioned - template/nontemplate versions of
>>>> function (here: readEntry/writeEntry) cannot be mixed. r721704 was a big
>>>> commit,
>>> does it work if you remove one of the overload variants, e.g. the one
>>> taking "const char*" as key or the one taking QString& as key?
>>>
>>> the const char* / QByteArray ones are workarounds from older times where
>>> we couldn't break source compatibility.
>> Dirk,
>> I've just tried this, and we have ambiguousity:
>>
>> [  0%] Building CXX object
>> kdecore/CMakeFiles/kdecore.dir/config/kconfig.obj kconfig.cpp
>> F:\kde4\trunk\KDE\kdelibs\kdecore\config\kconfig.cpp(287) : error C2668:
>> 'KConfigGroup::readEntry' : ambiguous call to o
>> verloaded function
>>          f:\kde4\trunk\KDE\kdelibs\kdecore\config\kconfiggroup.h(168):
>> could be 'T KConfigGroup::readEntry<QStringList>(c
>> onst QString &,const T &) const'
>>          with
>>          [
>>              T=QStringList
>>          ]
>>          f:\kde4\trunk\KDE\kdelibs\kdecore\config\kconfiggroup.h(492): or
>>    'QStringList KConfigGroup::readEntry<QStr
>> ingList>(const QByteArray &,const QStringList &) const'
>>          while trying to match the argument list '(const char [12],
>> QStringList)'
> 
> try removing the qstring one then as well. 


Thanks for response,
Removing QString overloads as well and thus leaving only QByteArray may be a 
good thing (although QString arg have to be cated to byte array in KDE code).

Again, we are encountering the same remaining problem with QVariant as before:

f:\kde4\trunk\kde\kdelibs\kdecore\config\kconfiggroup.h(500) : fatal error 
C1001: INTERNAL COMPILER ERROR
                 (compiler file 
'f:\vs70builds\6030\vc\Compiler\Utc\src\P2\main.c', line 148)
  Please choose the Technical Support command on the Visual C++
  Help menu, or open the Technical Support help file for more information


 > or change the
> 
>  "update_info"
> 
> into 
> 
> QLatin1String("update_info")

Requiring explicit cast to QString in all the KDE code is not as convenient, I 
am afraid...

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi.pl/en, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org




More information about the kde-core-devel mailing list