Diffstat (limited to 'pwmanager/pwmanager/pwmtray.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwmtray.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/pwmanager/pwmanager/pwmtray.cpp b/pwmanager/pwmanager/pwmtray.cpp index fe074ca..478116f 100644 --- a/pwmanager/pwmanager/pwmtray.cpp +++ b/pwmanager/pwmanager/pwmtray.cpp | |||
@@ -29,12 +29,15 @@ | |||
29 | #include "configuration.h" | 29 | #include "configuration.h" |
30 | #else | 30 | #else |
31 | #include "pwmprefs.h" | 31 | #include "pwmprefs.h" |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | //Added by qt3to4: | ||
36 | #include <Q3ValueList> | ||
37 | #include <QMouseEvent> | ||
35 | 38 | ||
36 | 39 | ||
37 | void ActiveTreeItem::execIt() | 40 | void ActiveTreeItem::execIt() |
38 | { | 41 | { |
39 | #ifndef PWM_EMBEDDED | 42 | #ifndef PWM_EMBEDDED |
40 | unsigned int entr = static_cast<unsigned int>(entry); | 43 | unsigned int entr = static_cast<unsigned int>(entry); |
@@ -84,18 +87,18 @@ void ActiveTreeItem::execIt() | |||
84 | break; | 87 | break; |
85 | } case goToURL: { | 88 | } case goToURL: { |
86 | doc->goToURL(cat, entr); | 89 | doc->goToURL(cat, entr); |
87 | break; | 90 | break; |
88 | } case openMainWnd: { | 91 | } case openMainWnd: { |
89 | // search if there is already an open window. | 92 | // search if there is already an open window. |
90 | const QValueList<PwM *> *wl = tray->init->mainWndList(); | 93 | const Q3ValueList<PwM *> *wl = tray->init->mainWndList(); |
91 | #ifndef PWM_EMBEDDED | 94 | #ifndef PWM_EMBEDDED |
92 | QValueList<PwM *>::const_iterator i = wl->begin(), | 95 | Q3ValueList<PwM *>::const_iterator i = wl->begin(), |
93 | end = wl->end(); | 96 | end = wl->end(); |
94 | #else | 97 | #else |
95 | QValueList<PwM *>::ConstIterator i = wl->begin(), | 98 | Q3ValueList<PwM *>::ConstIterator i = wl->begin(), |
96 | end = wl->end(); | 99 | end = wl->end(); |
97 | #endif | 100 | #endif |
98 | PwM *wnd; | 101 | PwM *wnd; |
99 | while (i != end) { | 102 | while (i != end) { |
100 | wnd = *i; | 103 | wnd = *i; |
101 | if (wnd->curDoc() == doc) { | 104 | if (wnd->curDoc() == doc) { |
@@ -175,13 +178,13 @@ void PwMTray::buildMain() | |||
175 | SLOT(undock())); | 178 | SLOT(undock())); |
176 | } | 179 | } |
177 | 180 | ||
178 | void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, | 181 | void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, |
179 | ActiveTreeItem::Task task, PwMDoc *doc, | 182 | ActiveTreeItem::Task task, PwMDoc *doc, |
180 | int docCategory, int docEntry, | 183 | int docCategory, int docEntry, |
181 | QValueList<int> *activeItemsList) | 184 | Q3ValueList<int> *activeItemsList) |
182 | { | 185 | { |
183 | ActiveTreeItem *activeItem; | 186 | ActiveTreeItem *activeItem; |
184 | int id; | 187 | int id; |
185 | 188 | ||
186 | activeItem = new ActiveTreeItem(text, insertIn->font(), task, | 189 | activeItem = new ActiveTreeItem(text, insertIn->font(), task, |
187 | doc, docCategory, docEntry, | 190 | doc, docCategory, docEntry, |
@@ -193,13 +196,13 @@ void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, | |||
193 | #else | 196 | #else |
194 | activeItemsList->append(id); | 197 | activeItemsList->append(id); |
195 | #endif | 198 | #endif |
196 | } | 199 | } |
197 | 200 | ||
198 | void PwMTray::rebuildTree(KPopupMenu *popup, PwMDoc *doc, | 201 | void PwMTray::rebuildTree(KPopupMenu *popup, PwMDoc *doc, |
199 | QValueList<int> *activeItems) | 202 | Q3ValueList<int> *activeItems) |
200 | { | 203 | { |
201 | PWM_ASSERT(doc); | 204 | PWM_ASSERT(doc); |
202 | PWM_ASSERT(popup); | 205 | PWM_ASSERT(popup); |
203 | activeItems->clear(); | 206 | activeItems->clear(); |
204 | popup->clear(); | 207 | popup->clear(); |
205 | #ifndef PWM_EMBEDDED | 208 | #ifndef PWM_EMBEDDED |
@@ -331,17 +334,17 @@ void PwMTray::updateTree(PwMDoc *document) | |||
331 | // tree-entry doesn't exist, yet. | 334 | // tree-entry doesn't exist, yet. |
332 | id = insertTreeEntry(document, &treeEntry); | 335 | id = insertTreeEntry(document, &treeEntry); |
333 | } | 336 | } |
334 | if (treeItemNum != -1) { | 337 | if (treeItemNum != -1) { |
335 | // delete all *old* active items | 338 | // delete all *old* active items |
336 | KPopupMenu *ctxMenu = contextMenu(); | 339 | KPopupMenu *ctxMenu = contextMenu(); |
337 | QValueList<int> *oldItems = &tree[treeItemNum].activeItems; | 340 | Q3ValueList<int> *oldItems = &tree[treeItemNum].activeItems; |
338 | #ifndef PWM_EMBEDDED | 341 | #ifndef PWM_EMBEDDED |
339 | QValueList<int>::iterator i = oldItems->begin(); | 342 | Q3ValueList<int>::iterator i = oldItems->begin(); |
340 | #else | 343 | #else |
341 | QValueList<int>::Iterator i = oldItems->begin(); | 344 | Q3ValueList<int>::Iterator i = oldItems->begin(); |
342 | #endif | 345 | #endif |
343 | while (i != oldItems->end()) { | 346 | while (i != oldItems->end()) { |
344 | ctxMenu->removeItem(*i); | 347 | ctxMenu->removeItem(*i); |
345 | ++i; | 348 | ++i; |
346 | } | 349 | } |
347 | oldItems->clear(); | 350 | oldItems->clear(); |
@@ -478,9 +481,9 @@ void PwMTray::undock() | |||
478 | { | 481 | { |
479 | conf()->confGlobTray(false); | 482 | conf()->confGlobTray(false); |
480 | init->initTray(); | 483 | init->initTray(); |
481 | // Attention! "this" is already deleted here! | 484 | // Attention! "this" is already deleted here! |
482 | } | 485 | } |
483 | 486 | ||
484 | #ifndef PWM_EMBEDDED | 487 | #ifndef PWM_EMBEDDED_ |
485 | #include "pwmtray.moc" | 488 | #include "moc_pwmtray.cpp" |
486 | #endif | 489 | #endif |