summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmtray.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/pwmtray.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmtray.cpp23
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
@@ -23,24 +23,27 @@
#include "pwmtray.h"
#include "pwmexception.h"
#include "pwm.h"
#include "pwmdoc.h"
#include "pwminit.h"
#ifndef PWM_EMBEDDED
#include "configuration.h"
#else
#include "pwmprefs.h"
#endif
#include <klocale.h>
+//Added by qt3to4:
+#include <Q3ValueList>
+#include <QMouseEvent>
void ActiveTreeItem::execIt()
{
#ifndef PWM_EMBEDDED
unsigned int entr = static_cast<unsigned int>(entry);
unsigned int cat = static_cast<unsigned int>(category);
#else
unsigned int entr = (unsigned int)(entry);
unsigned int cat = (unsigned int)(category);
#endif
switch (task) {
@@ -78,30 +81,30 @@ void ActiveTreeItem::execIt()
PwMDataItem d;
doc->getEntry(cat, entr, &d);
PwM::copyToClipboard(d.comment.c_str());
break;
} case execLauncher: {
doc->execLauncher(cat, entr);
break;
} case goToURL: {
doc->goToURL(cat, entr);
break;
} case openMainWnd: {
// search if there is already an open window.
- const QValueList<PwM *> *wl = tray->init->mainWndList();
+ const Q3ValueList<PwM *> *wl = tray->init->mainWndList();
#ifndef PWM_EMBEDDED
- QValueList<PwM *>::const_iterator i = wl->begin(),
+ Q3ValueList<PwM *>::const_iterator i = wl->begin(),
end = wl->end();
#else
- QValueList<PwM *>::ConstIterator i = wl->begin(),
+ Q3ValueList<PwM *>::ConstIterator i = wl->begin(),
end = wl->end();
#endif
PwM *wnd;
while (i != end) {
wnd = *i;
if (wnd->curDoc() == doc) {
// now bring this window to the foreground.
if (!wnd->hasFocus()) {
wnd->hide();
wnd->showNormal();
wnd->setFocus();
}
@@ -169,43 +172,43 @@ void PwMTray::buildMain()
ctxMenu->insertItem(i18n("&New main window..."), this,
SLOT(newMainWnd()));
ctxMenu->insertItem(i18n("&Open file..."), this,
SLOT(openDoc()));
ctxMenu->insertSeparator();
ctxMenu->insertItem(i18n("&Remove from tray"), this,
SLOT(undock()));
}
void PwMTray::insertActiveTreeItem(KPopupMenu *insertIn, const QString &text,
ActiveTreeItem::Task task, PwMDoc *doc,
int docCategory, int docEntry,
- QValueList<int> *activeItemsList)
+ Q3ValueList<int> *activeItemsList)
{
ActiveTreeItem *activeItem;
int id;
activeItem = new ActiveTreeItem(text, insertIn->font(), task,
doc, docCategory, docEntry,
this);
id = insertIn->insertItem(activeItem);
insertIn->connectItem(id, activeItem, SLOT(execIt()));
#ifndef PWM_EMBEDDED
activeItemsList->push_back(id);
#else
activeItemsList->append(id);
#endif
}
void PwMTray::rebuildTree(KPopupMenu *popup, PwMDoc *doc,
- QValueList<int> *activeItems)
+ Q3ValueList<int> *activeItems)
{
PWM_ASSERT(doc);
PWM_ASSERT(popup);
activeItems->clear();
popup->clear();
#ifndef PWM_EMBEDDED
popup->insertTitle(i18n("Categories:"));
#endif
vector<string> catList;
vector<string> entrList;
doc->getCategoryList(&catList);
KPopupMenu *newCatMenu;
@@ -325,29 +328,29 @@ void PwMTray::updateTree(PwMDoc *document)
{
PWM_ASSERT(document);
KPopupMenu *treeEntry;
int treeItemNum = -1;
int id = findTreeEntry(document, &treeEntry, &treeItemNum);
if (id == -1) {
// tree-entry doesn't exist, yet.
id = insertTreeEntry(document, &treeEntry);
}
if (treeItemNum != -1) {
// delete all *old* active items
KPopupMenu *ctxMenu = contextMenu();
- QValueList<int> *oldItems = &tree[treeItemNum].activeItems;
+ Q3ValueList<int> *oldItems = &tree[treeItemNum].activeItems;
#ifndef PWM_EMBEDDED
- QValueList<int>::iterator i = oldItems->begin();
+ Q3ValueList<int>::iterator i = oldItems->begin();
#else
- QValueList<int>::Iterator i = oldItems->begin();
+ Q3ValueList<int>::Iterator i = oldItems->begin();
#endif
while (i != oldItems->end()) {
ctxMenu->removeItem(*i);
++i;
}
oldItems->clear();
ctxMenu->changeItem(id, document->getTitle());
}
treeItem newTreeItem;
if (document->isDeepLocked()) {
treeEntry->clear();
@@ -472,15 +475,15 @@ void PwMTray::openDoc()
void PwMTray::newMainWnd()
{
init->createMainWnd();
}
void PwMTray::undock()
{
conf()->confGlobTray(false);
init->initTray();
// Attention! "this" is already deleted here!
}
-#ifndef PWM_EMBEDDED
-#include "pwmtray.moc"
+#ifndef PWM_EMBEDDED_
+#include "moc_pwmtray.cpp"
#endif