author | zecke <zecke> | 2003-04-20 17:24:50 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-20 17:24:50 (UTC) |
commit | 92c687d281f69085436a77efb8cd1d4d2d9333f8 (patch) (unidiff) | |
tree | 7bbfac3ea310ed140e78cb3c17f8219294cb61d0 /development/translation/shared/opie.cpp | |
parent | f1f4e6794507d9b8dafb46ce05968a0647a41777 (diff) | |
download | opie-92c687d281f69085436a77efb8cd1d4d2d9333f8.zip opie-92c687d281f69085436a77efb8cd1d4d2d9333f8.tar.gz opie-92c687d281f69085436a77efb8cd1d4d2d9333f8.tar.bz2 |
Initial revision
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 | } | ||