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

Andrew Walker arwalker at sumusltd.com
Thu Sep 20 19:27:03 CEST 2007


SVN commit 714818 by arwalker:

CCBUG:149952 list both styles of plugins together in alphabetical order

 M  +13 -12    kst.cpp  


--- branches/work/kst/1.6/kst/src/libkstapp/kst.cpp #714817:714818
@@ -969,7 +969,7 @@
 void KstApp::selectDataPlugin() {
   QStringList l;
 
-  //The new KstDataObject plugins...
+  // the new KstDataObject plugins...
   QStringList newPlugins;
   const KstPluginInfoList pluginInfo = KstDataObject::pluginInfoList();
   {
@@ -981,7 +981,7 @@
 
   l += newPlugins;
 
-  //The old C style plugins...
+  // the old C style plugins...
   QStringList oldPlugins;
   const QMap<QString,QString> readable = PluginCollection::self()->readableNameList();
   {
@@ -993,20 +993,21 @@
 
   l += oldPlugins;
 
+  // list the old and new stlye plugins together in ascending alphabetical order...
+  l.sort();
+
   bool ok = false;
   QStringList plugin = KInputDialog::getItemList(i18n("Data Plugins"), i18n("Create..."), l, 0, false, &ok, this);
 
-  if (!ok || plugin.isEmpty()) {
-    return;
-  }
+  if (ok && !plugin.isEmpty()) {
+    const QString p = plugin.join("");
 
-  const QString p = plugin.join("");
-
-  if (newPlugins.contains(p)) {
-    KstDataObjectPtr ptr = KstDataObject::plugin(p);
-    ptr->showDialog(true);
-  } else if (oldPlugins.contains(p)) {
-    KstPluginDialogI::globalInstance()->showNew(readable[p]);
+    if (newPlugins.contains(p)) {
+      KstDataObjectPtr ptr = KstDataObject::plugin(p);
+      ptr->showDialog(true);
+    } else if (oldPlugins.contains(p)) {
+      KstPluginDialogI::globalInstance()->showNew(readable[p]);
+    }
   }
 }
 


More information about the Kst mailing list