[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Feb 10 10:48:39 CET 2004


CVS commit by staikos: 

Added "extension" framework to Kst which allows Kst to make use of optional
technology not available in the minimum required KDE version.  Added
KJSEmbed extension, which is only marginally functional right now, and is not
in the build since it needs an autoconf check still.


  A            kstextension.cpp   1.1 [GPL (v2+)]
  A            kstextension.desktop   1.1
  A            kstextension.h   1.1 [GPL (v2+)]
  A            extensions/.cvsignore   1.1
  A            extensions/Makefile.am   1.1
  A            extensions/js/.cvsignore   1.1
  A            extensions/js/Makefile.am   1.1
  A            extensions/js/js.cpp   1.1 [GPL (v2+)]
  A            extensions/js/js.h   1.1 [GPL (v2+)]
  A            extensions/js/kstextension_js.desktop   1.1
  A            extensions/js/kstextension_js.rc   1.1
  M +2 -2      Makefile.am   1.60
  M +20 -0     kst.cpp   1.73


--- kdeextragear-2/kst/kst/Makefile.am  #1.59:1.60
@@ -7,5 +7,5 @@
 
 lib_LTLIBRARIES = libkst.la
-libkst_la_SOURCES = kstobject.cpp kstdatasource.cpp stdinsource.cpp
+libkst_la_SOURCES = kstobject.cpp kstdatasource.cpp stdinsource.cpp kstextension.cpp
 libkst_la_LDFLAGS = -version-info 1:0:0 -no-undefined $(all_libraries)
 libkst_la_LIBADD = $(LIB_KIO)
@@ -107,5 +107,5 @@
 KDE_ICON = kst
 
-services_DATA = kstplugin.desktop kstdatasourceplugin.desktop kstfilter.desktop
+services_DATA = kstplugin.desktop kstdatasourceplugin.desktop kstfilter.desktop kstextension.desktop
 servicesdir = $(kde_servicetypesdir)/kst
 

--- kdeextragear-2/kst/kst/kst.cpp  #1.72:1.73
@@ -28,4 +28,5 @@
 #include <kaccel.h>
 #include <kconfig.h>
+#include <kdebug.h>
 #include <kfiledialog.h>
 #include <kiconloader.h>
@@ -34,4 +35,5 @@
 #include <kmenubar.h>
 #include <kmessagebox.h>
+#include <kparts/componentfactory.h>
 #include <kprinter.h>
 #include <kstandarddirs.h>
@@ -45,4 +47,5 @@
 #include "kstview.h"
 #include "kstdoc.h"
+#include "kstextension.h"
 #include "kstplotdialog_i.h"
 #include "kstviewscalarsdialog_i.h"
@@ -151,4 +154,21 @@ KstApp::KstApp(QWidget *parent, const ch
 
   QTimer::singleShot(0, this, SLOT(updateActions()));
+
+  // Load any extensions
+  KService::List sl = KServiceType::offers("Kst Extension");
+  for (KService::List::ConstIterator it = sl.begin(); it != sl.end(); ++it) {
+    KService::Ptr service = *it;
+    kdDebug() << "Found Kst Extension " << service->property("Name").toString() << endl;
+    int err = 0;
+    KstExtension *e = KParts::ComponentFactory::createInstanceFromService<KstExtension>(service, this, 0, QStringList(), &err);
+    if (e) {
+      kdDebug() << "Kst Extension " << service->property("Name").toString() << " loaded" << endl;
+    } else {
+      kdDebug() << "Error trying to load extension: " << err << endl;
+      if (err == KParts::ComponentFactory::ErrNoLibrary) {
+        kdDebug() << "Library error: " << KLibLoader::self()->lastErrorMessage() << endl;
+      }
+    }
+  }
 }
 





More information about the Kst mailing list