[Fwd: KConfig on windows/msvc]

Jarosław Staniek js at iidea.pl
Tue Oct 30 09:04:30 GMT 2007


Hello
I am forwarding a post I've sent to Marc Mutz who I met in Berlin last weekend 
at KOffice meeting; he was helpful before with fixing of gpgme++ compilation.

The patch attached is only to get idea what I currently needed to use in 
ordetr to get working environment at the KOffice meeting. You can focus on my 
decription below on compile errors I encounter and what easy fixes I've tried.
Hopefully another easy can be added KConfigGroup::readListCheck().

-------- Original Message --------
Subject: KConfig on windows/msvc
Date: Mon, 29 Oct 2007 18:53:17 +0100
From: Jarosław Staniek <js at iidea.pl>
Organization: OpenOffice Polska
To: marc at kdab.net


Marc,
I am referring to our dicussion in Berlin last weekend about msvc 2k3(sp1)
templates and my problem in KConfig.
I've attached (very temporary) patch which break source compatibility ;(


If you have any hints, I'd be extremely grateful to you for your help.

Without any patch the following error appears:

[  0%] Building CXX object kdecore/CMakeFiles/kdecore.dir/config/kconfig.obj
kconfig.cpp
f:\kde4\trunk\kde\kdelibs\kdecore\config\kconfiggroup.h(172) : fatal error
C1001: INTERNAL COMPILER ERROR
                  (compiler file
'f:\vs70builds\6030\vc\Compiler\Utc\src\P2\main.c', line 148)

Then, I've fixed this by changing readEntry() to readListCheck() in line 172
and 169 (see [1]).

Then I got this error:

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)

Apparently, conversion from QVariant to T is a problem. Using value<T> does
not help.

	template<class T>
	T KConfigGroup::readListCheck(const QByteArray &key,
		const T&defaultValue) const
	{
		ConversionCheck::to_QVariant<T>();
  >>>>		return qvariant_cast<T>(readEntry(key,
			qVariantFromValue(defaultValue)));
	}



[1]
Index: kdecore/config/kconfiggroup.h
===================================================================
--- kdecore/config/kconfiggroup.h       (revision 730754)
+++ kdecore/config/kconfiggroup.h       (working copy)
@@ -166,10 +166,10 @@
               { return readListCheck(key, defaultValue); }
       template <typename T>
           T readEntry(const QString& pKey, const T& aDefault) const
-            { return readEntry(pKey.toUtf8(), aDefault); }
+            { return readListCheck(pKey.toUtf8(), aDefault); }
       template <typename T>
           T readEntry(const char *key, const T& aDefault) const
-            { return readEntry(QByteArray(key), aDefault); }
+            { return readListCheck(QByteArray(key), aDefault); }

       QString readEntry(const QByteArray &key, const char * aDefault = 0) const;
       QString readEntry(const QString &key, const char * aDefault = 0) const;



-- 
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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kdecore_config2.patch
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071030/76c99736/attachment.ksh>


More information about the kde-core-devel mailing list