summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/cfg.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/cfg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/cfg.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/noncore/apps/checkbook/cfg.cpp b/noncore/apps/checkbook/cfg.cpp
index 1e0ec5c..0d5d9ed 100644
--- a/noncore/apps/checkbook/cfg.cpp
+++ b/noncore/apps/checkbook/cfg.cpp
@@ -43,6 +43,7 @@ Cfg::Cfg()
43 _showLocks=FALSE; 43 _showLocks=FALSE;
44 _showBalances=FALSE; 44 _showBalances=FALSE;
45 _pCategories=new CategoryList(); 45 _pCategories=new CategoryList();
46 _bDirty=false;
46} 47}
47 48
48// --- readStringList --------------------------------------------------------- 49// --- readStringList ---------------------------------------------------------
@@ -52,8 +53,6 @@ Cfg::Cfg()
52// entries. 53// entries.
53void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst) 54void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst)
54{ 55{
55qDebug( "%s", sKey );
56
57 QString sEntry; 56 QString sEntry;
58 int iCount; 57 int iCount;
59 58
@@ -86,6 +85,7 @@ void Cfg::readConfig(Config &config)
86 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE ); 85 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE );
87 _sLastBook = config.readEntry("LastBook", ""); 86 _sLastBook = config.readEntry("LastBook", "");
88 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE ); 87 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE );
88 _bSavePayees = config.readBoolEntry( "SavePayees", FALSE );
89 89
90 // Account types 90 // Account types
91 readStringList(config, "AccType", _AccountTypes); 91 readStringList(config, "AccType", _AccountTypes);
@@ -100,6 +100,9 @@ void Cfg::readConfig(Config &config)
100 config.write(); 100 config.write();
101 } 101 }
102 102
103 // Payees
104 readStringList(config, "Payee", _Payees);
105
103 // Read Categories 106 // Read Categories
104 QStringList lst; 107 QStringList lst;
105 readStringList(config, "Category", lst); 108 readStringList(config, "Category", lst);
@@ -131,6 +134,9 @@ void Cfg::readConfig(Config &config)
131 } else { 134 } else {
132 setCategories(lst); 135 setCategories(lst);
133 } 136 }
137
138 // not dirty
139 _bDirty=false;
134} 140}
135 141
136 142
@@ -166,16 +172,21 @@ void Cfg::writeConfig(Config &config)
166 config.writeEntry( "OpenLastBook", _openLastBook ); 172 config.writeEntry( "OpenLastBook", _openLastBook );
167 config.writeEntry( "LastBook", _sLastBook ); 173 config.writeEntry( "LastBook", _sLastBook );
168 config.writeEntry( "ShowLastTab", _showLastTab ); 174 config.writeEntry( "ShowLastTab", _showLastTab );
175 config.writeEntry( "SavePayees", _bSavePayees );
169 176
170 // write account types 177 // write account types
171 writeStringList(config, "AccType", _AccountTypes); 178 writeStringList(config, "AccType", _AccountTypes);
172 179
180 // write payees
181 writeStringList(config, "Payee", _Payees);
182
173 // write categories 183 // write categories
174 QStringList lst=getCategories(); 184 QStringList lst=getCategories();
175 writeStringList(config, "Category", lst ); 185 writeStringList(config, "Category", lst );
176 186
177 // commit write 187 // commit write
178 config.write(); 188 config.write();
189 _bDirty=false;
179} 190}
180 191
181 192