summaryrefslogtreecommitdiffstats
path: root/kresources/kolab/knotes/note.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /kresources/kolab/knotes/note.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/kolab/knotes/note.cpp')
-rw-r--r--kresources/kolab/knotes/note.cpp41
1 files changed, 30 insertions, 11 deletions
diff --git a/kresources/kolab/knotes/note.cpp b/kresources/kolab/knotes/note.cpp
index 66556aaf8..168dae562 100644
--- a/kresources/kolab/knotes/note.cpp
+++ b/kresources/kolab/knotes/note.cpp
@@ -108,7 +108,6 @@ bool Note::richText() const
bool Note::loadAttribute( TQDomElement& element )
{
TQString tagName = element.tagName();
-
if ( tagName == "summary" )
setSummary( element.text() );
else if ( tagName == "foreground-color" )
@@ -136,8 +135,10 @@ bool Note::saveAttributes( TQDomElement& element ) const
#endif
writeString( element, "summary", summary() );
- writeString( element, "foreground-color", colorToString( foregroundColor() ) );
- writeString( element, "background-color", colorToString( backgroundColor() ) );
+ if ( foregroundColor().isValid() )
+ writeString( element, "foreground-color", colorToString( foregroundColor() ) );
+ if ( backgroundColor().isValid() )
+ writeString( element, "background-color", colorToString( backgroundColor() ) );
writeString( element, "knotes-richtext", mRichText ? "true" : "false" );
return true;
@@ -183,11 +184,27 @@ void Note::setFields( const KCal::Journal* journal )
{
KolabBase::setFields( journal );
- // TODO: background and foreground
setSummary( journal->summary() );
- setBackgroundColor( journal->customProperty( "KNotes", "BgColor" ) );
- setForegroundColor( journal->customProperty( "KNotes", "FgColor" ) );
- setRichText( journal->customProperty( "KNotes", "RichText" ) == "true" );
+
+ TQString property = journal->customProperty( "KNotes", "BgColor" );
+ if ( !property.isNull() ) {
+ setBackgroundColor( property );
+ } else {
+ setBackgroundColor( "yellow" );
+ }
+ property = journal->customProperty( "KNotes", "FgColor" );
+ if ( !property.isNull() ) {
+ setForegroundColor( property );
+ } else {
+ setForegroundColor( "black" );
+ }
+
+ property = journal->customProperty( "KNotes", "RichText" );
+ if ( !property.isNull() ) {
+ setRichText( property == "true" ? true : false );
+ } else {
+ setRichText( "false" );
+ }
}
void Note::saveTo( KCal::Journal* journal )
@@ -196,10 +213,12 @@ void Note::saveTo( KCal::Journal* journal )
// TODO: background and foreground
journal->setSummary( summary() );
- journal->setCustomProperty( "KNotes", "FgColor",
- colorToString( foregroundColor() ) );
- journal->setCustomProperty( "KNotes", "BgColor",
- colorToString( backgroundColor() ) );
+ if ( foregroundColor().isValid() )
+ journal->setCustomProperty( "KNotes", "FgColor",
+ colorToString( foregroundColor() ) );
+ if ( backgroundColor().isValid() )
+ journal->setCustomProperty( "KNotes", "BgColor",
+ colorToString( backgroundColor() ) );
journal->setCustomProperty( "KNotes", "RichText",
richText() ? "true" : "false" );
}