Changed: #1193 code cleanup.

This commit is contained in:
dnk-88 2011-02-12 18:11:23 +02:00
parent 8b03a1d829
commit d8d5269f98
16 changed files with 79 additions and 76 deletions

View file

@ -27,7 +27,7 @@
namespace NLMISC
{
class INelContext;
class INelContext;
}
namespace ExtensionSystem

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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;
}

View file

@ -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)

View file

@ -30,7 +30,7 @@ namespace NLQT
CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent)
: QGroupBox(parent),
_emit(true)
_emit(true)
{
_ui.setupUi(this);