/* Copyright 2007 Pino Toscano Copyright 2007-2008 Anne-Marie Mahfouf This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //project headers #include "langutils.h" #include "prefs.h" #include #include #include #include #include bool LangUtils::hasSpecialChars(const QString& lang) { if (lang== "cs" || lang== "da" || lang== "sk" || lang== "es" || lang== "de" || lang== "hu" || lang== "nds") return true; return false; } bool LangUtils::isIndian(const QString& lang) { if (lang == "kn" || lang == "ml" || lang == "te" || lang == "pa") return true; return false; } QStringList LangUtils::getLanguages() { QStringList m_languages; m_languages.clear(); //the program scans in klettres/data/ to see what languages data is found const QStringList mdirs = KGlobal::dirs()->findDirs("data", "klettres/"); //if (mdirs.isEmpty()) return NULL; for (QStringList::const_iterator it =mdirs.constBegin(); it !=mdirs.constEnd(); ++it ) { QDir dir(*it); m_languages += dir.entryList(QDir::Dirs, QDir::Name); m_languages.removeAll("."); m_languages.removeAll(".."); } m_languages.removeAll("pics"); m_languages.removeAll("data"); m_languages.removeAll("icons"); m_languages.sort(); //find duplicated entries in KDEDIR and KDEHOME QStringList temp_languages; for (int i=0; i1) { temp_languages.append(m_languages[i]); m_languages.removeAll(m_languages[i]); } for (int i=0; i