summaryrefslogtreecommitdiffstats
path: root/kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc')
-rw-r--r--kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc110
1 files changed, 55 insertions, 55 deletions
diff --git a/kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc b/kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc
index bf038bb21..11e25f2dd 100644
--- a/kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc
+++ b/kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc
@@ -33,10 +33,10 @@
#include "options.h"
-#include <qtimer.h>
-#include <qtextcodec.h>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqtimer.h>
+#include <tqtextcodec.h>
+#include <tqfile.h>
+#include <tqregexp.h>
#include <kabc/stdaddressbook.h>
#include <kabc/resourcefile.h>
@@ -110,7 +110,7 @@ using namespace KABC;
*********************************************************************/
-AbbrowserConduit::AbbrowserConduit(KPilotLink * o, const char *n, const QStringList & a):
+AbbrowserConduit::AbbrowserConduit(KPilotLink * o, const char *n, const TQStringList & a):
ConduitAction(o, n, a),
aBook(0L),
fAddressAppInfo(0L),
@@ -153,7 +153,7 @@ AbbrowserConduit::~AbbrowserConduit()
/* Builds the map which links record ids to uid's of Addressee
*/
-void AbbrowserConduit::_mapContactsToPilot(QMap < recordid_t, QString > &idContactMap)
+void AbbrowserConduit::_mapContactsToPilot(TQMap < recordid_t, TQString > &idContactMap)
{
FUNCTIONSETUP;
@@ -163,7 +163,7 @@ void AbbrowserConduit::_mapContactsToPilot(QMap < recordid_t, QString > &idConta
contactIter != aBook->end(); ++contactIter)
{
Addressee aContact = *contactIter;
- QString recid = aContact.custom(KABCSync::appString, KABCSync::idString);
+ TQString recid = aContact.custom(KABCSync::appString, KABCSync::idString);
if(!recid.isEmpty())
{
recordid_t id = recid.toULong();
@@ -400,7 +400,7 @@ bool AbbrowserConduit::_saveAddressBook()
else {
KIO::NetAccess::removeTempFile(fABookFile);
}
- QFile backup(fABookFile + CSL1("~"));
+ TQFile backup(fABookFile + CSL1("~"));
backup.remove();
}
@@ -524,13 +524,13 @@ void AbbrowserConduit::showAddresses(
// Local block
{
- QString dbpath = fLocalDatabase->dbPathName();
+ TQString dbpath = fLocalDatabase->dbPathName();
DEBUGKPILOT << fname << ": Local database path " << dbpath << endl;
}
if ( syncMode().isTest() )
{
- QTimer::singleShot(0, this, SLOT(slotTestRecord()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotTestRecord()));
return true;
}
@@ -561,7 +561,7 @@ void AbbrowserConduit::showAddresses(
allIds=fDatabase->idList();
}
- QValueVector<int> v(4);
+ TQValueVector<int> v(4);
v[0] = AbbrowserSettings::custom0();
v[1] = AbbrowserSettings::custom1();
v[2] = AbbrowserSettings::custom2();
@@ -580,7 +580,7 @@ void AbbrowserConduit::showAddresses(
for this, and no longer purge the whole addressbook before the sync to
prevent data loss in case of connection loss. */
- QTimer::singleShot(0, this, SLOT(slotPalmRecToPC()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPalmRecToPC()));
return true;
}
@@ -596,7 +596,7 @@ void AbbrowserConduit::slotPalmRecToPC()
{
DEBUGKPILOT << fname << ": Done; change to PCtoHH phase." << endl;
abiter = aBook->begin();
- QTimer::singleShot(0, this, SLOT(slotPCRecToPalm()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPCRecToPalm()));
return;
}
@@ -614,7 +614,7 @@ void AbbrowserConduit::slotPalmRecToPC()
if(!palmRec)
{
abiter = aBook->begin();
- QTimer::singleShot(0, this, SLOT(slotPCRecToPalm()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPCRecToPalm()));
return;
}
@@ -622,7 +622,7 @@ void AbbrowserConduit::slotPalmRecToPC()
if(syncedIds.contains(palmRec->id()))
{
KPILOT_DELETE(palmRec);
- QTimer::singleShot(0, this, SLOT(slotPalmRecToPC()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPalmRecToPC()));
return;
}
@@ -650,7 +650,7 @@ void AbbrowserConduit::slotPalmRecToPC()
KPILOT_DELETE(palmRec);
KPILOT_DELETE(backupRec);
- QTimer::singleShot(0, this, SLOT(slotPalmRecToPC()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPalmRecToPC()));
}
@@ -664,7 +664,7 @@ void AbbrowserConduit::slotPCRecToPalm()
{
DEBUGKPILOT << fname << ": Done; change to delete records." << endl;
pilotindex = 0;
- QTimer::singleShot(0, this, SLOT(slotDeletedRecord()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeletedRecord()));
return;
}
@@ -678,12 +678,12 @@ void AbbrowserConduit::slotPCRecToPalm()
{
DEBUGKPILOT << fname << ": address with id " << ad.uid() <<
" marked archived, so don't sync." << endl;
- QTimer::singleShot(0, this, SLOT(slotPCRecToPalm()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPCRecToPalm()));
return;
}
- QString recID(ad.custom(KABCSync::appString, KABCSync::idString));
+ TQString recID(ad.custom(KABCSync::appString, KABCSync::idString));
bool ok;
recordid_t rid = recID.toLong(&ok);
if (recID.isEmpty() || !ok || !rid)
@@ -691,7 +691,7 @@ void AbbrowserConduit::slotPCRecToPalm()
DEBUGKPILOT << fname << ": This is a new record." << endl;
// it's a new item(no record ID and not inserted by the Palm -> PC sync), so add it
syncAddressee(ad, 0L, 0L);
- QTimer::singleShot(0, this, SLOT(slotPCRecToPalm()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPCRecToPalm()));
return;
}
@@ -699,7 +699,7 @@ void AbbrowserConduit::slotPCRecToPalm()
if (syncedIds.contains(rid))
{
DEBUGKPILOT << ": address with id " << rid << " already synced." << endl;
- QTimer::singleShot(0, this, SLOT(slotPCRecToPalm()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPCRecToPalm()));
return;
}
@@ -742,7 +742,7 @@ void AbbrowserConduit::slotPCRecToPalm()
syncedIds.append(rid);
// done with the sync process, go on with the next one:
- QTimer::singleShot(0, this, SLOT(slotPCRecToPalm()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotPCRecToPalm()));
}
@@ -755,13 +755,13 @@ void AbbrowserConduit::slotDeletedRecord()
if(!backupRec || isFirstSync() )
{
KPILOT_DELETE(backupRec);
- QTimer::singleShot(0, this, SLOT(slotDeleteUnsyncedPCRecords()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteUnsyncedPCRecords()));
return;
}
recordid_t id = backupRec->id();
- QString uid = addresseeMap[id];
+ TQString uid = addresseeMap[id];
Addressee e = aBook->findByUid(uid);
DEBUGKPILOT << fname << ": now looking at palm id: ["
@@ -796,7 +796,7 @@ void AbbrowserConduit::slotDeletedRecord()
KPILOT_DELETE(palmRec);
KPILOT_DELETE(backupAddr);
KPILOT_DELETE(backupRec);
- QTimer::singleShot(0, this, SLOT(slotDeletedRecord()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeletedRecord()));
}
@@ -806,9 +806,9 @@ void AbbrowserConduit::slotDeleteUnsyncedPCRecords()
FUNCTIONSETUP;
if ( syncMode()==SyncMode::eCopyHHToPC )
{
- QStringList uids;
+ TQStringList uids;
RecordIDList::iterator it;
- QString uid;
+ TQString uid;
for ( it = syncedIds.begin(); it != syncedIds.end(); ++it)
{
uid=addresseeMap[*it];
@@ -829,7 +829,7 @@ void AbbrowserConduit::slotDeleteUnsyncedPCRecords()
}
}
}
- QTimer::singleShot(0, this, SLOT(slotDeleteUnsyncedHHRecords()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteUnsyncedHHRecords()));
}
@@ -852,7 +852,7 @@ void AbbrowserConduit::slotDeleteUnsyncedHHRecords()
}
}
}
- QTimer::singleShot(0, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotCleanup()));
}
@@ -874,7 +874,7 @@ void AbbrowserConduit::slotCleanup()
}
// Write out the sync maps
- QString syncFile = fLocalDatabase->dbPathName() + CSL1(".sync");
+ TQString syncFile = fLocalDatabase->dbPathName() + CSL1(".sync");
DEBUGKPILOT << fname << ": Writing sync map to " << syncFile << endl;
KSaveFile map( syncFile );
if ( map.status() == 0 )
@@ -1215,7 +1215,7 @@ bool AbbrowserConduit::_savePalmAddr(PilotAddress *palmAddr, Addressee &pcAddr)
abId = pcAddr.custom(KABCSync::appString, KABCSync::idString).toUInt();
if(abId != pilotId)
{
- pcAddr.insertCustom(KABCSync::appString, KABCSync::idString, QString::number(pilotId));
+ pcAddr.insertCustom(KABCSync::appString, KABCSync::idString, TQString::number(pilotId));
return true;
}
@@ -1230,16 +1230,16 @@ bool AbbrowserConduit::_savePCAddr(Addressee &pcAddr, PilotAddress*,
FUNCTIONSETUP;
DEBUGKPILOT<<"Before _savePCAddr, pcAddr.custom="<<pcAddr.custom(KABCSync::appString, KABCSync::idString)<<endl;
- QString pilotId = pcAddr.custom(KABCSync::appString, KABCSync::idString);
+ TQString pilotId = pcAddr.custom(KABCSync::appString, KABCSync::idString);
long pilotIdL = pilotId.toLong();
if(!pilotId.isEmpty())
{
// because we maintain a mapping between pilotId -> kabc uid, whenever we add
// a new relationship, we have to remove any old mapping that would tie a different
// pilot id -> this kabc uid
- QMap < recordid_t, QString>::iterator it;
+ TQMap < recordid_t, TQString>::iterator it;
for ( it = addresseeMap.begin(); it != addresseeMap.end(); ++it ) {
- QString kabcUid = it.data();
+ TQString kabcUid = it.data();
if (kabcUid == pcAddr.uid()) {
addresseeMap.remove(it);
break;
@@ -1317,8 +1317,8 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
{
// Check that the name of the category of the HH record
// is one matching the PC record.
- QString addressCategoryLabel = fAddressAppInfo->categoryName(piAddress->category());
- QString cat = KABCSync::bestMatchedCategoryName(abEntry.categories(),
+ TQString addressCategoryLabel = fAddressAppInfo->categoryName(piAddress->category());
+ TQString cat = KABCSync::bestMatchedCategoryName(abEntry.categories(),
*fAddressAppInfo, piAddress->category());
if(!_equal(cat, addressCategoryLabel))
{
@@ -1330,22 +1330,22 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
if (flags & eqFlagsPhones)
{
// first, look for missing e-mail addresses on either side
- QStringList abEmails(abEntry.emails());
- QStringList piEmails(piAddress->getEmails());
+ TQStringList abEmails(abEntry.emails());
+ TQStringList piEmails(piAddress->getEmails());
if (abEmails.count() != piEmails.count())
{
DEBUGKPILOT << fname << ": email count not equal" << endl;
return false;
}
- for (QStringList::Iterator it = abEmails.begin(); it != abEmails.end(); it++) {
+ for (TQStringList::Iterator it = abEmails.begin(); it != abEmails.end(); it++) {
if (!piEmails.contains(*it))
{
DEBUGKPILOT << fname << ": pilot e-mail missing" << endl;
return false;
}
}
- for (QStringList::Iterator it = piEmails.begin(); it != piEmails.end(); it++) {
+ for (TQStringList::Iterator it = piEmails.begin(); it != piEmails.end(); it++) {
if (!abEmails.contains(*it))
{
DEBUGKPILOT << fname << ": kabc e-mail missing" << endl;
@@ -1483,8 +1483,8 @@ bool AbbrowserConduit::_equal(const PilotAddress *piAddress, const Addressee &ab
@pc, @backup, @palm ... entries of the according databases
@returns string of the merged entries.
*/
-QString AbbrowserConduit::_smartMergeString(const QString &pc, const QString & backup,
- const QString & palm, ConflictResolution confRes)
+TQString AbbrowserConduit::_smartMergeString(const TQString &pc, const TQString & backup,
+ const TQString & palm, ConflictResolution confRes)
{
FUNCTIONSETUP;
@@ -1493,7 +1493,7 @@ QString AbbrowserConduit::_smartMergeString(const QString &pc, const QString & b
// If this is a first sync, we don't have a backup record, so
if(isFirstSync() || backup.isEmpty()) {
- if (pc.isEmpty() && palm.isEmpty() ) return QString::null;
+ if (pc.isEmpty() && palm.isEmpty() ) return TQString::null;
if(pc.isEmpty()) return palm;
if(palm.isEmpty()) return pc;
} else {
@@ -1512,7 +1512,7 @@ QString AbbrowserConduit::_smartMergeString(const QString &pc, const QString & b
case SyncAction::ePreviousSyncOverrides: return backup; break;
default: break;
}
- return QString::null;
+ return TQString::null;
}
@@ -1535,9 +1535,9 @@ bool AbbrowserConduit::_buildResolutionTable(ResolutionTable*tab, const Addresse
#define appendGen(desc, abfield, palmfield) \
tab->append(new ResolutionItem(desc, tab->fExistItems, \
- (!pcAddr.isEmpty())?(abfield):(QString::null), \
- (palmAddr)?(palmAddr->palmfield):(QString::null), \
- (backupAddr)?(backupAddr->palmfield):(QString::null) ))
+ (!pcAddr.isEmpty())?(abfield):(TQString::null), \
+ (palmAddr)?(palmAddr->palmfield):(TQString::null), \
+ (backupAddr)?(backupAddr->palmfield):(TQString::null) ))
#define appendAddr(desc, abfield, palmfield) \
appendGen(desc, abfield, getField(palmfield))
#define appendGenPhone(desc, abfield, palmfield) \
@@ -1572,12 +1572,12 @@ bool AbbrowserConduit::_buildResolutionTable(ResolutionTable*tab, const Addresse
appendAddr(i18n("Postal code"), abAddress.postalCode(), entryZip);
appendAddr(i18n("Country"), abAddress.country(), entryCountry);
- QString palmAddrCategoryLabel;
+ TQString palmAddrCategoryLabel;
if (palmAddr)
{
palmAddrCategoryLabel = fAddressAppInfo->categoryName(palmAddr->category());
}
- QString backupAddrCategoryLabel;
+ TQString backupAddrCategoryLabel;
if (backupAddr)
{
backupAddrCategoryLabel = fAddressAppInfo->categoryName(backupAddr->category());
@@ -1588,7 +1588,7 @@ bool AbbrowserConduit::_buildResolutionTable(ResolutionTable*tab, const Addresse
tab->fExistItems,
!pcAddr.isEmpty() ?
KABCSync::bestMatchedCategoryName(pcAddr.categories(), *fAddressAppInfo, category) :
- QString::null,
+ TQString::null,
palmAddrCategoryLabel,
backupAddrCategoryLabel));
#undef appendGen
@@ -1601,7 +1601,7 @@ bool AbbrowserConduit::_buildResolutionTable(ResolutionTable*tab, const Addresse
/// This function just sets the phone number of type "type" to "phone"
-static inline void setPhoneNumber(Addressee &abEntry, int type, const QString &nr)
+static inline void setPhoneNumber(Addressee &abEntry, int type, const TQString &nr)
{
PhoneNumber phone = abEntry.phoneNumber(type);
phone.setNumber(nr);
@@ -1746,7 +1746,7 @@ bool AbbrowserConduit::_smartMergeAddressee(Addressee &pcAddr,
if (!mergeOk)
{
- QString dlgText;
+ TQString dlgText;
if (!palmAddr)
{
dlgText=i18n("The following address entry was changed, but does no longer exist on the handheld. Please resolve this conflict:");
@@ -1839,7 +1839,7 @@ Addressee AbbrowserConduit::_findMatch(const PilotAddress & pilotAddress) const
// first, use the pilotID to UID map to find the appropriate record
if( !isFirstSync() && (pilotAddress.id() > 0) )
{
- QString id(addresseeMap[pilotAddress.id()]);
+ TQString id(addresseeMap[pilotAddress.id()]);
DEBUGKPILOT << fname << ": PilotRecord has id " << pilotAddress.id() << ", mapped to " << id << endl;
if(!id.isEmpty())
{
@@ -1852,7 +1852,7 @@ Addressee AbbrowserConduit::_findMatch(const PilotAddress & pilotAddress) const
for(AddressBook::Iterator iter = aBook->begin(); iter != aBook->end(); ++iter)
{
Addressee abEntry = *iter;
- QString recID(abEntry.custom(KABCSync::appString, KABCSync::idString));
+ TQString recID(abEntry.custom(KABCSync::appString, KABCSync::idString));
bool ok;
if (!recID.isEmpty() )
{
@@ -1893,5 +1893,5 @@ void AbbrowserConduit::slotTestRecord()
// Schedule more work.
++pilotindex;
- QTimer::singleShot(0, this, SLOT(slotTestRecord()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotTestRecord()));
}