[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Thu Oct 14 01:38:35 CEST 2004
CVS commit by staikos:
fix major performance regression from previous commit to plugin manager:
don't load all plugins on startup!
M +26 -26 plugincollection.h 1.13
M +4 -12 pluginmanager.ui.h 1.20
--- kdeextragear-2/kst/kst/pluginmanager.ui.h #1.19:1.20
@@ -21,6 +21,5 @@ void PluginManager::init()
void PluginManager::selectionChanged( QListViewItem *item )
{
- bool on = item != 0L;
- _remove->setEnabled(on);
+ _remove->setEnabled(item != 0L);
}
@@ -111,6 +110,4 @@ void PluginManager::rescan()
void PluginManager::reloadList()
{
- QString strPath;
-
_pluginList->clear();
PluginCollection *pc = PluginCollection::self();
@@ -120,10 +117,5 @@ void PluginManager::reloadList()
for (it = pluginList.begin(); it != pluginList.end(); ++it) {
- KstSharedPtr<Plugin> plugin = pc->plugin(it.data()._name);
- if (plugin) {
- strPath = plugin->xmlFile();
- } else {
- strPath = "";
- }
+ QString path = pc->pluginNameList()[it.data()._name];
QListViewItem *i = new QListViewItem(_pluginList,
it.data()._readableName,
@@ -133,5 +125,5 @@ void PluginManager::reloadList()
it.data()._author,
it.data()._name,
- strPath);
+ path);
if (loadedPluginList.contains(it.data()._name)) {
i->setPixmap(COLUMN_LOADED, locate("data", "kst/pics/yes.png"));
--- kdeextragear-2/kst/kst/plugincollection.h #1.12:1.13
@@ -28,6 +28,6 @@ class PluginXMLParser;
class PluginCollection : public QObject {
Q_OBJECT
-friend class KStaticDeleter<PluginCollection>;
-public:
+ friend class KStaticDeleter<PluginCollection>;
+ public:
static PluginCollection *self();
@@ -88,5 +88,5 @@ public:
-signals:
+ signals:
void pluginLoaded(const QString& name);
void pluginUnloaded(const QString& name);
@@ -95,5 +95,5 @@ signals:
void pluginListChanged();
-protected:
+ protected:
PluginCollection();
~PluginCollection();
@@ -101,5 +101,5 @@ protected:
static PluginCollection *_self;
-private:
+ private:
PluginXMLParser *_parser;
QMap<QString, KstSharedPtr<Plugin> > _plugins;
More information about the Kst
mailing list