summaryrefslogtreecommitdiffstats
path: root/kresources/groupwise/kabc_resourcegroupwise.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kresources/groupwise/kabc_resourcegroupwise.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/groupwise/kabc_resourcegroupwise.cpp')
-rw-r--r--kresources/groupwise/kabc_resourcegroupwise.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/kresources/groupwise/kabc_resourcegroupwise.cpp b/kresources/groupwise/kabc_resourcegroupwise.cpp
index e37a4d65c..9aa33ac7f 100644
--- a/kresources/groupwise/kabc_resourcegroupwise.cpp
+++ b/kresources/groupwise/kabc_resourcegroupwise.cpp
@@ -18,8 +18,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qapplication.h>
-#include <qfile.h>
+#include <tqapplication.h>
+#include <tqfile.h>
#include <kabc/addressee.h>
#include <kabc/vcardconverter.h>
@@ -47,10 +47,10 @@ ResourceGroupwise::ResourceGroupwise( const KConfig *config )
}
ResourceGroupwise::ResourceGroupwise( const KURL &url,
- const QString &user,
- const QString &password,
- const QStringList &readAddressBooks,
- const QString &writeAddressBook )
+ const TQString &user,
+ const TQString &password,
+ const TQStringList &readAddressBooks,
+ const TQString &writeAddressBook )
: ResourceCached( 0 )
{
init();
@@ -115,16 +115,16 @@ void ResourceGroupwise::clearCache()
{
idMapper().clear();
mAddrMap.clear();
- QFile file( cacheFile() );
+ TQFile file( cacheFile() );
file.remove();
}
void ResourceGroupwise::readAddressBooks()
{
- QStringList ids = prefs()->ids();
- QStringList names = prefs()->names();
- QStringList personals = prefs()->personals();
- QStringList frequents = prefs()->frequents();
+ TQStringList ids = prefs()->ids();
+ TQStringList names = prefs()->names();
+ TQStringList personals = prefs()->personals();
+ TQStringList frequents = prefs()->frequents();
if ( ids.count() != names.count() || ids.count() != personals.count() ||
ids.count() != frequents.count() ) {
@@ -147,10 +147,10 @@ void ResourceGroupwise::readAddressBooks()
void ResourceGroupwise::writeAddressBooks()
{
- QStringList ids;
- QStringList names;
- QStringList personals;
- QStringList frequents;
+ TQStringList ids;
+ TQStringList names;
+ TQStringList personals;
+ TQStringList frequents;
GroupWise::AddressBook::List::ConstIterator it;
for( it = mAddressBooks.begin(); it != mAddressBooks.end(); ++it ) {
ids.append( (*it).id );
@@ -177,8 +177,8 @@ void ResourceGroupwise::retrieveAddressBooks()
mAddressBooks = server.addressBookList();
server.logout();
- QStringList reads;
- QString write;
+ TQStringList reads;
+ TQString write;
GroupWise::AddressBook::List::ConstIterator it;
for( it = mAddressBooks.begin(); it != mAddressBooks.end(); ++it ) {
@@ -287,9 +287,9 @@ bool ResourceGroupwise::asyncLoad()
if ( !mProgress )
{
mProgress = KPIM::ProgressManager::instance()->createProgressItem(
- KPIM::ProgressManager::getUniqueID(), i18n( "Loading GroupWise resource %1" ).arg( resourceName() ), QString::null, true /*CanBeCancelled*/, mPrefs->url().startsWith("https" ) );
- connect( mProgress, SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ),
- SLOT( cancelLoad() ) );
+ KPIM::ProgressManager::getUniqueID(), i18n( "Loading GroupWise resource %1" ).arg( resourceName() ), TQString::null, true /*CanBeCancelled*/, mPrefs->url().startsWith("https" ) );
+ connect( mProgress, TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem * ) ),
+ TQT_SLOT( cancelLoad() ) );
}
if ( addressBooks().isEmpty() ) {
@@ -338,7 +338,7 @@ void ResourceGroupwise::fetchAddressBooks( const BookType bookType )
}
mState = ( bookType == System ? FetchingSAB : FetchingUAB );
- mJobData = QString::null;
+ mJobData = TQString::null;
if ( mJob )
{
@@ -349,28 +349,28 @@ void ResourceGroupwise::fetchAddressBooks( const BookType bookType )
mJob = KIO::get( url, false, false ); // TODO: make the GW jobs call finished if the URL
// contains no address book IDs
kdDebug() << " Job address: " << mJob << endl;
- connect( mJob, SIGNAL( data( KIO::Job *, const QByteArray & ) ),
- SLOT( slotReadJobData( KIO::Job *, const QByteArray & ) ) );
- connect( mJob, SIGNAL( percent( KIO::Job *, unsigned long ) ),
- SLOT( slotJobPercent( KIO::Job *, unsigned long ) ) );
+ connect( mJob, TQT_SIGNAL( data( KIO::Job *, const TQByteArray & ) ),
+ TQT_SLOT( slotReadJobData( KIO::Job *, const TQByteArray & ) ) );
+ connect( mJob, TQT_SIGNAL( percent( KIO::Job *, unsigned long ) ),
+ TQT_SLOT( slotJobPercent( KIO::Job *, unsigned long ) ) );
if ( bookType == System )
{
- connect( mJob, SIGNAL( result( KIO::Job * ) ),
- SLOT( fetchSABResult( KIO::Job * ) ) );
+ connect( mJob, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( fetchSABResult( KIO::Job * ) ) );
mSABProgress = KPIM::ProgressManager::instance()->createProgressItem(
mProgress, KPIM::ProgressManager::getUniqueID(),
- i18n( "Fetching System Address Book" ), QString::null,
+ i18n( "Fetching System Address Book" ), TQString::null,
false /*CannotBeCancelled*/,
mPrefs->url().startsWith("https" ) );
}
else
{
- connect( mJob, SIGNAL( result( KIO::Job * ) ),
- SLOT( fetchUABResult( KIO::Job * ) ) );
+ connect( mJob, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( fetchUABResult( KIO::Job * ) ) );
mUABProgress = KPIM::ProgressManager::instance()->createProgressItem(
mProgress, KPIM::ProgressManager::getUniqueID(),
- i18n( "Fetching User Address Books" ), QString::null,
+ i18n( "Fetching User Address Books" ), TQString::null,
false /*CannotBeCancelled*/,
mPrefs->url().startsWith("https" ) );
}
@@ -437,21 +437,21 @@ void ResourceGroupwise::updateSystemAddressBook()
KURL url = createAccessUrl( System, Update, mPrefs->lastSequenceNumber(), mPrefs->lastTimePORebuild() );
kdDebug() << " Update URL: " << url << endl;
- mJobData = QString::null;
+ mJobData = TQString::null;
mSABProgress = KPIM::ProgressManager::instance()->createProgressItem(
mProgress, KPIM::ProgressManager::getUniqueID(),
- i18n( "Updating System Address Book" ), QString::null,
+ i18n( "Updating System Address Book" ), TQString::null,
false /*CannotBeCancelled*/,
mPrefs->url().startsWith("https" ) );
mJob = KIO::get( url, false, false );
mJob->setInteractive( false );
- connect( mJob, SIGNAL( result( KIO::Job * ) ),
- SLOT( updateSABResult( KIO::Job * ) ) );
- connect( mJob, SIGNAL( data( KIO::Job *, const QByteArray & ) ),
- SLOT( slotUpdateJobData( KIO::Job *, const QByteArray & ) ) );
- connect( mJob, SIGNAL( percent( KIO::Job *, unsigned long ) ),
- SLOT( slotJobPercent( KIO::Job *, unsigned long ) ) );
+ connect( mJob, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( updateSABResult( KIO::Job * ) ) );
+ connect( mJob, TQT_SIGNAL( data( KIO::Job *, const TQByteArray & ) ),
+ TQT_SLOT( slotUpdateJobData( KIO::Job *, const TQByteArray & ) ) );
+ connect( mJob, TQT_SIGNAL( percent( KIO::Job *, unsigned long ) ),
+ TQT_SLOT( slotJobPercent( KIO::Job *, unsigned long ) ) );
return;
}
@@ -486,7 +486,7 @@ void ResourceGroupwise::updateSABResult( KIO::Job *job )
loadCompleted();
}
-void ResourceGroupwise::slotReadJobData( KIO::Job *job , const QByteArray &data )
+void ResourceGroupwise::slotReadJobData( KIO::Job *job , const TQByteArray &data )
{
kdDebug() << "ResourceGroupwise::slotReadJobData()" << endl;
Q_UNUSED( job );
@@ -494,7 +494,7 @@ void ResourceGroupwise::slotReadJobData( KIO::Job *job , const QByteArray &data
mJobData.append( data.data() );
KABC::VCardConverter conv;
- QTime profile;
+ TQTime profile;
profile.start();
Addressee::List addressees = conv.parseVCards( mJobData );
// kdDebug() << " parsed " << addressees.count() << " contacts in " << profile.elapsed() << "ms, now adding to resource..." << endl;
@@ -505,8 +505,8 @@ void ResourceGroupwise::slotReadJobData( KIO::Job *job , const QByteArray &data
if ( !addr.isEmpty() ) {
addr.setResource( this );
- QString remote = addr.custom( "GWRESOURCE", "UID" );
- QString local = idMapper().localId( remote );
+ TQString remote = addr.custom( "GWRESOURCE", "UID" );
+ TQString local = idMapper().localId( remote );
if ( local.isEmpty() ) {
idMapper().setRemoteId( addr.uid(), remote );
} else {
@@ -517,10 +517,10 @@ void ResourceGroupwise::slotReadJobData( KIO::Job *job , const QByteArray &data
clearChange( addr );
}
}
- mJobData = QString::null;
+ mJobData = TQString::null;
}
-void ResourceGroupwise::slotUpdateJobData( KIO::Job *job, const QByteArray &data )
+void ResourceGroupwise::slotUpdateJobData( KIO::Job *job, const TQByteArray &data )
{
kdDebug() << "ResourceGroupwise::slotUpdateJobData()" << endl;
kdDebug() << " Job address: " << job << endl;
@@ -534,9 +534,9 @@ void ResourceGroupwise::slotUpdateJobData( KIO::Job *job, const QByteArray &data
KABC::Addressee addr = *it;
if ( !addr.isEmpty() ) {
// if added or changed
- QString syncType = addr.custom( "GWRESOURCE", "SYNC" );
- QString remote = addr.custom( "GWRESOURCE", "UID" );
- QString local = idMapper().localId( remote );
+ TQString syncType = addr.custom( "GWRESOURCE", "SYNC" );
+ TQString remote = addr.custom( "GWRESOURCE", "UID" );
+ TQString local = idMapper().localId( remote );
if ( syncType == "ADD" || syncType == "UPD" )
{
@@ -567,7 +567,7 @@ void ResourceGroupwise::slotUpdateJobData( KIO::Job *job, const QByteArray &data
}
}
}
- mJobData = QString::null;
+ mJobData = TQString::null;
}
void ResourceGroupwise::loadCompleted()
@@ -664,20 +664,20 @@ ResourceGroupwise::SABState ResourceGroupwise::systemAddressBookState()
bool ResourceGroupwise::shouldFetchSystemAddressBook()
{
- QStringList ids = mPrefs->readAddressBooks();
+ TQStringList ids = mPrefs->readAddressBooks();
return ( appIsWhiteListedForSAB() && ids.find( mPrefs->systemAddressBook() ) != ids.end() );
}
bool ResourceGroupwise::shouldFetchUserAddressBooks()
{
- QStringList ids = mPrefs->readAddressBooks();
+ TQStringList ids = mPrefs->readAddressBooks();
return ( ids.count() > 1 || ids.find( mPrefs->systemAddressBook() ) == ids.end() );
}
KURL ResourceGroupwise::createAccessUrl( BookType bookType, AccessMode mode, unsigned long lastSequenceNumber, unsigned long lastPORebuildTime )
{
// set up list of address book IDs to fetch
- QStringList ids;
+ TQStringList ids;
if ( bookType == System )
ids.append( mPrefs->systemAddressBook() );
else
@@ -699,8 +699,8 @@ KURL ResourceGroupwise::createAccessUrl( BookType bookType, AccessMode mode, uns
url.setUser( prefs()->user() );
url.setPass( prefs()->password() );
- QString query = "?";
- QStringList::ConstIterator it;
+ TQString query = "?";
+ TQStringList::ConstIterator it;
for( it = ids.begin(); it != ids.end(); ++it ) {
if ( it != ids.begin() ) query += "&";
query += "addressbookid=" + *it;
@@ -708,7 +708,7 @@ KURL ResourceGroupwise::createAccessUrl( BookType bookType, AccessMode mode, uns
if ( mode == Update && lastSequenceNumber > 0 && lastPORebuildTime > 0 )
{
- query += QString::fromLatin1( "&update=true&lastSeqNo=%1&PORebuildTime=%2" ).arg( lastSequenceNumber ).arg( lastPORebuildTime );;
+ query += TQString::fromLatin1( "&update=true&lastSeqNo=%1&PORebuildTime=%2" ).arg( lastSequenceNumber ).arg( lastPORebuildTime );;
}
url.setQuery( query );
return url;