From kde-commits Thu Feb 28 23:39:51 2013 From: Patrick Spendrin Date: Thu, 28 Feb 2013 23:39:51 +0000 To: kde-commits Subject: [emerge/kde-4.10] portage/kdesupport/akonadi: make akonadi build and also provide sensible pathes in Message-Id: <20130228233951.0488BA604F () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=136209480729941 Git commit 2d4f3d6b1a762ad6817fd1c08a521ec86a6460c0 by Patrick Spendrin. Committed on 01/03/2013 at 00:39. Pushed by sengels into branch 'kde-4.10'. make akonadi build and also provide sensible pathes in case nothing is in t= he kde.conf M +39 -19 portage/kdesupport/akonadi/akonadi-kde.conf-fix.diff http://commits.kde.org/emerge/2d4f3d6b1a762ad6817fd1c08a521ec86a6460c0 diff --git a/portage/kdesupport/akonadi/akonadi-kde.conf-fix.diff b/portage= /kdesupport/akonadi/akonadi-kde.conf-fix.diff index 5cd3e59..f7a4f49 100644 --- a/portage/kdesupport/akonadi/akonadi-kde.conf-fix.diff +++ b/portage/kdesupport/akonadi/akonadi-kde.conf-fix.diff @@ -1,16 +1,16 @@ -diff --git a/libs/xdgbasedirs.cpp b/libs/xdgbasedirs.cpp -index acc316b..bb2a334 100644 ---- a/libs/xdgbasedirs.cpp -+++ b/libs/xdgbasedirs.cpp -@@ -27,6 +27,7 @@ +diff -Nru -x '*~' akonadi-1.9.0.orig/libs/xdgbasedirs.cpp akonadi-1.9.0/li= bs/xdgbasedirs.cpp +--- akonadi-1.9.0.orig/libs/xdgbasedirs.cpp 2012-12-23 11:11:44.000000000 = +0100 ++++ akonadi-1.9.0/libs/xdgbasedirs.cpp 2013-03-01 00:37:01.292466300 +0100 +@@ -27,6 +27,8 @@ #include #include #include +#include ++#include = #include = -@@ -38,6 +39,10 @@ +@@ -38,6 +40,10 @@ # endif #endif = @@ -21,7 +21,7 @@ index acc316b..bb2a334 100644 static QStringList alternateExecPaths( const QString& path ) { QStringList pathList; -@@ -62,6 +67,53 @@ static QStringList splitPathList( const QString &pathLi= st ) +@@ -62,6 +68,57 @@ #endif } = @@ -40,12 +40,12 @@ index acc316b..bb2a334 100644 +QString expandEnvironmentVariables(const QString& str) +{ + static QMap envVars =3D getEnvironment(); -+ static QRegExp possibleVars("((\\{|%)(\\w+)(\\}|%))"); ++ static QRegExp possibleVars(QLatin1String("((\\{|%)(\\w+)(\\}|%))")); + QString ret =3D str; + while(possibleVars.indexIn(ret) !=3D -1) + { + QStringList caps =3D possibleVars.capturedTexts(); -+ if(caps[2] =3D=3D "{") ++ if(caps[2] =3D=3D QLatin1String("{")) + { + ret.replace(QLatin1String("$") + caps[1], envVars[caps[3]]); + } @@ -65,17 +65,21 @@ index acc316b..bb2a334 100644 + GetModuleFileNameW(NULL, wPath, MAX_PATH); + QString kdeconfPath =3D QString::fromUtf16((const ushort *) wPath); + kdeconfPath =3D kdeconfPath.left(kdeconfPath.lastIndexOf(QLatin1Char(= '\\'))).replace(QLatin1Char('\\'), QLatin1Char('/')); -+ if(QFile::exists(kdeconfPath + QString::fromLatin1("/kde.conf"))) { ++ if(QFile::exists(kdeconfPath + QString::fromLatin1("/kde.conf"))) ++ { + return new QSettings(kdeconfPath + QString::fromLatin1("/kde.conf= "), QSettings::IniFormat); ++ } + else ++ { + return 0; ++ } +} +#endif + namespace Akonadi { = class XdgBaseDirsPrivate -@@ -111,9 +163,23 @@ XdgBaseDirs::~XdgBaseDirs() +@@ -111,9 +168,25 @@ = QString XdgBaseDirs::homePath( const char *resource ) { @@ -89,7 +93,9 @@ index acc316b..bb2a334 100644 + if(kdeconf) { + kdeconf->beginGroup(QLatin1String("XDG")); + if(kdeconf->childKeys().contains(QLatin1String("XDG_DATA_HOME"))) -+ instance()->mDataHome =3D expandEnvironmentVariables(kdeconf->= value(QLatin1String("XDG_DATA_HOME")).toString()); ++ instance()->mDataHome =3D expandEnvironmentVariables(kdeconf->= value(QLatin1String("XDG_DATA_HOME")).toString()) + QLatin1String("/.local/= share"); ++ else ++ instance()->mDataHome =3D instance()->homePath( "XDG_DATA_HOME= ", ".local/share" ); + kdeconf->endGroup(); + } else { +#else @@ -100,7 +106,7 @@ index acc316b..bb2a334 100644 #ifdef Q_OS_WINCE WIN32_FIND_DATA lpwFlashCard; if ( FindFirstFlashCard( &lpwFlashCard ) !=3D INVALID_HANDLE_VALUE = ) { -@@ -125,7 +191,18 @@ QString XdgBaseDirs::homePath( const char *resource ) +@@ -125,7 +198,20 @@ return instance()->mDataHome; } else if ( qstrncmp( "config", resource, 6 ) =3D=3D 0 ) { if ( instance()->mConfigHome.isEmpty() ) { @@ -109,7 +115,9 @@ index acc316b..bb2a334 100644 + if(kdeconf) { + kdeconf->beginGroup(QLatin1String("XDG")); + if(kdeconf->childKeys().contains(QLatin1String("XDG_CONFIG_HOME"= ))) -+ instance()->mDataHome =3D expandEnvironmentVariables(kdeconf->= value(QLatin1String("XDG_CONFIG_HOME")).toString()); ++ instance()->mDataHome =3D expandEnvironmentVariables(kdeconf->= value(QLatin1String("XDG_CONFIG_HOME")).toString()) + QLatin1String("/.conf= ig"); ++ else ++ instance()->mConfigHome =3D instance()->homePath( "XDG_CONFIG_= HOME", ".config" ); + kdeconf->endGroup(); + } else { +#else @@ -120,7 +128,7 @@ index acc316b..bb2a334 100644 } return instance()->mConfigHome; } -@@ -135,13 +212,24 @@ QString XdgBaseDirs::homePath( const char *resource ) +@@ -135,13 +221,30 @@ = QStringList XdgBaseDirs::systemPathList( const char *resource ) { @@ -137,8 +145,14 @@ index acc316b..bb2a334 100644 + QStringList dataDirs; + if(kdeconf) { + kdeconf->beginGroup(QLatin1String("XDG")); -+ if(kdeconf->childKeys().contains(QLatin1String("XDG_DATA_DIRS"))) ++ if(kdeconf->childKeys().contains(QLatin1String("XDG_DATA_DIRS")))= { + dataDirs =3D instance()->systemPathList( "XDG_DATA_DIRS", expan= dEnvironmentVariables(kdeconf->value(QLatin1String("XDG_DATA_DIRS")).toStri= ng()).toLocal8Bit().constData() ); ++ } else { ++ QDir dir( QCoreApplication::applicationDirPath() ); ++ dir.cdUp(); ++ const QString defaultPathList =3D dir.absoluteFilePath( QLatin1= String( "share" ) ); ++ dataDirs =3D instance()->systemPathList( "XDG_DATA_DIRS", defau= ltPathList.toLocal8Bit().constData() ); ++ } + kdeconf->endGroup(); + } else { + QDir dir( QCoreApplication::applicationDirPath() ); @@ -149,7 +163,7 @@ index acc316b..bb2a334 100644 #else QStringList dataDirs =3D instance()->systemPathList( "XDG_DATA_DIRS= ", "/usr/local/share:/usr/share" ); #endif -@@ -193,10 +281,18 @@ QStringList XdgBaseDirs::systemPathList( const char = *resource ) +@@ -193,10 +296,24 @@ } else if ( qstrncmp( "config", resource, 6 ) =3D=3D 0 ) { if ( instance()->mConfigDirs.isEmpty() ) { #ifdef Q_OS_WIN @@ -160,8 +174,14 @@ index acc316b..bb2a334 100644 + QStringList configDirs; + if(kdeconf) { + kdeconf->beginGroup(QLatin1String("XDG")); -+ if(kdeconf->childKeys().contains(QLatin1String("XDG_CONFIG_DIRS")= )) -+ configDirs =3D instance()->systemPathList( "XDG_CONFIG_DIRS", e= xpandEnvironmentVariables(kdeconf->value(QLatin1String("XDG_CONFIG_DIRS")).= toString()).toLocal8Bit().constData() ); ++ if(kdeconf->childKeys().contains(QLatin1String("XDG_CONFIG_DIRS")= )) { ++ configDirs =3D instance()->systemPathList( "XDG_CONFIG_DIRS",= expandEnvironmentVariables(kdeconf->value(QLatin1String("XDG_CONFIG_DIRS")= ).toString()).toLocal8Bit().constData() ); ++ } else { ++ QDir dir( QCoreApplication::applicationDirPath() ); ++ dir.cdUp(); ++ const QString defaultPathList =3D dir.absoluteFilePath( QLati= n1String( "etc" ) ) + QLatin1Char( ';' ) + dir.absoluteFilePath( QLatin1Str= ing( "share/config" ) ); ++ configDirs =3D instance()->systemPathList( "XDG_CONFIG_DIRS",= defaultPathList.toLocal8Bit().constData() ); ++ } + kdeconf->endGroup(); + } else { + QDir dir( QCoreApplication::applicationDirPath() );