[Patch] fix compile kdecore with msvc

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Sun Oct 30 09:14:31 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thiago Macieira schrieb:
>>* there is imho no need to export KResolverResults because nobody
>>derivates a class from KResolverResults. And if you really want to
>>export this class, you have to implement all functions QList<T> defines
>>because otherwise when someone wants to use a function you forgot to
>>implement he will get a linker error.
> 
> 
> Your argument doesn't make sense. Functions that were not overridden will 
> be inherited from QList<T>.

You're wrong. It's true for simple types but not for classes. Try to
compile this piece of code:

- --------------------8<------------------
#include <QList>

struct testStruct {
	int iFirst;
	int iSecond;
};

int main(int argc, char *argv[])
{
    QList<int> t1, t2;
    QList<testStruct> s1, s2;

    if ( t1 == t2 )
        qDebug("t1 == t2");
    if ( s1 == s2 )
        qDebug("s1 == s2");
	return 1;
}
- --------------------8<------------------
gcc will fail here (so it's  not only the stupid msvc-compiler).
Providing "bool QList<testStruct >::operator==(const QList<testStruct
>&)" doesn't help much because of QList<T>::toSet() and
QList<T>::fromSet() - you have to provide a class "KResolverResultSet :
public QSet<KResolverEntry>" too (and maybe mroe - didn't go deeper).

Christian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDZI73nNKwkgf+zVMRAhZ1AJ9T8FuT+VAZZeOkiCNxHAGvdbrikQCeNSHz
pfactN9VfBn0Oomnj68a3xk=
=vCM9
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list