summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-12-04 22:43:14 (UTC)
committer zautrix <zautrix>2004-12-04 22:43:14 (UTC)
commite4e75984b6cb581d87d436cb6c5140eb57dbdc51 (patch) (unidiff)
treebd3a1ddf191fd16d24dad9910c0b806cee23000e
parentac994c86c3037dbe2273e62c46115b942b09fdcc (diff)
downloadkdepimpi-e4e75984b6cb581d87d436cb6c5140eb57dbdc51.zip
kdepimpi-e4e75984b6cb581d87d436cb6c5140eb57dbdc51.tar.gz
kdepimpi-e4e75984b6cb581d87d436cb6c5140eb57dbdc51.tar.bz2
set pwmpi update timer from 10 sec to 5 min
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp3
-rw-r--r--pwmanager/pwmanager/pwmview.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index a740d6d..1f15ffd 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -27,97 +27,98 @@
27#include "compressgzip.h" 27#include "compressgzip.h"
28//US#include "compressbzip2.h" 28//US#include "compressbzip2.h"
29#include "randomizer.h" 29#include "randomizer.h"
30#include "pwminit.h" 30#include "pwminit.h"
31#include "libgcryptif.h" 31#include "libgcryptif.h"
32#ifdef PWM_EMBEDDED 32#ifdef PWM_EMBEDDED
33#include "pwmprefs.h" 33#include "pwmprefs.h"
34#include "kglobal.h" 34#include "kglobal.h"
35#endif 35#endif
36 36
37#include <kmessagebox.h> 37#include <kmessagebox.h>
38#include <libkcal/syncdefines.h> 38#include <libkcal/syncdefines.h>
39 39
40 40
41#ifdef CONFIG_KWALLETIF 41#ifdef CONFIG_KWALLETIF
42# include "kwalletemu.h" 42# include "kwalletemu.h"
43#endif // CONFIG_KWALLETIF 43#endif // CONFIG_KWALLETIF
44 44
45#include <qdatetime.h> 45#include <qdatetime.h>
46#include <qsize.h> 46#include <qsize.h>
47#include <qfileinfo.h> 47#include <qfileinfo.h>
48#include <qfile.h> 48#include <qfile.h>
49 49
50#include <stdio.h> 50#include <stdio.h>
51#include <stdlib.h> 51#include <stdlib.h>
52#include <errno.h> 52#include <errno.h>
53#include <string.h> 53#include <string.h>
54//US#include <iostream> 54//US#include <iostream>
55#include <algorithm> 55#include <algorithm>
56#include <sys/types.h> 56#include <sys/types.h>
57#include <sys/stat.h> 57#include <sys/stat.h>
58#ifndef _WIN32_ 58#ifndef _WIN32_
59#include <unistd.h> 59#include <unistd.h>
60#include <stdint.h> 60#include <stdint.h>
61#endif 61#endif
62 62
63#ifdef PWM_EMBEDDED 63#ifdef PWM_EMBEDDED
64#ifndef Q_LONG 64#ifndef Q_LONG
65#define Q_LONG long 65#define Q_LONG long
66#endif 66#endif
67 67
68#ifndef Q_ULONG 68#ifndef Q_ULONG
69#define Q_ULONG unsigned long 69#define Q_ULONG unsigned long
70#endif 70#endif
71#endif //PWM_EMBEDDED 71#endif //PWM_EMBEDDED
72 72
73 73
74//TODO: reset to its normal value. 74//TODO: reset to its normal value.
75 #define META_CHECK_TIMER_INTERVAL10/*300*/ /* sek */ 75//LR set to 5 min
76 #define META_CHECK_TIMER_INTERVAL300 /* 10 300*/ /* sek */
76 77
77using namespace std; 78using namespace std;
78 79
79 80
80void PwMDocList::add(PwMDoc *doc, const string &id) 81void PwMDocList::add(PwMDoc *doc, const string &id)
81{ 82{
82#ifdef PWM_DEBUG 83#ifdef PWM_DEBUG
83 // check for existance of object in debug mode only. 84 // check for existance of object in debug mode only.
84 vector<listItem>::iterator begin = docList.begin(), 85 vector<listItem>::iterator begin = docList.begin(),
85 end = docList.end(), 86 end = docList.end(),
86 i = begin; 87 i = begin;
87 while (i != end) { 88 while (i != end) {
88 if (i->doc == doc) { 89 if (i->doc == doc) {
89 BUG(); 90 BUG();
90 return; 91 return;
91 } 92 }
92 ++i; 93 ++i;
93 } 94 }
94#endif 95#endif
95 listItem newItem; 96 listItem newItem;
96 newItem.doc = doc; 97 newItem.doc = doc;
97 newItem.docId = id; 98 newItem.docId = id;
98 docList.push_back(newItem); 99 docList.push_back(newItem);
99} 100}
100 101
101void PwMDocList::edit(PwMDoc *doc, const string &newId) 102void PwMDocList::edit(PwMDoc *doc, const string &newId)
102{ 103{
103 vector<listItem>::iterator begin = docList.begin(), 104 vector<listItem>::iterator begin = docList.begin(),
104 end = docList.end(), 105 end = docList.end(),
105 i = begin; 106 i = begin;
106 while (i != end) { 107 while (i != end) {
107 if (i->doc == doc) { 108 if (i->doc == doc) {
108 i->docId = newId; 109 i->docId = newId;
109 return; 110 return;
110 } 111 }
111 ++i; 112 ++i;
112 } 113 }
113} 114}
114 115
115void PwMDocList::del(PwMDoc *doc) 116void PwMDocList::del(PwMDoc *doc)
116{ 117{
117 vector<listItem>::iterator begin = docList.begin(), 118 vector<listItem>::iterator begin = docList.begin(),
118 end = docList.end(), 119 end = docList.end(),
119 i = begin; 120 i = begin;
120 while (i != end) { 121 while (i != end) {
121 if (i->doc == doc) { 122 if (i->doc == doc) {
122 docList.erase(i); 123 docList.erase(i);
123 return; 124 return;
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp
index 7733028..cd816e5 100644
--- a/pwmanager/pwmanager/pwmview.cpp
+++ b/pwmanager/pwmanager/pwmview.cpp
@@ -160,96 +160,97 @@ bool PwMView::getDocEntryIndex(unsigned int *index,
160 return true; 160 return true;
161 } 161 }
162 162
163 return false; 163 return false;
164} 164}
165 165
166void PwMView::handleToggle(QListViewItem *item) 166void PwMView::handleToggle(QListViewItem *item)
167{ 167{
168 PWM_ASSERT(doc); 168 PWM_ASSERT(doc);
169 if (!item) 169 if (!item)
170 return; 170 return;
171 QCheckListItem *clItem = (QCheckListItem *)item; 171 QCheckListItem *clItem = (QCheckListItem *)item;
172 QString curCat(getCurrentCategory()); 172 QString curCat(getCurrentCategory());
173 173
174 // find document position of this entry. 174 // find document position of this entry.
175 unsigned int curEntryDocIndex; 175 unsigned int curEntryDocIndex;
176 if (!getDocEntryIndex(&curEntryDocIndex, item)) 176 if (!getDocEntryIndex(&curEntryDocIndex, item))
177 return; 177 return;
178 178
179 // hack to refresh the comment, if only one item is present 179 // hack to refresh the comment, if only one item is present
180 if (lv->childCount() == 1) 180 if (lv->childCount() == 1)
181 refreshCommentTextEdit(lv->currentItem()); 181 refreshCommentTextEdit(lv->currentItem());
182 182
183 if (doc->isLocked(curCat, curEntryDocIndex) != clItem->isOn()) 183 if (doc->isLocked(curCat, curEntryDocIndex) != clItem->isOn())
184 return; // this is just a click somewhere on the entry 184 return; // this is just a click somewhere on the entry
185 if (doc->isDeepLocked()) { 185 if (doc->isDeepLocked()) {
186 PwMerror ret; 186 PwMerror ret;
187 ret = doc->deepLock(false); 187 ret = doc->deepLock(false);
188 if (ret != e_success) 188 if (ret != e_success)
189 clItem->setOn(false); 189 clItem->setOn(false);
190 return; 190 return;
191 } 191 }
192 doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn()); 192 doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn());
193} 193}
194 194
195void PwMView::handleRightClick(QListViewItem *item, const QPoint &point, int) 195void PwMView::handleRightClick(QListViewItem *item, const QPoint &point, int)
196{ 196{
197 if (!item) 197 if (!item)
198 return; 198 return;
199 ctxMenu->move(point); 199 ctxMenu->move(point);
200 /* don't use ctxMenu->exec() here, as it generates race conditions 200 /* don't use ctxMenu->exec() here, as it generates race conditions
201 * with the card interface code. Believe it or not. :) 201 * with the card interface code. Believe it or not. :)
202 */ 202 */
203 ctxMenu->show(); 203 ctxMenu->show();
204} 204}
205 205
206void PwMView::updateCategories() 206void PwMView::updateCategories()
207{ 207{
208 qDebug("PwMView::updateCategories() ");
208 QString oldSel(getCurrentCategory()); 209 QString oldSel(getCurrentCategory());
209 delAllCategories(); 210 delAllCategories();
210 QStringList catList; 211 QStringList catList;
211 document()->getCategoryList(&catList); 212 document()->getCategoryList(&catList);
212 catList.sort(); 213 catList.sort();
213#ifndef PWM_EMBEDDED 214#ifndef PWM_EMBEDDED
214 QStringList::iterator i = catList.begin(), 215 QStringList::iterator i = catList.begin(),
215 end = catList.end(); 216 end = catList.end();
216#else 217#else
217 QStringList::Iterator i = catList.begin(), 218 QStringList::Iterator i = catList.begin(),
218 end = catList.end(); 219 end = catList.end();
219#endif 220#endif
220 while (i != end) { 221 while (i != end) {
221 addCategory(*i); 222 addCategory(*i);
222 ++i; 223 ++i;
223 } 224 }
224 selectCategory(oldSel); 225 selectCategory(oldSel);
225} 226}
226 227
227void PwMView::shiftToView() 228void PwMView::shiftToView()
228{ 229{
229 int cX = lv->contentsX(); 230 int cX = lv->contentsX();
230 int cY = lv->contentsY(); 231 int cY = lv->contentsY();
231 commentBox->clear(); 232 commentBox->clear();
232 233
233 unsigned int catDocIndex; 234 unsigned int catDocIndex;
234 if (unlikely( 235 if (unlikely(
235 !(document()->findCategory(getCurrentCategory(), 236 !(document()->findCategory(getCurrentCategory(),
236 &catDocIndex)))) { 237 &catDocIndex)))) {
237 BUG(); 238 BUG();
238 } 239 }
239 240
240 // ensure all listViewPos are set 241 // ensure all listViewPos are set
241 doc->ensureLvp(); 242 doc->ensureLvp();
242 243
243 // clear all tmp-data vectors 244 // clear all tmp-data vectors
244 unsigned int i, entries = doc->numEntries(catDocIndex); 245 unsigned int i, entries = doc->numEntries(catDocIndex);
245 if (entries) { 246 if (entries) {
246 mainClass->setVirgin(false); 247 mainClass->setVirgin(false);
247 } 248 }
248 vector<PwMDataItem> tmpSorted; 249 vector<PwMDataItem> tmpSorted;
249 PwMDataItem currItem; 250 PwMDataItem currItem;
250 currItem.clear(); 251 currItem.clear();
251 tmpSorted.insert(tmpSorted.begin(), entries, currItem); 252 tmpSorted.insert(tmpSorted.begin(), entries, currItem);
252 253
253 // Sort items and store them in tempoary tmpSorted. 254 // Sort items and store them in tempoary tmpSorted.
254 for (i = 0; i < entries; ++i) { 255 for (i = 0; i < entries; ++i) {
255 doc->getEntry(catDocIndex, i, &currItem); 256 doc->getEntry(catDocIndex, i, &currItem);