[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/kontact
From:       Ingo Klöcker <kloecker () kde ! org>
Date:       2004-06-14 21:31:35
Message-ID: 20040614213135.03C8799E9 () office ! kde ! org
[Download RAW message or body]

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 <kparts/componentfactory.h>
 #include <kparts/statusbarextension.h>
+#include <kparts/event.h>
 
 #include <infoextension.h>
@@ -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<Kontact::Summary> it( mSummaries );
+    for ( ; it.current(); ++it ) {
+      it.current()->updateSummary( false );
+    }
+  }
+
+  KParts::ReadOnlyPart::partActivateEvent( event );
+}
+
 void SummaryViewPart::updateWidgets()
 {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic