lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

patch Qt 5.4.1 to use XDG_CONFIG_DIRS in QSettings

+43
+42
pkgs/development/libraries/qt-5/5.4/0013-xdg_config_dirs.patch
··· 1 + diff --git a/qsettings.cpp b/qsettings.cpp 2 + index 35b3ed4..210dfeb 100644 3 + --- a/qsettings.cpp 4 + +++ b/qtbase/src/corelib/io/qsettings.cpp 5 + @@ -1174,6 +1174,24 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, 6 + if (!application.isEmpty()) 7 + confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false)); 8 + confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false)); 9 + + 10 + +#if !defined(Q_OS_WIN) 11 + + // Add directories specified in $XDG_CONFIG_DIRS 12 + + const QString pathEnv = QString::fromLocal8Bit(getenv("XDG_CONFIG_DIRS")); 13 + + if (!pathEnv.isEmpty()) { 14 + + const QStringList pathEntries = pathEnv.split(QLatin1Char(':'), QString::SkipEmptyParts); 15 + + if (!pathEntries.isEmpty()) { 16 + + int j = 4; // This is the number of confFiles set above -- we need to start adding $XDG_CONFIG_DIRS after those. 17 + + for (int k = 0; k < pathEntries.size() && j < NumConfFiles - 1; ++k) { 18 + + const QString& path = pathEntries.at(k); 19 + + if (!application.isEmpty()) 20 + + confFiles[j++].reset(QConfFile::fromName(path + QDir::separator() + appFile, false)); 21 + + confFiles[j++].reset(QConfFile::fromName(path + QDir::separator() + orgFile, false)); 22 + + } 23 + + } 24 + + } 25 + +#endif 26 + + 27 + #else 28 + QString confName = getPath(format, QSettings::UserScope) + org; 29 + if (!application.isEmpty()) 30 + diff --git a/qsettings_p.h b/qsettings_p.h 31 + index a28b583..b2a240d 100644 32 + --- a/qsettings_p.h 33 + +++ b/qtbase/src/corelib/io/qsettings_p.h 34 + @@ -244,7 +244,7 @@ public: 35 + F_Organization = 0x1, 36 + F_User = 0x0, 37 + F_System = 0x2, 38 + - NumConfFiles = 4 39 + + NumConfFiles = 40 // HACK: increase NumConfFiles from 4 to 40 in order to accommodate more paths in $XDG_CONFIG_DIRS -- ellis 40 + #else 41 + SandboxConfFile = 0, 42 + NumConfFiles = 1
+1
pkgs/development/libraries/qt-5/5.4/qtbase.nix
··· 67 67 (substituteAll { src = ./0010-dlopen-libXcursor.patch; inherit libXcursor; }) 68 68 (substituteAll { src = ./0011-dlopen-openssl.patch; inherit openssl; }) 69 69 (substituteAll { src = ./0012-dlopen-dbus.patch; dbus_libs = dbus; }) 70 + ./0013-xdg_config_dirs.patch 70 71 ]; 71 72 72 73 preConfigure = ''