summaryrefslogtreecommitdiff
path: root/library/config.cpp
authorkergoth <kergoth>2002-06-07 18:53:14 (UTC)
committer kergoth <kergoth>2002-06-07 18:53:14 (UTC)
commit640d964cfdc7467f6cacb513087cd3acda2c04f0 (patch) (unidiff)
tree9a784686c1795f8b1f81eb344598f3b549d43467 /library/config.cpp
parentdfb9c76738bb68e235114c5ad43dbd26a59b98ab (diff)
downloadopie-640d964cfdc7467f6cacb513087cd3acda2c04f0.zip
opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.gz
opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.bz2
Backing out unintentional merge from TT branch.
Diffstat (limited to 'library/config.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/config.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/library/config.cpp b/library/config.cpp
index 9634571..e07eecb 100644
--- a/library/config.cpp
+++ b/library/config.cpp
@@ -24,25 +24,27 @@
24#include <qmessagebox.h> 24#include <qmessagebox.h>
25#if QT_VERSION <= 230 && defined(QT_NO_CODECS) 25#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
26#include <qtextcodec.h> 26#include <qtextcodec.h>
27#endif 27#endif
28#include <qtextstream.h> 28#include <qtextstream.h>
29 29
30#include <sys/stat.h> 30#include <sys/stat.h>
31#include <sys/types.h> 31#include <sys/types.h>
32#include <fcntl.h> 32#include <fcntl.h>
33#include <stdlib.h> 33#include <stdlib.h>
34#include <unistd.h> 34#include <unistd.h>
35 35
36#define QTOPIA_INTERNAL_LANGLIST
36#include "config.h" 37#include "config.h"
38#include "global.h"
37 39
38 40
39/*! 41/*!
40 \internal 42 \internal
41*/ 43*/
42QString Config::configFilename(const QString& name, Domain d) 44QString Config::configFilename(const QString& name, Domain d)
43{ 45{
44 switch (d) { 46 switch (d) {
45 case File: 47 case File:
46 return name; 48 return name;
47 case User: { 49 case User: {
48 QDir dir = (QString(getenv("HOME")) + "/Settings"); 50 QDir dir = (QString(getenv("HOME")) + "/Settings");
@@ -86,32 +88,27 @@ QString Config::configFilename(const QString& name, Domain d)
86 In the default Domain, \e User, 88 In the default Domain, \e User,
87 the configuration is user-specific. \a name should not contain "/" in 89 the configuration is user-specific. \a name should not contain "/" in
88 this case, and in general should be the name of the C++ class that is 90 this case, and in general should be the name of the C++ class that is
89 primarily responsible for maintaining the configuration. 91 primarily responsible for maintaining the configuration.
90 92
91 In the File Domain, \a name is an absolute filename. 93 In the File Domain, \a name is an absolute filename.
92*/ 94*/
93Config::Config( const QString &name, Domain domain ) 95Config::Config( const QString &name, Domain domain )
94 : filename( configFilename(name,domain) ) 96 : filename( configFilename(name,domain) )
95{ 97{
96 git = groups.end(); 98 git = groups.end();
97 read(); 99 read();
98 100 QStringList l = Global::languageList();
99 lang = getenv("LANG"); 101 lang = l[0];
100 int i = lang.find("."); 102 glang = l[1];
101 if ( i > 0 )
102 lang = lang.left( i );
103 i = lang.find( "_" );
104 if ( i > 0 )
105 glang = lang.left(i);
106} 103}
107 104
108/*! 105/*!
109 Writes any changes to disk and destroys the in-memory object. 106 Writes any changes to disk and destroys the in-memory object.
110*/ 107*/
111Config::~Config() 108Config::~Config()
112{ 109{
113 if ( changed ) 110 if ( changed )
114 write(); 111 write();
115} 112}
116 113
117/*! 114/*!