Commit bab7794a authored by hjk's avatar hjk

Use TreeModel in plugin dialog

Change-Id: Ifc18e9779b9841a2f08c48dcd8dad36627d6e537
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 273c3fa0
...@@ -1301,10 +1301,6 @@ void PluginManagerPrivate::resolveDependencies() ...@@ -1301,10 +1301,6 @@ void PluginManagerPrivate::resolveDependencies()
spec->d->resolveDependencies(pluginSpecs); spec->d->resolveDependencies(pluginSpecs);
} }
// Reset disabledIndirectly flag
foreach (PluginSpec *spec, loadQueue())
spec->d->disabledIndirectly = false;
foreach (PluginSpec *spec, loadQueue()) { foreach (PluginSpec *spec, loadQueue()) {
spec->d->disableIndirectlyIfDependencyDisabled(); spec->d->disableIndirectlyIfDependencyDisabled();
} }
...@@ -1329,11 +1325,6 @@ PluginSpec *PluginManagerPrivate::pluginForOption(const QString &option, bool *r ...@@ -1329,11 +1325,6 @@ PluginSpec *PluginManagerPrivate::pluginForOption(const QString &option, bool *r
return 0; return 0;
} }
void PluginManagerPrivate::disablePluginIndirectly(PluginSpec *spec)
{
spec->d->disabledIndirectly = true;
}
PluginSpec *PluginManagerPrivate::pluginByName(const QString &name) const PluginSpec *PluginManagerPrivate::pluginByName(const QString &name) const
{ {
foreach (PluginSpec *spec, pluginSpecs) foreach (PluginSpec *spec, pluginSpecs)
......
...@@ -80,7 +80,6 @@ public: ...@@ -80,7 +80,6 @@ public:
void setGlobalSettings(QSettings *settings); void setGlobalSettings(QSettings *settings);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void disablePluginIndirectly(PluginSpec *spec);
class TestSpec { class TestSpec {
public: public:
......
...@@ -542,11 +542,6 @@ void PluginSpec::setDisabledByDefault(bool value) ...@@ -542,11 +542,6 @@ void PluginSpec::setDisabledByDefault(bool value)
d->disabledByDefault = value; d->disabledByDefault = value;
} }
void PluginSpec::setDisabledIndirectly(bool value)
{
d->disabledIndirectly = value;
}
void PluginSpec::setForceEnabled(bool value) void PluginSpec::setForceEnabled(bool value)
{ {
d->forceEnabled = value; d->forceEnabled = value;
......
...@@ -113,7 +113,6 @@ public: ...@@ -113,7 +113,6 @@ public:
void setEnabled(bool value); void setEnabled(bool value);
void setDisabledByDefault(bool value); void setDisabledByDefault(bool value);
void setDisabledIndirectly(bool value);
void setForceEnabled(bool value); void setForceEnabled(bool value);
void setForceDisabled(bool value); void setForceDisabled(bool value);
......
This diff is collapsed.
...@@ -33,21 +33,22 @@ ...@@ -33,21 +33,22 @@
#include "extensionsystem_global.h" #include "extensionsystem_global.h"
#include <QHash>
#include <QWidget> #include <QWidget>
#include <QIcon> #include <QSet>
#include <QHash>
QT_BEGIN_NAMESPACE
class QTreeWidgetItem;
QT_END_NAMESPACE
namespace Utils { class TreeWidget; } namespace Utils {
class TreeItem;
class TreeModel;
class TreeView;
} // namespace Utils
namespace ExtensionSystem { namespace ExtensionSystem {
class PluginManager; class PluginManager;
class PluginSpec; class PluginSpec;
class PluginCollection; class PluginItem;
class CollectionItem;
class EXTENSIONSYSTEM_EXPORT PluginView : public QWidget class EXTENSIONSYSTEM_EXPORT PluginView : public QWidget
{ {
...@@ -64,28 +65,16 @@ signals: ...@@ -64,28 +65,16 @@ signals:
void pluginActivated(ExtensionSystem::PluginSpec *spec); void pluginActivated(ExtensionSystem::PluginSpec *spec);
void pluginSettingsChanged(ExtensionSystem::PluginSpec *spec); void pluginSettingsChanged(ExtensionSystem::PluginSpec *spec);
private slots:
void updatePluginSettings(QTreeWidgetItem *item, int column);
void updateList();
void selectPlugin(QTreeWidgetItem *current);
void activatePlugin(QTreeWidgetItem *item);
private: private:
enum ParsedState { ParsedNone = 1, ParsedPartial = 2, ParsedAll = 4, ParsedWithErrors = 8}; PluginSpec *pluginForIndex(const QModelIndex &index) const;
QIcon iconForState(int state); void updatePlugins();
void updatePluginDependencies();
int parsePluginSpecs(QTreeWidgetItem *parentItem, Qt::CheckState &groupState, QList<PluginSpec*> plugins);
Utils::TreeWidget *m_categoryWidget;
QList<QTreeWidgetItem*> m_items;
QHash<PluginSpec*, QTreeWidgetItem*> m_specToItem;
QIcon m_okIcon; Utils::TreeView *m_categoryView;
QIcon m_errorIcon; Utils::TreeModel *m_model;
QIcon m_notLoadedIcon;
bool m_allowCheckStateUpdate;
const int C_LOAD; friend class CollectionItem;
friend class PluginItem;
QHash<PluginSpec *, QSet<PluginSpec *>> m_pluginDependencies;
}; };
} // namespae ExtensionSystem } // namespae ExtensionSystem
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment