diff options
Diffstat (limited to 'kresources/caldav')
-rw-r--r-- | kresources/caldav/config.cpp | 30 | ||||
-rw-r--r-- | kresources/caldav/config.h | 10 | ||||
-rw-r--r-- | kresources/caldav/configwidgets.cpp | 106 | ||||
-rw-r--r-- | kresources/caldav/configwidgets.h | 6 | ||||
-rw-r--r-- | kresources/caldav/job.cpp | 12 | ||||
-rw-r--r-- | kresources/caldav/job.h | 30 | ||||
-rw-r--r-- | kresources/caldav/preferences.cpp | 32 | ||||
-rw-r--r-- | kresources/caldav/preferences.h | 28 | ||||
-rw-r--r-- | kresources/caldav/reader.h | 16 | ||||
-rw-r--r-- | kresources/caldav/resource.cpp | 92 | ||||
-rw-r--r-- | kresources/caldav/resource.h | 32 | ||||
-rw-r--r-- | kresources/caldav/writer.h | 20 |
12 files changed, 207 insertions, 207 deletions
diff --git a/kresources/caldav/config.cpp b/kresources/caldav/config.cpp index 681faa1c7..da9bd8473 100644 --- a/kresources/caldav/config.cpp +++ b/kresources/caldav/config.cpp @@ -26,9 +26,9 @@ #include <klistview.h> #include <kurlrequester.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> /*========================================================================= | NAMESPACE @@ -70,7 +70,7 @@ CalDavPrefs* ResourceCalDavConfig::getPrefs(ResourceCalDav* res) { | CONSTRUCTOR / DESTRUCTOR ========================================================================*/ -ResourceCalDavConfig::ResourceCalDavConfig( QWidget *parent ) +ResourceCalDavConfig::ResourceCalDavConfig( TQWidget *parent ) : KRES::ConfigWidget( parent ) { setupUI(); @@ -111,35 +111,35 @@ void ResourceCalDavConfig::saveSettings( KRES::Resource *resource ) { } void ResourceCalDavConfig::setupUI() { - QVBoxLayout *vertical = new QVBoxLayout(this); + TQVBoxLayout *vertical = new TQVBoxLayout(this); - QGridLayout *mainLayout = new QGridLayout( this ); + TQGridLayout *mainLayout = new TQGridLayout( this ); // URL - QLabel *label = new QLabel( i18n( "URL:" ), this ); - mUrl = new QLineEdit( this ); + TQLabel *label = new TQLabel( i18n( "URL:" ), this ); + mUrl = new TQLineEdit( this ); mainLayout->addWidget( label, 1, 0 ); mainLayout->addWidget( mUrl, 1, 1 ); // Username - label = new QLabel( i18n( "Username:" ), this ); - mUsername = new QLineEdit( this ); + label = new TQLabel( i18n( "Username:" ), this ); + mUsername = new TQLineEdit( this ); mainLayout->addWidget( label, 2, 0 ); mainLayout->addWidget( mUsername, 2, 1 ); // Password - label = new QLabel( i18n( "Password:" ), this ); - mPassword = new QLineEdit( this ); - mPassword->setEchoMode( QLineEdit::Password ); + label = new TQLabel( i18n( "Password:" ), this ); + mPassword = new TQLineEdit( this ); + mPassword->setEchoMode( TQLineEdit::Password ); mainLayout->addWidget( label, 3, 0 ); mainLayout->addWidget( mPassword, 3, 1 ); // Remember password checkbox - mRememberPassword = new QCheckBox( i18n("Remember password"), this ); + mRememberPassword = new TQCheckBox( i18n("Remember password"), this ); mainLayout->addWidget(mRememberPassword, 4, 1); // configs - QHBoxLayout* horizontal = new QHBoxLayout(this); + TQHBoxLayout* horizontal = new TQHBoxLayout(this); // Reload config mReloadConfig = new CalDavReloadConfig(this); diff --git a/kresources/caldav/config.h b/kresources/caldav/config.h index 5b0325994..bd748db91 100644 --- a/kresources/caldav/config.h +++ b/kresources/caldav/config.h @@ -43,7 +43,7 @@ class KDE_EXPORT ResourceCalDavConfig : public KRES::ConfigWidget public: - ResourceCalDavConfig(QWidget *parent = 0); + ResourceCalDavConfig(TQWidget *parent = 0); public slots: @@ -56,10 +56,10 @@ protected: private: - QLineEdit *mUrl; - QLineEdit *mUsername; - QLineEdit *mPassword; - QCheckBox *mRememberPassword; + TQLineEdit *mUrl; + TQLineEdit *mUsername; + TQLineEdit *mPassword; + TQCheckBox *mRememberPassword; CalDavReloadConfig* mReloadConfig; CalDavSaveConfig* mSaveConfig; diff --git a/kresources/caldav/configwidgets.cpp b/kresources/caldav/configwidgets.cpp index 64eb1a279..b5ef0f496 100644 --- a/kresources/caldav/configwidgets.cpp +++ b/kresources/caldav/configwidgets.cpp @@ -40,14 +40,14 @@ #include <klocale.h> #include <kdebug.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qbuttongroup.h> -#include <qgroupbox.h> -#include <qhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqbuttongroup.h> +#include <tqgroupbox.h> +#include <tqhbox.h> using namespace KCal; @@ -59,8 +59,8 @@ class CalDavConfigPrivate : mGroup( 0 ), mIntervalSpin( 0 ) {} - QButtonGroup *mGroup; - QSpinBox *mIntervalSpin; + TQButtonGroup *mGroup; + TQSpinBox *mIntervalSpin; }; class CalDavReloadConfig::Private @@ -74,47 +74,47 @@ class CalDavSaveConfig::Private }; //@endcond -CalDavReloadConfig::CalDavReloadConfig( QWidget *parent ) - : QWidget( parent ), d( new KCal::CalDavReloadConfig::Private() ) +CalDavReloadConfig::CalDavReloadConfig( TQWidget *parent ) + : TQWidget( parent ), d( new KCal::CalDavReloadConfig::Private() ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + TQBoxLayout *topLayout = new TQVBoxLayout( this ); - //QGroupBox *groupBox = new QGroupBox( i18nc( "@title:group", "Automatic Reload" ), this ); - QGroupBox *groupBox = new QGroupBox( i18n( "Automatic Reload" ), this ); + //TQGroupBox *groupBox = new TQGroupBox( i18nc( "@title:group", "Automatic Reload" ), this ); + TQGroupBox *groupBox = new TQGroupBox( i18n( "Automatic Reload" ), this ); topLayout->addWidget( groupBox ); - QRadioButton *noAutomaticReload = - new QRadioButton( + TQRadioButton *noAutomaticReload = + new TQRadioButton( //i18nc( "@option:radio never reload the cache", "Never" ), groupBox ); i18n( "Never" ), groupBox ); - QRadioButton *automaticReloadOnStartup = - new QRadioButton( + TQRadioButton *automaticReloadOnStartup = + new TQRadioButton( //i18nc( "@option:radio reload the cache on startup", "Only on startup" ), groupBox ); i18n( "Only on startup" ), groupBox ); - QRadioButton *intervalRadio = - new QRadioButton( + TQRadioButton *intervalRadio = + new TQRadioButton( // i18nc( "@option:radio reload the cache at regular intervals", // "Regular interval" ), groupBox ); i18n( "Regular interval" ), groupBox ); - d->mGroup = new QButtonGroup( this ); + d->mGroup = new TQButtonGroup( this ); d->mGroup->hide(); d->mGroup->insert( intervalRadio, 2 ); d->mGroup->insert( automaticReloadOnStartup, 1 ); d->mGroup->insert( noAutomaticReload, 0 ); - connect( intervalRadio, SIGNAL( toggled( bool ) ), - SLOT( slotIntervalToggled( bool ) ) ); + connect( intervalRadio, TQT_SIGNAL( toggled( bool ) ), + TQT_SLOT( slotIntervalToggled( bool ) ) ); - QHBox *intervalBox = new QHBox( groupBox ); - //new QLabel( i18nc( "@label:spinbox", "Interval in minutes:" ), intervalBox ); - new QLabel( i18n( "Interval in minutes:" ), intervalBox ); - d->mIntervalSpin = new QSpinBox( intervalBox ); + TQHBox *intervalBox = new TQHBox( groupBox ); + //new TQLabel( i18nc( "@label:spinbox", "Interval in minutes:" ), intervalBox ); + new TQLabel( i18n( "Interval in minutes:" ), intervalBox ); + d->mIntervalSpin = new TQSpinBox( intervalBox ); d->mIntervalSpin->setRange( 1, 900 ); d->mIntervalSpin->setEnabled( false ); groupBox->setColumnLayout(1, Qt::Vertical); - QVBoxLayout *vbox = new QVBoxLayout(groupBox->layout()); + TQVBoxLayout *vbox = new TQVBoxLayout(groupBox->layout()); vbox->addWidget(intervalRadio); vbox->addWidget(intervalBox); vbox->addWidget(automaticReloadOnStartup); @@ -148,54 +148,54 @@ void CalDavReloadConfig::slotIntervalToggled( bool checked ) } } -CalDavSaveConfig::CalDavSaveConfig( QWidget *parent ) - : QWidget( parent ), d( new KCal::CalDavSaveConfig::Private() ) +CalDavSaveConfig::CalDavSaveConfig( TQWidget *parent ) + : TQWidget( parent ), d( new KCal::CalDavSaveConfig::Private() ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + TQBoxLayout *topLayout = new TQVBoxLayout( this ); - //QGroupBox *groupBox = new QGroupBox( i18nc( "@title:group", "Automatic Save" ), this ); - QGroupBox *groupBox = new QGroupBox( i18n( "Automatic Save" ), this ); - d->mGroup = new QButtonGroup( this ); + //TQGroupBox *groupBox = new TQGroupBox( i18nc( "@title:group", "Automatic Save" ), this ); + TQGroupBox *groupBox = new TQGroupBox( i18n( "Automatic Save" ), this ); + d->mGroup = new TQButtonGroup( this ); d->mGroup->hide(); topLayout->addWidget( groupBox ); - QRadioButton *never = - new QRadioButton( + TQRadioButton *never = + new TQRadioButton( //i18nc( "@option:radio never save the cache automatically", "Never" ), groupBox ); i18n( "Never" ), groupBox ); - QRadioButton *onExit = - new QRadioButton( + TQRadioButton *onExit = + new TQRadioButton( //i18nc( "@option:radio save the cache on exit", "Only on exit" ), groupBox ); i18n( "Only on exit" ), groupBox ); - QRadioButton *intervalRadio = - new QRadioButton( + TQRadioButton *intervalRadio = + new TQRadioButton( //i18nc( "@option:radio save the cache at regular intervals", "Regular interval" ), groupBox ); i18n( "Regular interval" ), groupBox ); - d->mGroup = new QButtonGroup( this ); + d->mGroup = new TQButtonGroup( this ); d->mGroup->hide(); d->mGroup->insert( never, 0 ); d->mGroup->insert( onExit, 1 ); d->mGroup->insert( intervalRadio, 2 ); - connect( intervalRadio, SIGNAL( toggled( bool ) ), - SLOT( slotIntervalToggled( bool ) ) ); + connect( intervalRadio, TQT_SIGNAL( toggled( bool ) ), + TQT_SLOT( slotIntervalToggled( bool ) ) ); - QHBox *intervalBox = new QHBox( groupBox ); - //new QLabel( i18nc( "@label:spinbox", "Interval in minutes:" ), intervalBox ); - new QLabel( i18n( "Interval in minutes:" ), intervalBox ); - d->mIntervalSpin = new QSpinBox( intervalBox ); + TQHBox *intervalBox = new TQHBox( groupBox ); + //new TQLabel( i18nc( "@label:spinbox", "Interval in minutes:" ), intervalBox ); + new TQLabel( i18n( "Interval in minutes:" ), intervalBox ); + d->mIntervalSpin = new TQSpinBox( intervalBox ); d->mIntervalSpin->setRange( 1, 900 ); d->mIntervalSpin->setEnabled( false ); - QRadioButton *delay = - new QRadioButton( + TQRadioButton *delay = + new TQRadioButton( // i18nc( "@option:radio save the cache after some delay", // "Delayed after changes" ), groupBox ); i18n( "Delayed after changes" ), groupBox ); - QRadioButton *every = - new QRadioButton( + TQRadioButton *every = + new TQRadioButton( // i18nc( "@option:radio save the cache after every modification", // "Immediately after changes" ), groupBox ); i18n( "Immediately after changes" ), groupBox ); @@ -207,7 +207,7 @@ CalDavSaveConfig::CalDavSaveConfig( QWidget *parent ) intervalBox->hide(); groupBox->setColumnLayout(1, Qt::Vertical); - QVBoxLayout *vbox = new QVBoxLayout(groupBox->layout()); + TQVBoxLayout *vbox = new TQVBoxLayout(groupBox->layout()); vbox->addWidget(delay); vbox->addWidget(every); vbox->addWidget(intervalRadio); diff --git a/kresources/caldav/configwidgets.h b/kresources/caldav/configwidgets.h index 6a44d482a..64ae78323 100644 --- a/kresources/caldav/configwidgets.h +++ b/kresources/caldav/configwidgets.h @@ -35,7 +35,7 @@ #ifndef KCALDAV_AUTOWIDGETS_H #define KCALDAV_AUTOWIDGETS_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdemacros.h> namespace KCal { @@ -51,7 +51,7 @@ class KDE_EXPORT CalDavReloadConfig : public QWidget { Q_OBJECT public: - explicit CalDavReloadConfig( QWidget *parent = 0 ); + explicit CalDavReloadConfig( TQWidget *parent = 0 ); ~CalDavReloadConfig(); public slots: void loadSettings( ResourceCached *resource ); @@ -77,7 +77,7 @@ class KDE_EXPORT CalDavSaveConfig : public QWidget { Q_OBJECT public: - explicit CalDavSaveConfig( QWidget *parent = 0 ); + explicit CalDavSaveConfig( TQWidget *parent = 0 ); ~CalDavSaveConfig(); public slots: diff --git a/kresources/caldav/job.cpp b/kresources/caldav/job.cpp index 9d317d131..1f6c38c49 100644 --- a/kresources/caldav/job.cpp +++ b/kresources/caldav/job.cpp @@ -18,7 +18,7 @@ #include <kdebug.h> #include <klocale.h> -#include <qmutex.h> +#include <tqmutex.h> #define log(s) kdDebug() << s; @@ -36,7 +36,7 @@ using namespace KCal; | CONSTRUCTOR AND DESTRUCTOR ========================================================================*/ -CalDavJob::CalDavJob(const QString& url) { +CalDavJob::CalDavJob(const TQString& url) { cleanJob(); setUrl(url); } @@ -56,14 +56,14 @@ void CalDavJob::enableCaldavDebug(runtime_info* rt) { } } -void CalDavJob::setErrorString(const QString& err, const long number) { +void CalDavJob::setErrorString(const TQString& err, const long number) { mError = true; mErrorString = err; mErrorNumber = number; } void CalDavJob::processError(const caldav_error* err) { - QString error_string; + TQString error_string; long code = err->code; @@ -104,8 +104,8 @@ void CalDavJob::run() { // Signal done // 1000 is read, 1001 is write - if (type() == 0) QApplication::postEvent ( parent(), new QEvent( static_cast<QEvent::Type>(1000) ) ); - if (type() == 1) QApplication::postEvent ( parent(), new QEvent( static_cast<QEvent::Type>(1001) ) ); + if (type() == 0) TQApplication::postEvent ( parent(), new TQEvent( static_cast<TQEvent::Type>(1000) ) ); + if (type() == 1) TQApplication::postEvent ( parent(), new TQEvent( static_cast<TQEvent::Type>(1001) ) ); } // EOF ======================================================================== diff --git a/kresources/caldav/job.h b/kresources/caldav/job.h index 4f3430c90..254a0a104 100644 --- a/kresources/caldav/job.h +++ b/kresources/caldav/job.h @@ -17,10 +17,10 @@ #ifndef KCALDAV_JOB_H #define KCALDAV_JOB_H -#include <qthread.h> -#include <qstring.h> -#include <qdatetime.h> -#include <qapplication.h> +#include <tqthread.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqapplication.h> extern "C" { #include <libcaldav/caldav.h> @@ -35,28 +35,28 @@ namespace KCal { /** * Calendar job. */ -class CalDavJob : public QThread { +class CalDavJob : public TQThread { public: /** * @param url URL to load. */ - CalDavJob(const QString& url = QString()); + CalDavJob(const TQString& url = TQString()); virtual ~CalDavJob(); /** * Sets a new URL to load. */ - virtual void setUrl(const QString& s) { + virtual void setUrl(const TQString& s) { mUrl = s; } /** * Sets the parent qobject. */ - virtual void setParent(QObject *s) { + virtual void setParent(TQObject *s) { mParent = s; } @@ -70,14 +70,14 @@ public: /** * @return URL to load. */ - virtual QString url() const { + virtual TQString url() const { return mUrl; } /** * @return parent object */ - virtual QObject *parent() { + virtual TQObject *parent() { return mParent; } @@ -98,7 +98,7 @@ public: /** * @return an error string. */ - virtual QString errorString() const { + virtual TQString errorString() const { return mErrorString; } @@ -134,7 +134,7 @@ protected: /** * Sets an error string to @p err. Also sets an error flag. */ - void setErrorString(const QString& str, const long number); + void setErrorString(const TQString& str, const long number); /** * Process an error. @@ -146,11 +146,11 @@ protected: private: - QString mUrl; + TQString mUrl; bool mError; - QString mErrorString; + TQString mErrorString; long mErrorNumber; - QObject *mParent; + TQObject *mParent; int mType; void enableCaldavDebug(runtime_info*); diff --git a/kresources/caldav/preferences.cpp b/kresources/caldav/preferences.cpp index 4be55e509..8e27b9df0 100644 --- a/kresources/caldav/preferences.cpp +++ b/kresources/caldav/preferences.cpp @@ -17,8 +17,8 @@ #include "preferences.h" #include <kwallet.h> -#include <qstring.h> -#include <qurl.h> +#include <tqstring.h> +#include <tqurl.h> #include <kdebug.h> /*========================================================================= @@ -32,15 +32,15 @@ using namespace KWallet; | CONSTANTS ========================================================================*/ -const QString CalDavPrefs::NO_PASSWORD = ""; -const QString CalDavPrefs::WALLET_FOLDER = "CalDAV resource"; -const QString CalDavPrefs::WALLET_PWD_SUFFIX = ":caldav_password"; +const TQString CalDavPrefs::NO_PASSWORD = ""; +const TQString CalDavPrefs::WALLET_FOLDER = "CalDAV resource"; +const TQString CalDavPrefs::WALLET_PWD_SUFFIX = ":caldav_password"; /*========================================================================= | METHODS ========================================================================*/ -bool CalDavPrefs::setWalletFolder(const QString& folder) { +bool CalDavPrefs::setWalletFolder(const TQString& folder) { bool ret = true; if (!mNoWallet && NULL != mWallet) { @@ -98,7 +98,7 @@ void CalDavPrefs::removeWallet(bool noWallet) { mNoWallet = noWallet; } -void CalDavPrefs::addPrefix(const QString& prefix) { +void CalDavPrefs::addPrefix(const TQString& prefix) { KConfigSkeletonItem::List itemList = items(); KConfigSkeletonItem::List::Iterator it; @@ -107,7 +107,7 @@ void CalDavPrefs::addPrefix(const QString& prefix) { } } -bool CalDavPrefs::writePasswordToWallet(const QString& password) { +bool CalDavPrefs::writePasswordToWallet(const TQString& password) { Wallet* w = getWallet(); @@ -124,12 +124,12 @@ bool CalDavPrefs::writePasswordToWallet(const QString& password) { return ret; } -bool CalDavPrefs::readPasswordFromWallet(QString& password) { +bool CalDavPrefs::readPasswordFromWallet(TQString& password) { Wallet* w = getWallet(); bool ret = false; if (NULL != w) { - QString p; + TQString p; int rc = w->readPassword(mPrefix + WALLET_PWD_SUFFIX, p); if (0 == rc) { //CalDavPrefsSkel::setPassword(p); @@ -161,7 +161,7 @@ bool CalDavPrefs::removePasswordFromWallet() { return ret; } -void CalDavPrefs::setPassword(const QString& p) { +void CalDavPrefs::setPassword(const TQString& p) { mPassword = p; @@ -170,14 +170,14 @@ void CalDavPrefs::setPassword(const QString& p) { } } -QString CalDavPrefs::password() { +TQString CalDavPrefs::password() { if (NO_PASSWORD == mPassword) { readPasswordFromWallet(mPassword); } return mPassword; } -QString CalDavPrefs::getusername() { +TQString CalDavPrefs::getusername() { return username(); } @@ -207,10 +207,10 @@ void CalDavPrefs::readConfig() { }*/ } -QString CalDavPrefs::getFullUrl() { +TQString CalDavPrefs::getFullUrl() { - QUrl t(url()); - QString safeURL; + TQUrl t(url()); + TQString safeURL; int firstAt; t.setUser(username()); diff --git a/kresources/caldav/preferences.h b/kresources/caldav/preferences.h index b8c3bb191..3e1bc0f9c 100644 --- a/kresources/caldav/preferences.h +++ b/kresources/caldav/preferences.h @@ -44,7 +44,7 @@ public: /** * @param prefix Unique prefix of the resource instance (use identifier() method). */ - CalDavPrefs(const QString& prefix) + CalDavPrefs(const TQString& prefix) : mWallet(NULL) , mNoWallet(false) , mPrefix(prefix) @@ -67,25 +67,25 @@ public: * to be properly saved, call this method after ensuring the remember flag * is set. */ - void setPassword(const QString& p); + void setPassword(const TQString& p); /** * Returns password. The password is taken from the wallet. * May return an empty string, if there is no password available. */ - QString password(); + TQString password(); /** * Returns the username. */ - QString getusername(); + TQString getusername(); void setRememberPassword(bool v); /** * @return A full URL to connect to CalDAV server (including username and password). */ - QString getFullUrl(); + TQString getFullUrl(); protected: @@ -94,7 +94,7 @@ protected: * can use the same config file. * @param prefix Unique prefix of the resource instance. */ - void addPrefix(const QString& prefix); + void addPrefix(const TQString& prefix); /** * Returns the wallet or NULL, if the wallet can't be obtained. @@ -106,7 +106,7 @@ protected: * @param folder the wallet working folder * @return true, if the folder has been set, and false otherwise. */ - bool setWalletFolder(const QString& folder); + bool setWalletFolder(const TQString& folder); /** * Removes the wallet. If @p noWallet is set, the wallet has been marked inaccessible, so that subsequent @@ -119,14 +119,14 @@ protected: * @param password password to write * @return true on success, false on failure */ - bool writePasswordToWallet(const QString& password); + bool writePasswordToWallet(const TQString& password); /** * Extracts password from the wallet. * @param password a variable to save read password to. * @return true on success, false on failure */ - bool readPasswordFromWallet(QString& password); + bool readPasswordFromWallet(TQString& password); /** * Clears password in the wallet. @@ -136,15 +136,15 @@ protected: private: - static const QString NO_PASSWORD; - static const QString WALLET_FOLDER; - static const QString WALLET_PWD_SUFFIX; + static const TQString NO_PASSWORD; + static const TQString WALLET_FOLDER; + static const TQString WALLET_PWD_SUFFIX; KWallet::Wallet* mWallet; bool mNoWallet; - QString mPrefix; - QString mPassword; + TQString mPrefix; + TQString mPassword; }; } // namespace KCal diff --git a/kresources/caldav/reader.h b/kresources/caldav/reader.h index 070239fdd..191d28bad 100644 --- a/kresources/caldav/reader.h +++ b/kresources/caldav/reader.h @@ -19,8 +19,8 @@ #include "job.h" -#include <qstring.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdatetime.h> namespace KCal { @@ -38,7 +38,7 @@ public: /** * @param url URL to load. */ - CalDavReader(const QString& url = QString()) : + CalDavReader(const TQString& url = TQString()) : CalDavJob(url) , mGetAll(true) { @@ -49,7 +49,7 @@ public: * This method call disables the effect of setGetAll() call. * setGetAll() call disables the effect of this method. */ - void setRange(const QDateTime& start, const QDateTime& end) { + void setRange(const TQDateTime& start, const TQDateTime& end) { mGetAll = false; mTimeStart = start; mTimeEnd = end; @@ -67,7 +67,7 @@ public: /** * @return downloaded calendar data in iCal format. */ - QString data() const { + TQString data() const { return mData; } @@ -79,10 +79,10 @@ protected: private: - QString mData; + TQString mData; bool mGetAll; - QDateTime mTimeStart; - QDateTime mTimeEnd; + TQDateTime mTimeStart; + TQDateTime mTimeEnd; }; diff --git a/kresources/caldav/resource.cpp b/kresources/caldav/resource.cpp index e5571ab99..1e52b3ec5 100644 --- a/kresources/caldav/resource.cpp +++ b/kresources/caldav/resource.cpp @@ -16,10 +16,10 @@ #include <string.h> -#include <qurl.h> -#include <qmessagebox.h> -#include <qapplication.h> -#include <qeventloop.h> +#include <tqurl.h> +#include <tqmessagebox.h> +#include <tqapplication.h> +#include <tqeventloop.h> #include <libkcal/calendarlocal.h> #include <libkcal/icalformat.h> @@ -27,12 +27,12 @@ #include <klocale.h> #include <kpassdlg.h> -#include <qdatetime.h> -#include <qmutex.h> -#include <qthread.h> +#include <tqdatetime.h> +#include <tqmutex.h> +#include <tqthread.h> #ifdef KCALDAV_DEBUG - #include <qfile.h> + #include <tqfile.h> #endif #include "resource.h" @@ -105,7 +105,7 @@ ResourceCalDav::~ResourceCalDav() { while ((mWriter->running() == true) || (mWritingQueue.isEmpty() == false) || !mWritingQueueReady) { readLockout = true; sleep(1); - qApp->processEvents(QEventLoop::ExcludeUserInput); + qApp->processEvents(TQEventLoop::ExcludeUserInput); } if (mWriter) { @@ -147,7 +147,7 @@ bool ResourceCalDav::doLoad() { return true; // Silently fail; the user has obviously not responded to a dialog and we don't need to pop up more of them! } - log(QString("doLoad(%1)").arg(syncCache)); + log(TQString("doLoad(%1)").arg(syncCache)); clearCache(); @@ -168,7 +168,7 @@ bool ResourceCalDav::doLoad() { bool ResourceCalDav::doSave() { bool syncCache = true; - log(QString("doSave(%1)").arg(syncCache)); + log(TQString("doSave(%1)").arg(syncCache)); if (!hasChanges()) { log("no changes"); @@ -196,7 +196,7 @@ bool ResourceCalDav::doSave() { clearChanges(); if (mWriteRetryTimer != NULL) { if (mWriteRetryTimer->isActive() == false) { - disconnect( mWriteRetryTimer, SIGNAL(timeout()), this, SLOT(doSave()) ); + disconnect( mWriteRetryTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doSave()) ); delete mWriteRetryTimer; mWriteRetryTimer = NULL; } @@ -253,8 +253,8 @@ void ResourceCalDav::init() { // creating jobs // Qt4 handles this quite differently, as shown below, // whereas Qt3 needs events (see ::event()) -// connect(mLoader, SIGNAL(finished()), this, SLOT(loadFinished())); -// connect(mWriter, SIGNAL(finished()), this, SLOT(writingFinished())); +// connect(mLoader, TQT_SIGNAL(finished()), this, TQT_SLOT(loadFinished())); +// connect(mWriter, TQT_SIGNAL(finished()), this, TQT_SLOT(writingFinished())); setType("ResourceCalDav"); } @@ -341,14 +341,14 @@ void ResourceCalDav::loadingQueuePop() { mLoader->setParent(this); mLoader->setType(0); - QDateTime dt(QDate::currentDate()); + TQDateTime dt(TQDate::currentDate()); mLoader->setRange(dt.addDays(-CACHE_DAYS), dt.addDays(CACHE_DAYS)); //mLoader->setGetAll(); mLoadingQueueReady = false; log("starting actual download job"); - mLoader->start(QThread::LowestPriority); + mLoader->start(TQThread::LowestPriority); // if all ok, removing the task from the queue mLoadingQueue.dequeue(); @@ -357,7 +357,7 @@ void ResourceCalDav::loadingQueuePop() { delete t; } -void ResourceCalDav::startLoading(const QString& url) { +void ResourceCalDav::startLoading(const TQString& url) { LoadingTask *t = new LoadingTask; t->url = url; loadingQueuePush(t); @@ -376,29 +376,29 @@ void ResourceCalDav::loadFinished() { if (loader->error()) { if (loader->errorNumber() == -401) { if (NULL != mPrefs) { - QCString newpass; - if (KPasswordDialog::getPassword (newpass, QString("<b>") + i18n("Remote authorization required") + QString("</b><p>") + i18n("Please input the password for") + QString(" ") + mPrefs->getusername(), NULL) != 1) { + TQCString newpass; + if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { log("load error: " + loader->errorString() ); - loadError(QString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); + loadError(TQString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); } else { // Set new password and try again - mPrefs->setPassword(QString(newpass)); + mPrefs->setPassword(TQString(newpass)); startLoading(mPrefs->getFullUrl()); } } else { log("load error: " + loader->errorString() ); - loadError(QString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); + loadError(TQString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); } } else { log("load error: " + loader->errorString() ); - loadError(QString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); + loadError(TQString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); } } else { log("successful load"); - QString data = loader->data(); + TQString data = loader->data(); if (!data.isNull() && !data.isEmpty()) { // TODO: I don't know why, but some schedules on http://caldav-test.ioda.net/ (I used it for testing) @@ -430,7 +430,7 @@ void ResourceCalDav::loadFinished() { loadingQueuePop(); } -bool ResourceCalDav::checkData(const QString& data) { +bool ResourceCalDav::checkData(const TQString& data) { log("checking the data"); ICalFormat ical; @@ -443,7 +443,7 @@ bool ResourceCalDav::checkData(const QString& data) { return ret; } -bool ResourceCalDav::parseData(const QString& data) { +bool ResourceCalDav::parseData(const TQString& data) { log("parseData()"); bool ret = true; @@ -470,11 +470,11 @@ bool ResourceCalDav::parseData(const QString& data) { // debug code here ------------------------------------------------------- #ifdef KCALDAV_DEBUG - const QString fout_path = "/tmp/kcaldav_download_" + identifier() + ".tmp"; + const TQString fout_path = "/tmp/kcaldav_download_" + identifier() + ".tmp"; - QFile fout(fout_path); + TQFile fout(fout_path); if (fout.open(IO_WriteOnly | IO_Append)) { - QTextStream sout(&fout); + TQTextStream sout(&fout); sout << "---------- " << resourceName() << ": --------------------------------\n"; sout << data << "\n"; fout.close(); @@ -504,13 +504,13 @@ bool ResourceCalDav::parseData(const QString& data) { | WRITING METHODS ========================================================================*/ -QString ResourceCalDav::getICalString(const Incidence::List& inc) { +TQString ResourceCalDav::getICalString(const Incidence::List& inc) { if (inc.isEmpty()) { return ""; } CalendarLocal loc(timeZoneId()); - QString data = ""; + TQString data = ""; ICalFormat ical; // NOTE: This is very susceptible to invalid entries in added/changed/deletedIncidences @@ -555,11 +555,11 @@ void ResourceCalDav::writingQueuePop() { mWriter->setType(1); #ifdef KCALDAV_DEBUG - const QString fout_path = "/tmp/kcaldav_upload_" + identifier() + ".tmp"; + const TQString fout_path = "/tmp/kcaldav_upload_" + identifier() + ".tmp"; - QFile fout(fout_path); + TQFile fout(fout_path); if (fout.open(IO_WriteOnly | IO_Append)) { - QTextStream sout(&fout); + TQTextStream sout(&fout); sout << "---------- " << resourceName() << ": --------------------------------\n"; sout << "================== Added:\n" << t->added << "\n"; sout << "================== Changed:\n" << t->changed << "\n"; @@ -577,7 +577,7 @@ void ResourceCalDav::writingQueuePop() { mWritingQueueReady = false; log("starting actual write job"); - mWriter->start(QThread::LowestPriority); + mWriter->start(TQThread::LowestPriority); // if all ok, remove the task from the queue mWritingQueue.dequeue(); @@ -586,7 +586,7 @@ void ResourceCalDav::writingQueuePop() { delete t; } -bool ResourceCalDav::event ( QEvent * e ) { +bool ResourceCalDav::event ( TQEvent * e ) { if (e->type() == 1000) { // Read done loadFinished(); @@ -604,7 +604,7 @@ void ResourceCalDav::releaseReadLockout() { readLockout = false; } -bool ResourceCalDav::startWriting(const QString& url) { +bool ResourceCalDav::startWriting(const TQString& url) { log("startWriting: url = " + url); // WARNING: This will segfault if a separate read or write thread @@ -612,8 +612,8 @@ bool ResourceCalDav::startWriting(const QString& url) { // Before these calls are made any existing read (and maybe write) threads should be finished if ((mLoader->running() == true) || (mLoadingQueue.isEmpty() == false) || (mWriter->running() == true) || (mWritingQueue.isEmpty() == false)) { if (mWriteRetryTimer == NULL) { - mWriteRetryTimer = new QTimer(this); - connect( mWriteRetryTimer, SIGNAL(timeout()), SLOT(doSave()) ); + mWriteRetryTimer = new TQTimer(this); + connect( mWriteRetryTimer, TQT_SIGNAL(timeout()), TQT_SLOT(doSave()) ); } mWriteRetryTimer->start(1000, TRUE); return false; @@ -690,25 +690,25 @@ void ResourceCalDav::writingFinished() { if (mWriter->error() && (abs(mWriter->errorNumber()) != 207)) { if (mWriter->errorNumber() == -401) { if (NULL != mPrefs) { - QCString newpass; - if (KPasswordDialog::getPassword (newpass, QString("<b>") + i18n("Remote authorization required") + QString("</b><p>") + i18n("Please input the password for") + QString(" ") + mPrefs->getusername(), NULL) != 1) { + TQCString newpass; + if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { log("write error: " + mWriter->errorString()); - saveError(QString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); + saveError(TQString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); } else { // Set new password and try again - mPrefs->setPassword(QString(newpass)); + mPrefs->setPassword(TQString(newpass)); startWriting(mPrefs->getFullUrl()); } } else { log("write error: " + mWriter->errorString()); - saveError(QString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); + saveError(TQString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); } } else { log("write error: " + mWriter->errorString()); - saveError(QString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); + saveError(TQString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); } } else { log("success"); @@ -716,7 +716,7 @@ void ResourceCalDav::writingFinished() { } // Give the remote system a few seconds to process the data before we allow any read operations - QTimer::singleShot( 3000, this, SLOT(releaseReadLockout()) ); + TQTimer::singleShot( 3000, this, TQT_SLOT(releaseReadLockout()) ); // Writing queue and mWritingQueueReady flag are not shared resources, i.e. only one thread has an access to them. // That's why no mutexes are required. diff --git a/kresources/caldav/resource.h b/kresources/caldav/resource.h index b81e555c5..deba22b72 100644 --- a/kresources/caldav/resource.h +++ b/kresources/caldav/resource.h @@ -18,8 +18,8 @@ #define KCAL_RESOURCECALDAV_H #include "preferences.h" -#include <qthread.h> -#include <qptrqueue.h> +#include <tqthread.h> +#include <tqptrqueue.h> #include <libkcal/resourcecached.h> #include <libkdepim/progressmanager.h> @@ -84,14 +84,14 @@ protected slots: protected: struct LoadingTask { - QString url; + TQString url; }; struct WritingTask { - QString url; - QString added; - QString changed; - QString deleted; + TQString url; + TQString added; + TQString changed; + TQString deleted; }; @@ -127,35 +127,35 @@ protected: * Initiates calendar loading process. * @param url URL to load calendar data from. */ - void startLoading(const QString& url); + void startLoading(const TQString& url); /** * Checks if the data is correct and can be parsed. * @param data ical string to check. * @return true if the data is correct, false otherwise. */ - bool checkData(const QString& data); + bool checkData(const TQString& data); /** * Parses the data and adds events to the calendar. * @param data calendar data. * @return true on success, false on fail. */ - bool parseData(const QString& data); + bool parseData(const TQString& data); /** * Initiates calendar writing process. * @param url URL to save calendar data to. * @return true if write was queued successfully, false if not */ - bool startWriting(const QString& url); + bool startWriting(const TQString& url); /** * Returns a list of incidences as a valid iCalendar string. * @param inc list of incidences. * @return a string in iCalendar format which describes the given incidences. */ - QString getICalString(const Incidence::List& inc); + TQString getICalString(const Incidence::List& inc); /** * Changes read-only status of incidences from a given list. @@ -193,7 +193,7 @@ protected: */ void writingQueuePush(const WritingTask *task); - virtual bool event ( QEvent * e ); + virtual bool event ( TQEvent * e ); private: @@ -224,12 +224,12 @@ private: KPIM::ProgressItem *mProgress; bool mLoadingQueueReady; - QPtrQueue<LoadingTask> mLoadingQueue; + TQPtrQueue<LoadingTask> mLoadingQueue; bool mWritingQueueReady; - QPtrQueue<WritingTask> mWritingQueue; + TQPtrQueue<WritingTask> mWritingQueue; - QTimer *mWriteRetryTimer; + TQTimer *mWriteRetryTimer; }; diff --git a/kresources/caldav/writer.h b/kresources/caldav/writer.h index 841fc4477..2d1d2d7bb 100644 --- a/kresources/caldav/writer.h +++ b/kresources/caldav/writer.h @@ -20,8 +20,8 @@ #include "job.h" #include <string> -#include <qstring.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdatetime.h> namespace KCal { @@ -39,7 +39,7 @@ public: /** * @param url URL to load. */ - CalDavWriter(const QString& url = QString()) : + CalDavWriter(const TQString& url = TQString()) : CalDavJob(url) { clearObjects(); @@ -50,7 +50,7 @@ public: * @param s icalendar-formatted string consists of all added incidences plus necessary calendar info. * May be an empty string, which means there is no added incidences to send. */ - void setAddedObjects(const QString& s) { + void setAddedObjects(const TQString& s) { mAdded = s; } @@ -59,7 +59,7 @@ public: * @param s icalendar-formatted string consists of all changed incidences plus necessary calendar info. * May be an empty string, which means there is no changed incidences to send. */ - void setChangedObjects(const QString& s) { + void setChangedObjects(const TQString& s) { mChanged = s; } @@ -68,7 +68,7 @@ public: * @param s icalendar-formatted string consists of all deleted incidences plus necessary calendar info. * May be an empty string, which means there is no deleted incidences to send. */ - void setDeletedObjects(const QString& s) { + void setDeletedObjects(const TQString& s) { mDeleted = s; } @@ -89,7 +89,7 @@ protected: /// Just a wrapper above libcaldav functions. template<typename Operation> - int pushObjects(const QString& data, Operation op, int okCode, runtime_info* RT) { + int pushObjects(const TQString& data, Operation op, int okCode, runtime_info* RT) { int r = okCode; if (!data.isNull() && !data.isEmpty()) { r = op(std::string(data.ascii()).c_str(), std::string(url().ascii()).c_str(), RT); @@ -99,9 +99,9 @@ protected: private: - QString mAdded; - QString mChanged; - QString mDeleted; + TQString mAdded; + TQString mChanged; + TQString mDeleted; }; } // namespace KCal |