[Kst] branches/work/kst/1.6/kst/src/libkstmath

Andrew Walker arwalker at sumusltd.com
Fri Jan 11 22:52:57 CET 2008


SVN commit 760087 by arwalker:

format changes

 M  +2 -3      enodes.h  
 M  +0 -1      kstbasicplugin.h  
 M  +3 -3      kstcplugin.cpp  
 M  +4 -4      kstcplugin.h  
 M  +1 -1      kstdataobject.cpp  
 M  +2 -0      plugin.h  
 M  +4 -6      plugincollection.cpp  
 M  +3 -3      plugincollection.h  


--- branches/work/kst/1.6/kst/src/libkstmath/enodes.h #760086:760087
@@ -18,13 +18,12 @@
 #ifndef ENODES_H
 #define ENODES_H
 
+#include "plugin.h"
 #include "kstbasicplugin.h"
 #include "kststring.h"
 #include "kstvector.h"
 #include "kst_export.h"
 
-class Plugin;
-
 #define EQ_FALSE        0.0
 #define EQ_TRUE         1.0
 #define EQ_INDEX_ERROR -424242
@@ -134,7 +133,7 @@
       char *_name;
       ArgumentList *_args;
       void *_f;
-      KstSharedPtr<Plugin> _cStylePlugin;
+      KstPluginPtr _cStylePlugin;
       KstBasicPluginPtr _dataObjectPlugin;
 
     private:
--- branches/work/kst/1.6/kst/src/libkstmath/kstbasicplugin.h #760086:760087
@@ -88,7 +88,6 @@
     void save(QTextStream& ts, const QString& indent = QString::null);
 
     bool isFit() const { return _isFit; }
-    // FIXME: remove this
     void createFitScalars();
     QString label(int precision) const;
 
--- branches/work/kst/1.6/kst/src/libkstmath/kstcplugin.cpp #760086:760087
@@ -623,7 +623,7 @@
 //
 // to be used only from javaScript...
 //
-bool KstCPlugin::setModule(KstSharedPtr<Plugin> plugin) {
+bool KstCPlugin::setModule(KstPluginPtr plugin) {
   // Assumes that this is called with a write lock in place on this object
   Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);
 
@@ -651,7 +651,7 @@
 }
 
 
-bool KstCPlugin::setPlugin(KstSharedPtr<Plugin> plugin) {
+bool KstCPlugin::setPlugin(KstPluginPtr plugin) {
   // Assumes that this is called with a write lock in place on this object
   Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);
 
@@ -728,7 +728,7 @@
 }
 
 
-KstSharedPtr<Plugin> KstCPlugin::plugin() const {
+KstPluginPtr KstCPlugin::plugin() const {
   return _plugin;
 }
 
--- branches/work/kst/1.6/kst/src/libkstmath/kstcplugin.h #760086:760087
@@ -42,9 +42,9 @@
     virtual bool isValid() const;
 
     virtual bool validate();
-    virtual bool setModule(KstSharedPtr<Plugin> plugin);
-    virtual bool setPlugin(KstSharedPtr<Plugin> plugin);
-    KstSharedPtr<Plugin> plugin() const;
+    virtual bool setModule(KstPluginPtr plugin);
+    virtual bool setPlugin(KstPluginPtr plugin);
+    KstPluginPtr plugin() const;
 
     virtual QString propertyString() const;
 
@@ -65,7 +65,7 @@
     static void countScalarsAndVectors(const QValueList<Plugin::Data::IOValue>& table, unsigned& scalars, unsigned& vectors);
     virtual void showNewDialog();
     virtual void showEditDialog();
-    KstSharedPtr<Plugin> _plugin;
+    KstPluginPtr _plugin;
     unsigned _inScalarCnt, _inArrayCnt, _inStringCnt, _outScalarCnt;
     unsigned _inPid, _outArrayCnt, _outStringCnt;
     void *_localData;
--- branches/work/kst/1.6/kst/src/libkstmath/kstdataobject.cpp #760086:760087
@@ -87,7 +87,7 @@
 
 static QMap<QString, KstDataObjectPtr> pluginInfo;
 void KstDataObject::cleanupForExit() {
-  pluginInfo.clear(); //FIXME?
+  pluginInfo.clear();
 }
 
 
--- branches/work/kst/1.6/kst/src/libkstmath/plugin.h #760086:760087
@@ -154,4 +154,6 @@
     QString _xmlFile, _soFile;
 };
 
+typedef KstSharedPtr<Plugin> KstPluginPtr;
+
 #endif
--- branches/work/kst/1.6/kst/src/libkstmath/plugincollection.cpp #760086:760087
@@ -109,7 +109,7 @@
   Plugin *p = PluginLoader::self()->loadPlugin(xmlfile,
                                    sofile.replace(QRegExp(".xml$"), ".so"));
   if (p) {
-    _plugins[name] = KstSharedPtr<Plugin>(p);
+    _plugins[name] = KstPluginPtr(p);
     emit pluginLoaded(name);
     return 0;
   }
@@ -118,7 +118,7 @@
 }
 
 
-int PluginCollection::unloadPlugin(const KstSharedPtr<Plugin> p) {
+int PluginCollection::unloadPlugin(const KstPluginPtr p) {
   if (!p.data()) {
     return -1;
   }
@@ -138,9 +138,7 @@
 
 
 void PluginCollection::unloadAllPlugins() {
-  for (QMap<QString, KstSharedPtr<Plugin> >::ConstIterator it = _plugins.begin();
-                                                          it != _plugins.end();
-                                                                         ++it) {
+  for (QMap<QString, KstPluginPtr>::ConstIterator it = _plugins.begin(); it != _plugins.end(); ++it) {
     emit pluginUnloaded(it.key());
   }
 
@@ -148,7 +146,7 @@
 }
 
 
-KstSharedPtr<Plugin> PluginCollection::plugin(const QString& name) {
+KstPluginPtr PluginCollection::plugin(const QString& name) {
   if (!_plugins.contains(name) || _plugins[name] == 0L) {
     if (!_installedPluginNames.contains(name)) {
       rescan();
--- branches/work/kst/1.6/kst/src/libkstmath/plugincollection.h #760086:760087
@@ -44,7 +44,7 @@
   /**
    *  Returns 0 on success, nonzero on error.
    */
-  int unloadPlugin(const KstSharedPtr<Plugin> p);
+  int unloadPlugin(const KstPluginPtr p);
   int unloadPlugin(const QString& name);
 
   int count() const;
@@ -53,7 +53,7 @@
    *  Returns 0L on error.  Will load the plugin if it is not already
    *  loaded.
    */
-  KstSharedPtr<Plugin> plugin(const QString& name);
+  KstPluginPtr plugin(const QString& name);
 
   /**
    *  Returns true if the plugin is loaded.
@@ -109,7 +109,7 @@
 
   private:
     PluginXMLParser *_parser;
-    QMap<QString, KstSharedPtr<Plugin> > _plugins;
+    QMap<QString, KstPluginPtr> _plugins;
 
     // Map: XMLFILE -> Plugin data
     mutable QMap<QString, Plugin::Data> _installedPlugins;


More information about the Kst mailing list