Changed: #1193 code cleanup.
This commit is contained in:
parent
c7b860c0f6
commit
a77156a92f
16 changed files with 79 additions and 76 deletions
|
@ -27,7 +27,7 @@
|
|||
|
||||
namespace NLMISC
|
||||
{
|
||||
class INelContext;
|
||||
class INelContext;
|
||||
}
|
||||
|
||||
namespace ExtensionSystem
|
||||
|
|
|
@ -56,8 +56,8 @@ public:
|
|||
virtual QList<ExtensionSystem::IPluginSpec *> plugins() const = 0;
|
||||
|
||||
// Settings
|
||||
virtual void setSettings(QSettings *settings) = 0;
|
||||
virtual QSettings *settings() const = 0;
|
||||
virtual void setSettings(QSettings *settings) = 0;
|
||||
virtual QSettings *settings() const = 0;
|
||||
|
||||
Q_SIGNALS:
|
||||
void objectAdded(QObject *obj);
|
||||
|
|
|
@ -95,8 +95,8 @@ void CPluginManager::loadPlugins()
|
|||
setPluginState(spec, State::Initialized);
|
||||
|
||||
QListIterator<CPluginSpec *> it(_pluginSpecs);
|
||||
it.toBack();
|
||||
while (it.hasPrevious())
|
||||
it.toBack();
|
||||
while (it.hasPrevious())
|
||||
setPluginState(it.previous(), State::Running);
|
||||
|
||||
Q_EMIT pluginsChanged();
|
||||
|
@ -202,12 +202,12 @@ void CPluginManager::stopAll()
|
|||
|
||||
void CPluginManager::deleteAll()
|
||||
{
|
||||
QListIterator<CPluginSpec *> it(_pluginSpecs);
|
||||
it.toBack();
|
||||
while (it.hasPrevious())
|
||||
QListIterator<CPluginSpec *> it(_pluginSpecs);
|
||||
it.toBack();
|
||||
while (it.hasPrevious())
|
||||
{
|
||||
setPluginState(it.previous(), State::Deleted);
|
||||
}
|
||||
setPluginState(it.previous(), State::Deleted);
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace NLQT
|
|
@ -52,10 +52,10 @@ public:
|
|||
virtual QList<IPluginSpec *> plugins() const;
|
||||
|
||||
// Settings
|
||||
virtual void setSettings(QSettings *settings);
|
||||
virtual QSettings *settings() const;
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
virtual void setSettings(QSettings *settings);
|
||||
virtual QSettings *settings() const;
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
private:
|
||||
void setPluginState(CPluginSpec *spec, int destState);
|
||||
|
|
|
@ -58,7 +58,10 @@ public:
|
|||
|
||||
QObject *objectByName(const QString &name) const;
|
||||
ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const;
|
||||
ExtensionSystem::IPluginManager *pluginManager() const { return _plugMan; }
|
||||
ExtensionSystem::IPluginManager *pluginManager() const
|
||||
{
|
||||
return _plugMan;
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
QList<Type *> getObjects() const
|
||||
|
|
|
@ -71,16 +71,16 @@ QList<QString> MyPlugin::dependencies() const
|
|||
QObject* MyPlugin::objectByName(const QString &name) const
|
||||
{
|
||||
Q_FOREACH (QObject *qobj, _plugMan->allObjects())
|
||||
if (qobj->objectName() == name)
|
||||
return qobj;
|
||||
if (qobj->objectName() == name)
|
||||
return qobj;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ExtensionSystem::IPluginSpec *MyPlugin::pluginByName(const QString &name) const
|
||||
{
|
||||
Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins())
|
||||
if (spec->name() == name)
|
||||
return spec;
|
||||
if (spec->name() == name)
|
||||
return spec;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -316,9 +316,9 @@ void CVegetableEditor::setVegetableWindPower(float w)
|
|||
_VegetableWindPower= w;
|
||||
if(_VegetableLandscape)
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
}
|
||||
|
||||
void CVegetableEditor::setVegetableWindBendStart(float w)
|
||||
|
@ -326,9 +326,9 @@ void CVegetableEditor::setVegetableWindBendStart(float w)
|
|||
_VegetableWindBendMin= w;
|
||||
if(_VegetableLandscape)
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
}
|
||||
|
||||
void CVegetableEditor::setVegetableWindFrequency(float w)
|
||||
|
@ -336,9 +336,9 @@ void CVegetableEditor::setVegetableWindFrequency(float w)
|
|||
_VegetableWindFreq= w;
|
||||
if(_VegetableLandscape)
|
||||
_VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir,
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
_VegetableWindFreq,
|
||||
_VegetableWindPower,
|
||||
_VegetableWindBendMin);
|
||||
}
|
||||
|
||||
void CVegetableEditor::snapToGroundVegetableLandscape(bool enable)
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace NLQT
|
|||
|
||||
CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent)
|
||||
: QGroupBox(parent),
|
||||
_emit(true)
|
||||
_emit(true)
|
||||
{
|
||||
_ui.setupUi(this);
|
||||
|
||||
|
|
Loading…
Reference in a new issue