summaryrefslogtreecommitdiffstats
path: root/kresources/kolab/knotes
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/kolab/knotes
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/kolab/knotes')
-rw-r--r--kresources/kolab/knotes/note.cpp42
-rw-r--r--kresources/kolab/knotes/note.h34
-rw-r--r--kresources/kolab/knotes/resourcekolab.cpp88
-rw-r--r--kresources/kolab/knotes/resourcekolab.h42
-rw-r--r--kresources/kolab/knotes/resourcekolab_plugin.cpp2
5 files changed, 104 insertions, 104 deletions
diff --git a/kresources/kolab/knotes/note.cpp b/kresources/kolab/knotes/note.cpp
index 76ecdd9db..66556aaf8 100644
--- a/kresources/kolab/knotes/note.cpp
+++ b/kresources/kolab/knotes/note.cpp
@@ -40,7 +40,7 @@
using namespace Kolab;
-KCal::Journal* Note::xmlToJournal( const QString& xml )
+KCal::Journal* Note::xmlToJournal( const TQString& xml )
{
Note note;
note.load( xml );
@@ -49,7 +49,7 @@ KCal::Journal* Note::xmlToJournal( const QString& xml )
return journal;
}
-QString Note::journalToXML( KCal::Journal* journal )
+TQString Note::journalToXML( KCal::Journal* journal )
{
Note note( journal );
return note.saveXML();
@@ -65,32 +65,32 @@ Note::~Note()
{
}
-void Note::setSummary( const QString& summary )
+void Note::setSummary( const TQString& summary )
{
mSummary = summary;
}
-QString Note::summary() const
+TQString Note::summary() const
{
return mSummary;
}
-void Note::setBackgroundColor( const QColor& bgColor )
+void Note::setBackgroundColor( const TQColor& bgColor )
{
mBackgroundColor = bgColor;
}
-QColor Note::backgroundColor() const
+TQColor Note::backgroundColor() const
{
return mBackgroundColor;
}
-void Note::setForegroundColor( const QColor& fgColor )
+void Note::setForegroundColor( const TQColor& fgColor )
{
mForegroundColor = fgColor;
}
-QColor Note::foregroundColor() const
+TQColor Note::foregroundColor() const
{
return mForegroundColor;
}
@@ -105,9 +105,9 @@ bool Note::richText() const
return mRichText;
}
-bool Note::loadAttribute( QDomElement& element )
+bool Note::loadAttribute( TQDomElement& element )
{
- QString tagName = element.tagName();
+ TQString tagName = element.tagName();
if ( tagName == "summary" )
setSummary( element.text() );
@@ -124,14 +124,14 @@ bool Note::loadAttribute( QDomElement& element )
return true;
}
-bool Note::saveAttributes( QDomElement& element ) const
+bool Note::saveAttributes( TQDomElement& element ) const
{
// Save the base class elements
KolabBase::saveAttributes( element );
// Save the elements
#if 0
- QDomComment c = element.ownerDocument().createComment( "Note specific attributes" );
+ TQDomComment c = element.ownerDocument().createComment( "Note specific attributes" );
element.appendChild( c );
#endif
@@ -144,9 +144,9 @@ bool Note::saveAttributes( QDomElement& element ) const
}
-bool Note::loadXML( const QDomDocument& document )
+bool Note::loadXML( const TQDomDocument& document )
{
- QDomElement top = document.documentElement();
+ TQDomElement top = document.documentElement();
if ( top.tagName() != "note" ) {
qWarning( "XML error: Top tag was %s instead of the expected note",
@@ -154,11 +154,11 @@ bool Note::loadXML( const QDomDocument& document )
return false;
}
- for ( QDomNode n = top.firstChild(); !n.isNull(); n = n.nextSibling() ) {
+ for ( TQDomNode n = top.firstChild(); !n.isNull(); n = n.nextSibling() ) {
if ( n.isComment() )
continue;
if ( n.isElement() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( !loadAttribute( e ) )
// TODO: Unhandled tag - save for later storage
kdDebug() << "Warning: Unhandled tag " << e.tagName() << endl;
@@ -169,10 +169,10 @@ bool Note::loadXML( const QDomDocument& document )
return true;
}
-QString Note::saveXML() const
+TQString Note::saveXML() const
{
- QDomDocument document = domTree();
- QDomElement element = document.createElement( "note" );
+ TQDomDocument document = domTree();
+ TQDomElement element = document.createElement( "note" );
element.setAttribute( "version", "1.0" );
saveAttributes( element );
document.appendChild( element );
@@ -204,7 +204,7 @@ void Note::saveTo( KCal::Journal* journal )
richText() ? "true" : "false" );
}
-QString Note::productID() const
+TQString Note::productID() const
{
- return QString( "KNotes %1, Kolab resource" ).arg( KNOTES_VERSION );
+ return TQString( "KNotes %1, Kolab resource" ).arg( KNOTES_VERSION );
}
diff --git a/kresources/kolab/knotes/note.h b/kresources/kolab/knotes/note.h
index 45769f97b..7a1c42407 100644
--- a/kresources/kolab/knotes/note.h
+++ b/kresources/kolab/knotes/note.h
@@ -54,10 +54,10 @@ class Note : public KolabBase {
public:
/// Use this to parse an xml string to a journal entry
/// The caller is responsible for deleting the returned journal
- static KCal::Journal* xmlToJournal( const QString& xml );
+ static KCal::Journal* xmlToJournal( const TQString& xml );
/// Use this to get an xml string describing this journal entry
- static QString journalToXML( KCal::Journal* );
+ static TQString journalToXML( KCal::Journal* );
/// Create a note object and
explicit Note( KCal::Journal* journal = 0 );
@@ -65,31 +65,31 @@ public:
void saveTo( KCal::Journal* journal );
- virtual QString type() const { return "Note"; }
+ virtual TQString type() const { return "Note"; }
- virtual void setSummary( const QString& summary );
- virtual QString summary() const;
+ virtual void setSummary( const TQString& summary );
+ virtual TQString summary() const;
- virtual void setBackgroundColor( const QColor& bgColor );
- virtual QColor backgroundColor() const;
+ virtual void setBackgroundColor( const TQColor& bgColor );
+ virtual TQColor backgroundColor() const;
- virtual void setForegroundColor( const QColor& fgColor );
- virtual QColor foregroundColor() const;
+ virtual void setForegroundColor( const TQColor& fgColor );
+ virtual TQColor foregroundColor() const;
virtual void setRichText( bool richText );
virtual bool richText() const;
// Load the attributes of this class
- virtual bool loadAttribute( QDomElement& );
+ virtual bool loadAttribute( TQDomElement& );
// Save the attributes of this class
- virtual bool saveAttributes( QDomElement& ) const;
+ virtual bool saveAttributes( TQDomElement& ) const;
// Load this note by reading the XML file
- virtual bool loadXML( const QDomDocument& xml );
+ virtual bool loadXML( const TQDomDocument& xml );
// Serialize this note to an XML string
- virtual QString saveXML() const;
+ virtual TQString saveXML() const;
protected:
// Read all known fields from this ical incidence
@@ -98,11 +98,11 @@ protected:
// Save all known fields into this ical incidence
void saveTo( KCal::Incidence* ) const;
- QString productID() const;
+ TQString productID() const;
- QString mSummary;
- QColor mBackgroundColor;
- QColor mForegroundColor;
+ TQString mSummary;
+ TQColor mBackgroundColor;
+ TQColor mForegroundColor;
bool mRichText;
};
diff --git a/kresources/kolab/knotes/resourcekolab.cpp b/kresources/kolab/knotes/resourcekolab.cpp
index b5cad153a..1d633b62a 100644
--- a/kresources/kolab/knotes/resourcekolab.cpp
+++ b/kresources/kolab/knotes/resourcekolab.cpp
@@ -51,7 +51,7 @@ static const char* inlineMimeType = "text/calendar";
ResourceKolab::ResourceKolab( const KConfig *config )
: ResourceNotes( config ), ResourceKolabBase( "ResourceKolab-KNotes" ),
- mCalendar( QString::fromLatin1("UTC") )
+ mCalendar( TQString::fromLatin1("UTC") )
{
setType( "imap" );
}
@@ -66,15 +66,15 @@ bool ResourceKolab::doOpen()
config.setGroup( configGroupName );
// Get the list of Notes folders from KMail
- QValueList<KMailICalIface::SubResource> subResources;
+ TQValueList<KMailICalIface::SubResource> subResources;
if ( !kmailSubresources( subResources, kmailContentsType ) )
return false;
// Make the resource map from the folder list
- QValueList<KMailICalIface::SubResource>::ConstIterator it;
+ TQValueList<KMailICalIface::SubResource>::ConstIterator it;
mSubResources.clear();
for ( it = subResources.begin(); it != subResources.end(); ++it ) {
- const QString subResource = (*it).location;
+ const TQString subResource = (*it).location;
const bool active = config.readBoolEntry( subResource, true );
mSubResources[ subResource ] = Kolab::SubResource( active, (*it).writable, (*it).label );
}
@@ -91,8 +91,8 @@ void ResourceKolab::doClose()
config.writeEntry( it.key(), it.data().active() );
}
-bool ResourceKolab::loadSubResource( const QString& subResource,
- const QString &mimetype )
+bool ResourceKolab::loadSubResource( const TQString& subResource,
+ const TQString &mimetype )
{
// Get the list of journals
int count = 0;
@@ -101,7 +101,7 @@ bool ResourceKolab::loadSubResource( const QString& subResource,
return false;
}
- QMap<Q_UINT32, QString> lst;
+ TQMap<Q_UINT32, TQString> lst;
if( !kmailIncidences( lst, mimetype, subResource, 0, count ) ) {
kdError(5500) << "Communication problem in "
<< "ResourceKolab::getIncidenceList()\n";
@@ -113,7 +113,7 @@ bool ResourceKolab::loadSubResource( const QString& subResource,
// Populate with the new entries
const bool silent = mSilent;
mSilent = true;
- QMap<Q_UINT32, QString>::Iterator it;
+ TQMap<Q_UINT32, TQString>::Iterator it;
for ( it = lst.begin(); it != lst.end(); ++it ) {
KCal::Journal* journal = addNote( it.data(), subResource, it.key(), mimetype );
if ( !journal )
@@ -139,7 +139,7 @@ bool ResourceKolab::load()
// This subResource is disabled
continue;
- QString mimetype = inlineMimeType;
+ TQString mimetype = inlineMimeType;
rc &= loadSubResource( itR.key(), mimetype );
mimetype = attachmentMimeType;
rc &= loadSubResource( itR.key(), mimetype );
@@ -156,11 +156,11 @@ bool ResourceKolab::save()
bool ResourceKolab::addNote( KCal::Journal* journal )
{
- return addNote( journal, QString::null, 0 );
+ return addNote( journal, TQString::null, 0 );
}
-KCal::Journal* ResourceKolab::addNote( const QString& data, const QString& subresource,
- Q_UINT32 sernum, const QString &mimetype )
+KCal::Journal* ResourceKolab::addNote( const TQString& data, const TQString& subresource,
+ Q_UINT32 sernum, const TQString &mimetype )
{
KCal::Journal* journal = 0;
// FIXME: This does not take into account the time zone!
@@ -180,7 +180,7 @@ KCal::Journal* ResourceKolab::addNote( const QString& data, const QString& subre
}
bool ResourceKolab::addNote( KCal::Journal* journal,
- const QString& subresource, Q_UINT32 sernum )
+ const TQString& subresource, Q_UINT32 sernum )
{
kdDebug(5500) << "ResourceKolab::addNote( KCal::Journal*, '" << subresource << "', " << sernum << " )\n";
@@ -190,13 +190,13 @@ bool ResourceKolab::addNote( KCal::Journal* journal,
bool newNote = subresource.isEmpty();
mCalendar.addJournal( journal );
- QString resource =
+ TQString resource =
newNote ? findWritableResource( mSubResources ) : subresource;
if ( resource.isEmpty() ) // canceled
return false;
if ( !mSilent ) {
- QString xml = Note::journalToXML( journal );
+ TQString xml = Note::journalToXML( journal );
kdDebug(5500) << k_funcinfo << "XML string:\n" << xml << endl;
if( !kmailUpdate( resource, sernum, xml, attachmentMimeType, journal->uid() ) ) {
@@ -215,7 +215,7 @@ bool ResourceKolab::addNote( KCal::Journal* journal,
bool ResourceKolab::deleteNote( KCal::Journal* journal )
{
- const QString uid = journal->uid();
+ const TQString uid = journal->uid();
if ( !mUidMap.contains( uid ) )
// Odd
return false;
@@ -230,20 +230,20 @@ bool ResourceKolab::deleteNote( KCal::Journal* journal )
return true;
}
-KCal::Alarm::List ResourceKolab::alarms( const QDateTime& from, const QDateTime& to )
+KCal::Alarm::List ResourceKolab::alarms( const TQDateTime& from, const TQDateTime& to )
{
KCal::Alarm::List alarms;
KCal::Journal::List notes = mCalendar.journals();
KCal::Journal::List::ConstIterator note;
for ( note = notes.begin(); note != notes.end(); ++note )
{
- QDateTime preTime = from.addSecs( -1 );
+ TQDateTime preTime = from.addSecs( -1 );
KCal::Alarm::List::ConstIterator it;
for( it = (*note)->alarms().begin(); it != (*note)->alarms().end(); ++it )
{
if ( (*it)->enabled() )
{
- QDateTime dt = (*it)->nextRepetition( preTime );
+ TQDateTime dt = (*it)->nextRepetition( preTime );
if ( dt.isValid() && dt <= to )
alarms.append( *it );
}
@@ -255,7 +255,7 @@ KCal::Alarm::List ResourceKolab::alarms( const QDateTime& from, const QDateTime&
void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* i )
{
- QString subResource;
+ TQString subResource;
Q_UINT32 sernum;
if ( mUidMap.contains( i->uid() ) ) {
subResource = mUidMap[ i->uid() ].resource();
@@ -268,7 +268,7 @@ void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* i )
}
KCal::Journal* journal = dynamic_cast<KCal::Journal*>( i );
- QString xml = Note::journalToXML( journal );
+ TQString xml = Note::journalToXML( journal );
if( !xml.isEmpty() && kmailUpdate( subResource, sernum, xml, attachmentMimeType, journal->uid() ) )
mUidMap[ i->uid() ] = StorageReference( subResource, sernum );
}
@@ -277,18 +277,18 @@ void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* i )
* These are the DCOP slots that KMail call to notify when something
* changed.
*/
-bool ResourceKolab::fromKMailAddIncidence( const QString& type,
- const QString& subResource,
+bool ResourceKolab::fromKMailAddIncidence( const TQString& type,
+ const TQString& subResource,
Q_UINT32 sernum,
int format,
- const QString& note )
+ const TQString& note )
{
// Check if this is a note
if( type != kmailContentsType ) return false;
const bool silent = mSilent;
mSilent = true;
- QString mimetype;
+ TQString mimetype;
if ( format == KMailICalIface::StorageXML )
mimetype = attachmentMimeType;
else
@@ -300,9 +300,9 @@ bool ResourceKolab::fromKMailAddIncidence( const QString& type,
return true;
}
-void ResourceKolab::fromKMailDelIncidence( const QString& type,
- const QString& /*subResource*/,
- const QString& uid )
+void ResourceKolab::fromKMailDelIncidence( const TQString& type,
+ const TQString& /*subResource*/,
+ const TQString& uid )
{
// Check if this is a note
if( type != kmailContentsType ) return;
@@ -318,16 +318,16 @@ void ResourceKolab::fromKMailDelIncidence( const QString& type,
mSilent = silent;
}
-void ResourceKolab::fromKMailRefresh( const QString& type,
- const QString& /*subResource*/ )
+void ResourceKolab::fromKMailRefresh( const TQString& type,
+ const TQString& /*subResource*/ )
{
if ( type == kmailContentsType )
load(); // ### should call loadSubResource(subResource) probably
}
-void ResourceKolab::fromKMailAddSubresource( const QString& type,
- const QString& subResource,
- const QString& /*label*/,
+void ResourceKolab::fromKMailAddSubresource( const TQString& type,
+ const TQString& subResource,
+ const TQString& /*label*/,
bool writable,
bool /*alarmRelevant*/ )
{
@@ -348,8 +348,8 @@ void ResourceKolab::fromKMailAddSubresource( const QString& type,
emit signalSubresourceAdded( this, type, subResource );
}
-void ResourceKolab::fromKMailDelSubresource( const QString& type,
- const QString& subResource )
+void ResourceKolab::fromKMailDelSubresource( const TQString& type,
+ const TQString& subResource )
{
if ( type != configGroupName )
// Not ours
@@ -369,7 +369,7 @@ void ResourceKolab::fromKMailDelSubresource( const QString& type,
// Make a list of all uids to remove
Kolab::UidMap::ConstIterator mapIt;
- QStringList uids;
+ TQStringList uids;
for ( mapIt = mUidMap.begin(); mapIt != mUidMap.end(); ++mapIt )
if ( mapIt.data().resource() == subResource )
// We have a match
@@ -379,7 +379,7 @@ void ResourceKolab::fromKMailDelSubresource( const QString& type,
if ( !uids.isEmpty() ) {
const bool silent = mSilent;
mSilent = true;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = uids.begin(); it != uids.end(); ++it ) {
KCal::Journal* j = mCalendar.journal( *it );
if( j )
@@ -391,21 +391,21 @@ void ResourceKolab::fromKMailDelSubresource( const QString& type,
emit signalSubresourceRemoved( this, type, subResource );
}
-void ResourceKolab::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map,
- const QString& type,
- const QString& folder )
+void ResourceKolab::fromKMailAsyncLoadResult( const TQMap<Q_UINT32, TQString>& map,
+ const TQString& type,
+ const TQString& folder )
{
// We are only interested in notes
if ( ( type != attachmentMimeType ) && ( type != inlineMimeType ) ) return;
// Populate with the new entries
const bool silent = mSilent;
mSilent = true;
- QString mimetype;
+ TQString mimetype;
if ( kmailStorageFormat( folder ) == KMailICalIface::StorageXML )
mimetype = attachmentMimeType;
else
mimetype = inlineMimeType;
- for( QMap<Q_UINT32, QString>::ConstIterator it = map.begin(); it != map.end(); ++it ) {
+ for( TQMap<Q_UINT32, TQString>::ConstIterator it = map.begin(); it != map.end(); ++it ) {
KCal::Journal* journal = addNote( it.data(), folder, it.key(), mimetype );
if ( !journal )
kdDebug(5500) << "loading note " << it.key() << " failed" << endl;
@@ -416,12 +416,12 @@ void ResourceKolab::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map
}
-QStringList ResourceKolab::subresources() const
+TQStringList ResourceKolab::subresources() const
{
return mSubResources.keys();
}
-bool ResourceKolab::subresourceActive( const QString& res ) const
+bool ResourceKolab::subresourceActive( const TQString& res ) const
{
if ( mSubResources.contains( res ) ) {
return mSubResources[ res ].active();
diff --git a/kresources/kolab/knotes/resourcekolab.h b/kresources/kolab/knotes/resourcekolab.h
index 44ce480b7..a738a30a5 100644
--- a/kresources/kolab/knotes/resourcekolab.h
+++ b/kresources/kolab/knotes/resourcekolab.h
@@ -74,47 +74,47 @@ public:
bool deleteNote( KCal::Journal* );
- KCal::Alarm::List alarms( const QDateTime& from, const QDateTime& to );
+ KCal::Alarm::List alarms( const TQDateTime& from, const TQDateTime& to );
/// Reimplemented from IncidenceBase::Observer to know when a note was changed
void incidenceUpdated( KCal::IncidenceBase* );
/// The ResourceKolabBase methods called by KMail
- bool fromKMailAddIncidence( const QString& type, const QString& resource,
- Q_UINT32 sernum, int format, const QString& note );
- void fromKMailDelIncidence( const QString& type, const QString& resource,
- const QString& uid );
- void fromKMailRefresh( const QString& type, const QString& resource );
+ bool fromKMailAddIncidence( const TQString& type, const TQString& resource,
+ Q_UINT32 sernum, int format, const TQString& note );
+ void fromKMailDelIncidence( const TQString& type, const TQString& resource,
+ const TQString& uid );
+ void fromKMailRefresh( const TQString& type, const TQString& resource );
/// Listen to KMail changes in the amount of sub resources
- void fromKMailAddSubresource( const QString& type, const QString& resource,
- const QString& label, bool writable,
+ void fromKMailAddSubresource( const TQString& type, const TQString& resource,
+ const TQString& label, bool writable,
bool alarmRelevant );
- void fromKMailDelSubresource( const QString& type, const QString& resource );
+ void fromKMailDelSubresource( const TQString& type, const TQString& resource );
- void fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map,
- const QString& type,
- const QString& folder );
+ void fromKMailAsyncLoadResult( const TQMap<Q_UINT32, TQString>& map,
+ const TQString& type,
+ const TQString& folder );
/** Return the list of subresources. */
- QStringList subresources() const;
+ TQStringList subresources() const;
/** Is this subresource active? */
- bool subresourceActive( const QString& ) const;
+ bool subresourceActive( const TQString& ) const;
signals:
- void signalSubresourceAdded( Resource*, const QString&, const QString& );
- void signalSubresourceRemoved( Resource*, const QString&, const QString& );
+ void signalSubresourceAdded( Resource*, const TQString&, const TQString& );
+ void signalSubresourceRemoved( Resource*, const TQString&, const TQString& );
private:
- bool addNote( KCal::Journal* journal, const QString& resource,
+ bool addNote( KCal::Journal* journal, const TQString& resource,
Q_UINT32 sernum );
- KCal::Journal* addNote( const QString& data, const QString& subresource,
- Q_UINT32 sernum, const QString &mimetype );
+ KCal::Journal* addNote( const TQString& data, const TQString& subresource,
+ Q_UINT32 sernum, const TQString &mimetype );
- bool loadSubResource( const QString& resource, const QString& mimetype );
+ bool loadSubResource( const TQString& resource, const TQString& mimetype );
- QString configFile() const {
+ TQString configFile() const {
return ResourceKolabBase::configFile( "knotes" );
}
diff --git a/kresources/kolab/knotes/resourcekolab_plugin.cpp b/kresources/kolab/knotes/resourcekolab_plugin.cpp
index cd97ecf6c..772184982 100644
--- a/kresources/kolab/knotes/resourcekolab_plugin.cpp
+++ b/kresources/kolab/knotes/resourcekolab_plugin.cpp
@@ -40,7 +40,7 @@ public:
return new Kolab::ResourceKolab( config );
}
- KRES::ConfigWidget *configWidget( QWidget* )
+ KRES::ConfigWidget *configWidget( TQWidget* )
{
return 0;
}