From kde-commits Mon Jun 14 21:31:35 2004 From: =?utf-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 14 Jun 2004 21:31:35 +0000 To: kde-commits Subject: kdepim/kontact Message-Id: <20040614213135.03C8799E9 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=108724870800675 CVS commit by kloecker: API change: Add updateSummary( bool force = false ) to the Summary class. This method is called with 'false' whenever the summary part is activated. It should be called with 'true' if the user requests an update of the summary (not yet possible). By default nothing happens if the method is called. Since the API has been changed the required KontactPluginVersion is raised (to 4). M +1 -1 interfaces/plugin.h 1.38 M +7 -1 interfaces/summary.h 1.9 M +15 -0 plugins/summary/summaryview_part.cpp 1.37 M +2 -0 plugins/summary/summaryview_part.h 1.19 --- kdepim/kontact/interfaces/plugin.h #1.37:1.38 @@ -41,5 +41,5 @@ namespace KParts { class Part; } in the API. */ -#define KONTACT_PLUGIN_VERSION 3 +#define KONTACT_PLUGIN_VERSION 4 namespace Kontact --- kdepim/kontact/interfaces/summary.h #1.8:1.9 @@ -62,5 +62,11 @@ class Summary : public QWidget public slots: - virtual void configChanged() {}; + virtual void configChanged() {} + + /** + This is called if the displayed information should be updated. + @param force true if the update was requested by the user + */ + virtual void updateSummary( bool force = false ) { Q_UNUSED( force ); } signals: --- kdepim/kontact/plugins/summary/summaryview_part.h #1.18:1.19 @@ -39,4 +39,5 @@ namespace KParts { class StatusBarExtension; + class PartActivateEvent; } @@ -67,4 +68,5 @@ class SummaryViewPart : public KParts::R protected: virtual bool openFile(); + virtual void partActivateEvent( KParts::PartActivateEvent *event ); protected slots: --- kdepim/kontact/plugins/summary/summaryview_part.cpp #1.36:1.37 @@ -47,4 +47,5 @@ #include #include +#include #include @@ -103,4 +104,18 @@ bool SummaryViewPart::openFile() } +void SummaryViewPart::partActivateEvent( KParts::PartActivateEvent *event ) +{ + // inform the plugins that the part has been activated so that they can + // update the displayed information + if ( event->activated() && ( event->part() == this ) ) { + QPtrListIterator it( mSummaries ); + for ( ; it.current(); ++it ) { + it.current()->updateSummary( false ); + } + } + + KParts::ReadOnlyPart::partActivateEvent( event ); +} + void SummaryViewPart::updateWidgets() {