forked from qt-creator/qt-creator
Some plugin spec property renaming.
This commit is contained in:
@@ -623,13 +623,13 @@ void PluginManagerPrivate::writeSettings()
|
|||||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope,
|
QSettings settings(QSettings::IniFormat, QSettings::UserScope,
|
||||||
QLatin1String("Nokia"), QLatin1String("QtCreator"));
|
QLatin1String("Nokia"), QLatin1String("QtCreator"));
|
||||||
|
|
||||||
QStringList notLoadedPlugins;
|
QStringList tempDisabledPlugins;
|
||||||
foreach(PluginSpec *spec, pluginSpecs) {
|
foreach(PluginSpec *spec, pluginSpecs) {
|
||||||
if (!spec->loadOnStartup())
|
if (!spec->isEnabled())
|
||||||
notLoadedPlugins.append(spec->name());
|
tempDisabledPlugins.append(spec->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.setValue(QLatin1String(C_IGNORED_PLUGINS), notLoadedPlugins);
|
settings.setValue(QLatin1String(C_IGNORED_PLUGINS), tempDisabledPlugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManagerPrivate::loadSettings()
|
void PluginManagerPrivate::loadSettings()
|
||||||
@@ -637,8 +637,7 @@ void PluginManagerPrivate::loadSettings()
|
|||||||
const QSettings settings(QSettings::IniFormat, QSettings::UserScope,
|
const QSettings settings(QSettings::IniFormat, QSettings::UserScope,
|
||||||
QLatin1String("Nokia"), QLatin1String("QtCreator"));
|
QLatin1String("Nokia"), QLatin1String("QtCreator"));
|
||||||
|
|
||||||
|
disabledPlugins = settings.value(QLatin1String(C_IGNORED_PLUGINS)).toStringList();
|
||||||
notLoadedPlugins = settings.value(QLatin1String(C_IGNORED_PLUGINS)).toStringList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManagerPrivate::stopAll()
|
void PluginManagerPrivate::stopAll()
|
||||||
@@ -762,7 +761,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
|
|||||||
circularityCheckQueue.append(spec);
|
circularityCheckQueue.append(spec);
|
||||||
// check if we have the dependencies
|
// check if we have the dependencies
|
||||||
if (spec->state() == PluginSpec::Invalid || spec->state() == PluginSpec::Read) {
|
if (spec->state() == PluginSpec::Invalid || spec->state() == PluginSpec::Read) {
|
||||||
if (!spec->d->ignoreOnStartup && spec->d->loadOnStartup) {
|
if (!spec->isDisabledByDependency() && spec->isEnabled()) {
|
||||||
spec->d->hasError = true;
|
spec->d->hasError = true;
|
||||||
spec->d->errorString += "\n";
|
spec->d->errorString += "\n";
|
||||||
spec->d->errorString += PluginManager::tr("Cannot load plugin because dependencies are not resolved");
|
spec->d->errorString += PluginManager::tr("Cannot load plugin because dependencies are not resolved");
|
||||||
@@ -790,7 +789,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
|
|||||||
*/
|
*/
|
||||||
void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destState)
|
void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destState)
|
||||||
{
|
{
|
||||||
if (spec->hasError() || spec->ignoreOnStartup())
|
if (spec->hasError() || spec->isDisabledByDependency())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (destState) {
|
switch (destState) {
|
||||||
@@ -884,8 +883,8 @@ void PluginManagerPrivate::readPluginPaths()
|
|||||||
collection = new PluginCollection(spec->category());
|
collection = new PluginCollection(spec->category());
|
||||||
pluginCategories.insert(spec->category(), collection);
|
pluginCategories.insert(spec->category(), collection);
|
||||||
}
|
}
|
||||||
if (notLoadedPlugins.contains(spec->name()))
|
if (disabledPlugins.contains(spec->name()))
|
||||||
spec->setLoadOnStartup(false);
|
spec->setEnabled(false);
|
||||||
|
|
||||||
collection->addPlugin(spec);
|
collection->addPlugin(spec);
|
||||||
pluginSpecs.append(spec);
|
pluginSpecs.append(spec);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public:
|
|||||||
QStringList pluginPaths;
|
QStringList pluginPaths;
|
||||||
QString extension;
|
QString extension;
|
||||||
QList<QObject *> allObjects; // ### make this a QList<QPointer<QObject> > > ?
|
QList<QObject *> allObjects; // ### make this a QList<QPointer<QObject> > > ?
|
||||||
QStringList notLoadedPlugins;
|
QStringList disabledPlugins;
|
||||||
|
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
QScopedPointer<QTime> m_profileTimer;
|
QScopedPointer<QTime> m_profileTimer;
|
||||||
|
|||||||
@@ -240,14 +240,14 @@ QString PluginSpec::category() const
|
|||||||
\fn bool PluginSpec::loadOnStartup() const
|
\fn bool PluginSpec::loadOnStartup() const
|
||||||
True if the plugin is loaded at startup. True by default - the user can change it from the Plugin settings.
|
True if the plugin is loaded at startup. True by default - the user can change it from the Plugin settings.
|
||||||
*/
|
*/
|
||||||
bool PluginSpec::loadOnStartup() const
|
bool PluginSpec::isEnabled() const
|
||||||
{
|
{
|
||||||
return d->loadOnStartup;
|
return d->enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PluginSpec::ignoreOnStartup() const
|
bool PluginSpec::isDisabledByDependency() const
|
||||||
{
|
{
|
||||||
return d->ignoreOnStartup;
|
return d->disabledByDependency;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -437,8 +437,8 @@ namespace {
|
|||||||
*/
|
*/
|
||||||
PluginSpecPrivate::PluginSpecPrivate(PluginSpec *spec)
|
PluginSpecPrivate::PluginSpecPrivate(PluginSpec *spec)
|
||||||
:
|
:
|
||||||
loadOnStartup(true),
|
enabled(true),
|
||||||
ignoreOnStartup(false),
|
disabledByDependency(false),
|
||||||
plugin(0),
|
plugin(0),
|
||||||
state(PluginSpec::Invalid),
|
state(PluginSpec::Invalid),
|
||||||
hasError(false),
|
hasError(false),
|
||||||
@@ -496,14 +496,9 @@ bool PluginSpecPrivate::read(const QString &fileName)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginSpec::setLoadOnStartup(bool value)
|
void PluginSpec::setEnabled(bool value)
|
||||||
{
|
{
|
||||||
d->loadOnStartup = value;
|
d->enabled = value;
|
||||||
}
|
|
||||||
|
|
||||||
void PluginSpec::setIgnoreOnStartup(bool value)
|
|
||||||
{
|
|
||||||
d->ignoreOnStartup = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -797,8 +792,8 @@ bool PluginSpecPrivate::resolveDependencies(const QList<PluginSpec *> &specs)
|
|||||||
foreach (PluginSpec *spec, specs) {
|
foreach (PluginSpec *spec, specs) {
|
||||||
if (spec->provides(dependency.name, dependency.version)) {
|
if (spec->provides(dependency.name, dependency.version)) {
|
||||||
found = spec;
|
found = spec;
|
||||||
if (!spec->loadOnStartup() || spec->ignoreOnStartup())
|
if (!spec->isEnabled() || spec->isDisabledByDependency())
|
||||||
ignoreOnStartup = true;
|
disabledByDependency = true;
|
||||||
|
|
||||||
spec->addDependentPlugin(q);
|
spec->addDependentPlugin(q);
|
||||||
|
|
||||||
@@ -820,7 +815,7 @@ bool PluginSpecPrivate::resolveDependencies(const QList<PluginSpec *> &specs)
|
|||||||
|
|
||||||
dependencySpecs = resolvedDependencies;
|
dependencySpecs = resolvedDependencies;
|
||||||
|
|
||||||
if (loadOnStartup && !ignoreOnStartup)
|
if (enabled && !disabledByDependency)
|
||||||
state = PluginSpec::Resolved;
|
state = PluginSpec::Resolved;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ public:
|
|||||||
QString description() const;
|
QString description() const;
|
||||||
QString url() const;
|
QString url() const;
|
||||||
QString category() const;
|
QString category() const;
|
||||||
bool loadOnStartup() const;
|
bool isEnabled() const;
|
||||||
// true if loading was not done due to user unselecting this plugin or its dependencies
|
// true if loading was not done due to user unselecting this plugin or its dependencies
|
||||||
bool ignoreOnStartup() const;
|
bool isDisabledByDependency() const;
|
||||||
QList<PluginDependency> dependencies() const;
|
QList<PluginDependency> dependencies() const;
|
||||||
|
|
||||||
typedef QList<PluginArgumentDescription> PluginArgumentDescriptions;
|
typedef QList<PluginArgumentDescription> PluginArgumentDescriptions;
|
||||||
@@ -91,8 +91,7 @@ public:
|
|||||||
QString location() const;
|
QString location() const;
|
||||||
QString filePath() const;
|
QString filePath() const;
|
||||||
|
|
||||||
void setLoadOnStartup(bool value);
|
void setEnabled(bool value);
|
||||||
void setIgnoreOnStartup(bool value);
|
|
||||||
|
|
||||||
QStringList arguments() const;
|
QStringList arguments() const;
|
||||||
void setArguments(const QStringList &arguments);
|
void setArguments(const QStringList &arguments);
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ public:
|
|||||||
QString url;
|
QString url;
|
||||||
QString category;
|
QString category;
|
||||||
QList<PluginDependency> dependencies;
|
QList<PluginDependency> dependencies;
|
||||||
bool loadOnStartup;
|
bool enabled;
|
||||||
bool ignoreOnStartup;
|
bool disabledByDependency;
|
||||||
|
|
||||||
QString location;
|
QString location;
|
||||||
QString filePath;
|
QString filePath;
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ void PluginView::updateList()
|
|||||||
defaultCollectionItem->setData(0, Qt::UserRole, qVariantFromValue(defaultCollection));
|
defaultCollectionItem->setData(0, Qt::UserRole, qVariantFromValue(defaultCollection));
|
||||||
|
|
||||||
foreach (PluginSpec *spec, m_specToItem.keys())
|
foreach (PluginSpec *spec, m_specToItem.keys())
|
||||||
toggleRelatedPlugins(spec, spec->loadOnStartup() && !spec->ignoreOnStartup());
|
toggleRelatedPlugins(spec, spec->isEnabled() && !spec->isDisabledByDependency());
|
||||||
|
|
||||||
m_ui->categoryWidget->clear();
|
m_ui->categoryWidget->clear();
|
||||||
if (!m_items.isEmpty()) {
|
if (!m_items.isEmpty()) {
|
||||||
@@ -217,7 +217,7 @@ int PluginView::parsePluginSpecs(QTreeWidgetItem *parentItem, Qt::CheckState &gr
|
|||||||
pluginItem->setData(0, Qt::UserRole, qVariantFromValue(spec));
|
pluginItem->setData(0, Qt::UserRole, qVariantFromValue(spec));
|
||||||
|
|
||||||
Qt::CheckState state = Qt::Unchecked;
|
Qt::CheckState state = Qt::Unchecked;
|
||||||
if (spec->loadOnStartup()) {
|
if (spec->isEnabled()) {
|
||||||
state = Qt::Checked;
|
state = Qt::Checked;
|
||||||
++loadCount;
|
++loadCount;
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
|
|||||||
|
|
||||||
if (column == C_LOAD) {
|
if (column == C_LOAD) {
|
||||||
|
|
||||||
spec->setLoadOnStartup(loadOnStartup);
|
spec->setEnabled(loadOnStartup);
|
||||||
toggleRelatedPlugins(spec, loadOnStartup);
|
toggleRelatedPlugins(spec, loadOnStartup);
|
||||||
|
|
||||||
if (item->parent()) {
|
if (item->parent()) {
|
||||||
@@ -308,7 +308,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
|
|||||||
Qt::CheckState state = Qt::PartiallyChecked;
|
Qt::CheckState state = Qt::PartiallyChecked;
|
||||||
int loadCount = 0;
|
int loadCount = 0;
|
||||||
for (int i = 0; i < collection->plugins().length(); ++i) {
|
for (int i = 0; i < collection->plugins().length(); ++i) {
|
||||||
if (collection->plugins().at(i)->loadOnStartup())
|
if (collection->plugins().at(i)->isEnabled())
|
||||||
++loadCount;
|
++loadCount;
|
||||||
}
|
}
|
||||||
if (loadCount == collection->plugins().length())
|
if (loadCount == collection->plugins().length())
|
||||||
@@ -329,7 +329,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
|
|||||||
QTreeWidgetItem *child = m_specToItem.value(spec);
|
QTreeWidgetItem *child = m_specToItem.value(spec);
|
||||||
|
|
||||||
if (!m_whitelist.contains(spec->name())) {
|
if (!m_whitelist.contains(spec->name())) {
|
||||||
spec->setLoadOnStartup(loadOnStartup);
|
spec->setEnabled(loadOnStartup);
|
||||||
Qt::CheckState state = (loadOnStartup ? Qt::Checked : Qt::Unchecked);
|
Qt::CheckState state = (loadOnStartup ? Qt::Checked : Qt::Unchecked);
|
||||||
child->setData(C_LOAD, Qt::CheckStateRole, state);
|
child->setData(C_LOAD, Qt::CheckStateRole, state);
|
||||||
toggleRelatedPlugins(spec, loadOnStartup);
|
toggleRelatedPlugins(spec, loadOnStartup);
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ void PluginDialog::updateButtons()
|
|||||||
if (selectedSpec) {
|
if (selectedSpec) {
|
||||||
m_detailsButton->setEnabled(true);
|
m_detailsButton->setEnabled(true);
|
||||||
m_errorDetailsButton->setEnabled(selectedSpec->hasError()
|
m_errorDetailsButton->setEnabled(selectedSpec->hasError()
|
||||||
|| selectedSpec->ignoreOnStartup()
|
|| selectedSpec->isDisabledByDependency()
|
||||||
|| !selectedSpec->loadOnStartup());
|
|| !selectedSpec->isEnabled());
|
||||||
} else {
|
} else {
|
||||||
m_detailsButton->setEnabled(false);
|
m_detailsButton->setEnabled(false);
|
||||||
m_errorDetailsButton->setEnabled(false);
|
m_errorDetailsButton->setEnabled(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user