Version: (using KDE 3.2.1, compiled sources) Compiler: gcc version 3.3.1 (SuSE Linux) OS: Linux (i686) release 2.4.21-243-default Load a Kolab resource for notes in the KDE Control Center/KDE Components/KDE Resource Configuration Setup KMail with a Dimap account and enable IMAP Resource functionality using Kolab (XML) some format for the groupware folders. Setup your Kontact Summary view to show notes Create a note in the Notes view of kontact ( Kolab resources ) Pass to Summary View. The note is not shown in the Summary View.
CVS commit by tilladam: Fix proko2 issue 389 by making the knotes summary widget show notes from all resources, not just the local file one. CCMAIL: 89494-done@bugs.kde.org M +27 -8 summarywidget.cpp 1.17.2.1 M +3 -5 summarywidget.h 1.6.2.1 --- kdepim/kontact/plugins/knotes/summarywidget.cpp #1.17:1.17.2.1 @@ -22,4 +22,5 @@ */ +#include <qobject.h> #include <qlabel.h> #include <qlayout.h> @@ -35,4 +36,7 @@ #include <kstandarddirs.h> +#include <knotes/resourcenotes.h> +#include <knotes/resourcemanager.h> + #include "core.h" #include "plugin.h" @@ -42,14 +46,16 @@ SummaryWidget::SummaryWidget( Kontact::Plugin *plugin, QWidget *parent, const char *name ) - : Kontact::Summary( parent, name ), mPlugin( plugin ) + : Kontact::Summary( parent, name ), mLayout( 0 ), mMainLayout( 0 ), + mPlugin( plugin ) { mMainLayout = new QVBoxLayout( this, 3, 3 ); - mCalendar = new KCal::CalendarResources; - mResource = new KCal::ResourceLocal( ::locate( "data", "knotes/notes.ics" ) ); - mCalendar->resourceManager()->add( mResource ); - mCalendar->load(); - - connect( mCalendar, SIGNAL( calendarChanged() ), SLOT( updateView() ) ); + mCalendar = new KCal::CalendarLocal(); + KNotesResourceManager *manager = new KNotesResourceManager(); + QObject::connect( manager, SIGNAL( sigRegisteredNote( KCal::Journal* ) ), + this, SLOT( addNote( KCal::Journal* ) ) ); + QObject::connect( manager, SIGNAL( sigDeregisteredNote( KCal::Journal* ) ), + this, SLOT( removeNote( KCal::Journal* ) ) ); + manager->load(); QPixmap icon = KGlobal::iconLoader()->loadIcon( "kontact_notes", KIcon::Desktop, KIcon::SizeMedium ); @@ -96,3 +102,16 @@ void SummaryWidget::urlClicked( const QS } +void SummaryWidget::addNote( KCal::Journal *j ) +{ + mCalendar->addJournal( j ); + updateView(); +} + +void SummaryWidget::removeNote( KCal::Journal *j ) +{ + mCalendar->deleteJournal( j ); + updateView(); +} + + #include "summarywidget.moc" --- kdepim/kontact/plugins/knotes/summarywidget.h #1.6:1.6.2.1 @@ -34,6 +34,4 @@ #include <libkcal/calendarresources.h> -typedef QMap<QString, QString> NotesMap; - class QGridLayout; class QLabel; @@ -56,8 +54,9 @@ class SummaryWidget : public Kontact::Su void urlClicked( const QString& ); void updateView(); + void addNote( KCal::Journal* ); + void removeNote( KCal::Journal* ); private: - KCal::ResourceLocal *mResource; - KCal::CalendarResources *mCalendar; + KCal::CalendarLocal *mCalendar; KCal::Journal::List mNotes; @@ -66,5 +65,4 @@ class SummaryWidget : public Kontact::Su QPtrList<QLabel> mLabels; - NotesMap mNotesMap; Kontact::Plugin *mPlugin; };