From 5f5ee2367157176ed223b86343eb0a9e4022e020 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:52:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1157653 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwallet/allyourbase.cpp | 220 +++++++++++------------ kwallet/allyourbase.h | 82 ++++----- kwallet/kbetterthankdialogbase.ui.h | 4 +- kwallet/konfigurator/konfigurator.cpp | 118 ++++++------ kwallet/konfigurator/konfigurator.h | 8 +- kwallet/kwalleteditor.cpp | 328 +++++++++++++++++----------------- kwallet/kwalleteditor.h | 22 +-- kwallet/kwalletmanager.cpp | 140 +++++++-------- kwallet/kwalletmanager.h | 26 +-- kwallet/kwalletpopup.cpp | 18 +- kwallet/kwalletpopup.h | 18 +- kwallet/kwmapeditor.cpp | 74 ++++---- kwallet/kwmapeditor.h | 16 +- kwallet/main.cpp | 8 +- 14 files changed, 541 insertions(+), 541 deletions(-) (limited to 'kwallet') diff --git a/kwallet/allyourbase.cpp b/kwallet/allyourbase.cpp index add178b..917857c 100644 --- a/kwallet/allyourbase.cpp +++ b/kwallet/allyourbase.cpp @@ -31,28 +31,28 @@ #include #include -#include -#include -#include +#include +#include +#include /**************** * KWalletFolderItem - ListView items to represent kwallet folders */ -KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, QListView* parent, const QString &name, int entries) +KWalletFolderItem::KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, const TQString &name, int entries) : KListViewItem(parent),_wallet(w),_name(name),_entries(entries) { - setText(0, QString("%1 (%2)").arg(_name).arg(_entries)); + setText(0, TQString("%1 (%2)").arg(_name).arg(_entries)); setRenameEnabled(0, false); setDragEnabled(true); setDropEnabled(true); - QPixmap pix = getFolderIcon(KIcon::Small); + TQPixmap pix = getFolderIcon(KIcon::Small); setPixmap(0,pix); } -QPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ +TQPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ KIconLoader *loader = KGlobal::instance()->iconLoader(); - QPixmap pix = loader->loadIcon( _name, group, 0, + TQPixmap pix = loader->loadIcon( _name, group, 0, KIcon::DefaultState, 0, true ); if (pix.isNull()) pix = loader->loadIcon( _name.lower(), group, 0, @@ -64,14 +64,14 @@ QPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){ } void KWalletFolderItem::refresh() { - QString saveFolder = _wallet->currentFolder(); + TQString saveFolder = _wallet->currentFolder(); _wallet->setFolder(_name); - setText(0, QString("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); + setText(0, TQString("%1 (%2)").arg(_name).arg(_wallet->entryList().count())); _wallet->setFolder(saveFolder); } KWalletContainerItem* KWalletFolderItem::getContainer(KWallet::Wallet::EntryType type) { - for (QListViewItem *i = firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { KWalletContainerItem *ci = dynamic_cast(i); if (!ci) { continue; @@ -83,17 +83,17 @@ KWalletContainerItem* KWalletFolderItem::getContainer(KWallet::Wallet::EntryType return 0; } -bool KWalletFolderItem::contains(const QString& key) { +bool KWalletFolderItem::contains(const TQString& key) { return (getItem(key) != 0); } -QListViewItem* KWalletFolderItem::getItem(const QString& key) { - for (QListViewItem *i = firstChild(); i; i = i->nextSibling()) { +TQListViewItem* KWalletFolderItem::getItem(const TQString& key) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { KWalletContainerItem *ci = dynamic_cast(i); if (!ci) { continue; } - QListViewItem *tmp = ci->getItem(key); + TQListViewItem *tmp = ci->getItem(key); if (tmp) { return tmp; } @@ -101,7 +101,7 @@ QListViewItem* KWalletFolderItem::getItem(const QString& key) { return 0; } -bool KWalletFolderItem::acceptDrop(const QMimeSource *mime) const { +bool KWalletFolderItem::acceptDrop(const TQMimeSource *mime) const { return mime->provides("application/x-kwallet-entry") || mime->provides("text/uri-list"); } @@ -110,7 +110,7 @@ int KWalletFolderItem::rtti() const { return KWalletFolderItemClass; } -QString KWalletFolderItem::name() const { +TQString KWalletFolderItem::name() const { return _name; } @@ -121,7 +121,7 @@ KWalletFolderItem::~KWalletFolderItem() { * KWalletContainerItem - ListView items to represent kwallet containers, i.e. * passwords, maps, ... */ -KWalletContainerItem::KWalletContainerItem(QListViewItem* parent, const QString &name, KWallet::Wallet::EntryType type) +KWalletContainerItem::KWalletContainerItem(TQListViewItem* parent, const TQString &name, KWallet::Wallet::EntryType type) : KListViewItem(parent, name), _type(type) { setRenameEnabled(0, false); setDragEnabled(true); @@ -138,12 +138,12 @@ KWallet::Wallet::EntryType KWalletContainerItem::type() { return _type; } -bool KWalletContainerItem::contains(const QString& key) { +bool KWalletContainerItem::contains(const TQString& key) { return getItem(key) != 0; } -QListViewItem *KWalletContainerItem::getItem(const QString& key) { - for (QListViewItem *i = firstChild(); i; i = i->nextSibling()) { +TQListViewItem *KWalletContainerItem::getItem(const TQString& key) { + for (TQListViewItem *i = firstChild(); i; i = i->nextSibling()) { if (i->text(0) == key) { return i; } @@ -154,7 +154,7 @@ QListViewItem *KWalletContainerItem::getItem(const QString& key) { /**************** * KWalletEntryItem - ListView items to represent kwallet entries */ -KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, QListViewItem* parent, const QString& ename) +KWalletEntryItem::KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename) : KListViewItem(parent, ename), _wallet(w), _oldName(ename) { setRenameEnabled(0, true); setDragEnabled(true); @@ -170,27 +170,27 @@ KWalletEntryItem::~KWalletEntryItem() { /**************** * KWalletItem - IconView items to represent wallets */ -KWalletItem::KWalletItem(QIconView *parent, const QString& walletName) -: QIconViewItem(parent, walletName, DesktopIcon("kwalletmanager")) { +KWalletItem::KWalletItem(TQIconView *parent, const TQString& walletName) +: TQIconViewItem(parent, walletName, DesktopIcon("kwalletmanager")) { } KWalletItem::~KWalletItem() { } -bool KWalletItem::acceptDrop(const QMimeSource *mime) const { +bool KWalletItem::acceptDrop(const TQMimeSource *mime) const { return mime->provides("application/x-kwallet-folder") || mime->provides("text/uri-list"); } -static bool decodeEntry(KWallet::Wallet *_wallet, QDataStream& ds) { +static bool decodeEntry(KWallet::Wallet *_wallet, TQDataStream& ds) { Q_UINT32 magic; ds >> magic; if (magic != KWALLETENTRYMAGIC) { kdDebug() << "bad magic" << endl; return false; } - QString name; - QByteArray value; + TQString name; + TQByteArray value; KWallet::Wallet::EntryType et; ds >> name; if (_wallet->hasEntry(name)) { @@ -207,17 +207,17 @@ static bool decodeEntry(KWallet::Wallet *_wallet, QDataStream& ds) { return true; } -static bool decodeFolder(KWallet::Wallet *_wallet, QDataStream& ds) { +static bool decodeFolder(KWallet::Wallet *_wallet, TQDataStream& ds) { Q_UINT32 magic; ds >> magic; if (magic != KWALLETFOLDERMAGIC) { kdDebug() << "bad magic" << endl; return false; } - QString folder; + TQString folder; ds >> folder; if (_wallet->hasFolder(folder)) { - int rc = KMessageBox::warningYesNoCancel(0L, i18n("A folder by the name '%1' already exists. What would you like to do?").arg(folder), QString::null, KStdGuiItem::cont(), i18n("Replace")); + int rc = KMessageBox::warningYesNoCancel(0L, i18n("A folder by the name '%1' already exists. What would you like to do?").arg(folder), TQString::null, KStdGuiItem::cont(), i18n("Replace")); if (rc == KMessageBox::Cancel) { return false; } @@ -231,8 +231,8 @@ static bool decodeFolder(KWallet::Wallet *_wallet, QDataStream& ds) { _wallet->setFolder(folder); while (!ds.atEnd()) { - QString name; - QByteArray value; + TQString name; + TQByteArray value; KWallet::Wallet::EntryType et; ds >> name; long l; @@ -244,7 +244,7 @@ static bool decodeFolder(KWallet::Wallet *_wallet, QDataStream& ds) { return true; } -void KWalletItem::dropped(QDropEvent *e, const QValueList& lst) { +void KWalletItem::dropped(TQDropEvent *e, const TQValueList& lst) { Q_UNUSED(lst); if (e->provides("application/x-kwallet-folder") || e->provides("text/uri-list")) { @@ -257,19 +257,19 @@ void KWalletItem::dropped(QDropEvent *e, const QValueList& lst) { return; } - QString saveFolder = _wallet->currentFolder(); + TQString saveFolder = _wallet->currentFolder(); - QFile file; - QDataStream *ds = 0L; + TQFile file; + TQDataStream *ds = 0L; if (e->provides("application/x-kwallet-folder")) { - QByteArray edata = e->encodedData("application/x-kwallet-folder"); + TQByteArray edata = e->encodedData("application/x-kwallet-folder"); if (!edata.isEmpty()) { - ds = new QDataStream(edata, IO_ReadOnly); + ds = new TQDataStream(edata, IO_ReadOnly); } } else { // text/uri-list - QStrList urls; - QUriDrag::decode(e, urls); + TQStrList urls; + TQUriDrag::decode(e, urls); if (urls.isEmpty()) { e->ignore(); @@ -281,11 +281,11 @@ void KWalletItem::dropped(QDropEvent *e, const QValueList& lst) { e->ignore(); return; } - QString tmpFile; + TQString tmpFile; if (KIO::NetAccess::download(u, tmpFile, 0L)) { file.setName(tmpFile); file.open(IO_ReadOnly); - ds = new QDataStream(&file); + ds = new TQDataStream(&file); KIO::NetAccess::removeTempFile(tmpFile); } else { KMessageBox::error(iconView(), KIO::NetAccess::lastErrorString()); @@ -324,10 +324,10 @@ void KWalletItem::dropped(QDropEvent *e, const QValueList& lst) { /**************** * KWalletEntryDrag - Stores data for wallet entry drags */ -class KWalletEntryDrag : public QStoredDrag { +class KWalletEntryDrag : public TQStoredDrag { public: - KWalletEntryDrag(QWidget *dragSource, const char *name = 0L) - : QStoredDrag("application/x-kwallet-entry", dragSource, name) { + KWalletEntryDrag(TQWidget *dragSource, const char *name = 0L) + : TQStoredDrag("application/x-kwallet-entry", dragSource, name) { } virtual ~KWalletEntryDrag() {} @@ -336,10 +336,10 @@ class KWalletEntryDrag : public QStoredDrag { /**************** * KWalletFolderDrag - Stores data for wallet folder drags */ -class KWalletFolderDrag : public QStoredDrag { +class KWalletFolderDrag : public TQStoredDrag { public: - KWalletFolderDrag(QWidget *dragSource, const char *name = 0L) - : QStoredDrag("application/x-kwallet-folder", dragSource, name) { + KWalletFolderDrag(TQWidget *dragSource, const char *name = 0L) + : TQStoredDrag("application/x-kwallet-folder", dragSource, name) { } virtual ~KWalletFolderDrag() {} @@ -348,7 +348,7 @@ class KWalletFolderDrag : public QStoredDrag { /**************** * KWalletEntryList - A listview to store wallet entries */ -KWalletEntryList::KWalletEntryList(QWidget *parent, const char *name) +KWalletEntryList::KWalletEntryList(TQWidget *parent, const char *name) : KListView(parent, name) { addColumn(i18n("Folders")); setRootIsDecorated(true); @@ -362,8 +362,8 @@ KWalletEntryList::KWalletEntryList(QWidget *parent, const char *name) KWalletEntryList::~KWalletEntryList() { } -bool KWalletEntryList::acceptDrag(QDropEvent* e) const { - QListViewItem *i = itemAt(contentsToViewport(e->pos())); +bool KWalletEntryList::acceptDrag(TQDropEvent* e) const { + TQListViewItem *i = itemAt(contentsToViewport(e->pos())); if (i) { if (e->provides("application/x-kwallet-entry") || e->provides("text/uri-list")) { @@ -379,14 +379,14 @@ bool KWalletEntryList::acceptDrag(QDropEvent* e) const { } //returns true if the item has been dropped successfully -void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { +void KWalletEntryList::itemDropped(TQDropEvent *e, TQListViewItem *item) { bool ok = true; bool isEntry; - QFile file; - QDataStream *ds; + TQFile file; + TQDataStream *ds; KWalletEntryList *el = 0L; - QListViewItem *sel = 0L; + TQListViewItem *sel = 0L; //detect if we are dragging from kwallet itself if (e->source() && e->source()->parent() && @@ -407,12 +407,12 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { return; } isEntry = true; - QByteArray data = e->encodedData("application/x-kwallet-entry"); + TQByteArray data = e->encodedData("application/x-kwallet-entry"); if (data.isEmpty()) { e->ignore(); return; } - ds = new QDataStream(data, IO_ReadOnly); + ds = new TQDataStream(data, IO_ReadOnly); } else if (e->provides("application/x-kwallet-folder")) { //do nothing if we are in the same wallet if (this == el) { @@ -420,15 +420,15 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { return; } isEntry = false; - QByteArray data = e->encodedData("application/x-kwallet-folder"); + TQByteArray data = e->encodedData("application/x-kwallet-folder"); if (data.isEmpty()) { e->ignore(); return; } - ds = new QDataStream(data, IO_ReadOnly); + ds = new TQDataStream(data, IO_ReadOnly); } else if (e->provides("text/uri-list")) { - QStrList urls; - QUriDrag::decode(e, urls); + TQStrList urls; + TQUriDrag::decode(e, urls); if (urls.isEmpty()) { e->ignore(); return; @@ -438,11 +438,11 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { e->ignore(); return; } - QString tmpFile; + TQString tmpFile; if (KIO::NetAccess::download(u, tmpFile, 0L)) { file.setName(tmpFile); file.open(IO_ReadOnly); - ds = new QDataStream(&file); + ds = new TQDataStream(&file); //check magic to discover mime type Q_UINT32 magic; (*ds) >> magic; @@ -458,7 +458,7 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { delete ds; //set the file back to the beginning file.reset(); - ds = new QDataStream(&file); + ds = new TQDataStream(&file); KIO::NetAccess::removeTempFile(tmpFile); } else { KMessageBox::error(this, KIO::NetAccess::lastErrorString()); @@ -481,7 +481,7 @@ void KWalletEntryList::itemDropped(QDropEvent *e, QListViewItem *item) { e->accept(); return; } - QString saveFolder = _wallet->currentFolder(); + TQString saveFolder = _wallet->currentFolder(); _wallet->setFolder(fi->name()); ok = decodeEntry(_wallet, *ds); _wallet->setFolder(saveFolder); @@ -516,8 +516,8 @@ void KWalletEntryList::setWallet(KWallet::Wallet *w) { _wallet = w; } -bool KWalletEntryList::existsFolder(const QString& name) { - for (QListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { +bool KWalletEntryList::existsFolder(const TQString& name) { + for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { KWalletFolderItem *fi = dynamic_cast(vi); if (!fi) { continue; @@ -529,12 +529,12 @@ bool KWalletEntryList::existsFolder(const QString& name) { return false; } -void KWalletEntryList::contentsDropEvent(QDropEvent *e) { - QListViewItem *i = itemAt(contentsToViewport(e->pos())); +void KWalletEntryList::contentsDropEvent(TQDropEvent *e) { + TQListViewItem *i = itemAt(contentsToViewport(e->pos())); itemDropped(e, i); } -void KWalletEntryList::contentsDragEnterEvent(QDragEnterEvent *e) { +void KWalletEntryList::contentsDragEnterEvent(TQDragEnterEvent *e) { if (e->provides("application/x-kwallet-entry") || e->provides("application/x-kwallet-folder") || e->provides("application/uri-list")) { @@ -544,8 +544,8 @@ void KWalletEntryList::contentsDragEnterEvent(QDragEnterEvent *e) { } } -KWalletFolderItem* KWalletEntryList::getFolder(const QString& name) { - for (QListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { +KWalletFolderItem* KWalletEntryList::getFolder(const TQString& name) { + for (TQListViewItem *vi = firstChild(); vi; vi = vi->nextSibling()) { KWalletFolderItem *fi = dynamic_cast(vi); if (!fi) { continue; @@ -557,7 +557,7 @@ KWalletFolderItem* KWalletEntryList::getFolder(const QString& name) { return 0; } -KWalletFolderItem *KWalletEntryList::getItemFolder(QListViewItem *item) { +KWalletFolderItem *KWalletEntryList::getItemFolder(TQListViewItem *item) { switch (item->rtti()) { case KWalletFolderItemClass: return dynamic_cast(item); @@ -572,10 +572,10 @@ KWalletFolderItem *KWalletEntryList::getItemFolder(QListViewItem *item) { /**************** * KWalletIconDrag - Stores the data for wallet drags */ -class KWalletIconDrag : public QIconDrag { +class KWalletIconDrag : public TQIconDrag { public: - KWalletIconDrag(QWidget *dragSource, const char *name = 0L) - : QIconDrag(dragSource, name) { + KWalletIconDrag(TQWidget *dragSource, const char *name = 0L) + : TQIconDrag(dragSource, name) { } virtual ~KWalletIconDrag() {} @@ -589,13 +589,13 @@ class KWalletIconDrag : public QIconDrag { return 0L; } - QByteArray encodedData(const char *mime) const { - QByteArray a; - QCString mimetype(mime); + TQByteArray encodedData(const char *mime) const { + TQByteArray a; + TQCString mimetype(mime); if (mimetype == "application/x-qiconlist") { - return QIconDrag::encodedData(mime); + return TQIconDrag::encodedData(mime); } else if (mimetype == "text/uri-list") { - QCString s = _urls.join("\r\n").latin1(); + TQCString s = _urls.join("\r\n").latin1(); if (_urls.count() > 0) { s.append("\r\n"); } @@ -605,29 +605,29 @@ class KWalletIconDrag : public QIconDrag { return a; } - void append(const QIconDragItem &item, const QRect &pr, - const QRect &tr, const QString &url) { - QIconDrag::append(item, pr, tr); + void append(const TQIconDragItem &item, const TQRect &pr, + const TQRect &tr, const TQString &url) { + TQIconDrag::append(item, pr, tr); _urls.append(url); } private: - QStringList _urls; + TQStringList _urls; }; /**************** * * KWalletIconView - An iconview to store wallets * */ -KWalletIconView::KWalletIconView(QWidget *parent, const char *name) +KWalletIconView::KWalletIconView(TQWidget *parent, const char *name) : KIconView(parent, name) { KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); - connect(this, SIGNAL(dropped(QDropEvent*, const QValueList&)), SLOT(slotDropped(QDropEvent*, const QValueList&))); + connect(this, TQT_SIGNAL(dropped(TQDropEvent*, const TQValueList&)), TQT_SLOT(slotDropped(TQDropEvent*, const TQValueList&))); } KWalletIconView::~KWalletIconView() { } -void KWalletIconView::slotDropped(QDropEvent *e, const QValueList& /*lst*/) { +void KWalletIconView::slotDropped(TQDropEvent *e, const TQValueList& /*lst*/) { if (e->source() == viewport()) { e->ignore(); return; @@ -638,10 +638,10 @@ void KWalletIconView::slotDropped(QDropEvent *e, const QValueList return; } - QByteArray edata = e->encodedData("text/uri-list"); - QCString urls = edata.data(); + TQByteArray edata = e->encodedData("text/uri-list"); + TQCString urls = edata.data(); - QStringList ul = QStringList::split("\r\n", urls); + TQStringList ul = TQStringList::split("\r\n", urls); if (ul.isEmpty() || ul.first().isEmpty()) { e->ignore(); return; @@ -654,8 +654,8 @@ void KWalletIconView::slotDropped(QDropEvent *e, const QValueList return; } - QString dest = KGlobal::dirs()->saveLocation("kwallet") + u.fileName(); - if (QFile::exists(dest)) { + TQString dest = KGlobal::dirs()->saveLocation("kwallet") + u.fileName(); + if (TQFile::exists(dest)) { KMessageBox::sorry(viewport(), i18n("That wallet file already exists. You cannot overwrite wallets.")); e->ignore(); return; @@ -666,7 +666,7 @@ void KWalletIconView::slotDropped(QDropEvent *e, const QValueList e->accept(); } -void KWalletIconView::contentsMousePressEvent(QMouseEvent *e) { +void KWalletIconView::contentsMousePressEvent(TQMouseEvent *e) { _mousePos = e->pos(); if (!findItem(_mousePos)) { clearSelection(); @@ -674,19 +674,19 @@ void KWalletIconView::contentsMousePressEvent(QMouseEvent *e) { KIconView::contentsMousePressEvent( e ); } -QDragObject *KWalletIconView::dragObject() { +TQDragObject *KWalletIconView::dragObject() { KWalletIconDrag* id = new KWalletIconDrag(viewport(), "KWallet Drag"); - QString path = "file:" + KGlobal::dirs()->saveLocation("kwallet"); - QPoint pos = _mousePos; - for (QIconViewItem *item = firstItem(); item; item = item->nextItem()) { + TQString path = "file:" + KGlobal::dirs()->saveLocation("kwallet"); + TQPoint pos = _mousePos; + for (TQIconViewItem *item = firstItem(); item; item = item->nextItem()) { if (item->isSelected()) { - QString url = path + item->text() + ".kwl"; - QIconDragItem idi; + TQString url = path + item->text() + ".kwl"; + TQIconDragItem idi; idi.setData(url.local8Bit()); id->append(idi, - QRect(item->pixmapRect(false).topLeft() - pos, + TQRect(item->pixmapRect(false).topLeft() - pos, item->pixmapRect(false).size()), - QRect(item->textRect(false).topLeft() - pos, + TQRect(item->textRect(false).topLeft() - pos, item->textRect(false).size()), url); } @@ -698,10 +698,10 @@ QDragObject *KWalletIconView::dragObject() { return id; } -QDragObject *KWalletEntryList::dragObject() { - QListViewItem *i = currentItem(); +TQDragObject *KWalletEntryList::dragObject() { + TQListViewItem *i = currentItem(); - QStoredDrag *sd = 0L; + TQStoredDrag *sd = 0L; if (i->rtti() == KWalletEntryItemClass) { KWalletEntryItem *ei = dynamic_cast(i); @@ -709,8 +709,8 @@ QDragObject *KWalletEntryList::dragObject() { return 0L; } sd = new KWalletEntryDrag(viewport(), "KWallet Entry Drag"); - QByteArray a; - QDataStream ds(a, IO_WriteOnly); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); ds << KWALLETENTRYMAGIC; ds << *ei; sd->setEncodedData(a); @@ -720,8 +720,8 @@ QDragObject *KWalletEntryList::dragObject() { return 0L; } sd = new KWalletFolderDrag(viewport(), "KWallet Folder Drag"); - QByteArray a; - QDataStream ds(a, IO_WriteOnly); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); ds << KWALLETFOLDERMAGIC; ds << *fi; diff --git a/kwallet/allyourbase.h b/kwallet/allyourbase.h index 7f5ae92..299a6c9 100644 --- a/kwallet/allyourbase.h +++ b/kwallet/allyourbase.h @@ -39,11 +39,11 @@ enum KWalletListItemClasses { class KWalletEntryItem : public KListViewItem { public: - KWalletEntryItem(KWallet::Wallet *w, QListViewItem* parent, const QString& ename); + KWalletEntryItem(KWallet::Wallet *w, TQListViewItem* parent, const TQString& ename); virtual ~KWalletEntryItem(); - const QString& oldName() { return _oldName; } - QString currentName() { return text(0); } + const TQString& oldName() { return _oldName; } + TQString currentName() { return text(0); } void clearOldName() { _oldName = text(0); } virtual int rtti() const; @@ -52,20 +52,20 @@ class KWalletEntryItem : public KListViewItem { KWallet::Wallet *_wallet; private: - QString _oldName; + TQString _oldName; }; class KWalletContainerItem : public KListViewItem { public: - KWalletContainerItem(QListViewItem* parent, const QString& name, + KWalletContainerItem(TQListViewItem* parent, const TQString& name, KWallet::Wallet::EntryType type); virtual ~KWalletContainerItem(); public: virtual int rtti() const; KWallet::Wallet::EntryType type(); - bool contains(const QString& itemKey); - QListViewItem* getItem(const QString& itemKey); + bool contains(const TQString& itemKey); + TQListViewItem* getItem(const TQString& itemKey); private: KWallet::Wallet::EntryType _type; @@ -73,101 +73,101 @@ class KWalletContainerItem : public KListViewItem { class KWalletFolderItem : public KListViewItem { public: - KWalletFolderItem(KWallet::Wallet *w, QListView* parent, - const QString& name, int entries); + KWalletFolderItem(KWallet::Wallet *w, TQListView* parent, + const TQString& name, int entries); virtual ~KWalletFolderItem(); - virtual bool acceptDrop(const QMimeSource *mime) const; + virtual bool acceptDrop(const TQMimeSource *mime) const; virtual int rtti() const; - QString name() const; + TQString name() const; void refresh(); KWalletContainerItem* getContainer(KWallet::Wallet::EntryType type); - QPixmap getFolderIcon(KIcon::Group group); - bool contains(const QString& itemKey); - QListViewItem* getItem(const QString& itemKey); + TQPixmap getFolderIcon(KIcon::Group group); + bool contains(const TQString& itemKey); + TQListViewItem* getItem(const TQString& itemKey); public: KWallet::Wallet *_wallet; private: - QString _name; + TQString _name; int _entries; }; class KWalletEntryList : public KListView { Q_OBJECT public: - KWalletEntryList(QWidget *parent, const char *name = 0L); + KWalletEntryList(TQWidget *parent, const char *name = 0L); virtual ~KWalletEntryList(); - bool existsFolder(const QString& name); - KWalletFolderItem* getFolder(const QString& name); - void contentsDropEvent(QDropEvent *e); - void contentsDragEnterEvent(QDragEnterEvent *e); + bool existsFolder(const TQString& name); + KWalletFolderItem* getFolder(const TQString& name); + void contentsDropEvent(TQDropEvent *e); + void contentsDragEnterEvent(TQDragEnterEvent *e); void setWallet(KWallet::Wallet *w); protected: - void itemDropped(QDropEvent *e, QListViewItem *item); - virtual QDragObject *dragObject(); - virtual bool acceptDrag (QDropEvent* event) const; + void itemDropped(TQDropEvent *e, TQListViewItem *item); + virtual TQDragObject *dragObject(); + virtual bool acceptDrag (TQDropEvent* event) const; private: - static KWalletFolderItem *getItemFolder(QListViewItem *item); + static KWalletFolderItem *getItemFolder(TQListViewItem *item); public: KWallet::Wallet *_wallet; }; -class KWalletItem : public QIconViewItem { +class KWalletItem : public TQIconViewItem { public: - KWalletItem(QIconView *parent, const QString& walletName); + KWalletItem(TQIconView *parent, const TQString& walletName); virtual ~KWalletItem(); - virtual bool acceptDrop(const QMimeSource *mime) const; + virtual bool acceptDrop(const TQMimeSource *mime) const; protected: - virtual void dropped(QDropEvent *e, const QValueList& lst); + virtual void dropped(TQDropEvent *e, const TQValueList& lst); }; class KWalletIconView : public KIconView { Q_OBJECT public: - KWalletIconView(QWidget *parent, const char *name = 0L); + KWalletIconView(TQWidget *parent, const char *name = 0L); virtual ~KWalletIconView(); protected slots: - virtual void slotDropped(QDropEvent *e, const QValueList& lst); + virtual void slotDropped(TQDropEvent *e, const TQValueList& lst); protected: - virtual QDragObject *dragObject(); - virtual void contentsMousePressEvent(QMouseEvent *e); - QPoint _mousePos; + virtual TQDragObject *dragObject(); + virtual void contentsMousePressEvent(TQMouseEvent *e); + TQPoint _mousePos; }; -inline QDataStream& operator<<(QDataStream& str, const KWalletEntryItem& w) { - QString name = w.text(0); +inline TQDataStream& operator<<(TQDataStream& str, const KWalletEntryItem& w) { + TQString name = w.text(0); str << name; KWallet::Wallet::EntryType et = w._wallet->entryType(name); str << long(et); - QByteArray a; + TQByteArray a; w._wallet->readEntry(name, a); str << a; return str; } -inline QDataStream& operator<<(QDataStream& str, const KWalletFolderItem& w) { - QString oldFolder = w._wallet->currentFolder(); +inline TQDataStream& operator<<(TQDataStream& str, const KWalletFolderItem& w) { + TQString oldFolder = w._wallet->currentFolder(); str << w.name(); w._wallet->setFolder(w.name()); - QStringList entries = w._wallet->entryList(); - for (QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { + TQStringList entries = w._wallet->entryList(); + for (TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it) { str << *it; KWallet::Wallet::EntryType et = w._wallet->entryType(*it); str << long(et); - QByteArray a; + TQByteArray a; w._wallet->readEntry(*it, a); str << a; } diff --git a/kwallet/kbetterthankdialogbase.ui.h b/kwallet/kbetterthankdialogbase.ui.h index 3937746..4d32a14 100644 --- a/kwallet/kbetterthankdialogbase.ui.h +++ b/kwallet/kbetterthankdialogbase.ui.h @@ -25,7 +25,7 @@ void KBetterThanKDialogBase::clicked() } -void KBetterThanKDialogBase::setLabel( const QString & label ) +void KBetterThanKDialogBase::setLabel( const TQString & label ) { _label->setText(label); } @@ -45,6 +45,6 @@ void KBetterThanKDialogBase::accept() void KBetterThanKDialogBase::reject() { - QDialog::reject(); + TQDialog::reject(); setResult(4); } diff --git a/kwallet/konfigurator/konfigurator.cpp b/kwallet/konfigurator/konfigurator.cpp index a5fc336..25e5239 100644 --- a/kwallet/konfigurator/konfigurator.cpp +++ b/kwallet/konfigurator/konfigurator.cpp @@ -30,17 +30,17 @@ #include #include -#include -#include -#include -#include -#include -#include - -typedef KGenericFactory KWalletFactory; +#include +#include +#include +#include +#include +#include + +typedef KGenericFactory KWalletFactory; K_EXPORT_COMPONENT_FACTORY(kcm_kwallet, KWalletFactory("kcmkwallet")) -KWalletConfig::KWalletConfig(QWidget *parent, const char *name, const QStringList&) +KWalletConfig::KWalletConfig(TQWidget *parent, const char *name, const TQStringList&) : KCModule(KWalletFactory::instance(), parent, name) { KAboutData *about = @@ -53,24 +53,24 @@ KWalletConfig::KWalletConfig(QWidget *parent, const char *name, const QStringLis _cfg = new KConfig("kwalletrc", false, false); - QVBoxLayout *vbox = new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint()); vbox->add(_wcw = new WalletConfigWidget(this)); - connect(_wcw->_enabled, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_launchManager, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_autocloseManager, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_autoclose, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_closeIdle, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_openPrompt, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_screensaverLock, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_localWalletSelected, SIGNAL(clicked()), this, SLOT(configChanged())); - connect(_wcw->_idleTime, SIGNAL(valueChanged(int)), this, SLOT(configChanged())); - connect(_wcw->_launch, SIGNAL(clicked()), this, SLOT(launchManager())); - connect(_wcw->_newWallet, SIGNAL(clicked()), this, SLOT(newNetworkWallet())); - connect(_wcw->_newLocalWallet, SIGNAL(clicked()), this, SLOT(newLocalWallet())); - connect(_wcw->_localWallet, SIGNAL(activated(int)), this, SLOT(configChanged())); - connect(_wcw->_defaultWallet, SIGNAL(activated(int)), this, SLOT(configChanged())); - connect(_wcw->_accessList, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)), this, SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int))); + connect(_wcw->_enabled, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_launchManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_autocloseManager, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_autoclose, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_closeIdle, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_openPrompt, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_screensaverLock, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_localWalletSelected, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + connect(_wcw->_idleTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_launch, TQT_SIGNAL(clicked()), this, TQT_SLOT(launchManager())); + connect(_wcw->_newWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newNetworkWallet())); + connect(_wcw->_newLocalWallet, TQT_SIGNAL(clicked()), this, TQT_SLOT(newLocalWallet())); + connect(_wcw->_localWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_defaultWallet, TQT_SIGNAL(activated(int)), this, TQT_SLOT(configChanged())); + connect(_wcw->_accessList, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int))); _wcw->_accessList->setAllColumnsShowFocus(true); updateWalletLists(); @@ -90,14 +90,14 @@ KWalletConfig::~KWalletConfig() { void KWalletConfig::updateWalletLists() { - QString p1, p2; + TQString p1, p2; p1 = _wcw->_localWallet->currentText(); p2 = _wcw->_defaultWallet->currentText(); _wcw->_localWallet->clear(); _wcw->_defaultWallet->clear(); - QStringList wl = KWallet::Wallet::walletList(); + TQStringList wl = KWallet::Wallet::walletList(); _wcw->_localWallet->insertStringList(wl); _wcw->_defaultWallet->insertStringList(wl); @@ -111,22 +111,22 @@ void KWalletConfig::updateWalletLists() { } -QString KWalletConfig::newWallet() { +TQString KWalletConfig::newWallet() { bool ok; - QString n = KInputDialog::getText(i18n("New Wallet"), + TQString n = KInputDialog::getText(i18n("New Wallet"), i18n("Please choose a name for the new wallet:"), - QString::null, + TQString::null, &ok, this); if (!ok) { - return QString::null; + return TQString::null; } KWallet::Wallet *w = KWallet::Wallet::openWallet(n); if (!w) { - return QString::null; + return TQString::null; } delete w; @@ -135,7 +135,7 @@ QString KWalletConfig::newWallet() { void KWalletConfig::newLocalWallet() { - QString n = newWallet(); + TQString n = newWallet(); if (n.isEmpty()) { return; } @@ -149,7 +149,7 @@ void KWalletConfig::newLocalWallet() { void KWalletConfig::newNetworkWallet() { - QString n = newWallet(); + TQString n = newWallet(); if (n.isEmpty()) { return; } @@ -205,29 +205,29 @@ void KWalletConfig::load(bool useDefaults) { } _wcw->_accessList->clear(); _cfg->setGroup("Auto Deny"); - QStringList denykeys = _cfg->entryMap("Auto Deny").keys(); + TQStringList denykeys = _cfg->entryMap("Auto Deny").keys(); _cfg->setGroup("Auto Allow"); - QStringList keys = _cfg->entryMap("Auto Allow").keys(); - for (QStringList::Iterator i = keys.begin(); i != keys.end(); ++i) { + TQStringList keys = _cfg->entryMap("Auto Allow").keys(); + for (TQStringList::Iterator i = keys.begin(); i != keys.end(); ++i) { _cfg->setGroup("Auto Allow"); - QStringList apps = _cfg->readListEntry(*i); + TQStringList apps = _cfg->readListEntry(*i); _cfg->setGroup("Auto Deny"); - QStringList denyapps = _cfg->readListEntry(*i); + TQStringList denyapps = _cfg->readListEntry(*i); denykeys.remove(*i); - QListViewItem *lvi = new QListViewItem(_wcw->_accessList, *i); - for (QStringList::Iterator j = apps.begin(); j != apps.end(); ++j) { - new QListViewItem(lvi, QString::null, *j, i18n("Always Allow")); + TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); + for (TQStringList::Iterator j = apps.begin(); j != apps.end(); ++j) { + new TQListViewItem(lvi, TQString::null, *j, i18n("Always Allow")); } - for (QStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { - new QListViewItem(lvi, QString::null, *j, i18n("Always Deny")); + for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { + new TQListViewItem(lvi, TQString::null, *j, i18n("Always Deny")); } } _cfg->setGroup("Auto Deny"); - for (QStringList::Iterator i = denykeys.begin(); i != denykeys.end(); ++i) { - QStringList denyapps = _cfg->readListEntry(*i); - QListViewItem *lvi = new QListViewItem(_wcw->_accessList, *i); - for (QStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { - new QListViewItem(lvi, QString::null, *j, i18n("Always Deny")); + for (TQStringList::Iterator i = denykeys.begin(); i != denykeys.end(); ++i) { + TQStringList denyapps = _cfg->readListEntry(*i); + TQListViewItem *lvi = new TQListViewItem(_wcw->_accessList, *i); + for (TQStringList::Iterator j = denyapps.begin(); j != denyapps.end(); ++j) { + new TQListViewItem(lvi, TQString::null, *j, i18n("Always Deny")); } } emit changed(useDefaults); @@ -262,9 +262,9 @@ void KWalletConfig::save() { _cfg->deleteGroup("Auto Allow"); _cfg->deleteGroup("Auto Deny"); _cfg->setGroup("Auto Allow"); - for (QListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { - QStringList al; - for (QListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { + for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { + TQStringList al; + for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { if (j->text(2) == i18n("Always Allow")) { al << j->text(1); } @@ -273,9 +273,9 @@ void KWalletConfig::save() { } _cfg->setGroup("Auto Deny"); - for (QListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { - QStringList al; - for (QListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { + for (TQListViewItem *i = _wcw->_accessList->firstChild(); i; i = i->nextSibling()) { + TQStringList al; + for (TQListViewItem *j = i->firstChild(); j; j = j->nextSibling()) { if (j->text(2) == i18n("Always Deny")) { al << j->text(1); } @@ -295,24 +295,24 @@ void KWalletConfig::defaults() { } -QString KWalletConfig::quickHelp() const { +TQString KWalletConfig::quickHelp() const { return i18n("This configuration module allows you to configure the KDE wallet system."); } -void KWalletConfig::contextMenuRequested(QListViewItem *item, const QPoint& pos, int col) { +void KWalletConfig::contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { Q_UNUSED(col) if (item && item->parent()) { KPopupMenu *m = new KPopupMenu(this); m->insertTitle(item->parent()->text(0)); - m->insertItem(i18n("&Delete"), this, SLOT(deleteEntry()), Key_Delete); + m->insertItem(i18n("&Delete"), this, TQT_SLOT(deleteEntry()), Key_Delete); m->popup(pos); } } void KWalletConfig::deleteEntry() { - QListViewItem *item = _wcw->_accessList->selectedItem(); + TQListViewItem *item = _wcw->_accessList->selectedItem(); if (item) { delete item; emit changed(true); diff --git a/kwallet/konfigurator/konfigurator.h b/kwallet/konfigurator/konfigurator.h index e12ebfc..0d4d4b6 100644 --- a/kwallet/konfigurator/konfigurator.h +++ b/kwallet/konfigurator/konfigurator.h @@ -29,7 +29,7 @@ class QListViewItem; class KWalletConfig : public KCModule { Q_OBJECT public: - KWalletConfig(QWidget *parent = 0L, const char *name = 0L, const QStringList& = QStringList()); + KWalletConfig(TQWidget *parent = 0L, const char *name = 0L, const TQStringList& = TQStringList()); virtual ~KWalletConfig(); void load(); @@ -37,7 +37,7 @@ class KWalletConfig : public KCModule { void save(); void defaults(); - QString quickHelp() const; + TQString quickHelp() const; public slots: void configChanged(); @@ -45,9 +45,9 @@ class KWalletConfig : public KCModule { void newLocalWallet(); void newNetworkWallet(); void updateWalletLists(); - QString newWallet(); + TQString newWallet(); void deleteEntry(); - void contextMenuRequested(QListViewItem *item, const QPoint& pos, int col); + void contextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); private: WalletConfigWidget *_wcw; diff --git a/kwallet/kwalleteditor.cpp b/kwallet/kwalleteditor.cpp index d9e49d0..adaec87 100644 --- a/kwallet/kwalleteditor.cpp +++ b/kwallet/kwalleteditor.cpp @@ -45,30 +45,30 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent, const char *name) +KWalletEditor::KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent, const char *name) : KMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) { _newWallet = false; _ww = new WalletWidget(this, "Wallet Widget"); - _copyPassAction = KStdAction::copy(this, SLOT(copyPassword()), actionCollection()); + _copyPassAction = KStdAction::copy(this, TQT_SLOT(copyPassword()), actionCollection()); - QVBoxLayout *box = new QVBoxLayout(_ww->_entryListFrame); + TQVBoxLayout *box = new TQVBoxLayout(_ww->_entryListFrame); box->setSpacing( KDialog::spacingHint() ); box->setMargin( KDialog::marginHint() ); _entryList = new KWalletEntryList(_ww->_entryListFrame, "Wallet Entry List"); @@ -77,9 +77,9 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent _ww->_entryStack->setEnabled(true); - box = new QVBoxLayout(_ww->_entryStack->widget(2)); - _mapEditorShowHide = new QCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2)); - connect(_mapEditorShowHide, SIGNAL(toggled(bool)), this, SLOT(showHideMapEditorValue(bool))); + box = new TQVBoxLayout(_ww->_entryStack->widget(2)); + _mapEditorShowHide = new TQCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2)); + connect(_mapEditorShowHide, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showHideMapEditorValue(bool))); _mapEditor = new KWMapEditor(_currentMap, _ww->_entryStack->widget(2)); box->addWidget(_mapEditorShowHide); box->addWidget(_mapEditor); @@ -88,40 +88,40 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent resize(600, 400); - connect(_entryList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(entrySelectionChanged(QListViewItem*))); + connect(_entryList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(entrySelectionChanged(TQListViewItem*))); connect(_entryList, - SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&,int)), + TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)), this, - SLOT(listContextMenuRequested(QListViewItem*,const QPoint&,int))); + TQT_SLOT(listContextMenuRequested(TQListViewItem*,const TQPoint&,int))); connect(_entryList, - SIGNAL(itemRenamed(QListViewItem*, int, const QString&)), + TQT_SIGNAL(itemRenamed(TQListViewItem*, int, const TQString&)), this, - SLOT(listItemRenamed(QListViewItem*, int, const QString&))); + TQT_SLOT(listItemRenamed(TQListViewItem*, int, const TQString&))); - connect(_ww->_passwordValue, SIGNAL(textChanged()), - this, SLOT(entryEditted())); - connect(_mapEditor, SIGNAL(dirty()), - this, SLOT(entryEditted())); + connect(_ww->_passwordValue, TQT_SIGNAL(textChanged()), + this, TQT_SLOT(entryEditted())); + connect(_mapEditor, TQT_SIGNAL(dirty()), + this, TQT_SLOT(entryEditted())); - connect(_ww->_undoChanges, SIGNAL(clicked()), - this, SLOT(restoreEntry())); - connect(_ww->_saveChanges, SIGNAL(clicked()), - this, SLOT(saveEntry())); + connect(_ww->_undoChanges, TQT_SIGNAL(clicked()), + this, TQT_SLOT(restoreEntry())); + connect(_ww->_saveChanges, TQT_SIGNAL(clicked()), + this, TQT_SLOT(saveEntry())); - connect(_ww->_showContents, SIGNAL(clicked()), - this, SLOT(showPasswordContents())); - connect(_ww->_hideContents, SIGNAL(clicked()), - this, SLOT(hidePasswordContents())); + connect(_ww->_showContents, TQT_SIGNAL(clicked()), + this, TQT_SLOT(showPasswordContents())); + connect(_ww->_hideContents, TQT_SIGNAL(clicked()), + this, TQT_SLOT(hidePasswordContents())); _walletIsOpen = false; _w = KWallet::Wallet::openWallet(wallet, winId(), isPath ? KWallet::Wallet::Path : KWallet::Wallet::Asynchronous); if (_w) { - connect(_w, SIGNAL(walletOpened(bool)), this, SLOT(walletOpened(bool))); - connect(_w, SIGNAL(walletClosed()), this, SLOT(walletClosed())); - connect(_w, SIGNAL(folderUpdated(const QString&)), this, SLOT(updateEntries(const QString&))); - connect(_w, SIGNAL(folderListUpdated()), this, SLOT(updateFolderList())); + connect(_w, TQT_SIGNAL(walletOpened(bool)), this, TQT_SLOT(walletOpened(bool))); + connect(_w, TQT_SIGNAL(walletClosed()), this, TQT_SLOT(walletClosed())); + connect(_w, TQT_SIGNAL(folderUpdated(const TQString&)), this, TQT_SLOT(updateEntries(const TQString&))); + connect(_w, TQT_SIGNAL(folderListUpdated()), this, TQT_SLOT(updateFolderList())); updateFolderList(); } else { kdDebug(2300) << "Wallet open failed!" << endl; @@ -133,7 +133,7 @@ KWalletEditor::KWalletEditor(const QString& wallet, bool isPath, QWidget *parent setCaption(wallet); - QTimer::singleShot(0, this, SLOT(layout())); + TQTimer::singleShot(0, this, TQT_SLOT(layout())); } KWalletEditor::~KWalletEditor() { @@ -150,7 +150,7 @@ KWalletEditor::~KWalletEditor() { } void KWalletEditor::layout() { - QValueList sz = _ww->_splitter->sizes(); + TQValueList sz = _ww->_splitter->sizes(); int sum = sz[0] + sz[1]; sz[0] = sum/2; sz[1] = sum/2; @@ -159,49 +159,49 @@ void KWalletEditor::layout() { void KWalletEditor::createActions() { _newFolderAction = new KAction(i18n("&New Folder..."), "folder_new", - 0, this, SLOT(createFolder()), actionCollection(), + 0, this, TQT_SLOT(createFolder()), actionCollection(), "create_folder"); - connect(this, SIGNAL(enableFolderActions(bool)), - _newFolderAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableFolderActions(bool)), + _newFolderAction, TQT_SLOT(setEnabled(bool))); _deleteFolderAction = new KAction(i18n("&Delete Folder"), 0, 0, - this, SLOT(deleteFolder()), actionCollection(), + this, TQT_SLOT(deleteFolder()), actionCollection(), "delete_folder"); - connect(this, SIGNAL(enableContextFolderActions(bool)), - _deleteFolderAction, SLOT(setEnabled(bool))); - connect(this, SIGNAL(enableFolderActions(bool)), - _deleteFolderAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableContextFolderActions(bool)), + _deleteFolderAction, TQT_SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableFolderActions(bool)), + _deleteFolderAction, TQT_SLOT(setEnabled(bool))); _passwordAction = new KAction(i18n("Change &Password..."), 0, 0, this, - SLOT(changePassword()), actionCollection(), + TQT_SLOT(changePassword()), actionCollection(), "change_password"); - connect(this, SIGNAL(enableWalletActions(bool)), - _passwordAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _passwordAction, TQT_SLOT(setEnabled(bool))); _mergeAction = new KAction(i18n("&Merge Wallet..."), 0, 0, this, - SLOT(importWallet()), actionCollection(), + TQT_SLOT(importWallet()), actionCollection(), "merge"); - connect(this, SIGNAL(enableWalletActions(bool)), - _mergeAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _mergeAction, TQT_SLOT(setEnabled(bool))); _importAction = new KAction(i18n("&Import XML..."), 0, 0, this, - SLOT(importXML()), actionCollection(), + TQT_SLOT(importXML()), actionCollection(), "import"); - connect(this, SIGNAL(enableWalletActions(bool)), - _importAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _importAction, TQT_SLOT(setEnabled(bool))); _exportAction = new KAction(i18n("&Export..."), 0, 0, this, - SLOT(exportXML()), actionCollection(), + TQT_SLOT(exportXML()), actionCollection(), "export"); - connect(this, SIGNAL(enableWalletActions(bool)), - _exportAction, SLOT(setEnabled(bool))); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _exportAction, TQT_SLOT(setEnabled(bool))); - _saveAsAction = KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - connect(this, SIGNAL(enableWalletActions(bool)), - _saveAsAction, SLOT(setEnabled(bool))); + _saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + connect(this, TQT_SIGNAL(enableWalletActions(bool)), + _saveAsAction, TQT_SLOT(setEnabled(bool))); - KStdAction::quit(this, SLOT(close()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); emit enableWalletActions(false); emit enableFolderActions(false); @@ -222,10 +222,10 @@ void KWalletEditor::walletClosed() { void KWalletEditor::updateFolderList(bool checkEntries) { - QStringList fl = _w->folderList(); - QPtrStack trash; + TQStringList fl = _w->folderList(); + TQPtrStack trash; - for (QListViewItem *i = _entryList->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = _entryList->firstChild(); i; i = i->nextSibling()) { KWalletFolderItem *fi = dynamic_cast(i); if (!fi) { continue; @@ -238,7 +238,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { trash.setAutoDelete(true); trash.clear(); - for (QStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { + for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { if (_entryList->existsFolder(*i)) { if (checkEntries) { updateEntries(*i); @@ -247,7 +247,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { } _w->setFolder(*i); - QStringList entries = _w->entryList(); + TQStringList entries = _w->entryList(); KWalletFolderItem *item = new KWalletFolderItem(_w,_entryList, *i, entries.count()); @@ -256,7 +256,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { KWalletContainerItem *bi = new KWalletContainerItem(item, i18n("Binary Data"),KWallet::Wallet::Stream); KWalletContainerItem *ui = new KWalletContainerItem(item, i18n("Unknown"),KWallet::Wallet::Unknown); - for (QStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { + for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { switch (_w->entryType(*j)) { case KWallet::Wallet::Password: new KWalletEntryItem(_w, pi, *j); @@ -269,7 +269,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { break; case KWallet::Wallet::Unknown: default: - new QListViewItem(ui, *j); + new TQListViewItem(ui, *j); break; } } @@ -286,7 +286,7 @@ void KWalletEditor::updateFolderList(bool checkEntries) { void KWalletEditor::deleteFolder() { if (_w) { - QListViewItem *i = _entryList->currentItem(); + TQListViewItem *i = _entryList->currentItem(); if (i) { KWalletFolderItem *fi = dynamic_cast(i); if (!fi) { @@ -312,13 +312,13 @@ void KWalletEditor::deleteFolder() { void KWalletEditor::createFolder() { if (_w) { - QString n; + TQString n; bool ok; do { n = KInputDialog::getText(i18n("New Folder"), i18n("Please choose a name for the new folder:"), - QString::null, + TQString::null, &ok, this); @@ -327,11 +327,11 @@ void KWalletEditor::createFolder() { } if (_entryList->existsFolder(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that folder name is in use. Try again?"), QString::null, i18n("Try Again"), i18n("Do Not Try")); + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that folder name is in use. Try again?"), TQString::null, i18n("Try Again"), i18n("Do Not Try")); if (rc == KMessageBox::Yes) { continue; } - n = QString::null; + n = TQString::null; } break; } while (true); @@ -344,7 +344,7 @@ void KWalletEditor::createFolder() { void KWalletEditor::saveEntry() { int rc = 1; - QListViewItem *item = _entryList->currentItem(); + TQListViewItem *item = _entryList->currentItem(); _ww->_saveChanges->setEnabled(false); _ww->_undoChanges->setEnabled(false); @@ -381,7 +381,7 @@ void KWalletEditor::entryEditted() { } -void KWalletEditor::entrySelectionChanged(QListViewItem *item) { +void KWalletEditor::entrySelectionChanged(TQListViewItem *item) { KWalletContainerItem *ci = 0L; KWalletFolderItem *fi = 0L; @@ -398,7 +398,7 @@ void KWalletEditor::entrySelectionChanged(QListViewItem *item) { _w->setFolder(fi->name()); _deleteFolderAction->setEnabled(false); if (ci->type() == KWallet::Wallet::Password) { - QString pass; + TQString pass; if (_w->readPassword(item->text(0), pass) == 0) { _ww->_entryStack->raiseWidget(int(4)); _ww->_entryName->setText(i18n("Password: %1") @@ -419,7 +419,7 @@ void KWalletEditor::entrySelectionChanged(QListViewItem *item) { } } else if (ci->type() == KWallet::Wallet::Stream) { _ww->_entryStack->raiseWidget(int(3)); - QByteArray ba; + TQByteArray ba; if (_w->readEntry(item->text(0), ba) == 0) { _ww->_entryName->setText(i18n("Binary Data: %1") .arg(item->text(0))); @@ -454,16 +454,16 @@ void KWalletEditor::entrySelectionChanged(QListViewItem *item) { if (fi) { _currentFolder = fi->name(); - _ww->_entryTitle->setText(QString("%1").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); _ww->_iconTitle->setPixmap(fi->getFolderIcon(KIcon::Toolbar)); } } -void KWalletEditor::updateEntries(const QString& folder) { - QPtrStack trash; +void KWalletEditor::updateEntries(const TQString& folder) { + TQPtrStack trash; _w->setFolder(folder); - QStringList entries = _w->entryList(); + TQStringList entries = _w->entryList(); KWalletFolderItem *fi = _entryList->getFolder(folder); @@ -477,7 +477,7 @@ void KWalletEditor::updateEntries(const QString& folder) { KWalletContainerItem *ui = fi->getContainer(KWallet::Wallet::Unknown); // Remove deleted entries - for (QListViewItem *i = pi->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = pi->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -486,7 +486,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } - for (QListViewItem *i = mi->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = mi->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -495,7 +495,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } - for (QListViewItem *i = bi->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = bi->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -504,7 +504,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } - for (QListViewItem *i = ui->firstChild(); i; i = i->nextSibling()) { + for (TQListViewItem *i = ui->firstChild(); i; i = i->nextSibling()) { if (!entries.contains(i->text(0))) { if (i == _entryList->currentItem()) { entrySelectionChanged(0L); @@ -517,7 +517,7 @@ void KWalletEditor::updateEntries(const QString& folder) { trash.clear(); // Add new entries - for (QStringList::Iterator i = entries.begin(); i != entries.end(); ++i) { + for (TQStringList::Iterator i = entries.begin(); i != entries.end(); ++i) { if (fi->contains(*i)){ continue; } @@ -534,13 +534,13 @@ void KWalletEditor::updateEntries(const QString& folder) { break; case KWallet::Wallet::Unknown: default: - new QListViewItem(ui, *i); + new TQListViewItem(ui, *i); break; } } fi->refresh(); if (fi->name() == _currentFolder) { - _ww->_entryTitle->setText(QString("%1").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); } if (!_entryList->selectedItem()) { _ww->_entryName->clear(); @@ -548,7 +548,7 @@ void KWalletEditor::updateEntries(const QString& folder) { } } -void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& pos, int col) { +void KWalletEditor::listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col) { Q_UNUSED(col) if (!_walletIsOpen) { @@ -579,15 +579,15 @@ void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& KPopupMenu *m = new KPopupMenu(this); if (item) { - QString title = item->text(0); + TQString title = item->text(0); // I think 200 pixels is wide enough for a title title = KStringHandler::cPixelSqueeze(title, m->fontMetrics(), 200); m->insertTitle(title); switch (menuClass) { case KWalletEntryItemClass: - m->insertItem(i18n("&New..." ), this, SLOT(newEntry()), Key_Insert); - m->insertItem(i18n( "&Rename" ), this, SLOT(renameEntry()), Key_F2); - m->insertItem(i18n( "&Delete" ), this, SLOT(deleteEntry()), Key_Delete); + m->insertItem(i18n("&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); + m->insertItem(i18n( "&Rename" ), this, TQT_SLOT(renameEntry()), Key_F2); + m->insertItem(i18n( "&Delete" ), this, TQT_SLOT(deleteEntry()), Key_Delete); if (ci && ci->type() == KWallet::Wallet::Password) { m->insertSeparator(); _copyPassAction->plug(m); @@ -595,7 +595,7 @@ void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& break; case KWalletContainerItemClass: - m->insertItem(i18n( "&New..." ), this, SLOT(newEntry()), Key_Insert); + m->insertItem(i18n( "&New..." ), this, TQT_SLOT(newEntry()), Key_Insert); break; case KWalletFolderItemClass: @@ -613,22 +613,22 @@ void KWalletEditor::listContextMenuRequested(QListViewItem *item, const QPoint& void KWalletEditor::copyPassword() { - QListViewItem *item = _entryList->selectedItem(); + TQListViewItem *item = _entryList->selectedItem(); if (_w && item) { - QString pass; + TQString pass; if (_w->readPassword(item->text(0), pass) == 0) { - QApplication::clipboard()->setText(pass); + TQApplication::clipboard()->setText(pass); } } } void KWalletEditor::newEntry() { - QListViewItem *item = _entryList->selectedItem(); - QString n; + TQListViewItem *item = _entryList->selectedItem(); + TQString n; bool ok; - QListViewItem *p; + TQListViewItem *p; KWalletFolderItem *fi; //set the folder where we're trying to create the new entry @@ -649,7 +649,7 @@ void KWalletEditor::newEntry() { do { n = KInputDialog::getText(i18n("New Entry"), i18n("Please choose a name for the new entry:"), - QString::null, + TQString::null, &ok, this); @@ -659,17 +659,17 @@ void KWalletEditor::newEntry() { // FIXME: prohibits the use of the subheadings if (fi->contains(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that entry already exists. Try again?"), QString::null, i18n("Try Again"), i18n("Do Not Try")); + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that entry already exists. Try again?"), TQString::null, i18n("Try Again"), i18n("Do Not Try")); if (rc == KMessageBox::Yes) { continue; } - n = QString::null; + n = TQString::null; } break; } while (true); if (_w && item && !n.isEmpty()) { - QListViewItem *p = item; + TQListViewItem *p = item; if (p->rtti() == KWalletEntryItemClass) { p = item->parent(); } @@ -691,22 +691,22 @@ void KWalletEditor::newEntry() { return; } if (ci->type() == KWallet::Wallet::Password) { - _w->writePassword(n, QString::null); + _w->writePassword(n, TQString::null); } else if (ci->type() == KWallet::Wallet::Map) { - _w->writeMap(n, QMap()); + _w->writeMap(n, TQMap()); } else if (ci->type() == KWallet::Wallet::Stream) { - _w->writeEntry(n, QByteArray()); + _w->writeEntry(n, TQByteArray()); } else { abort(); } fi->refresh(); - _ww->_entryTitle->setText(QString("%1").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); } } void KWalletEditor::renameEntry() { - QListViewItem *item = _entryList->selectedItem(); + TQListViewItem *item = _entryList->selectedItem(); if (_w && item) { item->startRename(0); } @@ -714,7 +714,7 @@ void KWalletEditor::renameEntry() { // Only supports renaming of KWalletEntryItem derived classes. -void KWalletEditor::listItemRenamed(QListViewItem* item, int, const QString& t) { +void KWalletEditor::listItemRenamed(TQListViewItem* item, int, const TQString& t) { if (item) { KWalletEntryItem *i = dynamic_cast(item); if (!i) { @@ -748,7 +748,7 @@ void KWalletEditor::listItemRenamed(QListViewItem* item, int, const QString& t) void KWalletEditor::deleteEntry() { - QListViewItem *item = _entryList->selectedItem(); + TQListViewItem *item = _entryList->selectedItem(); if (_w && item) { int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the item '%1'?").arg(item->text(0)),"",KStdGuiItem::del()); if (rc == KMessageBox::Continue) { @@ -761,7 +761,7 @@ void KWalletEditor::deleteEntry() { delete item; entrySelectionChanged(_entryList->currentItem()); fi->refresh(); - _ww->_entryTitle->setText(QString("%1").arg(fi->text(0))); + _ww->_entryTitle->setText(TQString("%1").arg(fi->text(0))); } } } @@ -811,12 +811,12 @@ void KWalletEditor::showHideMapEditorValue(bool show) { enum MergePlan { Prompt = 0, Always = 1, Never = 2, Yes = 3, No = 4 }; void KWalletEditor::importWallet() { - KURL url = KFileDialog::getOpenURL(QString::null, "*.kwl", this); + KURL url = KFileDialog::getOpenURL(TQString::null, "*.kwl", this); if (url.isEmpty()) { return; } - QString tmpFile; + TQString tmpFile; if (!KIO::NetAccess::download(url, tmpFile, this)) { KMessageBox::sorry(this, i18n("Unable to access wallet '%1'.").arg(url.prettyURL())); return; @@ -825,8 +825,8 @@ void KWalletEditor::importWallet() { KWallet::Wallet *w = KWallet::Wallet::openWallet(tmpFile, winId(), KWallet::Wallet::Path); if (w && w->isOpen()) { MergePlan mp = Prompt; - QStringList fl = w->folderList(); - for (QStringList::ConstIterator f = fl.constBegin(); f != fl.constEnd(); ++f) { + TQStringList fl = w->folderList(); + for (TQStringList::ConstIterator f = fl.constBegin(); f != fl.constEnd(); ++f) { if (!w->setFolder(*f)) { continue; } @@ -837,17 +837,17 @@ void KWalletEditor::importWallet() { _w->setFolder(*f); - QMap > map; + TQMap > map; int rc; rc = w->readMapList("*", map); if (rc == 0) { - QMap >::ConstIterator me; + TQMap >::ConstIterator me; for (me = map.constBegin(); me != map.constEnd(); ++me) { bool hasEntry = _w->hasEntry(me.key()); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(QStyleSheet::escape(*f)).arg(QStyleSheet::escape(me.key()))); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(me.key()))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -868,16 +868,16 @@ void KWalletEditor::importWallet() { } } - QMap pwd; + TQMap pwd; rc = w->readPasswordList("*", pwd); if (rc == 0) { - QMap::ConstIterator pe; + TQMap::ConstIterator pe; for (pe = pwd.constBegin(); pe != pwd.constEnd(); ++pe) { bool hasEntry = _w->hasEntry(pe.key()); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(QStyleSheet::escape(*f)).arg(QStyleSheet::escape(pe.key()))); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(pe.key()))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -898,16 +898,16 @@ void KWalletEditor::importWallet() { } } - QMap ent; + TQMap ent; rc = w->readEntryList("*", ent); if (rc == 0) { - QMap::ConstIterator ee; + TQMap::ConstIterator ee; for (ee = ent.constBegin(); ee != ent.constEnd(); ++ee) { bool hasEntry = _w->hasEntry(ee.key()); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(QStyleSheet::escape(*f)).arg(QStyleSheet::escape(ee.key()))); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(*f)).arg(TQStyleSheet::escape(ee.key()))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -939,48 +939,48 @@ void KWalletEditor::importWallet() { void KWalletEditor::importXML() { - KURL url = KFileDialog::getOpenURL(QString::null, "*.xml", this); + KURL url = KFileDialog::getOpenURL(TQString::null, "*.xml", this); if (url.isEmpty()) { return; } - QString tmpFile; + TQString tmpFile; if (!KIO::NetAccess::download(url, tmpFile, this)) { KMessageBox::sorry(this, i18n("Unable to access XML file '%1'.").arg(url.prettyURL())); return; } - QFile qf(tmpFile); + TQFile qf(tmpFile); if (!qf.open(IO_ReadOnly)) { KMessageBox::sorry(this, i18n("Error opening XML file '%1' for input.").arg(url.prettyURL())); KIO::NetAccess::removeTempFile(tmpFile); return; } - QDomDocument doc(tmpFile); + TQDomDocument doc(tmpFile); if (!doc.setContent(&qf)) { KMessageBox::sorry(this, i18n("Error reading XML file '%1' for input.").arg(url.prettyURL())); KIO::NetAccess::removeTempFile(tmpFile); return; } - QDomElement top = doc.documentElement(); + TQDomElement top = doc.documentElement(); if (top.tagName().lower() != "wallet") { KMessageBox::sorry(this, i18n("Error: XML file does not contain a wallet.")); KIO::NetAccess::removeTempFile(tmpFile); return; } - QDomNode n = top.firstChild(); + TQDomNode n = top.firstChild(); MergePlan mp = Prompt; while (!n.isNull()) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if (e.tagName().lower() != "folder") { n = n.nextSibling(); continue; } - QString fname = e.attribute("name"); + TQString fname = e.attribute("name"); if (fname.isEmpty()) { n = n.nextSibling(); continue; @@ -989,16 +989,16 @@ void KWalletEditor::importXML() { _w->createFolder(fname); } _w->setFolder(fname); - QDomNode enode = e.firstChild(); + TQDomNode enode = e.firstChild(); while (!enode.isNull()) { e = enode.toElement(); - QString type = e.tagName().lower(); - QString ename = e.attribute("name"); + TQString type = e.tagName().lower(); + TQString ename = e.attribute("name"); bool hasEntry = _w->hasEntry(ename); if (hasEntry && mp == Prompt) { KBetterThanKDialogBase *bd; bd = new KBetterThanKDialogBase(this); - bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(QStyleSheet::escape(fname)).arg(QStyleSheet::escape(ename))); + bd->setLabel(i18n("Folder '%1' already contains an entry '%2'. Do you wish to replace it?").arg(TQStyleSheet::escape(fname)).arg(TQStyleSheet::escape(ename))); mp = (MergePlan)bd->exec(); delete bd; bool ok = false; @@ -1022,10 +1022,10 @@ void KWalletEditor::importXML() { } else if (type == "stream") { _w->writeEntry(ename, KCodecs::base64Decode(e.text().latin1())); } else if (type == "map") { - QMap map; - QDomNode mapNode = e.firstChild(); + TQMap map; + TQDomNode mapNode = e.firstChild(); while (!mapNode.isNull()) { - QDomElement mape = mapNode.toElement(); + TQDomElement mape = mapNode.toElement(); if (mape.tagName().lower() == "mapentry") { map[mape.attribute("name")] = mape.text(); } @@ -1047,31 +1047,31 @@ void KWalletEditor::importXML() { void KWalletEditor::exportXML() { KTempFile tf; tf.setAutoDelete(true); - QTextStream& ts(*tf.textStream()); - QStringList fl = _w->folderList(); + TQTextStream& ts(*tf.textStream()); + TQStringList fl = _w->folderList(); ts << "" << endl; - for (QStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { + for (TQStringList::Iterator i = fl.begin(); i != fl.end(); ++i) { ts << " " << endl; _w->setFolder(*i); - QStringList entries = _w->entryList(); - for (QStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { + TQStringList entries = _w->entryList(); + for (TQStringList::Iterator j = entries.begin(); j != entries.end(); ++j) { switch (_w->entryType(*j)) { case KWallet::Wallet::Password: { - QString pass; + TQString pass; if (_w->readPassword(*j, pass) == 0) { - ts << " "; - ts << QStyleSheet::escape(pass); + ts << " "; + ts << TQStyleSheet::escape(pass); ts << "" << endl; } break; } case KWallet::Wallet::Stream: { - QByteArray ba; + TQByteArray ba; if (_w->readEntry(*j, ba) == 0) { - ts << " "; + ts << " "; ts << KCodecs::base64Encode(ba); ts << "" << endl; @@ -1080,11 +1080,11 @@ void KWalletEditor::exportXML() { } case KWallet::Wallet::Map: { - QMap map; + TQMap map; if (_w->readMap(*j, map) == 0) { - ts << " " << endl; - for (QMap::ConstIterator k = map.begin(); k != map.end(); ++k) { - ts << " " << QStyleSheet::escape(k.data()) << "" << endl; + ts << " " << endl; + for (TQMap::ConstIterator k = map.begin(); k != map.end(); ++k) { + ts << " " << TQStyleSheet::escape(k.data()) << "" << endl; } ts << " " << endl; } @@ -1101,7 +1101,7 @@ void KWalletEditor::exportXML() { ts << "" << endl; tf.close(); - KURL url = KFileDialog::getSaveURL(QString::null, "*.xml", this); + KURL url = KFileDialog::getSaveURL(TQString::null, "*.xml", this); if (!url.isEmpty()) { bool ok = true; @@ -1125,13 +1125,13 @@ void KWalletEditor::setNewWallet(bool x) { void KWalletEditor::saveAs() { - KURL url = KFileDialog::getSaveURL(QString::null, "*.kwl", this); + KURL url = KFileDialog::getSaveURL(TQString::null, "*.kwl", this); if (!url.isEmpty()) { // Sync() kwalletd if (_nonLocal) { KIO::NetAccess::file_copy(KURL(_walletName), url, 0600, false, false, this); } else { - QString path = KGlobal::dirs()->saveLocation("kwallet") + "/" + _walletName + ".kwl"; + TQString path = KGlobal::dirs()->saveLocation("kwallet") + "/" + _walletName + ".kwl"; KURL destURL; destURL.setPath(path); KIO::NetAccess::file_copy(destURL, url, 0600, false, false, this); } diff --git a/kwallet/kwalleteditor.h b/kwallet/kwalleteditor.h index 2a3c9ef..62cbcf1 100644 --- a/kwallet/kwalleteditor.h +++ b/kwallet/kwalleteditor.h @@ -24,7 +24,7 @@ #include "walletwidget.h" #include #include -#include +#include class KAction; class QIconViewItem; @@ -38,7 +38,7 @@ class KWalletEditor : public KMainWindow { Q_OBJECT public: - KWalletEditor(const QString& wallet, bool isPath, QWidget *parent = 0, const char* name = 0); + KWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent = 0, const char* name = 0); virtual ~KWalletEditor(); bool isOpen() const { return _w != 0L; } @@ -53,10 +53,10 @@ class KWalletEditor : public KMainWindow { private slots: void layout(); void updateFolderList(bool checkEntries = false); - void entrySelectionChanged(QListViewItem *item); - void listItemRenamed(QListViewItem *, int, const QString&); - void listContextMenuRequested(QListViewItem *item, const QPoint& pos, int col); - void updateEntries(const QString& folder); + void entrySelectionChanged(TQListViewItem *item); + void listItemRenamed(TQListViewItem *, int, const TQString&); + void listContextMenuRequested(TQListViewItem *item, const TQPoint& pos, int col); + void updateEntries(const TQString& folder); void newEntry(); void renameEntry(); @@ -86,7 +86,7 @@ class KWalletEditor : public KMainWindow { void editorClosed(KMainWindow*); public: - QString _walletName; + TQString _walletName; private: void createActions(); @@ -98,12 +98,12 @@ class KWalletEditor : public KMainWindow { KAction *_newFolderAction, *_deleteFolderAction; KAction *_passwordAction, *_exportAction, *_saveAsAction, *_mergeAction, *_importAction; KAction *_copyPassAction; - QLabel*_details; - QString _currentFolder; - QMap _currentMap; // save memory by storing + TQLabel*_details; + TQString _currentFolder; + TQMap _currentMap; // save memory by storing // only the most recent map. KWMapEditor *_mapEditor; - QCheckBox *_mapEditorShowHide; + TQCheckBox *_mapEditorShowHide; bool _newWallet; }; diff --git a/kwallet/kwalletmanager.cpp b/kwallet/kwalletmanager.cpp index a4fe6cf..58c98aa 100644 --- a/kwallet/kwalletmanager.cpp +++ b/kwallet/kwalletmanager.cpp @@ -39,18 +39,18 @@ #include #include -#include -#include -#include -#include -#include -#include - -KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) +#include +#include +#include +#include +#include +#include + +KWalletManager::KWalletManager(TQWidget *parent, const char *name, WFlags f) : KMainWindow(parent, name, f), DCOPObject("KWalletManager") { KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); _kwalletdLaunch = false; - QAccel *accel = new QAccel(this, "kwalletmanager"); + TQAccel *accel = new TQAccel(this, "kwalletmanager"); KApplication::dcopClient()->setQtBridgeEnabled(false); _shuttingDown = false; @@ -60,15 +60,15 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) if (walletConfigGroup.readBoolEntry("Launch Manager", true)) { _tray = new KSystemTray(this, "kwalletmanager tray"); _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); - QToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); - connect(_tray, SIGNAL(quitSelected()), SLOT(shuttingDown())); - QStringList wl = KWallet::Wallet::walletList(); + TQToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); + connect(_tray, TQT_SIGNAL(quitSelected()), TQT_SLOT(shuttingDown())); + TQStringList wl = KWallet::Wallet::walletList(); bool isOpen = false; - for (QStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { + for (TQStringList::Iterator it = wl.begin(); it != wl.end(); ++it) { if (KWallet::Wallet::isOpen(*it)) { _tray->setPixmap(loadSystemTrayIcon("wallet_open")); - QToolTip::remove(_tray); - QToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); isOpen = true; break; } @@ -76,7 +76,7 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) if (!isOpen && kapp->isRestored()) { delete _tray; _tray = 0L; - QTimer::singleShot( 0, kapp, SLOT( quit())); + TQTimer::singleShot( 0, kapp, TQT_SLOT( quit())); return; } } else { @@ -84,8 +84,8 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) } _iconView = new KWalletIconView(this, "kwalletmanager icon view"); - connect(_iconView, SIGNAL(executed(QIconViewItem*)), this, SLOT(openWallet(QIconViewItem*))); - connect(_iconView, SIGNAL(contextMenuRequested(QIconViewItem*, const QPoint&)), this, SLOT(contextMenu(QIconViewItem*, const QPoint&))); + connect(_iconView, TQT_SIGNAL(executed(TQIconViewItem*)), this, TQT_SLOT(openWallet(TQIconViewItem*))); + connect(_iconView, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)), this, TQT_SLOT(contextMenu(TQIconViewItem*, const TQPoint&))); updateWalletDisplay(); setCentralWidget(_iconView); @@ -94,18 +94,18 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) _dcopRef = new DCOPRef("kded", "kwalletd"); _dcopRef->dcopClient()->setNotifications(true); connect(_dcopRef->dcopClient(), - SIGNAL(applicationRemoved(const QCString&)), + TQT_SIGNAL(applicationRemoved(const TQCString&)), this, - SLOT(possiblyRescan(const QCString&))); + TQT_SLOT(possiblyRescan(const TQCString&))); connect(_dcopRef->dcopClient(), - SIGNAL(applicationRegistered(const QCString&)), + TQT_SIGNAL(applicationRegistered(const TQCString&)), this, - SLOT(possiblyRescan(const QCString&))); + TQT_SLOT(possiblyRescan(const TQCString&))); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "allWalletsClosed()", "allWalletsClosed()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(QString)", "updateWalletDisplay()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(QString)", "aWalletWasOpened()", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(QString)", "updateWalletDisplay()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(TQString)", "updateWalletDisplay()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletOpened(TQString)", "aWalletWasOpened()", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletDeleted(TQString)", "updateWalletDisplay()", false); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletListDirty()", "updateWalletDisplay()", false); // FIXME: slight race - a wallet can open, then we get launched, but the @@ -113,27 +113,27 @@ KWalletManager::KWalletManager(QWidget *parent, const char *name, WFlags f) // open. Must check that a wallet is still open here. new KAction(i18n("&New Wallet..."), "kwalletmanager", 0, this, - SLOT(createWallet()), actionCollection(), + TQT_SLOT(createWallet()), actionCollection(), "wallet_create"); KAction *act = new KAction(i18n("Configure &Wallet..."), "configure", - 0, this, SLOT(setupWallet()), actionCollection(), + 0, this, TQT_SLOT(setupWallet()), actionCollection(), "wallet_settings"); if (_tray) { act->plug(_tray->contextMenu()); } act = new KAction(i18n("Close &All Wallets"), 0, 0, this, - SLOT(closeAllWallets()), actionCollection(), + TQT_SLOT(closeAllWallets()), actionCollection(), "close_all_wallets"); if (_tray) { act->plug(_tray->contextMenu()); } - KStdAction::quit(this, SLOT(shuttingDown()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::quit(this, TQT_SLOT(shuttingDown()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); createGUI("kwalletmanager.rc"); - accel->connectItem(accel->insertItem(Key_Return), this, SLOT(openWallet())); - accel->connectItem(accel->insertItem(Key_Delete), this, SLOT(deleteWallet())); + accel->connectItem(accel->insertItem(Key_Return), this, TQT_SLOT(openWallet())); + accel->connectItem(accel->insertItem(Key_Delete), this, TQT_SLOT(deleteWallet())); if (_tray) { _tray->show(); @@ -173,18 +173,18 @@ bool KWalletManager::queryClose() { void KWalletManager::aWalletWasOpened() { if (_tray) { _tray->setPixmap(loadSystemTrayIcon("wallet_open")); - QToolTip::remove(_tray); - QToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("KDE Wallet: A wallet is open.")); } updateWalletDisplay(); } void KWalletManager::updateWalletDisplay() { -QStringList wl = KWallet::Wallet::walletList(); -QPtrStack trash; +TQStringList wl = KWallet::Wallet::walletList(); +TQPtrStack trash; - for (QIconViewItem *item = _iconView->firstItem(); item; item = item->nextItem()) { + for (TQIconViewItem *item = _iconView->firstItem(); item; item = item->nextItem()) { if (!wl.contains(item->text())) { trash.push(item); } @@ -193,7 +193,7 @@ QPtrStack trash; trash.setAutoDelete(true); trash.clear(); - for (QStringList::Iterator i = wl.begin(); i != wl.end(); ++i) { + for (TQStringList::Iterator i = wl.begin(); i != wl.end(); ++i) { if (!_iconView->findItem(*i)) { // FIXME: if KWallet::Wallet::isOpen(*i) then show // a different icon! @@ -205,21 +205,21 @@ QPtrStack trash; } -void KWalletManager::contextMenu(QIconViewItem *item, const QPoint& pos) { +void KWalletManager::contextMenu(TQIconViewItem *item, const TQPoint& pos) { if (item) { - QGuardedPtr popupMenu = new KWalletPopup(item->text(), this); - connect(popupMenu, SIGNAL(walletOpened(const QString&)), this, SLOT(openWallet(const QString&))); - connect(popupMenu, SIGNAL(walletClosed(const QString&)), this, SLOT(closeWallet(const QString&))); - connect(popupMenu, SIGNAL(walletDeleted(const QString&)), this, SLOT(deleteWallet(const QString&))); - connect(popupMenu, SIGNAL(walletChangePassword(const QString&)), this, SLOT(changeWalletPassword(const QString&))); - connect(popupMenu, SIGNAL(walletCreated()), this, SLOT(createWallet())); + TQGuardedPtr popupMenu = new KWalletPopup(item->text(), this); + connect(popupMenu, TQT_SIGNAL(walletOpened(const TQString&)), this, TQT_SLOT(openWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletClosed(const TQString&)), this, TQT_SLOT(closeWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletDeleted(const TQString&)), this, TQT_SLOT(deleteWallet(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletChangePassword(const TQString&)), this, TQT_SLOT(changeWalletPassword(const TQString&))); + connect(popupMenu, TQT_SIGNAL(walletCreated()), this, TQT_SLOT(createWallet())); popupMenu->exec(pos); delete popupMenu; } } -void KWalletManager::deleteWallet(const QString& walletName) { +void KWalletManager::deleteWallet(const TQString& walletName) { int rc = KMessageBox::warningContinueCancel(this, i18n("Are you sure you wish to delete the wallet '%1'?").arg(walletName),"",KStdGuiItem::del()); if (rc != KMessageBox::Continue) { return; @@ -232,10 +232,10 @@ void KWalletManager::deleteWallet(const QString& walletName) { } -void KWalletManager::closeWallet(const QString& walletName) { +void KWalletManager::closeWallet(const TQString& walletName) { int rc = KWallet::Wallet::closeWallet(walletName, false); if (rc != 0) { - rc = KMessageBox::warningYesNo(this, i18n("Unable to close wallet cleanly. It is probably in use by other applications. Do you wish to force it closed?"), QString::null, i18n("Force Closure"), i18n("Do Not Force")); + rc = KMessageBox::warningYesNo(this, i18n("Unable to close wallet cleanly. It is probably in use by other applications. Do you wish to force it closed?"), TQString::null, i18n("Force Closure"), i18n("Do Not Force")); if (rc == KMessageBox::Yes) { rc = KWallet::Wallet::closeWallet(walletName, true); if (rc != 0) { @@ -248,16 +248,16 @@ void KWalletManager::closeWallet(const QString& walletName) { } -void KWalletManager::changeWalletPassword(const QString& walletName) { +void KWalletManager::changeWalletPassword(const TQString& walletName) { KWallet::Wallet::changePassword(walletName); } -void KWalletManager::openWalletFile(const QString& path) { +void KWalletManager::openWalletFile(const TQString& path) { KWalletEditor *we = new KWalletEditor(path, true, this, "Wallet Editor"); if (we->isOpen()) { - connect(we, SIGNAL(editorClosed(KMainWindow*)), - this, SLOT(editorClosed(KMainWindow*))); + connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), + this, TQT_SLOT(editorClosed(KMainWindow*))); we->show(); } else { KMessageBox::sorry(this, i18n("Error opening wallet %1.").arg(path)); @@ -267,24 +267,24 @@ void KWalletManager::openWalletFile(const QString& path) { void KWalletManager::openWallet() { - QIconViewItem *item = _iconView->currentItem(); + TQIconViewItem *item = _iconView->currentItem(); openWallet(item); } void KWalletManager::deleteWallet() { - QIconViewItem *item = _iconView->currentItem(); + TQIconViewItem *item = _iconView->currentItem(); if (item) { deleteWallet(item->text()); } } -void KWalletManager::openWallet(const QString& walletName) { +void KWalletManager::openWallet(const TQString& walletName) { openWallet(walletName, false); } -void KWalletManager::openWallet(const QString& walletName, bool newWallet) { +void KWalletManager::openWallet(const TQString& walletName, bool newWallet) { // Don't allow a wallet to open in two windows for (KMainWindow *w = _windows.first(); w; w = _windows.next()) { KWalletEditor *e = static_cast(w); @@ -297,8 +297,8 @@ void KWalletManager::openWallet(const QString& walletName, bool newWallet) { KWalletEditor *we = new KWalletEditor(walletName, false, this, "Wallet Editor"); we->setNewWallet(newWallet); if (we->isOpen()) { - connect(we, SIGNAL(editorClosed(KMainWindow*)), - this, SLOT(editorClosed(KMainWindow*))); + connect(we, TQT_SIGNAL(editorClosed(KMainWindow*)), + this, TQT_SLOT(editorClosed(KMainWindow*))); we->show(); _windows.append(we); } else if (!newWallet) { @@ -308,7 +308,7 @@ void KWalletManager::openWallet(const QString& walletName, bool newWallet) { } -void KWalletManager::openWallet(QIconViewItem *item) { +void KWalletManager::openWallet(TQIconViewItem *item) { if (item) { openWallet(item->text()); } @@ -318,8 +318,8 @@ void KWalletManager::openWallet(QIconViewItem *item) { void KWalletManager::allWalletsClosed() { if (_tray) { _tray->setPixmap(loadSystemTrayIcon("wallet_closed")); - QToolTip::remove(_tray); - QToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); + TQToolTip::remove(_tray); + TQToolTip::add(_tray, i18n("KDE Wallet: No wallets open.")); } possiblyQuit(); } @@ -342,7 +342,7 @@ void KWalletManager::editorClosed(KMainWindow* e) { } -void KWalletManager::possiblyRescan(const QCString& app) { +void KWalletManager::possiblyRescan(const TQCString& app) { if (app == "kded") { updateWalletDisplay(); } @@ -350,21 +350,21 @@ void KWalletManager::possiblyRescan(const QCString& app) { void KWalletManager::createWallet() { - QString n; + TQString n; bool ok; // FIXME: support international names - QRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$"); - QString txt = i18n("Please choose a name for the new wallet:"); + TQRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$"); + TQString txt = i18n("Please choose a name for the new wallet:"); if (!KWallet::Wallet::isEnabled()) { - // FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you want to enable it?"), QString::null, i18n("Enable"), i18n("Keep Disabled")); + // FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you want to enable it?"), TQString::null, i18n("Enable"), i18n("Keep Disabled")); return; } do { n = KInputDialog::getText(i18n("New Wallet"), txt, - QString::null, + TQString::null, &ok, this); @@ -373,11 +373,11 @@ void KWalletManager::createWallet() { } if (_iconView->findItem(n)) { - int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that wallet already exists. Try a new name?"), QString::null, i18n("Try New"), i18n("Do Not Try")); + int rc = KMessageBox::questionYesNo(this, i18n("Sorry, that wallet already exists. Try a new name?"), TQString::null, i18n("Try New"), i18n("Do Not Try")); if (rc == KMessageBox::Yes) { continue; } - n = QString::null; + n = TQString::null; } else if (regexp.exactMatch(n)) { break; } else { @@ -408,7 +408,7 @@ void KWalletManager::closeAllWallets() { } -QPixmap KWalletManager::loadSystemTrayIcon(const QString &icon) { +TQPixmap KWalletManager::loadSystemTrayIcon(const TQString &icon) { #if KDE_IS_VERSION(3, 1, 90) return KSystemTray::loadIcon(icon); #else diff --git a/kwallet/kwalletmanager.h b/kwallet/kwalletmanager.h index 0c28839..c9cc553 100644 --- a/kwallet/kwalletmanager.h +++ b/kwallet/kwalletmanager.h @@ -22,7 +22,7 @@ #include #include -#include +#include class KSystemTray; class KWalletIconView; @@ -35,23 +35,23 @@ class KWalletManager : public KMainWindow, public DCOPObject { K_DCOP public: - KWalletManager(QWidget *parent = 0, const char* name = 0, WFlags f = 0); + KWalletManager(TQWidget *parent = 0, const char* name = 0, WFlags f = 0); virtual ~KWalletManager(); - QPixmap loadSystemTrayIcon(const QString &icon); + TQPixmap loadSystemTrayIcon(const TQString &icon); void kwalletdLaunch(); public slots: void createWallet(); - void deleteWallet(const QString& walletName); - void closeWallet(const QString& walletName); - void changeWalletPassword(const QString& walletName); - void openWallet(const QString& walletName); - void openWallet(const QString& walletName, bool newWallet); - void openWalletFile(const QString& path); - void openWallet(QIconViewItem *item); - void contextMenu(QIconViewItem *item, const QPoint& pos); + void deleteWallet(const TQString& walletName); + void closeWallet(const TQString& walletName); + void changeWalletPassword(const TQString& walletName); + void openWallet(const TQString& walletName); + void openWallet(const TQString& walletName, bool newWallet); + void openWalletFile(const TQString& path); + void openWallet(TQIconViewItem *item); + void contextMenu(TQIconViewItem *item, const TQPoint& pos); protected: virtual bool queryClose(); @@ -66,7 +66,7 @@ class KWalletManager : public KMainWindow, public DCOPObject { void shuttingDown(); void possiblyQuit(); void editorClosed(KMainWindow* e); - void possiblyRescan(const QCString& app); + void possiblyRescan(const TQCString& app); void setupWallet(); void openWallet(); void deleteWallet(); @@ -77,7 +77,7 @@ class KWalletManager : public KMainWindow, public DCOPObject { bool _shuttingDown; KWalletIconView *_iconView; DCOPRef *_dcopRef; - QPtrList _windows; + TQPtrList _windows; bool _kwalletdLaunch; }; diff --git a/kwallet/kwalletpopup.cpp b/kwallet/kwalletpopup.cpp index 3f2082e..bd5e75d 100644 --- a/kwallet/kwalletpopup.cpp +++ b/kwallet/kwalletpopup.cpp @@ -28,31 +28,31 @@ #include #include -KWalletPopup::KWalletPopup(const QString& wallet, QWidget *parent, const char *name) +KWalletPopup::KWalletPopup(const TQString& wallet, TQWidget *parent, const char *name) : KPopupMenu(parent, name), _walletName(wallet) { insertTitle(wallet); KActionCollection *ac = new KActionCollection(this, "kwallet context actions"); KAction *act; act = new KAction(i18n("&New Wallet..."), 0, 0, this, - SLOT(createWallet()), ac, "wallet_create"); + TQT_SLOT(createWallet()), ac, "wallet_create"); act->plug(this); act = new KAction(i18n("&Open..."), 0, Key_Return, this, - SLOT(openWallet()), ac, "wallet_open"); + TQT_SLOT(openWallet()), ac, "wallet_open"); act->plug(this); act = new KAction(i18n("Change &Password..."), 0, 0, this, - SLOT(changeWalletPassword()), ac, "wallet_password"); + TQT_SLOT(changeWalletPassword()), ac, "wallet_password"); act->plug(this); - QStringList ul = KWallet::Wallet::users(wallet); + TQStringList ul = KWallet::Wallet::users(wallet); if (!ul.isEmpty()) { KPopupMenu *pm = new KPopupMenu(this, "Disconnect Apps"); int id = 7000; - for (QStringList::Iterator it = ul.begin(); it != ul.end(); ++it) { + for (TQStringList::Iterator it = ul.begin(); it != ul.end(); ++it) { _appMap[id] = *it; - pm->insertItem(*it, this, SLOT(disconnectApp(int)), 0, id); + pm->insertItem(*it, this, TQT_SLOT(disconnectApp(int)), 0, id); pm->setItemParameter(id, id); id++; } @@ -61,14 +61,14 @@ KWalletPopup::KWalletPopup(const QString& wallet, QWidget *parent, const char *n } act = KStdAction::close( this, - SLOT(closeWallet()), ac, "wallet_close"); + TQT_SLOT(closeWallet()), ac, "wallet_close"); // FIXME: let's track this inside the manager so we don't need a dcop // roundtrip here. act->setEnabled(KWallet::Wallet::isOpen(wallet)); act->plug(this); act = new KAction(i18n("&Delete"), 0, Key_Delete, this, - SLOT(deleteWallet()), ac, "wallet_delete"); + TQT_SLOT(deleteWallet()), ac, "wallet_delete"); act->plug(this); } diff --git a/kwallet/kwalletpopup.h b/kwallet/kwalletpopup.h index c704d69..36a2d8f 100644 --- a/kwallet/kwalletpopup.h +++ b/kwallet/kwalletpopup.h @@ -21,14 +21,14 @@ #define KWALLETPOPUP_H #include -#include -#include +#include +#include class KWalletPopup : public KPopupMenu { Q_OBJECT public: - KWalletPopup(const QString& wallet, QWidget *parent = 0, const char* name = 0); + KWalletPopup(const TQString& wallet, TQWidget *parent = 0, const char* name = 0); virtual ~KWalletPopup(); public slots: @@ -40,15 +40,15 @@ class KWalletPopup : public KPopupMenu { void disconnectApp(int); signals: - void walletOpened(const QString& walletName); - void walletClosed(const QString& walletName); - void walletDeleted(const QString& walletName); + void walletOpened(const TQString& walletName); + void walletClosed(const TQString& walletName); + void walletDeleted(const TQString& walletName); void walletCreated(); - void walletChangePassword(const QString& walletName); + void walletChangePassword(const TQString& walletName); private: - QString _walletName; - QMap _appMap; + TQString _walletName; + TQMap _appMap; }; #endif diff --git a/kwallet/kwmapeditor.cpp b/kwallet/kwmapeditor.cpp index a15b9c9..b6cbb50 100644 --- a/kwallet/kwmapeditor.cpp +++ b/kwallet/kwmapeditor.cpp @@ -26,20 +26,20 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -KWMapEditor::KWMapEditor(QMap& map, QWidget *parent, const char *name) -: QTable(0, 3, parent, name), _map(map) { +KWMapEditor::KWMapEditor(TQMap& map, TQWidget *parent, const char *name) +: TQTable(0, 3, parent, name), _map(map) { _ac = new KActionCollection(this); - _copyAct = KStdAction::copy(this, SLOT(copy()), _ac); - connect(this, SIGNAL(valueChanged(int,int)), this, SIGNAL(dirty())); - connect(this, SIGNAL(contextMenuRequested(int,int,const QPoint&)), - this, SLOT(contextMenu(int,int,const QPoint&))); - setSelectionMode(QTable::NoSelection); - horizontalHeader()->setLabel(0, QString::null); + _copyAct = KStdAction::copy(this, TQT_SLOT(copy()), _ac); + connect(this, TQT_SIGNAL(valueChanged(int,int)), this, TQT_SIGNAL(dirty())); + connect(this, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)), + this, TQT_SLOT(contextMenu(int,int,const TQPoint&))); + setSelectionMode(TQTable::NoSelection); + horizontalHeader()->setLabel(0, TQString::null); horizontalHeader()->setLabel(1, i18n("Key")); horizontalHeader()->setLabel(2, i18n("Value")); setColumnWidth(0, 20); // FIXME: this is arbitrary @@ -56,14 +56,14 @@ void KWMapEditor::reload() { if ((row = numRows()) < _map.count()) { insertRows(row, _map.count() - row); for (int x = row; x < numRows(); ++x) { - QPushButton *b = new QPushButton("X", this); - connect(b, SIGNAL(clicked()), this, SLOT(erase())); + TQPushButton *b = new TQPushButton("X", this); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); setCellWidget(x, 0, b); } } row = 0; - for (QMap::Iterator it = _map.begin(); it != _map.end(); ++it) { + for (TQMap::Iterator it = _map.begin(); it != _map.end(); ++it) { setText(row, 1, it.key()); setText(row, 2, it.data()); row++; @@ -76,7 +76,7 @@ KWMapEditor::~KWMapEditor() { void KWMapEditor::erase() { - const QObject *o = sender(); + const TQObject *o = sender(); for (int i = 0; i < numRows(); i++) { if (cellWidget(i, 0) == o) { removeRow(i); @@ -100,8 +100,8 @@ void KWMapEditor::saveMap() { void KWMapEditor::addEntry() { int x = numRows(); insertRows(x, 1); - QPushButton *b = new QPushButton("X", this); - connect(b, SIGNAL(clicked()), this, SLOT(erase())); + TQPushButton *b = new TQPushButton("X", this); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(erase())); setCellWidget(x, 0, b); ensureCellVisible(x, 1); setCurrentCell(x, 1); @@ -114,68 +114,68 @@ void KWMapEditor::emitDirty() { } -void KWMapEditor::contextMenu(int row, int col, const QPoint& pos) { +void KWMapEditor::contextMenu(int row, int col, const TQPoint& pos) { _contextRow = row; _contextCol = col; KPopupMenu *m = new KPopupMenu(this); - m->insertItem(i18n("&New Entry"), this, SLOT(addEntry())); + m->insertItem(i18n("&New Entry"), this, TQT_SLOT(addEntry())); _copyAct->plug(m); m->popup(pos); } void KWMapEditor::copy() { - QApplication::clipboard()->setText(text(_contextRow, 2)); + TQApplication::clipboard()->setText(text(_contextRow, 2)); } -class InlineEditor : public QTextEdit { +class InlineEditor : public TQTextEdit { public: InlineEditor(KWMapEditor *p, int row, int col) - : QTextEdit(), _p(p), row(row), col(col) { + : TQTextEdit(), _p(p), row(row), col(col) { setWFlags(WStyle_NoBorder | WDestructiveClose); KWin::setType(winId(), NET::Override); - connect(p, SIGNAL(destroyed()), SLOT(close())); + connect(p, TQT_SIGNAL(destroyed()), TQT_SLOT(close())); } virtual ~InlineEditor() { if (!_p) return; _p->setText(row, col, text()); _p->emitDirty(); } protected: - virtual void focusOutEvent(QFocusEvent*) { - if (QFocusEvent::reason() == QFocusEvent::Popup) { - QWidget *focusW = qApp->focusWidget(); + virtual void focusOutEvent(TQFocusEvent*) { + if (TQFocusEvent::reason() == TQFocusEvent::Popup) { + TQWidget *focusW = qApp->focusWidget(); if (focusW && focusW == popup) { return; } } close(); } - virtual void keyPressEvent(QKeyEvent *e) { + virtual void keyPressEvent(TQKeyEvent *e) { if (e->key() == Qt::Key_Escape) { e->accept(); close(); } else { e->ignore(); - QTextEdit::keyPressEvent(e); + TQTextEdit::keyPressEvent(e); } } - virtual QPopupMenu *createPopupMenu(const QPoint &p) { - popup = QTextEdit::createPopupMenu(p); + virtual TQPopupMenu *createPopupMenu(const TQPoint &p) { + popup = TQTextEdit::createPopupMenu(p); return popup; } - QGuardedPtr _p; + TQGuardedPtr _p; int row, col; - QGuardedPtr popup; + TQGuardedPtr popup; }; -QWidget *KWMapEditor::beginEdit(int row, int col, bool replace) { +TQWidget *KWMapEditor::beginEdit(int row, int col, bool replace) { //kdDebug(2300) << "EDIT COLUMN " << col << endl; if (col != 2) { - return QTable::beginEdit(row, col, replace); + return TQTable::beginEdit(row, col, replace); } - QRect geo = cellGeometry(row, col); - QTextEdit *e = new InlineEditor(this, row, col); + TQRect geo = cellGeometry(row, col); + TQTextEdit *e = new InlineEditor(this, row, col); e->setText(text(row, col)); e->move(mapToGlobal(geo.topLeft())); e->resize(geo.width() * 2, geo.height() * 3); diff --git a/kwallet/kwmapeditor.h b/kwallet/kwmapeditor.h index 8322a91..abd835f 100644 --- a/kwallet/kwmapeditor.h +++ b/kwallet/kwmapeditor.h @@ -20,25 +20,25 @@ #ifndef KWMAPEDITOR_H #define KWMAPEDITOR_H -#include -#include -#include +#include +#include +#include class KAction; class KActionCollection; -class KWMapEditor : public QTable { +class KWMapEditor : public TQTable { Q_OBJECT public: - KWMapEditor(QMap& map, QWidget *parent = 0, const char *name = 0); + KWMapEditor(TQMap& map, TQWidget *parent = 0, const char *name = 0); virtual ~KWMapEditor(); public slots: void reload(); void saveMap(); void erase(); - void contextMenu(int row, int col, const QPoint& pos); + void contextMenu(int row, int col, const TQPoint& pos); void addEntry(); void emitDirty(); @@ -46,13 +46,13 @@ class KWMapEditor : public QTable { void copy(); protected: - virtual QWidget *beginEdit(int row, int col, bool replace); + virtual TQWidget *beginEdit(int row, int col, bool replace); signals: void dirty(); private: - QMap& _map; + TQMap& _map; int _contextRow, _contextCol; KActionCollection *_ac; KAction *_copyAct; diff --git a/kwallet/main.cpp b/kwallet/main.cpp index 08f5b74..8fbd0da 100644 --- a/kwallet/main.cpp +++ b/kwallet/main.cpp @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include "kwalletmanager.h" @@ -84,9 +84,9 @@ int main(int argc, char **argv) { } for (int i = 0; i < args->count(); ++i) { - QString fn = QFileInfo(args->arg(i)).absFilePath(); + TQString fn = TQFileInfo(args->arg(i)).absFilePath(); KMimeType::Ptr ptr; - if (QFile::exists(fn) && + if (TQFile::exists(fn) && (ptr = KMimeType::findByFileContent(fn)) && ptr->is("application/x-kde-wallet")) { wm.openWalletFile(fn); -- cgit v1.2.3