From fb98f5e1d6e4142ae1b7302ced455d8afb9d2cbb Mon Sep 17 00:00:00 2001 From: craig Date: Tue, 17 Apr 2012 21:39:33 +0000 Subject: Another hunspell backup..., works a bit better now git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17455 11d20701-8431-0410-a711-e3c959e3b870 --- scribus/scpaths.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'scribus/scpaths.cpp') 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; -- cgit