diff options
Diffstat (limited to 'scribus/scpaths.cpp')
| -rw-r--r-- | scribus/scpaths.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scribus/scpaths.cpp b/scribus/scpaths.cpp index 22b9753..40d79ba 100644 --- a/scribus/scpaths.cpp +++ b/scribus/scpaths.cpp @@ -252,6 +252,49 @@ QString ScPaths::dictDir() const return(m_shareDir + "dicts/"); } +QStringList ScPaths::spellDirs() const +{ + //dictionaryPaths + QString macPortsPath("/opt/local/share/hunspell/"); + QString finkPath("/sw/share/hunspell/"); + QString osxLibreOfficePath("/Applications/LibreOffice.app/Contents/share/extensions"); + QString osxUserLibreOfficePath(QDir::homePath()+"/Applications/LibreOffice.app/Contents/share/extensions"); + QString linuxLocalPath("/usr/local/share/hunspell/"); + QString linuxPath("/usr/share/hunspell/"); + QString windowsLOPath("LibreOffice 3.5/share/extensions"); + QDir d; + QStringList spellDirs; + spellDirs.append(m_shareDir + "dicts/spelling/"); +#ifdef Q_OS_MAC + //spellDirs.append(QDir::homePath() + "/Library/Fonts/"); + d.setPath(macPortsPath); + if (d.exists()) + spellDirs.append(macPortsPath); + d.setPath(finkPath); + if (d.exists()) + spellDirs.append(finkPath); + d.setPath(osxLibreOfficePath); + if (d.exists()) + spellDirs.append(osxLibreOfficePath); + d.setPath(osxUserLibreOfficePath); + if (d.exists()) + spellDirs.append(osxUserLibreOfficePath); +#elif defined(_WIN32) + QString progFiles = getSpecialDir(CSIDL_PROGRAM_FILES); + d.setPath(progFiles+windowsLOPath); + if (d.exists()) + spellDirs.append(progFiles+windowsLOPath); +#elif defined(Q_WS_X11) + d.setPath(linuxPath); + if (d.exists()) + spellDirs.append(linuxPath); + d.setPath(linuxLocalPath); + if (d.exists()) + spellDirs.append(linuxLocalPath); +#endif + return spellDirs; +} + QStringList ScPaths::getSystemFontDirs(void) { QStringList fontDirs; |
