[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Tue Jun 1 00:16:41 CEST 2004


CVS commit by arwalker: 

Added the concept of a readable name for plugins. This will be displayed in the plugin and fit dialog, and does not have to be the same as the function name. Thus, spaces can be used instead of underscores.


  M +1 -1      kstfitdialog_i.cpp   1.8
  M +1 -1      kstplugindialog_i.cpp   1.64
  M +1 -0      plugin.h   1.20
  M +7 -1      pluginxmlparser.cpp   1.17


--- kdeextragear-2/kst/kst/kstfitdialog_i.cpp  #1.7:1.8
@@ -136,5 +136,5 @@ void KstFitDialogI::updatePluginList() {
       if (!it.data()._isFitWeighted || _evector != i18n("<None>")) {
         _pluginList += it.data()._name;
-        PluginCombo->insertItem(i18n("%1 (v%2) - %3").arg(it.data()._name)
+        PluginCombo->insertItem(i18n("%1 (v%2) - %3").arg(it.data()._readableName)
                                 .arg(it.data()._version)
                                 .arg(it.data()._description));

--- kdeextragear-2/kst/kst/kstplugindialog_i.cpp  #1.63:1.64
@@ -113,5 +113,5 @@ void KstPluginDialogI::updatePluginList(
     if (it.data()._filter == false) {
       _pluginList += it.data()._name;
-      PluginCombo->insertItem(i18n("%1 (v%2) - %3").arg(it.data()._name)
+      PluginCombo->insertItem(i18n("%1 (v%2) - %3").arg(it.data()._readableName)
                               .arg(it.data()._version)
                               .arg(it.data()._description));

--- kdeextragear-2/kst/kst/plugin.h  #1.19:1.20
@@ -101,4 +101,5 @@ public:
       bool _isFitWeighted;
       QString _name;
+      QString _readableName;
       QString _author;
       QString _description;

--- kdeextragear-2/kst/kst/pluginxmlparser.cpp  #1.16:1.17
@@ -62,4 +62,5 @@ static const QString QS_string = QString
 static const QString QS_int = QString::fromLatin1("int");
 static const QString QS_name = QString::fromLatin1("name");
+static const QString QS_readableName = QString::fromLatin1("readableName");
 static const QString QS_helptext = QString::fromLatin1("helptext");
 static const QString QS_intro = QString::fromLatin1("intro");
@@ -146,4 +147,5 @@ QDomNode n = element.firstChild();
     QString tn = e.tagName().lower();
     if (tn == QS_modulename) {
+      _pluginData._readableName = e.attribute(QS_readableName);
       _pluginData._name = e.attribute(QS_name);
     } else if (tn == QS_localdata) {
@@ -191,5 +193,9 @@ QDomNode n = element.firstChild();
   }
 
-return 0;
+  if (_pluginData._readableName.isEmpty()) {
+    _pluginData._readableName = _pluginData._name;
+  }
+
+  return 0;
 }
 





More information about the Kst mailing list