Diffstat (limited to 'development/translation/shared/opie.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | development/translation/shared/opie.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/development/translation/shared/opie.cpp b/development/translation/shared/opie.cpp new file mode 100644 index 0000000..c5c72d1 --- a/dev/null +++ b/development/translation/shared/opie.cpp | |||
@@ -0,0 +1,40 @@ | |||
1 | #include <stdlib.h> | ||
2 | |||
3 | #include <qdir.h> | ||
4 | |||
5 | #include "opie.h" | ||
6 | |||
7 | OPIE* OPIE::m_self = 0; | ||
8 | |||
9 | |||
10 | OPIE::OPIE() { | ||
11 | } | ||
12 | OPIE::~OPIE() { | ||
13 | } | ||
14 | OPIE* OPIE::self() { | ||
15 | if (!m_self ) m_self = new OPIE; | ||
16 | return m_self; | ||
17 | } | ||
18 | QStringList OPIE::languageList( const QString& _opieDir )const { | ||
19 | QString opieDi = opieDir( _opieDir ); | ||
20 | |||
21 | QStringList langs; | ||
22 | QDir dir( opieDi + "/i18n/"); | ||
23 | if (!dir.exists() ) return langs; | ||
24 | langs = dir.entryList( QDir::Dirs ); | ||
25 | |||
26 | langs.remove("CVS"); // hey this no language | ||
27 | langs.remove("unmaintained"); // remove this one too | ||
28 | langs.remove("."); | ||
29 | langs.remove(".."); | ||
30 | |||
31 | |||
32 | |||
33 | return langs; | ||
34 | } | ||
35 | QString OPIE::opieDir( const QString& _opieDir ) const{ | ||
36 | if (!_opieDir.isEmpty() ) return _opieDir; | ||
37 | char* dir = ::getenv("OPIEDIR"); | ||
38 | if (!dir ) return QString::null; | ||
39 | return QString::fromLatin1(dir); | ||
40 | } | ||