From d8c55e73be04d7bca6c46605536f26849ade11fb Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Sat, 12 Feb 2011 18:11:23 +0200 Subject: [PATCH] Changed: #1193 code cleanup. --- .../src/extension_system/iplugin.h | 16 ++++++------- .../src/extension_system/iplugin_manager.h | 8 +++---- .../src/extension_system/iplugin_spec.h | 18 +++++++------- .../src/extension_system/plugin_manager.cpp | 14 +++++------ .../src/extension_system/plugin_manager.h | 12 +++++----- .../tools/3d/object_viewer_qt/src/main.cpp | 4 ++-- .../src/particle_workspace_page.h | 2 +- .../src/plugins/core/core_plugin.cpp | 6 ++--- .../src/plugins/core/core_plugin.h | 5 +++- .../src/plugins/example/plugin1.cpp | 8 +++---- .../object_viewer_qt/src/settings_dialog.cpp | 10 ++++---- .../src/tail_particle_widget.cpp | 16 ++++++------- .../object_viewer_qt/src/tune_mrm_dialog.cpp | 6 ++--- .../object_viewer_qt/src/vegetable_editor.cpp | 24 +++++++++---------- .../src/vegetable_noise_value_widget.cpp | 4 ++-- .../src/vegetable_noise_value_widget.h | 2 +- 16 files changed, 79 insertions(+), 76 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h index 3d7e24028..1f878cc32 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h @@ -25,20 +25,20 @@ #include "iplugin_manager.h" -namespace NLMISC +namespace NLMISC { - class INelContext; +class INelContext; } namespace ExtensionSystem { /** -@interface IPlugin -@brief Base class for all plugins. -@details The IPlugin class is an abstract class that must be implemented -once for each plugin. The IPlugin implementation must be exported and -made known to Qt's plugin system via the Q_EXPORT_PLUGIN macro, +@interface IPlugin +@brief Base class for all plugins. +@details The IPlugin class is an abstract class that must be implemented +once for each plugin. The IPlugin implementation must be exported and +made known to Qt's plugin system via the Q_EXPORT_PLUGIN macro, see the Qt documentation for details on that. */ class IPlugin @@ -50,7 +50,7 @@ public: virtual void extensionsInitialized() = 0; virtual void shutdown() { } - virtual void setNelContext(NLMISC::INelContext *nelContext) = 0; + virtual void setNelContext(NLMISC::INelContext *nelContext) = 0; virtual QString name() const = 0; virtual QString version() const = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h index 4874d6b47..0cde19d0a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h @@ -54,10 +54,10 @@ public: virtual QStringList getPluginPaths() const = 0; virtual void setPluginPaths(const QStringList &paths) = 0; virtual QList plugins() const = 0; - - // Settings - virtual void setSettings(QSettings *settings) = 0; - virtual QSettings *settings() const = 0; + + // Settings + virtual void setSettings(QSettings *settings) = 0; + virtual QSettings *settings() const = 0; Q_SIGNALS: void objectAdded(QObject *obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h index a27b76cd0..020183cc1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h @@ -26,10 +26,10 @@ namespace ExtensionSystem { class IPlugin; class IPluginManager; - -/** -@struct State -@details The plugin goes through several steps while being loaded. + +/** +@struct State +@details The plugin goes through several steps while being loaded. The state gives a hint on what went wrong in case of an error. */ struct State @@ -47,11 +47,11 @@ struct State }; /** -@interface IPluginSpec -@brief Interface for plugin spec contains the information of the plugins and -information about the plugin's current state. -@details The plugin spec is also filled with more information as the plugin -goes through its loading process (see State). +@interface IPluginSpec +@brief Interface for plugin spec contains the information of the plugins and +information about the plugin's current state. +@details The plugin spec is also filled with more information as the plugin +goes through its loading process (see State). If an error occurs, the plugin spec is the place to look for the error details. */ class IPluginSpec diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index b6e70fdf5..921f14fbe 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -95,8 +95,8 @@ void CPluginManager::loadPlugins() setPluginState(spec, State::Initialized); QListIterator 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 it(_pluginSpecs); - it.toBack(); - while (it.hasPrevious()) + QListIterator it(_pluginSpecs); + it.toBack(); + while (it.hasPrevious()) { - setPluginState(it.previous(), State::Deleted); - } + setPluginState(it.previous(), State::Deleted); + } } }; // namespace NLQT \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h index eeef76836..97698b14e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h @@ -50,12 +50,12 @@ public: virtual QStringList getPluginPaths() const; virtual void setPluginPaths(const QStringList &paths); virtual QList plugins() const; - - // Settings - virtual void setSettings(QSettings *settings); - virtual QSettings *settings() const; - void readSettings(); - void writeSettings(); + + // Settings + virtual void setSettings(QSettings *settings); + virtual QSettings *settings() const; + void readSettings(); + void writeSettings(); private: void setPluginState(CPluginSpec *spec, int destState); diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index b97e07c0a..3eb2049d3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -117,9 +117,9 @@ sint main(int argc, char **argv) #endif Modules::init(); - QSettings *settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, + QSettings *settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, QLatin1String("Ryzom Core"), QLatin1String("ObjectViewerQt")); - + Modules::plugMan().setSettings(settings); // load and set remap extensions from config diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h index c533e8325..b29945b9a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h @@ -36,7 +36,7 @@ namespace NLQT /** @class CWorkspacePage -@brief Page for QStackWidget, to particles workspace operation (new/load/save workspace, +@brief Page for QStackWidget, to particles workspace operation (new/load/save workspace, create/insert/remove all particles system to workspace) */ class CWorkspacePage: public QWidget diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp index fc30b3ce3..a681d8975 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -49,7 +49,7 @@ bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QStr void CorePlugin::extensionsInitialized() { _pluginView = new ExtensionSystem::CPluginView(_plugMan); - + // for old ovqt QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); if (wnd) @@ -63,7 +63,7 @@ void CorePlugin::extensionsInitialized() QAction *newAction = toolsMenu->addAction(tr("New settings")); QAction *newAction2 = helpMenu->addAction(tr("About plugins")); newAction->setIcon(QIcon(Constants::ICON_SETTINGS)); - + connect(newAction, SIGNAL(triggered()), this, SLOT(execSettings())); connect(newAction2, SIGNAL(triggered()), _pluginView, SLOT(show())); oldOVQT = true; @@ -94,7 +94,7 @@ void CorePlugin::extensionsInitialized() void CorePlugin::shutdown() { if (!oldOVQT) - { + { delete _mainWindow; delete _pluginView; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h index 252b6549a..0695a0acf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h @@ -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 QList getObjects() const diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index b77be4892..a8974478e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -71,16 +71,16 @@ QList 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; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp index 3e35bf855..c41d59a68 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp @@ -59,7 +59,7 @@ CSettingsDialog::CSettingsDialog(QWidget *parent) connect(ui.removeToolButton, SIGNAL(clicked()), this, SLOT(removePath())); connect(ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); connect(ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); - + connect(ui.tileBankToolButton, SIGNAL(clicked()), this, SLOT(setTileBank())); connect(ui.tileFarBankToolButton, SIGNAL(clicked()), this, SLOT(setTileFarBank())); connect(ui.vegetTexToolButton, SIGNAL(clicked()), this, SLOT(setTextureVegetable())); @@ -341,9 +341,9 @@ void CSettingsDialog::saveGraphicsSettings() QApplication::setStyle(QStyleFactory::create(ui.styleComboBox->currentText())); - if (ui.paletteCheckBox->isChecked()) - QApplication::setPalette(QApplication::style()->standardPalette()); - else + if (ui.paletteCheckBox->isChecked()) + QApplication::setPalette(QApplication::style()->standardPalette()); + else QApplication::setPalette(Modules::mainWin().getOriginalPalette()); } @@ -384,7 +384,7 @@ void CSettingsDialog::saveVegetableSettings() std::string str = ui.zonesListWidget->item(i)->text().toStdString(); list.push_back(str); } - + Modules::config().getConfigFile().getVar("VegetLandscapeZones").Type = NLMISC::CConfigFile::CVar::T_STRING; Modules::config().getConfigFile().getVar("VegetLandscapeZones").setAsString(list); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp index d08b991be..39ef9164c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp @@ -126,15 +126,15 @@ void CTailParticleWidget::setRibbonOrientation(int index) } bool CTailParticleWidget::eventFilter(QObject *object, QEvent *event) -{ - if( event->type() == QEvent::Paint ) - { +{ + if( event->type() == QEvent::Paint ) + { QPainter painter(_ui.graphicsWidget); painter.setRenderHint(QPainter::Antialiasing, true); painter.setBrush(QBrush(Qt::white)); painter.setPen(QPen(Qt::black, 2, Qt::SolidLine)); - painter.drawRoundedRect(QRect(3, 3, _ui.graphicsWidget->width() - 6, _ui.graphicsWidget->height() - 6), 3.0, 3.0); - + painter.drawRoundedRect(QRect(3, 3, _ui.graphicsWidget->width() - 6, _ui.graphicsWidget->height() - 6), 3.0, 3.0); + painter.setPen(QPen(Qt::red, 2, Qt::SolidLine)); painter.scale(0.86, 0.86); painter.translate(6, 6); @@ -167,9 +167,9 @@ bool CTailParticleWidget::eventFilter(QObject *object, QEvent *event) int((_ui.graphicsWidget->height() / 2.0) * (1 - verts[0].y)), int((_ui.graphicsWidget->width() / 2.0) * (1 + verts[verts.size() - 1].x)), int((_ui.graphicsWidget->height() / 2.0) * (1 - verts[verts.size() - 1].y))); - } - } - } + } + } + } return QWidget::eventFilter(object, event); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp index 33088a064..ac58736bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp @@ -24,7 +24,7 @@ #include // Project includes -#include "modules.h" +#include "modules.h" const int sliderStepSize = 5000; @@ -47,8 +47,8 @@ CTuneMRMDialog::~CTuneMRMDialog() } void CTuneMRMDialog::setMaxValue(int value) -{ - int actualMaxValue = value * sliderStepSize; +{ + int actualMaxValue = value * sliderStepSize; int actualValue = float(actualMaxValue) * _ui.currentValueSlider->value() / _ui.currentValueSlider->maximum(); _ui.currentValueSlider->setMaximum(actualMaxValue); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp index 6cddfd90d..492bc101b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp @@ -315,30 +315,30 @@ void CVegetableEditor::setVegetableWindPower(float w) { _VegetableWindPower= w; if(_VegetableLandscape) - _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, - _VegetableWindFreq, - _VegetableWindPower, - _VegetableWindBendMin); + _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, + _VegetableWindFreq, + _VegetableWindPower, + _VegetableWindBendMin); } void CVegetableEditor::setVegetableWindBendStart(float w) { _VegetableWindBendMin= w; if(_VegetableLandscape) - _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, - _VegetableWindFreq, - _VegetableWindPower, - _VegetableWindBendMin); + _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, + _VegetableWindFreq, + _VegetableWindPower, + _VegetableWindBendMin); } void CVegetableEditor::setVegetableWindFrequency(float w) { _VegetableWindFreq= w; if(_VegetableLandscape) - _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, - _VegetableWindFreq, - _VegetableWindPower, - _VegetableWindBendMin); + _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, + _VegetableWindFreq, + _VegetableWindPower, + _VegetableWindBendMin); } void CVegetableEditor::snapToGroundVegetableLandscape(bool enable) diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp index 20bad2067..3a605a5bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp @@ -29,8 +29,8 @@ namespace NLQT { CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent) - : QGroupBox(parent), - _emit(true) + : QGroupBox(parent), + _emit(true) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h index 87467e775..752c9afb9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h @@ -43,7 +43,7 @@ public: void setDefaultRangeAbs(float defRangeMin, float defRangeMax); void setDefaultRangeRand(float defRangeMin, float defRangeMax); void setDefaultRangeFreq(float defRangeMin, float defRangeMax); - + Q_SIGNALS: void noiseValueChanged(const NLMISC::CNoiseValue &value);