From kde-commits Wed Nov 24 04:16:38 2010 From: Kurt Hindenburg Date: Wed, 24 Nov 2010 04:16:38 +0000 To: kde-commits Subject: KDE/kdelibs/kdecore Message-Id: <20101124041638.0DF9BAC8A2 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129057224711999 SVN commit 1200158 by hindenburg: Patch to allow building on the Mac. Patch by John Layt M +1 -1 kernel/kkernel_mac.cpp M +7 -0 kernel/kkernel_mac.h M +3 -2 localization/klocale_mac.cpp --- trunk/KDE/kdelibs/kdecore/kernel/kkernel_mac.cpp #1200157:1200158 @@ -51,7 +51,7 @@ qAppFileName() is not public in qt4/mac, so we need to redo it here */ -static QString convert_CFString_to_QString(CFStringRef str) { +QString convert_CFString_to_QString(CFStringRef str) { CFIndex length = CFStringGetLength(str); const UniChar *chars = CFStringGetCharactersPtr(str); if (chars) --- trunk/KDE/kdelibs/kdecore/kernel/kkernel_mac.h #1200157:1200158 @@ -26,6 +26,8 @@ #include #include +#include + /** * @short Mac-specific functions needed in kdecore * @author Benjamin Reed @@ -34,6 +36,11 @@ * are needed to work around OS issues. */ +/** + * Convert a CFString to a QString. + * Don't export, is for internal kdelibs use only. + */ +QString convert_CFString_to_QString(CFStringRef str); /** * Fork and reexec to work around CoreFoundation issues. --- trunk/KDE/kdelibs/kdecore/localization/klocale_mac.cpp #1200157:1200158 @@ -18,6 +18,7 @@ */ #include "klocale_mac_p.h" +#include "kkernel_mac.h" KLocaleMacPrivate::KLocaleMacPrivate( KLocale *q_ptr, const QString &catalog, KConfig *config, const QString &language, const QString &country ) @@ -48,7 +49,7 @@ QString KLocaleMacPrivate::macLocaleValue( CFStringRef key ) const { - return QCFString::toQString( CFStringRef( CFLocaleGetValue( m_macLocale, key ) ) ); + return convert_CFString_to_QString( CFStringRef( CFLocaleGetValue( m_macLocale, key ) ) ); } QString KLocaleMacPrivate::systemCountry() const @@ -68,7 +69,7 @@ QString KLocaleMacPrivate::macDateFormatterValue(CFStringRef key) const { CFDateFormatterRef formatter = CFDateFormatterCreate(kCFAllocatorDefault, m_macLocale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle); - return QCFString::toQString(CFStringRef(CFDateFormatterCopyProperty(formatter, key))); + return convert_CFString_to_QString(CFStringRef(CFDateFormatterCopyProperty(formatter, key))); } void KLocaleMacPrivate::initDayPeriods(const KConfigGroup &cg)