diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kwallet | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwallet')
-rw-r--r-- | kwallet/backend/kwalletbackend.cc | 124 | ||||
-rw-r--r-- | kwallet/backend/kwalletbackend.h | 66 | ||||
-rw-r--r-- | kwallet/backend/kwalletentry.cc | 18 | ||||
-rw-r--r-- | kwallet/backend/kwalletentry.h | 22 | ||||
-rw-r--r-- | kwallet/backend/tests/backendtest.cpp | 4 | ||||
-rw-r--r-- | kwallet/client/kwallet.cc | 146 | ||||
-rw-r--r-- | kwallet/client/kwallet.h | 106 | ||||
-rw-r--r-- | kwallet/client/kwallettypes.h | 8 | ||||
-rw-r--r-- | kwallet/tests/kwalletasync.cpp | 10 | ||||
-rw-r--r-- | kwallet/tests/kwalletboth.cpp | 16 | ||||
-rw-r--r-- | kwallet/tests/kwalletsync.cpp | 6 | ||||
-rw-r--r-- | kwallet/tests/kwallettest.h | 2 |
12 files changed, 264 insertions, 264 deletions
diff --git a/kwallet/backend/kwalletbackend.cc b/kwallet/backend/kwalletbackend.cc index 5b9c29299..c208c4d69 100644 --- a/kwallet/backend/kwalletbackend.cc +++ b/kwallet/backend/kwalletbackend.cc @@ -29,9 +29,9 @@ #include <ksavefile.h> #include <kstandarddirs.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqregexp.h> #include "blowfish.h" #include "sha1.h" @@ -59,7 +59,7 @@ static void initKWalletDir() KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); } -Backend::Backend(const QString& name, bool isPath) : _name(name), _ref(0) { +Backend::Backend(const TQString& name, bool isPath) : _name(name), _ref(0) { initKWalletDir(); if (isPath) { _path = name; @@ -90,10 +90,10 @@ return 0; } -static int getRandomBlock(QByteArray& randBlock) { +static int getRandomBlock(TQByteArray& randBlock) { // First try /dev/urandom - if (QFile::exists("/dev/urandom")) { - QFile devrand("/dev/urandom"); + if (TQFile::exists("/dev/urandom")) { + TQFile devrand("/dev/urandom"); if (devrand.open(IO_ReadOnly)) { unsigned int rc = devrand.readBlock(randBlock.data(), randBlock.size()); @@ -107,8 +107,8 @@ static int getRandomBlock(QByteArray& randBlock) { // If that failed, try /dev/random // FIXME: open in noblocking mode! - if (QFile::exists("/dev/random")) { - QFile devrand("/dev/random"); + if (TQFile::exists("/dev/random")) { + TQFile devrand("/dev/random"); if (devrand.open(IO_ReadOnly)) { unsigned int rc = 0; unsigned int cnt = 0; @@ -134,8 +134,8 @@ static int getRandomBlock(QByteArray& randBlock) { // EGD method char *randFilename; if ((randFilename = getenv("RANDFILE"))) { - if (QFile::exists(randFilename)) { - QFile devrand(randFilename); + if (TQFile::exists(randFilename)) { + TQFile devrand(randFilename); if (devrand.open(IO_ReadOnly)) { unsigned int rc = devrand.readBlock(randBlock.data(), randBlock.size()); if (rc != randBlock.size()) { @@ -153,13 +153,13 @@ static int getRandomBlock(QByteArray& randBlock) { // this should be SHA-512 for release probably -static int password2hash(const QByteArray& password, QByteArray& hash) { +static int password2hash(const TQByteArray& password, TQByteArray& hash) { SHA1 sha; int shasz = sha.size() / 8; assert(shasz >= 20); - QByteArray block1(shasz); + TQByteArray block1(shasz); sha.process(password.data(), QMIN(password.size(), 16)); @@ -174,7 +174,7 @@ static int password2hash(const QByteArray& password, QByteArray& hash) { if (password.size() > 16) { sha.process(password.data() + 16, QMIN(password.size() - 16, 16)); - QByteArray block2(shasz); + TQByteArray block2(shasz); // To make brute force take longer for (int i = 0; i < 2000; i++) { memcpy(block2.data(), sha.hash(), shasz); @@ -187,7 +187,7 @@ static int password2hash(const QByteArray& password, QByteArray& hash) { if (password.size() > 32) { sha.process(password.data() + 32, QMIN(password.size() - 32, 16)); - QByteArray block3(shasz); + TQByteArray block3(shasz); // To make brute force take longer for (int i = 0; i < 2000; i++) { memcpy(block3.data(), sha.hash(), shasz); @@ -200,7 +200,7 @@ static int password2hash(const QByteArray& password, QByteArray& hash) { if (password.size() > 48) { sha.process(password.data() + 48, password.size() - 48); - QByteArray block4(shasz); + TQByteArray block4(shasz); // To make brute force take longer for (int i = 0; i < 2000; i++) { memcpy(block4.data(), sha.hash(), shasz); @@ -243,16 +243,16 @@ static int password2hash(const QByteArray& password, QByteArray& hash) { } -bool Backend::exists(const QString& wallet) { +bool Backend::exists(const TQString& wallet) { initKWalletDir(); - QString path = KGlobal::dirs()->saveLocation("kwallet") + "/" + wallet + ".kwl"; + TQString path = KGlobal::dirs()->saveLocation("kwallet") + "/" + wallet + ".kwl"; // Note: 60 bytes is presently the minimum size of a wallet file. // Anything smaller is junk. -return QFile::exists(path) && QFileInfo(path).size() >= 60; +return TQFile::exists(path) && TQFileInfo(path).size() >= 60; } -QString Backend::openRCToString(int rc) { +TQString Backend::openRCToString(int rc) { switch (rc) { case -255: return i18n("Already open."); @@ -275,24 +275,24 @@ QString Backend::openRCToString(int rc) { case -6: return i18n("Decryption error."); default: - return QString::null; + return TQString::null; } } -int Backend::open(const QByteArray& password) { +int Backend::open(const TQByteArray& password) { if (_open) { return -255; // already open } - QByteArray passhash; + TQByteArray passhash; // No wallet existed. Let's create it. // Note: 60 bytes is presently the minimum size of a wallet file. // Anything smaller is junk and should be deleted. - if (!QFile::exists(_path) || QFileInfo(_path).size() < 60) { - QFile newfile(_path); + if (!TQFile::exists(_path) || TQFileInfo(_path).size() < 60) { + TQFile newfile(_path); if (!newfile.open(IO_ReadWrite)) { return -2; // error opening file } @@ -302,7 +302,7 @@ int Backend::open(const QByteArray& password) { return 1; // new file opened, but OK } - QFile db(_path); + TQFile db(_path); if (!db.open(IO_ReadOnly)) { return -2; // error opening file @@ -335,7 +335,7 @@ int Backend::open(const QByteArray& password) { _hashes.clear(); // Read in the hashes - QDataStream hds(&db); + TQDataStream hds(&db); Q_UINT32 n; hds >> n; if (n > 0xffff) { // sanity check @@ -345,13 +345,13 @@ int Backend::open(const QByteArray& password) { for (size_t i = 0; i < n; ++i) { KMD5::Digest d, d2; // judgment day MD5Digest ba; - QMap<MD5Digest,QValueList<MD5Digest> >::iterator it; + TQMap<MD5Digest,TQValueList<MD5Digest> >::iterator it; Q_UINT32 fsz; if (hds.atEnd()) return -43; hds.readRawBytes(reinterpret_cast<char *>(d), 16); hds >> fsz; ba.duplicate(reinterpret_cast<char *>(d), 16); - it = _hashes.insert(ba, QValueList<MD5Digest>()); + it = _hashes.insert(ba, TQValueList<MD5Digest>()); for (size_t j = 0; j < fsz; ++j) { hds.readRawBytes(reinterpret_cast<char *>(d2), 16); ba.duplicate(reinterpret_cast<char *>(d2), 16); @@ -360,7 +360,7 @@ int Backend::open(const QByteArray& password) { } // Read in the rest of the file. - QByteArray encrypted = db.readAll(); + TQByteArray encrypted = db.readAll(); assert(encrypted.size() < db.size()); BlowFish _bf; @@ -432,17 +432,17 @@ int Backend::open(const QByteArray& password) { sha.reset(); // chop off the leading blksz+4 bytes - QByteArray tmpenc; + TQByteArray tmpenc; tmpenc.duplicate(encrypted.data()+blksz+4, fsize); encrypted.fill(0); encrypted.duplicate(tmpenc.data(), tmpenc.size()); tmpenc.fill(0); // Load the data structures up - QDataStream eStream(encrypted, IO_ReadOnly); + TQDataStream eStream(encrypted, IO_ReadOnly); while (!eStream.atEnd()) { - QString folder; + TQString folder; Q_UINT32 n; eStream >> folder; @@ -452,7 +452,7 @@ int Backend::open(const QByteArray& password) { _entries[folder].clear(); for (size_t i = 0; i < n; i++) { - QString key; + TQString key; KWallet::Wallet::EntryType et = KWallet::Wallet::Unknown; Entry *e = new Entry; eStream >> key; @@ -470,7 +470,7 @@ int Backend::open(const QByteArray& password) { continue; } - QByteArray a; + TQByteArray a; eStream >> a; e->setValue(a); e->setType(et); @@ -484,13 +484,13 @@ int Backend::open(const QByteArray& password) { } -int Backend::sync(const QByteArray& password) { +int Backend::sync(const TQByteArray& password) { if (!_open) { return -255; // not open yet } KSaveFile sf(_path, 0600); - QFile *qf = sf.file(); + TQFile *qf = sf.file(); if (!qf) { sf.abort(); @@ -500,7 +500,7 @@ int Backend::sync(const QByteArray& password) { qf->writeBlock(KWMAGIC, KWMAGIC_LEN); // Write the version number - QByteArray version(4); + TQByteArray version(4); version[0] = KWALLET_VERSION_MAJOR; version[1] = KWALLET_VERSION_MINOR; version[2] = KWALLET_CIPHER_BLOWFISH_CBC; @@ -508,20 +508,20 @@ int Backend::sync(const QByteArray& password) { qf->writeBlock(version, 4); // Holds the hashes we write out - QByteArray hashes; - QDataStream hashStream(hashes, IO_WriteOnly); + TQByteArray hashes; + TQDataStream hashStream(hashes, IO_WriteOnly); KMD5 md5; hashStream << static_cast<Q_UINT32>(_entries.count()); // Holds decrypted data prior to encryption - QByteArray decrypted; + TQByteArray decrypted; // FIXME: we should estimate the amount of data we will write in each // buffer and resize them approximately in order to avoid extra // resizes. // populate decrypted - QDataStream dStream(decrypted, IO_WriteOnly); + TQDataStream dStream(decrypted, IO_WriteOnly); for (FolderMap::ConstIterator i = _entries.begin(); i != _entries.end(); ++i) { dStream << i.key(); dStream << static_cast<Q_UINT32>(i.data().count()); @@ -552,7 +552,7 @@ int Backend::sync(const QByteArray& password) { sha.process(decrypted.data(), decrypted.size()); // prepend and append the random data - QByteArray wholeFile; + TQByteArray wholeFile; long blksz = bf.blockSize(); long newsize = decrypted.size() + blksz + // encrypted block @@ -563,7 +563,7 @@ int Backend::sync(const QByteArray& password) { newsize += delta; wholeFile.resize(newsize); - QByteArray randBlock; + TQByteArray randBlock; randBlock.resize(blksz+delta); if (getRandomBlock(randBlock) < 0) { sha.reset(); @@ -597,7 +597,7 @@ int Backend::sync(const QByteArray& password) { decrypted.fill(0); // hash the passphrase - QByteArray passhash; + TQByteArray passhash; password2hash(password, passhash); // encrypt the data @@ -632,7 +632,7 @@ return 0; } -int Backend::close(const QByteArray& password) { +int Backend::close(const TQByteArray& password) { int rc = sync(password); _open = false; if (rc != 0) { @@ -642,7 +642,7 @@ int Backend::close(const QByteArray& password) { } -const QString& Backend::walletName() const { +const TQString& Backend::walletName() const { return _name; } @@ -652,17 +652,17 @@ bool Backend::isOpen() const { } -QStringList Backend::folderList() const { +TQStringList Backend::folderList() const { return _entries.keys(); } -QStringList Backend::entryList() const { +TQStringList Backend::entryList() const { return _entries[_folder].keys(); } -Entry *Backend::readEntry(const QString& key) { +Entry *Backend::readEntry(const TQString& key) { Entry *rc = 0L; if (_open && hasEntry(key)) { @@ -673,14 +673,14 @@ return rc; } -QPtrList<Entry> Backend::readEntryList(const QString& key) { - QPtrList<Entry> rc; +TQPtrList<Entry> Backend::readEntryList(const TQString& key) { + TQPtrList<Entry> rc; if (!_open) { return rc; } - QRegExp re(key, true, true); + TQRegExp re(key, true, true); const EntryMap& map = _entries[_folder]; for (EntryMap::ConstIterator i = map.begin(); i != map.end(); ++i) { @@ -692,7 +692,7 @@ QPtrList<Entry> Backend::readEntryList(const QString& key) { } -bool Backend::createFolder(const QString& f) { +bool Backend::createFolder(const TQString& f) { if (_entries.contains(f)) { return false; } @@ -701,13 +701,13 @@ bool Backend::createFolder(const QString& f) { KMD5 folderMd5; folderMd5.update(f.utf8()); - _hashes.insert(MD5Digest(folderMd5.rawDigest()), QValueList<MD5Digest>()); + _hashes.insert(MD5Digest(folderMd5.rawDigest()), TQValueList<MD5Digest>()); return true; } -int Backend::renameEntry(const QString& oldName, const QString& newName) { +int Backend::renameEntry(const TQString& oldName, const TQString& newName) { EntryMap& emap = _entries[_folder]; EntryMap::Iterator oi = emap.find(oldName); EntryMap::Iterator ni = emap.find(newName); @@ -756,12 +756,12 @@ void Backend::writeEntry(Entry *e) { } -bool Backend::hasEntry(const QString& key) const { +bool Backend::hasEntry(const TQString& key) const { return _entries.contains(_folder) && _entries[_folder].contains(key); } -bool Backend::removeEntry(const QString& key) { +bool Backend::removeEntry(const TQString& key) { if (!_open) { return false; } @@ -788,7 +788,7 @@ return false; } -bool Backend::removeFolder(const QString& f) { +bool Backend::removeFolder(const TQString& f) { if (!_open) { return false; } @@ -797,7 +797,7 @@ bool Backend::removeFolder(const QString& f) { if (fi != _entries.end()) { if (_folder == f) { - _folder = QString::null; + _folder = TQString::null; } for (EntryMap::Iterator ei = fi.data().begin(); ei != fi.data().end(); ++ei) { @@ -816,14 +816,14 @@ return false; } -bool Backend::folderDoesNotExist(const QString& folder) const { +bool Backend::folderDoesNotExist(const TQString& folder) const { KMD5 md5; md5.update(folder.utf8()); return !_hashes.contains(MD5Digest(md5.rawDigest())); } -bool Backend::entryDoesNotExist(const QString& folder, const QString& entry) const { +bool Backend::entryDoesNotExist(const TQString& folder, const TQString& entry) const { KMD5 md5; md5.update(folder.utf8()); HashMap::const_iterator i = _hashes.find(MD5Digest(md5.rawDigest())); diff --git a/kwallet/backend/kwalletbackend.h b/kwallet/backend/kwalletbackend.h index f1e9e521d..9d46d25c9 100644 --- a/kwallet/backend/kwalletbackend.h +++ b/kwallet/backend/kwalletbackend.h @@ -24,9 +24,9 @@ #include <kmdcodec.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqmap.h> #include "kwalletentry.h" @@ -38,66 +38,66 @@ class MD5Digest; */ class KDE_EXPORT Backend { public: - Backend(const QString& name = "kdewallet", bool isPath = false); + Backend(const TQString& name = "kdewallet", bool isPath = false); ~Backend(); // Open and unlock the wallet. - int open(const QByteArray& password); + int open(const TQByteArray& password); // Close and lock the wallet (saving changes). - int close(const QByteArray& password); + int close(const TQByteArray& password); // Close the wallet, losing any changes. int close(); // Write the wallet to disk - int sync(const QByteArray& password); + int sync(const TQByteArray& password); // Returns true if the current wallet is open. bool isOpen() const; // Returns the current wallet name. - const QString& walletName() const; + const TQString& walletName() const; // The list of folders. - QStringList folderList() const; + TQStringList folderList() const; // Force creation of a folder. - bool createFolder(const QString& f); + bool createFolder(const TQString& f); // Change the folder. - void setFolder(const QString& f) { _folder = f; } + void setFolder(const TQString& f) { _folder = f; } // Current folder. If empty, it's the global folder. - const QString& folder() const { return _folder; } + const TQString& folder() const { return _folder; } // Does it have this folder? - bool hasFolder(const QString& f) const { return _entries.contains(f); } + bool hasFolder(const TQString& f) const { return _entries.contains(f); } // Look up an entry. Returns null if it doesn't exist. - Entry *readEntry(const QString& key); + Entry *readEntry(const TQString& key); // Look up a list of entries. Supports wildcards. // You delete the list. - QPtrList<Entry> readEntryList(const QString& key); + TQPtrList<Entry> readEntryList(const TQString& key); // Store an entry. void writeEntry(Entry *e); // Does this folder contain this entry? - bool hasEntry(const QString& key) const; + bool hasEntry(const TQString& key) const; // Returns true if the entry was removed - bool removeEntry(const QString& key); + bool removeEntry(const TQString& key); // Returns true if the folder was removed - bool removeFolder(const QString& f); + bool removeFolder(const TQString& f); // The list of entries in this folder. - QStringList entryList() const; + TQStringList entryList() const; // Rename an entry in this folder. - int renameEntry(const QString& oldName, const QString& newName); + int renameEntry(const TQString& oldName, const TQString& newName); int ref() { return ++_ref; } @@ -105,37 +105,37 @@ class KDE_EXPORT Backend { int refCount() const { return _ref; } - static bool exists(const QString& wallet); + static bool exists(const TQString& wallet); - bool folderDoesNotExist(const QString& folder) const; + bool folderDoesNotExist(const TQString& folder) const; - bool entryDoesNotExist(const QString& folder, const QString& entry) const; + bool entryDoesNotExist(const TQString& folder, const TQString& entry) const; - static QString openRCToString(int rc); + static TQString openRCToString(int rc); private: class BackendPrivate; BackendPrivate *d; - QString _name; - QString _path; + TQString _name; + TQString _path; bool _open; - QString _folder; + TQString _folder; int _ref; // Map Folder->Entries - typedef QMap< QString, Entry* > EntryMap; - typedef QMap< QString, EntryMap > FolderMap; + typedef TQMap< TQString, Entry* > EntryMap; + typedef TQMap< TQString, EntryMap > FolderMap; FolderMap _entries; - typedef QMap<MD5Digest, QValueList<MD5Digest> > HashMap; + typedef TQMap<MD5Digest, TQValueList<MD5Digest> > HashMap; HashMap _hashes; }; /** * @internal */ -class MD5Digest : public QByteArray { +class MD5Digest : public TQByteArray { public: - MD5Digest() : QByteArray(16) {} - MD5Digest(const KMD5::Digest d) : QByteArray() { duplicate(reinterpret_cast<const char *>(d), 16); } + MD5Digest() : TQByteArray(16) {} + MD5Digest(const KMD5::Digest d) : TQByteArray() { duplicate(reinterpret_cast<const char *>(d), 16); } virtual ~MD5Digest() {} int operator<(const MD5Digest& r) const { diff --git a/kwallet/backend/kwalletentry.cc b/kwallet/backend/kwalletentry.cc index da88610b1..4e74c03e3 100644 --- a/kwallet/backend/kwalletentry.cc +++ b/kwallet/backend/kwalletentry.cc @@ -31,25 +31,25 @@ Entry::~Entry() { _value.fill(0); } -const QString& Entry::key() const { +const TQString& Entry::key() const { return _key; } -const QByteArray& Entry::value() const { +const TQByteArray& Entry::value() const { return _value; } -QString Entry::password() const { -QString x; - QDataStream qds(_value, IO_ReadOnly); +TQString Entry::password() const { +TQString x; + TQDataStream qds(_value, IO_ReadOnly); qds >> x; return x; } -void Entry::setValue(const QByteArray& val) { +void Entry::setValue(const TQByteArray& val) { // do a direct copy from one into the other without // temporary variables _value.fill(0); @@ -57,14 +57,14 @@ void Entry::setValue(const QByteArray& val) { } -void Entry::setValue(const QString& val) { +void Entry::setValue(const TQString& val) { _value.fill(0); - QDataStream qds(_value, IO_WriteOnly); + TQDataStream qds(_value, IO_WriteOnly); qds << val; } -void Entry::setKey(const QString& key) { +void Entry::setKey(const TQString& key) { _key = key; } diff --git a/kwallet/backend/kwalletentry.h b/kwallet/backend/kwalletentry.h index 7f8c88448..530e1a828 100644 --- a/kwallet/backend/kwalletentry.h +++ b/kwallet/backend/kwalletentry.h @@ -22,8 +22,8 @@ #ifndef _KWALLETENTRY_H #define _KWALLETENTRY_H -#include <qstring.h> -#include <qdatastream.h> +#include <tqstring.h> +#include <tqdatastream.h> #include "kwallet.h" @@ -36,14 +36,14 @@ class KDE_EXPORT Entry { Entry(); ~Entry(); - const QString& key() const; - const QByteArray& value() const; - QString password() const; - const QByteArray& map() const { return value(); } + const TQString& key() const; + const TQByteArray& value() const; + TQString password() const; + const TQByteArray& map() const { return value(); } - void setValue(const QByteArray& val); - void setValue(const QString& val); - void setKey(const QString& key); + void setValue(const TQByteArray& val); + void setValue(const TQString& val); + void setKey(const TQString& key); Wallet::EntryType type() const; void setType(Wallet::EntryType type); @@ -51,8 +51,8 @@ class KDE_EXPORT Entry { void copy(const Entry* x); private: - QString _key; - QByteArray _value; + TQString _key; + TQByteArray _value; Wallet::EntryType _type; }; diff --git a/kwallet/backend/tests/backendtest.cpp b/kwallet/backend/tests/backendtest.cpp index a38c8cdb3..e7599b3a2 100644 --- a/kwallet/backend/tests/backendtest.cpp +++ b/kwallet/backend/tests/backendtest.cpp @@ -2,7 +2,7 @@ #include <stdio.h> #include <kapplication.h> -#include <qstring.h> +#include <tqstring.h> #include "kwalletbackend.h" @@ -12,7 +12,7 @@ int main(int argc, char **argv) { KWallet::Backend be("ktestwallet"); printf("KWalletBackend constructed\n"); - QByteArray apass, bpass, cpass; + TQByteArray apass, bpass, cpass; apass.duplicate("apassword", 9); bpass.duplicate("bpassword", 9); diff --git a/kwallet/client/kwallet.cc b/kwallet/client/kwallet.cc index 266135f85..0575050e5 100644 --- a/kwallet/client/kwallet.cc +++ b/kwallet/client/kwallet.cc @@ -25,68 +25,68 @@ #include <kdeversion.h> #include <dcopclient.h> #include <dcopref.h> -#include <qpopupmenu.h> -#include <qapplication.h> +#include <tqpopupmenu.h> +#include <tqapplication.h> #include <assert.h> using namespace KWallet; -const QString Wallet::LocalWallet() { +const TQString Wallet::LocalWallet() { KConfig cfg("kwalletrc", true); cfg.setGroup("Wallet"); if (!cfg.readBoolEntry("Use One Wallet", true)) { - QString tmp = cfg.readEntry("Local Wallet", "localwallet"); + TQString tmp = cfg.readEntry("Local Wallet", "localwallet"); if (tmp.isEmpty()) { return "localwallet"; } return tmp; } - QString tmp = cfg.readEntry("Default Wallet", "kdewallet"); + TQString tmp = cfg.readEntry("Default Wallet", "kdewallet"); if (tmp.isEmpty()) { return "kdewallet"; } return tmp; } -const QString Wallet::NetworkWallet() { +const TQString Wallet::NetworkWallet() { KConfig cfg("kwalletrc", true); cfg.setGroup("Wallet"); - QString tmp = cfg.readEntry("Default Wallet", "kdewallet"); + TQString tmp = cfg.readEntry("Default Wallet", "kdewallet"); if (tmp.isEmpty()) { return "kdewallet"; } return tmp; } -const QString Wallet::PasswordFolder() { +const TQString Wallet::PasswordFolder() { return "Passwords"; } -const QString Wallet::FormDataFolder() { +const TQString Wallet::FormDataFolder() { return "Form Data"; } -Wallet::Wallet(int handle, const QString& name) -: QObject(0L), DCOPObject(), d(0L), _name(name), _handle(handle) { +Wallet::Wallet(int handle, const TQString& name) +: TQObject(0L), DCOPObject(), d(0L), _name(name), _handle(handle) { _dcopRef = new DCOPRef("kded", "kwalletd"); _dcopRef->dcopClient()->setNotifications(true); connect(_dcopRef->dcopClient(), - SIGNAL(applicationRemoved(const QCString&)), + TQT_SIGNAL(applicationRemoved(const TQCString&)), this, - SLOT(slotAppUnregistered(const QCString&))); + TQT_SLOT(slotAppUnregistered(const TQCString&))); connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "walletClosed(int)", "slotWalletClosed(int)", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "folderListUpdated(QString)", "slotFolderListUpdated(QString)", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "folderUpdated(QString, QString)", "slotFolderUpdated(QString, QString)", false); - connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "applicationDisconnected(QString, QCString)", "slotApplicationDisconnected(QString, QCString)", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "folderListUpdated(TQString)", "slotFolderListUpdated(TQString)", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "folderUpdated(TQString, TQString)", "slotFolderUpdated(TQString, TQString)", false); + connectDCOPSignal(_dcopRef->app(), _dcopRef->obj(), "applicationDisconnected(TQString, TQCString)", "slotApplicationDisconnected(TQString, TQCString)", false); // Verify that the wallet is still open if (_handle != -1) { @@ -96,7 +96,7 @@ Wallet::Wallet(int handle, const QString& name) r.get(rc); if (!rc) { _handle = -1; - _name = QString::null; + _name = TQString::null; } } } @@ -107,8 +107,8 @@ Wallet::~Wallet() { if (_handle != -1) { _dcopRef->call("close", _handle, false); _handle = -1; - _folder = QString::null; - _name = QString::null; + _folder = TQString::null; + _name = TQString::null; } delete _dcopRef; @@ -116,9 +116,9 @@ Wallet::~Wallet() { } -QStringList Wallet::walletList() { +TQStringList Wallet::walletList() { DCOPReply r = DCOPRef("kded", "kwalletd").call("wallets"); - QStringList rc; + TQStringList rc; if (r.isValid()) { r.get(rc); } @@ -126,7 +126,7 @@ QStringList Wallet::walletList() { } -void Wallet::changePassword(const QString& name, WId w) { +void Wallet::changePassword(const TQString& name, WId w) { DCOPRef("kded", "kwalletd").send("changePassword", name, uint(w)); } @@ -141,7 +141,7 @@ bool Wallet::isEnabled() { } -bool Wallet::isOpen(const QString& name) { +bool Wallet::isOpen(const TQString& name) { DCOPReply r = DCOPRef("kded", "kwalletd").call("isOpen", name); bool rc = false; if (r.isValid()) { @@ -151,7 +151,7 @@ bool Wallet::isOpen(const QString& name) { } -int Wallet::closeWallet(const QString& name, bool force) { +int Wallet::closeWallet(const TQString& name, bool force) { DCOPReply r = DCOPRef("kded", "kwalletd").call("close", name, force); int rc = -1; if (r.isValid()) { @@ -161,7 +161,7 @@ int Wallet::closeWallet(const QString& name, bool force) { } -int Wallet::deleteWallet(const QString& name) { +int Wallet::deleteWallet(const TQString& name) { DCOPReply r = DCOPRef("kded", "kwalletd").call("deleteWallet", name); int rc = -1; if (r.isValid()) { @@ -171,7 +171,7 @@ int Wallet::deleteWallet(const QString& name) { } -Wallet *Wallet::openWallet(const QString& name, WId w, OpenType ot) { +Wallet *Wallet::openWallet(const TQString& name, WId w, OpenType ot) { if (ot == Asynchronous) { Wallet *wallet = new Wallet(-1, name); DCOPRef("kded", "kwalletd").send("openAsynchronous", name, wallet->objId(), uint(w)); @@ -179,7 +179,7 @@ Wallet *Wallet::openWallet(const QString& name, WId w, OpenType ot) { } // avoid deadlock if the app has some popup open (#65978/#71048) - while( QWidget* widget = qApp->activePopupWidget()) + while( TQWidget* widget = qApp->activePopupWidget()) widget->close(); bool isPath = ot == Path; @@ -203,7 +203,7 @@ Wallet *Wallet::openWallet(const QString& name, WId w, OpenType ot) { } -bool Wallet::disconnectApplication(const QString& wallet, const QCString& app) { +bool Wallet::disconnectApplication(const TQString& wallet, const TQCString& app) { DCOPReply r = DCOPRef("kded", "kwalletd").call("disconnectApplication", wallet, app); bool rc = false; if (r.isValid()) { @@ -213,9 +213,9 @@ bool Wallet::disconnectApplication(const QString& wallet, const QCString& app) { } -QStringList Wallet::users(const QString& name) { +TQStringList Wallet::users(const TQString& name) { DCOPReply r = DCOPRef("kded", "kwalletd").call("users", name); - QStringList drc; + TQStringList drc; if (r.isValid()) { r.get(drc); } @@ -240,8 +240,8 @@ int Wallet::lockWallet() { DCOPReply r = _dcopRef->call("close", _handle, true); _handle = -1; - _folder = QString::null; - _name = QString::null; + _folder = TQString::null; + _name = TQString::null; if (r.isValid()) { int drc = -1; r.get(drc); @@ -251,7 +251,7 @@ int Wallet::lockWallet() { } -const QString& Wallet::walletName() const { +const TQString& Wallet::walletName() const { return _name; } @@ -273,15 +273,15 @@ void Wallet::requestChangePassword(WId w) { void Wallet::slotWalletClosed(int handle) { if (_handle == handle) { _handle = -1; - _folder = QString::null; - _name = QString::null; + _folder = TQString::null; + _name = TQString::null; emit walletClosed(); } } -QStringList Wallet::folderList() { - QStringList rc; +TQStringList Wallet::folderList() { + TQStringList rc; if (_handle == -1) { return rc; @@ -296,8 +296,8 @@ QStringList Wallet::folderList() { } -QStringList Wallet::entryList() { - QStringList rc; +TQStringList Wallet::entryList() { + TQStringList rc; if (_handle == -1) { return rc; @@ -312,7 +312,7 @@ QStringList Wallet::entryList() { } -bool Wallet::hasFolder(const QString& f) { +bool Wallet::hasFolder(const TQString& f) { bool rc = false; if (_handle == -1) { @@ -328,7 +328,7 @@ bool Wallet::hasFolder(const QString& f) { } -bool Wallet::createFolder(const QString& f) { +bool Wallet::createFolder(const TQString& f) { bool rc = true; if (_handle == -1) { @@ -346,7 +346,7 @@ bool Wallet::createFolder(const QString& f) { } -bool Wallet::setFolder(const QString& f) { +bool Wallet::setFolder(const TQString& f) { bool rc = false; if (_handle == -1) { @@ -369,7 +369,7 @@ bool Wallet::setFolder(const QString& f) { } -bool Wallet::removeFolder(const QString& f) { +bool Wallet::removeFolder(const TQString& f) { bool rc = false; if (_handle == -1) { @@ -382,19 +382,19 @@ bool Wallet::removeFolder(const QString& f) { } if (_folder == f) { - setFolder(QString::null); + setFolder(TQString::null); } return rc; } -const QString& Wallet::currentFolder() const { +const TQString& Wallet::currentFolder() const { return _folder; } -int Wallet::readEntry(const QString& key, QByteArray& value) { +int Wallet::readEntry(const TQString& key, TQByteArray& value) { int rc = -1; if (_handle == -1) { @@ -411,7 +411,7 @@ int Wallet::readEntry(const QString& key, QByteArray& value) { } -int Wallet::readEntryList(const QString& key, QMap<QString, QByteArray>& value) { +int Wallet::readEntryList(const TQString& key, TQMap<TQString, TQByteArray>& value) { int rc = -1; if (_handle == -1) { @@ -428,7 +428,7 @@ int Wallet::readEntryList(const QString& key, QMap<QString, QByteArray>& value) } -int Wallet::renameEntry(const QString& oldName, const QString& newName) { +int Wallet::renameEntry(const TQString& oldName, const TQString& newName) { int rc = -1; if (_handle == -1) { @@ -444,7 +444,7 @@ int Wallet::renameEntry(const QString& oldName, const QString& newName) { } -int Wallet::readMap(const QString& key, QMap<QString,QString>& value) { +int Wallet::readMap(const TQString& key, TQMap<TQString,TQString>& value) { int rc = -1; if (_handle == -1) { @@ -453,10 +453,10 @@ int Wallet::readMap(const QString& key, QMap<QString,QString>& value) { DCOPReply r = _dcopRef->call("readMap", _handle, _folder, key); if (r.isValid()) { - QByteArray v; + TQByteArray v; r.get(v); if (!v.isEmpty()) { - QDataStream ds(v, IO_ReadOnly); + TQDataStream ds(v, IO_ReadOnly); ds >> value; } rc = 0; @@ -466,7 +466,7 @@ int Wallet::readMap(const QString& key, QMap<QString,QString>& value) { } -int Wallet::readMapList(const QString& key, QMap<QString, QMap<QString, QString> >& value) { +int Wallet::readMapList(const TQString& key, TQMap<TQString, TQMap<TQString, TQString> >& value) { int rc = -1; if (_handle == -1) { @@ -475,12 +475,12 @@ int Wallet::readMapList(const QString& key, QMap<QString, QMap<QString, QString> DCOPReply r = _dcopRef->call("readMapList", _handle, _folder, key); if (r.isValid()) { - QMap<QString,QByteArray> unparsed; + TQMap<TQString,TQByteArray> unparsed; r.get(unparsed); - for (QMap<QString,QByteArray>::ConstIterator i = unparsed.begin(); i != unparsed.end(); ++i) { + for (TQMap<TQString,TQByteArray>::ConstIterator i = unparsed.begin(); i != unparsed.end(); ++i) { if (!i.data().isEmpty()) { - QDataStream ds(i.data(), IO_ReadOnly); - QMap<QString,QString> v; + TQDataStream ds(i.data(), IO_ReadOnly); + TQMap<TQString,TQString> v; ds >> v; value.insert(i.key(), v); } @@ -492,7 +492,7 @@ int Wallet::readMapList(const QString& key, QMap<QString, QMap<QString, QString> } -int Wallet::readPassword(const QString& key, QString& value) { +int Wallet::readPassword(const TQString& key, TQString& value) { int rc = -1; if (_handle == -1) { @@ -509,7 +509,7 @@ int Wallet::readPassword(const QString& key, QString& value) { } -int Wallet::readPasswordList(const QString& key, QMap<QString, QString>& value) { +int Wallet::readPasswordList(const TQString& key, TQMap<TQString, TQString>& value) { int rc = -1; if (_handle == -1) { @@ -526,7 +526,7 @@ int Wallet::readPasswordList(const QString& key, QMap<QString, QString>& value) } -int Wallet::writeEntry(const QString& key, const QByteArray& value, EntryType entryType) { +int Wallet::writeEntry(const TQString& key, const TQByteArray& value, EntryType entryType) { int rc = -1; if (_handle == -1) { @@ -542,7 +542,7 @@ int Wallet::writeEntry(const QString& key, const QByteArray& value, EntryType en } -int Wallet::writeEntry(const QString& key, const QByteArray& value) { +int Wallet::writeEntry(const TQString& key, const TQByteArray& value) { int rc = -1; if (_handle == -1) { @@ -558,15 +558,15 @@ int Wallet::writeEntry(const QString& key, const QByteArray& value) { } -int Wallet::writeMap(const QString& key, const QMap<QString,QString>& value) { +int Wallet::writeMap(const TQString& key, const TQMap<TQString,TQString>& value) { int rc = -1; if (_handle == -1) { return rc; } - QByteArray a; - QDataStream ds(a, IO_WriteOnly); + TQByteArray a; + TQDataStream ds(a, IO_WriteOnly); ds << value; DCOPReply r = _dcopRef->call("writeMap", _handle, _folder, key, a); if (r.isValid()) { @@ -577,7 +577,7 @@ int Wallet::writeMap(const QString& key, const QMap<QString,QString>& value) { } -int Wallet::writePassword(const QString& key, const QString& value) { +int Wallet::writePassword(const TQString& key, const TQString& value) { int rc = -1; if (_handle == -1) { @@ -593,7 +593,7 @@ int Wallet::writePassword(const QString& key, const QString& value) { } -bool Wallet::hasEntry(const QString& key) { +bool Wallet::hasEntry(const TQString& key) { bool rc = false; if (_handle == -1) { @@ -609,7 +609,7 @@ bool Wallet::hasEntry(const QString& key) { } -int Wallet::removeEntry(const QString& key) { +int Wallet::removeEntry(const TQString& key) { int rc = -1; if (_handle == -1) { @@ -625,7 +625,7 @@ int Wallet::removeEntry(const QString& key) { } -Wallet::EntryType Wallet::entryType(const QString& key) { +Wallet::EntryType Wallet::entryType(const TQString& key) { int rc = 0; if (_handle == -1) { @@ -641,28 +641,28 @@ Wallet::EntryType Wallet::entryType(const QString& key) { } -void Wallet::slotAppUnregistered(const QCString& app) { +void Wallet::slotAppUnregistered(const TQCString& app) { if (_handle >= 0 && app == "kded") { slotWalletClosed(_handle); } } -void Wallet::slotFolderUpdated(const QString& wallet, const QString& folder) { +void Wallet::slotFolderUpdated(const TQString& wallet, const TQString& folder) { if (_name == wallet) { emit folderUpdated(folder); } } -void Wallet::slotFolderListUpdated(const QString& wallet) { +void Wallet::slotFolderListUpdated(const TQString& wallet) { if (_name == wallet) { emit folderListUpdated(); } } -void Wallet::slotApplicationDisconnected(const QString& wallet, const QCString& application) { +void Wallet::slotApplicationDisconnected(const TQString& wallet, const TQCString& application) { if (_handle >= 0 && _name == wallet && application == _dcopRef->dcopClient()->appId()) { @@ -686,7 +686,7 @@ void Wallet::walletOpenResult(int id) { } -bool Wallet::folderDoesNotExist(const QString& wallet, const QString& folder) { +bool Wallet::folderDoesNotExist(const TQString& wallet, const TQString& folder) { DCOPReply r = DCOPRef("kded", "kwalletd").call("folderDoesNotExist", wallet, folder); bool rc = true; if (r.isValid()) { @@ -696,7 +696,7 @@ return rc; } -bool Wallet::keyDoesNotExist(const QString& wallet, const QString& folder, const QString& key) { +bool Wallet::keyDoesNotExist(const TQString& wallet, const TQString& folder, const TQString& key) { DCOPReply r = DCOPRef("kded", "kwalletd").call("keyDoesNotExist", wallet, folder, key); bool rc = true; if (r.isValid()) { diff --git a/kwallet/client/kwallet.h b/kwallet/client/kwallet.h index e49839ddc..b7b3bce31 100644 --- a/kwallet/client/kwallet.h +++ b/kwallet/client/kwallet.h @@ -22,12 +22,12 @@ #ifndef _KWALLET_H #define _KWALLET_H -#include <qglobal.h> +#include <tqglobal.h> #ifdef Q_OS_UNIX -#include <qstring.h> -#include <qstringlist.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <dcopobject.h> class DCOPRef; @@ -45,7 +45,7 @@ namespace KWallet { * @author George Staikos <staikos@kde.org> * @short KDE Wallet Class */ -class KIO_EXPORT Wallet : public QObject, public DCOPObject { +class KIO_EXPORT Wallet : public TQObject, public DCOPObject { K_DCOP Q_OBJECT protected: @@ -55,7 +55,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param handle The handle for the wallet. * @param name The name of the wallet. */ - Wallet(int handle, const QString& name); + Wallet(int handle, const TQString& name); /** * Copy a KWallet object. * @internal @@ -75,7 +75,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns a list of the names of all wallets that are * open. */ - static QStringList walletList(); + static TQStringList walletList(); /** * Determine if the KDE wallet is enabled. Normally you do @@ -89,7 +89,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param name The name of the wallet to check. * @return Returns true if the wallet is open, else false. */ - static bool isOpen(const QString& name); + static bool isOpen(const TQString& name); /** * Close the wallet @p name. The wallet will only be closed @@ -100,7 +100,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * is in use by others. * @return Returns 0 on success, non-zero on error. */ - static int closeWallet(const QString& name, bool force); + static int closeWallet(const TQString& name, bool force); /** * Delete the wallet @p name. The wallet will be forced closed @@ -108,7 +108,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param name The name of the wallet to delete. * @return Returns 0 on success, non-zero on error. */ - static int deleteWallet(const QString& name); + static int deleteWallet(const TQString& name); /** * Disconnect the application @p app from @p wallet. @@ -116,7 +116,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param app The name of the application to disconnect. * @return Returns true on success, false on error. */ - static bool disconnectApplication(const QString& wallet, const QCString& app); + static bool disconnectApplication(const TQString& wallet, const TQCString& app); enum OpenType { Synchronous=0, Asynchronous, Path, OpenTypeUnused=0xff }; @@ -136,7 +136,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns a pointer to the wallet if successful, * or a null pointer on error or if rejected. */ - static Wallet* openWallet(const QString& name, WId w = 0, OpenType ot = Synchronous); + static Wallet* openWallet(const TQString& name, WId w = 0, OpenType ot = Synchronous); /** * List the applications that are using the wallet @p wallet. @@ -144,17 +144,17 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns a list of all DCOP application IDs using * the wallet. */ - static QStringList users(const QString& wallet); + static TQStringList users(const TQString& wallet); /** * The name of the wallet used to store local passwords. */ - static const QString LocalWallet(); + static const TQString LocalWallet(); /** * The name of the wallet used to store network passwords. */ - static const QString NetworkWallet(); + static const TQString NetworkWallet(); /** * The standardized name of the password folder. @@ -162,7 +162,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * the user may still delete it so you should check for its * existence and recreate it if necessary and desired. */ - static const QString PasswordFolder(); + static const TQString PasswordFolder(); /** * The standardized name of the form data folder. @@ -170,7 +170,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * the user may still delete it so you should check for its * existence and recreate it if necessary and desired. */ - static const QString FormDataFolder(); + static const TQString FormDataFolder(); /** * Request to the wallet service to change the password of @@ -178,7 +178,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param name The the wallet to change the password of. * @param w The window id to associate any dialogs with. */ - static void changePassword(const QString& name, WId w = 0); + static void changePassword(const TQString& name, WId w = 0); /** * This syncs the wallet file on disk with what is in memory. @@ -198,7 +198,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { /** * The name of the current wallet. */ - virtual const QString& walletName() const; + virtual const TQString& walletName() const; /** * Determine if the current wallet is open, and is a valid @@ -218,14 +218,14 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * Obtain the list of all folders contained in the wallet. * @return Returns an empty list if the wallet is not open. */ - virtual QStringList folderList(); + virtual TQStringList folderList(); /** * Determine if the folder @p f exists in the wallet. * @param f the name of the folder to check for * @return Returns true if the folder exists in the wallet. */ - virtual bool hasFolder(const QString& f); + virtual bool hasFolder(const TQString& f); /** * Set the current working folder to @p f. The folder must @@ -234,21 +234,21 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param f the name of the folder to make the working folder * @return Returns true if the folder was successfully set. */ - virtual bool setFolder(const QString& f); + virtual bool setFolder(const TQString& f); /** * Remove the folder @p f and all its entries from the wallet. * @param f the name of the folder to remove * @return Returns true if the folder was successfully removed. */ - virtual bool removeFolder(const QString& f); + virtual bool removeFolder(const TQString& f); /** * Created the folder @p f. * @param f the name of the folder to create * @return Returns true if the folder was successfully created. */ - virtual bool createFolder(const QString& f); + virtual bool createFolder(const TQString& f); /** * Determine the current working folder in the wallet. @@ -256,14 +256,14 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * folder, which is valid but discouraged. * @return Returns the current working folder. */ - virtual const QString& currentFolder() const; + virtual const TQString& currentFolder() const; /** * Return the list of keys of all entries in this folder. * @return Returns an empty list if the wallet is not open, or * if the folder is empty. */ - virtual QStringList entryList(); + virtual TQStringList entryList(); /** * Rename the entry @p oldName to @p newName. @@ -271,18 +271,18 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param newName The new key of the entry. * @return Returns 0 on success, non-zero on error. */ - virtual int renameEntry(const QString& oldName, const QString& newName); + virtual int renameEntry(const TQString& oldName, const TQString& newName); /** * Read the entry @p key from the current folder. * The entry format is unknown except that it is either a - * QByteArray or a QDataStream, which effectively means that + * TQByteArray or a TQDataStream, which effectively means that * it is anything. * @param key The key of the entry to read. * @param value A buffer to fill with the value. * @return Returns 0 on success, non-zero on error. */ - virtual int readEntry(const QString& key, QByteArray& value); + virtual int readEntry(const TQString& key, TQByteArray& value); /** * Read the map entry @p key from the current folder. @@ -292,7 +292,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * return an error if the key was not originally * written as a map. */ - virtual int readMap(const QString& key, QMap<QString,QString>& value); + virtual int readMap(const TQString& key, TQMap<TQString,TQString>& value); /** * Read the password entry @p key from the current folder. @@ -302,12 +302,12 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * return an error if the key was not originally * written as a password. */ - virtual int readPassword(const QString& key, QString& value); + virtual int readPassword(const TQString& key, TQString& value); /** * Read the entries matching @p key from the current folder. * The entry format is unknown except that it is either a - * QByteArray or a QDataStream, which effectively means that + * TQByteArray or a TQDataStream, which effectively means that * it is anything. * @param key The key of the entry to read. Wildcards * are supported. @@ -316,7 +316,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns 0 on success, non-zero on error. * @since 3.4 */ - int readEntryList(const QString& key, QMap<QString, QByteArray>& value); + int readEntryList(const TQString& key, TQMap<TQString, TQByteArray>& value); /** * Read the map entry @p key from the current folder. @@ -329,7 +329,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * written as a map. * @since 3.4 */ - int readMapList(const QString& key, QMap<QString, QMap<QString, QString> >& value); + int readMapList(const TQString& key, TQMap<TQString, TQMap<TQString, TQString> >& value); /** * Read the password entry @p key from the current folder. @@ -342,7 +342,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * written as a password. * @since 3.4 */ - int readPasswordList(const QString& key, QMap<QString, QString>& value); + int readPasswordList(const TQString& key, TQMap<TQString, TQString>& value); /** * Write @p key = @p value as a binary entry to the current @@ -354,7 +354,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param entryType The type of the entry. * @return Returns 0 on success, non-zero on error. */ - virtual int writeEntry(const QString& key, const QByteArray& value, EntryType entryType); + virtual int writeEntry(const TQString& key, const TQByteArray& value, EntryType entryType); /** * Write @p key = @p value as a binary entry to the current @@ -363,7 +363,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param value The value of the entry. * @return Returns 0 on success, non-zero on error. */ - virtual int writeEntry(const QString& key, const QByteArray& value); + virtual int writeEntry(const TQString& key, const TQByteArray& value); /** * Write @p key = @p value as a map to the current folder. @@ -371,7 +371,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param value The value of the map. * @return Returns 0 on success, non-zero on error. */ - virtual int writeMap(const QString& key, const QMap<QString,QString>& value); + virtual int writeMap(const TQString& key, const TQMap<TQString,TQString>& value); /** * Write @p key = @p value as a password to the current folder. @@ -379,21 +379,21 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @param value The value of the password. * @return Returns 0 on success, non-zero on error. */ - virtual int writePassword(const QString& key, const QString& value); + virtual int writePassword(const TQString& key, const TQString& value); /** * Determine if the current folder has they entry @p key. * @param key The key to search for. * @return Returns true if the folder contains @p key. */ - virtual bool hasEntry(const QString& key); + virtual bool hasEntry(const TQString& key); /** * Remove the entry @p key from the current folder. * @param key The key to remove. * @return Returns 0 on success, non-zero on error. */ - virtual int removeEntry(const QString& key); + virtual int removeEntry(const TQString& key); /** * Determine the type of the entry @p key in this folder. @@ -401,7 +401,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns an enumerated type representing the type * of the entry. */ - virtual EntryType entryType(const QString& key); + virtual EntryType entryType(const TQString& key); /** * Determine if a folder does not exist in a wallet. This @@ -413,7 +413,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns true if the folder does NOT exist in the * wallet, or the wallet does not exist. */ - static bool folderDoesNotExist(const QString& wallet, const QString& folder); + static bool folderDoesNotExist(const TQString& wallet, const TQString& folder); /** * Determine if an entry in a folder does not exist in a @@ -426,8 +426,8 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @return Returns true if the key does NOT exist in the * wallet, or the folder or wallet does not exist. */ - static bool keyDoesNotExist(const QString& wallet, const QString& folder, - const QString& key); + static bool keyDoesNotExist(const TQString& wallet, const TQString& folder, + const TQString& key); signals: /** @@ -439,7 +439,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * Emitted when a folder in this wallet is updated. * @param folder The folder that was updated. */ - void folderUpdated(const QString& folder); + void folderUpdated(const TQString& folder); /** * Emitted when the folder list is changed in this wallet. @@ -450,7 +450,7 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * Emitted when a folder in this wallet is removed. * @param folder The folder that was removed. */ - void folderRemoved(const QString& folder); + void folderRemoved(const TQString& folder); /** * Emitted when a wallet is opened in asynchronous mode. @@ -470,19 +470,19 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @internal * DCOP slot for signals emitted by the wallet service. */ - ASYNC slotFolderUpdated(const QString& wallet, const QString& folder); + ASYNC slotFolderUpdated(const TQString& wallet, const TQString& folder); /** * @internal * DCOP slot for signals emitted by the wallet service. */ - ASYNC slotFolderListUpdated(const QString& wallet); + ASYNC slotFolderListUpdated(const TQString& wallet); /** * @internal * DCOP slot for signals emitted by the wallet service. */ - ASYNC slotApplicationDisconnected(const QString& wallet, const QCString& application); + ASYNC slotApplicationDisconnected(const TQString& wallet, const TQCString& application); /** * @internal @@ -495,13 +495,13 @@ class KIO_EXPORT Wallet : public QObject, public DCOPObject { * @internal * Used to detect when the wallet service dies. */ - void slotAppUnregistered(const QCString&); + void slotAppUnregistered(const TQCString&); private: class WalletPrivate; WalletPrivate *d; - QString _name; - QString _folder; + TQString _name; + TQString _folder; int _handle; DCOPRef *_dcopRef; diff --git a/kwallet/client/kwallettypes.h b/kwallet/client/kwallettypes.h index b98d3d17a..43b7a6485 100644 --- a/kwallet/client/kwallettypes.h +++ b/kwallet/client/kwallettypes.h @@ -21,12 +21,12 @@ #ifndef KWALLET_TYPES_H #define KWALLET_TYPES_H -#include <qmap.h> +#include <tqmap.h> class QString; -inline const char* dcopTypeName(const QByteArray&) { return "QByteArray"; } -inline const char* dcopTypeName(const QMap<QString,QString>&) { return "QMap<QString,QString>"; } -inline const char* dcopTypeName(const QMap<QString,QByteArray>&) { return "QMap<QString,QByteArray>"; } +inline const char* dcopTypeName(const TQByteArray&) { return "TQByteArray"; } +inline const char* dcopTypeName(const TQMap<TQString,TQString>&) { return "TQMap<TQString,TQString>"; } +inline const char* dcopTypeName(const TQMap<TQString,TQByteArray>&) { return "TQMap<TQString,TQByteArray>"; } #endif diff --git a/kwallet/tests/kwalletasync.cpp b/kwallet/tests/kwalletasync.cpp index 0992c6e7d..6e5c22998 100644 --- a/kwallet/tests/kwalletasync.cpp +++ b/kwallet/tests/kwalletasync.cpp @@ -1,5 +1,5 @@ -#include <qtextstream.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include <kaboutdata.h> #include <kapplication.h> @@ -12,7 +12,7 @@ #include "kwallettest.h" -static QTextStream _out( stdout, IO_WriteOnly ); +static TQTextStream _out( stdout, IO_WriteOnly ); void openWallet() { @@ -22,11 +22,11 @@ void openWallet() KWallet::Wallet *wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Asynchronous ); WalletReceiver r; - r.connect( wallet, SIGNAL( walletOpened(bool) ), SLOT( walletOpened(bool) ) ); + r.connect( wallet, TQT_SIGNAL( walletOpened(bool) ), TQT_SLOT( walletOpened(bool) ) ); _out << "About to start 30 second event loop" << endl; - QTimer::singleShot( 30000, qApp, SLOT( quit() ) ); + TQTimer::singleShot( 30000, qApp, TQT_SLOT( quit() ) ); int ret = qApp->exec(); if ( ret == 0 ) diff --git a/kwallet/tests/kwalletboth.cpp b/kwallet/tests/kwalletboth.cpp index 736be72cb..f79f38567 100644 --- a/kwallet/tests/kwalletboth.cpp +++ b/kwallet/tests/kwalletboth.cpp @@ -1,5 +1,5 @@ -#include <qtextstream.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include <kaboutdata.h> #include <kapplication.h> @@ -12,7 +12,7 @@ #include "kwallettest.h" -static QTextStream _out( stdout, IO_WriteOnly ); +static TQTextStream _out( stdout, IO_WriteOnly ); void openWallet() { @@ -22,7 +22,7 @@ void openWallet() KWallet::Wallet *wallet = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Asynchronous ); WalletReceiver r; - r.connect( wallet, SIGNAL( walletOpened(bool) ), SLOT( walletOpened(bool) ) ); + r.connect( wallet, TQT_SIGNAL( walletOpened(bool) ), TQT_SLOT( walletOpened(bool) ) ); _out << "About to ask for wallet sync" << endl; @@ -31,7 +31,7 @@ void openWallet() _out << "Got sync wallet: " << (wallet != 0) << endl; _out << "About to start 30 second event loop" << endl; - QTimer::singleShot( 30000, qApp, SLOT( quit() ) ); + TQTimer::singleShot( 30000, qApp, TQT_SLOT( quit() ) ); int ret = qApp->exec(); @@ -40,16 +40,16 @@ void openWallet() else _out << "Success!" << endl; - QMap<QString,QString> p; + TQMap<TQString,TQString> p; ret = wallet->readPasswordList("*", p); _out << "readPasswordList returned: " << ret << endl; _out << "readPasswordList returned " << p.keys().count() << " entries" << endl; - QMap<QString, QMap<QString, QString> > q; + TQMap<TQString, TQMap<TQString, TQString> > q; ret = wallet->readMapList("*", q); _out << "readMapList returned: " << ret << endl; _out << "readMapList returned " << q.keys().count() << " entries" << endl; - QMap<QString, QByteArray> s; + TQMap<TQString, TQByteArray> s; ret = wallet->readEntryList("*", s); _out << "readEntryList returned: " << ret << endl; _out << "readEntryList returned " << s.keys().count() << " entries" << endl; diff --git a/kwallet/tests/kwalletsync.cpp b/kwallet/tests/kwalletsync.cpp index d5eae13a3..3625a5cb6 100644 --- a/kwallet/tests/kwalletsync.cpp +++ b/kwallet/tests/kwalletsync.cpp @@ -1,5 +1,5 @@ -#include <qtextstream.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include <kaboutdata.h> #include <kapplication.h> @@ -10,7 +10,7 @@ #include <dcopclient.h> #include <kwallet.h> -static QTextStream _out( stdout, IO_WriteOnly ); +static TQTextStream _out( stdout, IO_WriteOnly ); void openWallet() { diff --git a/kwallet/tests/kwallettest.h b/kwallet/tests/kwallettest.h index e3fe834f2..448cdb785 100644 --- a/kwallet/tests/kwallettest.h +++ b/kwallet/tests/kwallettest.h @@ -1,7 +1,7 @@ #ifndef KWALLETASYNC_H #define KWALLETASYNC_H -#include <qobject.h> +#include <tqobject.h> namespace KWallet { class Wallet; } |