| 1 | --- core/libs/dimg/filters/icc/iccprofile.cpp.orig |
| 2 | +++ core/libs/dimg/filters/icc/iccprofile.cpp |
| 3 | @@ -489,7 +489,39 @@ |
| 4 | #ifdef Q_WS_WIN |
| 5 | //TODO |
| 6 | #elif defined (Q_WS_MAC) |
| 7 | - //TODO |
| 8 | + // RJVB 20140620: use a scheme highly identical to the Linux scheme, adapted for MacPorts in /opt/local and the OS X standard ColorSync directories |
| 9 | + |
| 10 | + candidates << "/System/Library/ColorSync/Profiles"; |
| 11 | + candidates << "/Library/ColorSync/Profiles"; |
| 12 | + candidates << QDir::homePath() + "/Library/ColorSync/Profiles"; |
| 13 | + |
| 14 | + // MacPorts installs for KDE, so we include the XDG data dirs, including /usr/share/color/icc |
| 15 | + QStringList dataDirs = QString::fromLocal8Bit(getenv("XDG_DATA_DIRS")).split(':', QString::SkipEmptyParts); |
| 16 | + |
| 17 | + if (!dataDirs.contains(QLatin1String("/opt/local/share"))) |
| 18 | + { |
| 19 | + dataDirs << "/opt/local/share"; |
| 20 | + } |
| 21 | + |
| 22 | + foreach(const QString& dataDir, dataDirs) |
| 23 | + { |
| 24 | + candidates << dataDir + "/color/icc"; |
| 25 | + } |
| 26 | + |
| 27 | + // XDG_DATA_HOME |
| 28 | + QString dataHomeDir = QString::fromLocal8Bit(getenv("XDG_DATA_HOME")); |
| 29 | + |
| 30 | + if (!dataHomeDir.isEmpty()) |
| 31 | + { |
| 32 | + candidates << dataHomeDir + "/color/icc"; |
| 33 | + candidates << dataHomeDir + "/icc"; |
| 34 | + } |
| 35 | + |
| 36 | + // home dir directories |
| 37 | + candidates << QDir::homePath() + "/.local/share/color/icc/"; |
| 38 | + candidates << QDir::homePath() + "/.local/share/icc/"; |
| 39 | + candidates << QDir::homePath() + "/.color/icc/"; |
| 40 | + |
| 41 | #else |
| 42 | |
| 43 | // XDG data dirs, including /usr/share/color/icc |
| 44 | --- core/utilities/setup/setupicc.cpp.orig |
| 45 | +++ core/utilities/setup/setupicc.cpp |
| 46 | @@ -901,6 +901,25 @@ |
| 47 | existingPaths = defaultSearchPaths.join("</li><li>"); |
| 48 | } |
| 49 | |
| 50 | +#ifdef Q_WS_WIN |
| 51 | + //TODO |
| 52 | +#elif defined (Q_WS_MAC) |
| 53 | + QString text = i18n("On Mac OS X, the default search paths include " |
| 54 | + "<ul>" |
| 55 | + "<li>/System/Library/ColorSync/Profiles</li>" |
| 56 | + "<li>/Library/ColorSync/Profiles</li>" |
| 57 | + "<li>~/Library/ColorSync/Profiles</li>" |
| 58 | + "<li>/opt/local/share/color/icc</li>" |
| 59 | + "<li>~/.local/share/color/icc/</li>" |
| 60 | + "<li>~/.local/share/icc/</li>" |
| 61 | + "<li>~/.color/icc/</li>" |
| 62 | + "</ul>" |
| 63 | + "On your system, currently these paths exist and are scanned:" |
| 64 | + "<ul>" |
| 65 | + "<li>%1</li>" |
| 66 | + "</ul>", |
| 67 | + existingPaths); |
| 68 | +#else |
| 69 | QString text = i18n("On Linux, the default search paths include " |
| 70 | "<ul>" |
| 71 | "<li>/usr/share/color/icc</li>" |
| 72 | @@ -914,6 +933,7 @@ |
| 73 | "<li>%1</li>" |
| 74 | "</ul>", |
| 75 | existingPaths); |
| 76 | +#endif |
| 77 | QWhatsThis::showText(d->iccFolderLabel->mapToGlobal(QPoint(0, 0)), text, d->iccFolderLabel); |
| 78 | } |
| 79 | |