summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--knotes/knote.cpp26
-rw-r--r--kontact/plugins/knotes/knotes_part_p.h2
2 files changed, 23 insertions, 5 deletions
diff --git a/knotes/knote.cpp b/knotes/knote.cpp
index e20b52ef8..2a78d7189 100644
--- a/knotes/knote.cpp
+++ b/knotes/knote.cpp
@@ -515,13 +515,31 @@ TQColor KNote::bgColor() const
void KNote::setColor( const TQColor& fg, const TQColor& bg )
{
- m_journal->setCustomProperty( "KNotes", "FgColor", fg.name() );
- m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() );
+ bool updateJournal = false;
+ TQString journalFg = m_journal->customProperty( "KNotes", "FgColor" );
+ if ( journalFg.isEmpty() || journalFg != fg.name() )
+ {
+ m_journal->setCustomProperty( "KNotes", "FgColor", fg.name() );
+ updateJournal = true;
+ }
+ TQString journalbg = m_journal->customProperty( "KNotes", "BgColor" );
+ if ( journalbg.isEmpty() || journalbg != bg.name() )
+ {
+ m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() );
+ updateJournal = true;
+ }
+
m_config->setFgColor( fg );
m_config->setBgColor( bg );
- m_journal->updated(); // because setCustomProperty() doesn't call it!!
- emit sigDataChanged(noteId());
+ if (updateJournal)
+ {
+ // Only update the journal if new configuration was really used.
+ // This is necessary because setColor() is called also when loading a note from an .ics
+ // file and we do not want to inadvertantly update the last modified field each time.
+ m_journal->updated(); // because setCustomProperty() doesn't call it!!
+ emit sigDataChanged(noteId());
+ }
m_config->writeConfig();
TQPalette newpalette = palette();
diff --git a/kontact/plugins/knotes/knotes_part_p.h b/kontact/plugins/knotes/knotes_part_p.h
index aa5b602cb..9a30d715e 100644
--- a/kontact/plugins/knotes/knotes_part_p.h
+++ b/kontact/plugins/knotes/knotes_part_p.h
@@ -71,7 +71,7 @@ class KNotesIconViewItem : public TDEIconViewItem
TQPixmap icon = TDEGlobal::iconLoader()->loadIcon( "knotes", TDEIcon::Desktop );
icon = effect.apply( icon, TDEIconEffect::Colorize, 1, color, false );
setPixmap( icon );
- setText( journal->summary() );
+ TDEIconViewItem::setText( journal->summary() );
}
KCal::Journal *journal()