summaryrefslogtreecommitdiffstats
path: root/libkpimexchange/core/exchangeupload.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 /libkpimexchange/core/exchangeupload.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 'libkpimexchange/core/exchangeupload.cpp')
-rw-r--r--libkpimexchange/core/exchangeupload.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/libkpimexchange/core/exchangeupload.cpp b/libkpimexchange/core/exchangeupload.cpp
index 8332979a0..bbc30906d 100644
--- a/libkpimexchange/core/exchangeupload.cpp
+++ b/libkpimexchange/core/exchangeupload.cpp
@@ -18,8 +18,8 @@
Boston, MA 02110-1301, USA.
*/
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqregexp.h>
#include <kurl.h>
#include <kdebug.h>
@@ -52,7 +52,7 @@ extern "C" {
using namespace KPIM;
ExchangeUpload::ExchangeUpload( KCal::Event *event, ExchangeAccount *account,
- const QString &timeZoneId, QWidget *window )
+ const TQString &timeZoneId, TQWidget *window )
: mTimeZoneId( timeZoneId ), mWindow( window )
{
kdDebug() << "Called ExchangeUpload" << endl;
@@ -75,9 +75,9 @@ ExchangeUpload::~ExchangeUpload()
kdDebug() << "Finished ExchangeUpload destructor" << endl;
}
-void ExchangeUpload::findUid( QString const &uid )
+void ExchangeUpload::findUid( TQString const &uid )
{
- QString query =
+ TQString query =
"SELECT \"DAV:href\", \"urn:schemas:calendar:uid\"\r\n"
"FROM Scope('shallow traversal of \"\"')\r\n"
"WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n";
@@ -88,8 +88,8 @@ void ExchangeUpload::findUid( QString const &uid )
KIO::DavJob* job = KIO::davSearch( mAccount->calendarURL(), "DAV:", "sql",
query, false );
job->setWindow( mWindow );
- connect( job, SIGNAL( result( KIO::Job * ) ),
- SLOT( slotFindUidResult( KIO::Job * ) ) );
+ connect( job, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( slotFindUidResult( KIO::Job * ) ) );
}
void ExchangeUpload::slotFindUidResult( KIO::Job * job )
@@ -100,16 +100,16 @@ void ExchangeUpload::slotFindUidResult( KIO::Job * job )
kdDebug() << "Error: " << job->error() << endl;
job->showErrorDialog( 0 );
emit finished( this, ExchangeClient::CommunicationError,
- "IO Error: " + QString::number(job->error()) + ":" +
+ "IO Error: " + TQString::number(job->error()) + ":" +
job->errorString() );
return;
}
- QDomDocument &response = static_cast<KIO::DavJob *>( job )->response();
+ TQDomDocument &response = static_cast<KIO::DavJob *>( job )->response();
kdDebug() << "Search uid result: " << endl << response.toString() << endl;
- QDomElement item = response.documentElement().firstChild().toElement();
- QDomElement hrefElement = item.namedItem( "href" ).toElement();
+ TQDomElement item = response.documentElement().firstChild().toElement();
+ TQDomElement hrefElement = item.namedItem( "href" ).toElement();
if ( item.isNull() || hrefElement.isNull() ) {
// No appointment with this UID in exchange database
// Create a new filename for this appointment and store it there
@@ -118,7 +118,7 @@ void ExchangeUpload::slotFindUidResult( KIO::Job * job )
}
// The appointment is already in the exchange database
// Overwrite it with the new data
- QString href = hrefElement.text();
+ TQString href = hrefElement.text();
KURL url( href );
kdDebug() << "Found URL with identical uid: " << url.prettyURL()
<< ", overwriting that one" << endl;
@@ -134,21 +134,21 @@ void ExchangeUpload::tryExist()
if ( m_currentUploadNumber == 0 )
url.addPath( m_currentUpload->summary() + ".EML" );
else
- url.addPath( m_currentUpload->summary() + "-" + QString::number( m_currentUploadNumber ) + ".EML" );
+ url.addPath( m_currentUpload->summary() + "-" + TQString::number( m_currentUploadNumber ) + ".EML" );
kdDebug() << "Trying to see whether " << url.prettyURL() << " exists" << endl;
- QDomDocument doc;
- QDomElement root = addElement( doc, doc, "DAV:", "propfind" );
- QDomElement prop = addElement( doc, root, "DAV:", "prop" );
+ TQDomDocument doc;
+ TQDomElement root = addElement( doc, doc, "DAV:", "propfind" );
+ TQDomElement prop = addElement( doc, root, "DAV:", "prop" );
addElement( doc, prop, "DAV:", "displayname" );
addElement( doc, prop, "urn:schemas:calendar", "uid" );
KIO::DavJob *job = KIO::davPropFind( url, doc, "0", false );
job->setWindow( mWindow );
job->addMetaData( "errorPage", "false" );
- connect( job, SIGNAL( result( KIO::Job * ) ),
- SLOT( slotPropFindResult( KIO::Job * ) ) );
+ connect( job, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( slotPropFindResult( KIO::Job * ) ) );
}
void ExchangeUpload::slotPropFindResult( KIO::Job *job )
@@ -159,7 +159,7 @@ void ExchangeUpload::slotPropFindResult( KIO::Job *job )
if ( error && error != KIO::ERR_DOES_NOT_EXIST ) {
job->showErrorDialog( 0 );
emit finished( this, ExchangeClient::CommunicationError,
- "IO Error: " + QString::number(error) + ":" +
+ "IO Error: " + TQString::number(error) + ":" +
job->errorString() );
return;
}
@@ -180,12 +180,12 @@ void ExchangeUpload::slotPropFindResult( KIO::Job *job )
url.addPath( m_currentUpload->summary() + ".EML" );
else
url.addPath( m_currentUpload->summary() + "-" +
- QString::number( m_currentUploadNumber ) + ".EML" );
+ TQString::number( m_currentUploadNumber ) + ".EML" );
startUpload( url );
}
-QString timezoneid( int offset )
+TQString timezoneid( int offset )
{
switch ( offset ) {
case 0: return "0";
@@ -232,10 +232,10 @@ void ExchangeUpload::startUpload( const KURL &url )
return;
}
- QDomDocument doc;
- QDomElement root = addElement( doc, doc, "DAV:", "propertyupdate" );
- QDomElement set = addElement( doc, root, "DAV:", "set" );
- QDomElement prop = addElement( doc, set, "DAV:", "prop" );
+ TQDomDocument doc;
+ TQDomElement root = addElement( doc, doc, "DAV:", "propertyupdate" );
+ TQDomElement set = addElement( doc, root, "DAV:", "set" );
+ TQDomElement prop = addElement( doc, set, "DAV:", "prop" );
addElement( doc, prop, "DAV:", "contentclass", "urn:content-classes:appointment" );
// addElement( doc, prop, "http://schemas.microsoft.com/exchange/", "outlookmessageclass", "IPM.appointment" );
addElement( doc, prop, "http://schemas.microsoft.com/exchange/",
@@ -249,14 +249,14 @@ void ExchangeUpload::startUpload( const KURL &url )
// value that localUTCOffset() supplies...
// FIXME: What do we need that offset for anyway???
int tzOffset = - KRFCDate::localUTCOffset();
- QString offsetString;
+ TQString offsetString;
if ( tzOffset == 0 )
offsetString = "Z";
else if ( tzOffset > 0 )
- offsetString = QString( "+%1:%2" ).arg(tzOffset/60, 2).arg( tzOffset%60, 2 );
+ offsetString = TQString( "+%1:%2" ).arg(tzOffset/60, 2).arg( tzOffset%60, 2 );
else
- offsetString = QString( "-%1:%2" ).arg((-tzOffset)/60, 2).arg( (-tzOffset)%60, 2 );
- offsetString = offsetString.replace( QRegExp(" "), "0" );
+ offsetString = TQString( "-%1:%2" ).arg((-tzOffset)/60, 2).arg( (-tzOffset)%60, 2 );
+ offsetString = offsetString.replace( TQRegExp(" "), "0" );
kdDebug() << "Timezone offset: " << tzOffset << " : " << offsetString << endl;
kdDebug() << "ExchangeUpload::mTimeZoneId=" << mTimeZoneId << endl;
@@ -290,12 +290,12 @@ void ExchangeUpload::startUpload( const KURL &url )
if ( recurrence->recurrenceType() != KCal::Recurrence::rNone ) {
addElement( doc, prop, "urn:schemas:calendar:", "instancetype", "1" );
KCal::ICalFormat *format = new KCal::ICalFormat();
- QString recurstr = format->toString( recurrence->defaultRRule() );
+ TQString recurstr = format->toString( recurrence->defaultRRule() );
// Strip leading "RRULE\n :" and whitespace
- recurstr = recurstr.replace( QRegExp("^[A-Z]*[\\s]*:"), "").stripWhiteSpace();
+ recurstr = recurstr.replace( TQRegExp("^[A-Z]*[\\s]*:"), "").stripWhiteSpace();
kdDebug() << "Recurrence rule after replace: \"" << recurstr << "\"" << endl;
delete format;
- QDomElement rrule = addElement( doc, prop, "urn:schemas:calendar:", "rrule" );
+ TQDomElement rrule = addElement( doc, prop, "urn:schemas:calendar:", "rrule" );
addElement( doc, rrule, "xml:", "v", recurstr );
addElement( doc, prop, "urn:schemas:calendar:", "timezoneid", timezoneid( tzOffset ) );
} else {
@@ -304,11 +304,11 @@ void ExchangeUpload::startUpload( const KURL &url )
KCal::DateList exdates = recurrence->exDates();
if ( !exdates.isEmpty() ) {
- QDomElement exdate = addElement( doc, prop, "urn:schemas:calendar:", "exdate" );
+ TQDomElement exdate = addElement( doc, prop, "urn:schemas:calendar:", "exdate" );
KCal::DateList::iterator it;
for ( it = exdates.begin(); it != exdates.end(); ++it ) {
- QString date = (*it).toString( "yyyy-MM-ddT00:00:00.000" )+ offsetString;
-// QString date = zoneAsUtc( (*it), mTimeZoneId ).toString( Qt::ISODate );
+ TQString date = (*it).toString( "yyyy-MM-ddT00:00:00.000" )+ offsetString;
+// TQString date = zoneAsUtc( (*it), mTimeZoneId ).toString( Qt::ISODate );
addElement( doc, exdate, "xml:", "v", date );
}
}
@@ -321,7 +321,7 @@ void ExchangeUpload::startUpload( const KURL &url )
// TODO: handle alarm types
if ( alarm->hasStartOffset() ) {
int offset = - alarm->startOffset().asSeconds();
- addElement( doc, prop, "urn:schemas:calendar:", "reminderoffset", QString::number( offset ) );
+ addElement( doc, prop, "urn:schemas:calendar:", "reminderoffset", TQString::number( offset ) );
}
}
@@ -332,8 +332,8 @@ void ExchangeUpload::startUpload( const KURL &url )
KIO::DavJob *job = KIO::davPropPatch( url, doc, false );
job->setWindow( mWindow );
- connect( job, SIGNAL( result( KIO::Job * ) ),
- SLOT( slotPatchResult( KIO::Job * ) ) );
+ connect( job, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( slotPatchResult( KIO::Job * ) ) );
}
void ExchangeUpload::slotPatchResult( KIO::Job *job )
@@ -343,19 +343,19 @@ void ExchangeUpload::slotPatchResult( KIO::Job *job )
job->showErrorDialog( 0 );
kdDebug() << "Error: " << job->error() << endl;
emit finished( this, ExchangeClient::CommunicationError,
- "IO Error: " + QString::number(job->error()) + ":" +
+ "IO Error: " + TQString::number(job->error()) + ":" +
job->errorString() );
return;
}
- QDomDocument response = static_cast<KIO::DavJob *>( job )->response();
+ TQDomDocument response = static_cast<KIO::DavJob *>( job )->response();
kdDebug() << "Patch result: " << response.toString() << endl;
// Either we have a "201 Created" (if a new event has been created) or
// we have a "200 OK" (if an existing event has been altered),
// or else an error has occurred ;)
- QDomElement status = response.documentElement().namedItem( "response" )
+ TQDomElement status = response.documentElement().namedItem( "response" )
.namedItem( "status" ).toElement();
- QDomElement propstat = response.documentElement().namedItem( "response" )
+ TQDomElement propstat = response.documentElement().namedItem( "response" )
.namedItem( "propstat" ).namedItem( "status" )
.toElement();
kdDebug() << "status: " << status.text() << endl;
@@ -365,7 +365,7 @@ void ExchangeUpload::slotPatchResult( KIO::Job *job )
emit finished( this, ExchangeClient::EventWriteError,
"Upload error response: \n" + response.toString() );
else
- emit finished( this, ExchangeClient::ResultOK, QString::null );
+ emit finished( this, ExchangeClient::ResultOK, TQString::null );
}
#include "exchangeupload.moc"