Diffstat (limited to 'noncore/apps/checkbook/cfg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/cfg.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/checkbook/cfg.cpp b/noncore/apps/checkbook/cfg.cpp index 24fa4cb..4f70593 100644 --- a/noncore/apps/checkbook/cfg.cpp +++ b/noncore/apps/checkbook/cfg.cpp | |||
@@ -28,24 +28,25 @@ | |||
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | 30 | ||
31 | #include <qwidget.h> | 31 | #include <qwidget.h> |
32 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
33 | 33 | ||
34 | #include "cfg.h" | 34 | #include "cfg.h" |
35 | 35 | ||
36 | // --- Cfg -------------------------------------------------------------------- | 36 | // --- Cfg -------------------------------------------------------------------- |
37 | Cfg::Cfg() | 37 | Cfg::Cfg() |
38 | { | 38 | { |
39 | _currencySymbol="$"; | 39 | _currencySymbol="$"; |
40 | _useSmallFont=TRUE; | ||
40 | _showLocks=FALSE; | 41 | _showLocks=FALSE; |
41 | _showBalances=FALSE; | 42 | _showBalances=FALSE; |
42 | _pCategories=new CategoryList(); | 43 | _pCategories=new CategoryList(); |
43 | _bDirty=false; | 44 | _bDirty=false; |
44 | } | 45 | } |
45 | 46 | ||
46 | // --- readStringList --------------------------------------------------------- | 47 | // --- readStringList --------------------------------------------------------- |
47 | // Reads the entries for the control from a configuration file and returns | 48 | // Reads the entries for the control from a configuration file and returns |
48 | // them in a StringList. Later this list can be used to create the control. It | 49 | // them in a StringList. Later this list can be used to create the control. It |
49 | // is assumed, that the group is already set. Key is used to enumerate the | 50 | // is assumed, that the group is already set. Key is used to enumerate the |
50 | // entries. | 51 | // entries. |
51 | void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst) | 52 | void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst) |
@@ -68,24 +69,25 @@ void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst) | |||
68 | 69 | ||
69 | 70 | ||
70 | // --- readConfig ------------------------------------------------------------- | 71 | // --- readConfig ------------------------------------------------------------- |
71 | // Reads the member data from the given config file. It will also set the group | 72 | // Reads the member data from the given config file. It will also set the group |
72 | // "Config" | 73 | // "Config" |
73 | void Cfg::readConfig(Config &config) | 74 | void Cfg::readConfig(Config &config) |
74 | { | 75 | { |
75 | // set group | 76 | // set group |
76 | config.setGroup( "Config" ); | 77 | config.setGroup( "Config" ); |
77 | 78 | ||
78 | // read scalars | 79 | // read scalars |
79 | _currencySymbol = config.readEntry( "CurrencySymbol", "$" ); | 80 | _currencySymbol = config.readEntry( "CurrencySymbol", "$" ); |
81 | _useSmallFont = config.readBoolEntry( "UseSmallFont", TRUE ); | ||
80 | _showLocks = config.readBoolEntry( "ShowLocks", FALSE ); | 82 | _showLocks = config.readBoolEntry( "ShowLocks", FALSE ); |
81 | _showBalances = config.readBoolEntry( "ShowBalances", FALSE ); | 83 | _showBalances = config.readBoolEntry( "ShowBalances", FALSE ); |
82 | _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE ); | 84 | _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE ); |
83 | _sLastBook = config.readEntry("LastBook", ""); | 85 | _sLastBook = config.readEntry("LastBook", ""); |
84 | _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE ); | 86 | _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE ); |
85 | _bSavePayees = config.readBoolEntry( "SavePayees", FALSE ); | 87 | _bSavePayees = config.readBoolEntry( "SavePayees", FALSE ); |
86 | 88 | ||
87 | // Account types | 89 | // Account types |
88 | readStringList(config, "AccType", _AccountTypes); | 90 | readStringList(config, "AccType", _AccountTypes); |
89 | if( _AccountTypes.isEmpty() ) { | 91 | if( _AccountTypes.isEmpty() ) { |
90 | _AccountTypes+= (const char *)QWidget::tr("Savings"); | 92 | _AccountTypes+= (const char *)QWidget::tr("Savings"); |
91 | _AccountTypes+= (const char *)QWidget::tr("Checking"); | 93 | _AccountTypes+= (const char *)QWidget::tr("Checking"); |
@@ -155,24 +157,25 @@ void Cfg::writeStringList(Config &cfg, const char *sKey, QStringList &lst) | |||
155 | 157 | ||
156 | 158 | ||
157 | // --- writeConfig ----------------------------------------------------------- | 159 | // --- writeConfig ----------------------------------------------------------- |
158 | // Writes all config data back to the config file. The group will be set to | 160 | // Writes all config data back to the config file. The group will be set to |
159 | // "Config" and the write be commited | 161 | // "Config" and the write be commited |
160 | void Cfg::writeConfig(Config &config) | 162 | void Cfg::writeConfig(Config &config) |
161 | { | 163 | { |
162 | // set the group | 164 | // set the group |
163 | config.setGroup( "Config" ); | 165 | config.setGroup( "Config" ); |
164 | 166 | ||
165 | // write scalars | 167 | // write scalars |
166 | config.writeEntry( "CurrencySymbol", _currencySymbol ); | 168 | config.writeEntry( "CurrencySymbol", _currencySymbol ); |
169 | config.writeEntry( "UseSmallFont", _useSmallFont ); | ||
167 | config.writeEntry( "ShowLocks", _showLocks ); | 170 | config.writeEntry( "ShowLocks", _showLocks ); |
168 | config.writeEntry( "ShowBalances", _showBalances ); | 171 | config.writeEntry( "ShowBalances", _showBalances ); |
169 | config.writeEntry( "OpenLastBook", _openLastBook ); | 172 | config.writeEntry( "OpenLastBook", _openLastBook ); |
170 | config.writeEntry( "LastBook", _sLastBook ); | 173 | config.writeEntry( "LastBook", _sLastBook ); |
171 | config.writeEntry( "ShowLastTab", _showLastTab ); | 174 | config.writeEntry( "ShowLastTab", _showLastTab ); |
172 | config.writeEntry( "SavePayees", _bSavePayees ); | 175 | config.writeEntry( "SavePayees", _bSavePayees ); |
173 | 176 | ||
174 | // write account types | 177 | // write account types |
175 | writeStringList(config, "AccType", _AccountTypes); | 178 | writeStringList(config, "AccType", _AccountTypes); |
176 | 179 | ||
177 | // write payees | 180 | // write payees |
178 | writeStringList(config, "Payee", _Payees); | 181 | writeStringList(config, "Payee", _Payees); |