diff --git a/code/nel/tools/3d/object_viewer_qt/data/object_viewer.cfg b/code/nel/tools/3d/object_viewer_qt/data/object_viewer.cfg
deleted file mode 100644
index ae0c72e4b..000000000
--- a/code/nel/tools/3d/object_viewer_qt/data/object_viewer.cfg
+++ /dev/null
@@ -1,29 +0,0 @@
-RootConfigFilename = "object_viewer_default.cfg";
-SearchPaths = {
- "/mnt/disk_d/NEL3D/texture", "/mnt/disk_d/NEL3D/SFX/maps", "/mnt/disk_d/NEL3D/Database_proto/Stuff/fyros/agent/actors/_textures"
-};
-GraphicsEnabled = 1;
-SoundEnabled = 1;
-GraphicsDriver = "OpenGL";
-SoundDriver = "OpenAL";
-SoundDevice = "";
-LanguageCode = "en";
-QtStyle = "";
-FontName = "andbasr.ttf";
-FontShadow = 1;
-BackgroundColor = {
- 98, 98, 98
-};
-FogStart = 0.0000000000;
-FogEnd = 10.0000000000;
-FogColor = {
- 88, 88, 88
-};
-SoundAutoLoadSample = 1;
-SoundMaxTrack = 48;
-SoundEnableOccludeObstruct = 1;
-SoundEnableReverb = 1;
-SoundManualRolloff = 1;
-SoundUseADPCM = 0;
-SoundForceSoftware = 0;
-CameraFocal = 75.0000000000;
diff --git a/code/nel/tools/3d/object_viewer_qt/data/object_viewer_default.cfg b/code/nel/tools/3d/object_viewer_qt/data/object_viewer_default.cfg
deleted file mode 100644
index 350001aeb..000000000
--- a/code/nel/tools/3d/object_viewer_qt/data/object_viewer_default.cfg
+++ /dev/null
@@ -1,156 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Config file for Object Viewer Qt ////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//
-// This file is used to setup the Object Viewer tool.
-//
-
-
-//////////////////////////////////////////////////////////////////////////////
-// NeL Qt ////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-// Root directory where we can find the client datas (zones, tiles, maps, ...)
-// You must uncomment this line on GNU/Linux and comment the next one
-//SearchPaths = { "/usr/local/share/games/nel_qt/" };
-SearchPaths = { "data" };
-
-// Which extensions to remap to what if needed (pairs of 2)
-RemapExtensions = { "png", "tga", "dds", "tga"};
-
-
-// The language code of the client
-LanguageCode = "en";
-
-// If changes to the config should be saved on exit
-SaveConfig = 1;
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Qt ////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-QtStyle = "Cleanlooks";
-QtPalette = 0;
-QtWindowState = "";
-QtWindowGeometry = "";
-
-//////////////////////////////////////////////////////////////////////////////
-// Graphics //////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-// Use OpenGL or Direct3D (Windows)
-GraphicsEnabled = 1;
-GraphicsDrivers = { "OpenGL", "Direct3D" };
-GraphicsDriver = "OpenGL";
-
-// Resolution of the screen
-// ScreenWidth = 1360;
-// ScreenHeight = 768;
-// ScreenDepth = 32;
-
-// If 1, run in fullscreen mode, 0 for windowed
-// Fullscreen = 0;
-
-// Font name used for all text in the client (it can be a .ttf, .fon, .pfb)
-FontName = "andbasr.ttf";
-FontShadow = 1;
-
-// Background color
-BackgroundColor = { 151, 156, 182 };
-
-// Bloom effect
-BloomEffect = 1;
-BloomSquare = 1;
-BloomDensity = 120;
-
-// Path where screenshots are saved
-ScreenshotName = "nel_qt";
-ScreenshotJPG = 1;
-ScreenshotPNG = 1;
-ScreenshotTGA = 0;
-ScreenshotPath = "screenshots";
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Environment ///////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-CameraFocal = 75.0;
-
-SunDirection = { -2.935, +0.107, -1.22 };
-SunAmbient = { 190, 170, 150 };
-SunDiffuse = { 255, 248, 255 };
-SunSpecular = { 255, 255, 255};
-
-// 1 if you want to see the fog
-FogEnable = 1;
-FogStart = 100.0; // in meter
-FogEnd = 250.0; // in meter
-FogColor = { 129, 136, 205 }; // { 147, 125, 114 };
-
-/////////////////////////////////////////////////////////////
-//// Vegetable Landscape Setup (for vegetable edition) //////
-/////////////////////////////////////////////////////////////
-
-VegetTileBank = ""; // this is optional, but obligatory for Vegetable Edit to work properly
-VegetTileFarBank = ""; // this is optional, but obligatory for Vegetable Edit to work properly
-VegetLandscapeZones = // this is optional, but obligatory for Vegetable Edit to work properly
-{
-"WARNING: Delete this string" // NOT DELETE
-};
-
-VegetLandscapeThreshold = 0.01; // this is optional
-VegetLandscapeTileNear = 50.0; // this is optional
-VegetLandscapeAmbient = {17, 54, 100, 255} ; // this is optional
-VegetLandscapeDiffuse = {241, 226, 244, 255} ; // this is optional
-VegetLandscapeSnapHeight = 1.70; // this is optional
-VegetLandscapeMultiply = 1.5;
-
-// veget setup
-VegetTexture = ""; // this is optional, but important for Vegetable Edit to behave properly
-VegetAmbient = {80, 80, 80}; // this is optional
-VegetDiffuse = {255, 255, 255}; // this is optional. NB: works like veget_landscape_diffuse (ie maxLightFactor possible)
-VegetLightDir = {0.0, 1.0, -1.0}; // this is optional
-VegetWindDir = {1.0, 1.0, 0.0}; // this is optional
-VegetWindFreq = 0.5; // this is optional
-VegetWindPower = 5.0; // this is optional
-VegetWindBendMin = 0.5; // this is optional
-
-//////////////////////////////////////////////////////////////////////////////
-// Time //////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-FpsSmoothing = 64;
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Sound /////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-// The sound driver, choose between "Auto", "FMod", "DSound" and "OpenAl"
-SoundEnabled = 1;
-SoundDrivers = { "Auto", "OpenAL", "XAudio2", "FMod", "DSound" };
-SoundDriver = "OpenAL";
-SoundDevice = "";
-SoundMaxTrack = 48;
-SoundEnableOccludeObstruct = 1;
-SoundEnableReverb = 1;
-SoundManualRolloff = 1;
-SoundUseADPCM = 0;
-SoundForceSoftware = 0;
-SoundAutoLoadSample = 1;
-
-SoundPackedSheetPath = "/home/timon/sound";
-SoundSamplePath = "/home/timon/sound";
-
-//////////////////////////////////////////////////////////////////////////////
-// Interface /////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-// Debug HUD /////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-// end of file
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 8b85d58a7..fc2e0736b 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
@@ -71,7 +71,7 @@ public:
virtual void extensionsInitialized() = 0;
/**
- @\brief Called during a shutdown sequence in the same order as initialization
+ @brief Called during a shutdown sequence in the same order as initialization
before the plugins get deleted in reverse order.
@details This method should be used to disconnect from other plugins,
@@ -80,7 +80,7 @@ public:
virtual void shutdown() { }
/**
- @\brief This method should be implemented to work properly NeL singletons.
+ @brief This method should be implemented to work properly NeL singletons.
Called immediately after loading the plugin.
@code
void Plugin::setNelContext(NLMISC::INelContext *nelContext)
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp
index dbd738b28..4bd80a616 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp
@@ -54,7 +54,7 @@ void MenuManager::registerAction(QAction *action, const QString &id)
QMenu *MenuManager::menu(const QString &id) const
{
QMenu *result = 0;
- if (_menuMap.count(id) == 0)
+ if (!_menuMap.contains(id))
nlwarning("QMenu %s not found", id.toStdString().c_str());
else
result = _menuMap.value(id);
@@ -64,7 +64,7 @@ QMenu *MenuManager::menu(const QString &id) const
QAction *MenuManager::action(const QString &id) const
{
QAction *result = 0;
- if (_actionMap.count(id) == 0)
+ if (!_actionMap.contains(id))
nlwarning("QAction %s not found", id.toStdString().c_str());
else
result = _actionMap.value(id);
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp
index ead8451f0..7f85a17df 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp
@@ -31,6 +31,8 @@
namespace Core
{
+QString lastDir = ".";
+
CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent)
: IOptionsPage(parent),
m_page(0)
@@ -104,13 +106,14 @@ void CSearchPathsSettingsPage::applySearchPaths()
void CSearchPathsSettingsPage::addPath()
{
- QString newPath = QFileDialog::getExistingDirectory(m_page);
+ QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir);
if (!newPath.isEmpty())
{
QListWidgetItem *newItem = new QListWidgetItem;
newItem->setText(newPath);
newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
m_ui.pathsListWidget->addItem(newItem);
+ lastDir = newPath;
}
checkEnabledButton();
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.cpp
deleted file mode 100644
index a8d50dfa8..000000000
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2010 by authors
- *
- * This file is part of NEL QT.
- * NEL QT is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * NEL QT is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with NEL QT; see the file COPYING. If not, see
- * .
- */
-
-#include "stdpch.h"
-#include "callback.h"
-
-namespace NLQT
-{
-
-} /* namespace NLQT */
-
-/* end of file */
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.h
deleted file mode 100644
index 85c4d1c6e..000000000
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/callback.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (C) 2010 by authors
- *
- * This file is part of NEL QT.
- * NEL QT is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * NEL QT is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with NEL QT; see the file COPYING. If not, see
- * .
- */
-
-#ifndef NLQT_CALLBACK_H
-#define NLQT_CALLBACK_H
-#include
-
-// STL includes
-
-// NeL includes
-#ifdef NL_COMP_GCC
-// temporary fix for GCC 4.4 segmentation fault
-# undef nlassert
-# define nlassert(x)
-#else
-# include
-#endif // NL_COMP_GCC
-
-// Project includes
-
-namespace NLQT
-{
-
-#define NLQT_CALLBACK_TEMPLATE \
-/** \
- * \brief NLQT_CALLBACK_ARGS_CLASS \
- * \date 2009-03-03 18:09GMT \
- * \author Jan Boon (Kaetemi) \
- * Awesome callback template \
- */ \
-template \
-class NLQT_CALLBACK_ARGS_CLASS \
-{ \
- /* Very simple reference counting callback base */ \
- class CCallbackBase \
- { \
- public: \
- CCallbackBase() : m_RefCount(0) \
- { \
- \
- } \
- \
- virtual ~CCallbackBase() \
- { \
- nlassert(!m_RefCount); \
- } \
- \
- void refAdd() \
- { \
- ++m_RefCount; \
- } \
- \
- void refRemove() \
- { \
- --m_RefCount; \
- if (!m_RefCount) \
- delete this; \
- } \
- \
- virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) = 0; \
- \
- virtual bool equals(const CCallbackBase *callbackBase) = 0; \
- \
- /* disable copy */ \
- CCallbackBase(const CCallbackBase &); \
- CCallbackBase &operator=(const CCallbackBase &); \
- \
- private: \
- uint m_RefCount; \
- }; \
- \
- typedef TReturn TCallbackFunction(NLQT_CALLBACK_ARGS_DECL); \
- class CCallbackFunction : public CCallbackBase \
- { \
- public: \
- CCallbackFunction(TCallbackFunction *callbackFunction) : m_CallbackFunction(callbackFunction) \
- { \
- nlassert(m_CallbackFunction); \
- } \
- \
- virtual ~CCallbackFunction() \
- { \
- m_CallbackFunction = NULL; \
- } \
- \
- virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) \
- { \
- return m_CallbackFunction(NLQT_CALLBACK_ARGS_IMPL); \
- } \
- \
- virtual bool equals(const CCallbackBase *callbackBase) \
- { \
- const CCallbackFunction *callbackFunction = \
- dynamic_cast(callbackBase); \
- if (!callbackFunction) return false; \
- return m_CallbackFunction == callbackFunction->m_CallbackFunction; \
- } \
- \
- private: \
- TCallbackFunction *m_CallbackFunction; \
- }; \
- \
- template \
- class CCallbackMethod : public CCallbackBase \
- { \
- typedef TReturn (TClass::*TCallbackMethod)(NLQT_CALLBACK_ARGS_DECL); \
- public: \
- CCallbackMethod(TClass *callbackObject, TCallbackMethod callbackMethod) : m_CallbackObject(callbackObject), m_CallbackMethod(callbackMethod) \
- { \
- nlassert(m_CallbackObject); \
- nlassert(m_CallbackMethod); \
- } \
- \
- virtual ~CCallbackMethod() \
- { \
- m_CallbackObject = NULL; \
- m_CallbackMethod = NULL; \
- } \
- \
- virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) \
- { \
- return (m_CallbackObject->*m_CallbackMethod)(NLQT_CALLBACK_ARGS_IMPL); \
- } \
- \
- virtual bool equals(const CCallbackBase *callbackBase) \
- { \
- const CCallbackMethod *callbackMethod = \
- dynamic_cast(callbackBase); \
- if (!callbackMethod) return false; \
- return m_CallbackObject == callbackMethod->m_CallbackObject \
- && m_CallbackMethod == callbackMethod->m_CallbackMethod; \
- } \
- \
- private: \
- TClass *m_CallbackObject; \
- TCallbackMethod m_CallbackMethod; \
- }; \
- \
-public: \
- CCallback() : m_CallbackBase(NULL) \
- { \
- \
- } \
- \
- CCallback(TCallbackFunction *callbackFunction) : m_CallbackBase(new CCallbackFunction(callbackFunction)) \
- { \
- nlassert(m_CallbackBase); \
- m_CallbackBase->refAdd(); \
- } \
- \
- template \
- CCallback(TClass *callbackObject, TReturn (TClass::*callbackMethod)(NLQT_CALLBACK_ARGS_DECL)) : m_CallbackBase(new CCallbackMethod(callbackObject, callbackMethod)) \
- { \
- nlassert(m_CallbackBase); \
- m_CallbackBase->refAdd(); \
- } \
- \
- CCallback(const CCallback &callback) \
- { \
- m_CallbackBase = callback.m_CallbackBase; \
- if (m_CallbackBase) \
- m_CallbackBase->refAdd(); \
- } \
- \
- CCallback &operator=(const CCallback &callback) \
- { \
- if (m_CallbackBase != callback.m_CallbackBase) \
- { \
- if (m_CallbackBase) \
- m_CallbackBase->refRemove(); \
- m_CallbackBase = callback.m_CallbackBase; \
- if (m_CallbackBase) \
- m_CallbackBase->refAdd(); \
- } \
- return *this; \
- } \
- \
- ~CCallback() \
- { \
- if (m_CallbackBase) \
- { \
- m_CallbackBase->refRemove(); \
- m_CallbackBase = NULL; \
- } \
- } \
- \
- TReturn callback(NLQT_CALLBACK_ARGS_DECL) \
- { \
- nlassert(m_CallbackBase); \
- return m_CallbackBase->callback(NLQT_CALLBACK_ARGS_IMPL); \
- } \
- \
- TReturn operator()(NLQT_CALLBACK_ARGS_DECL) \
- { \
- nlassert(m_CallbackBase); \
- return m_CallbackBase->callback(NLQT_CALLBACK_ARGS_IMPL); \
- } \
- \
- bool valid() const \
- { \
- return m_CallbackBase != NULL; \
- } \
- \
- operator bool() const \
- { \
- return m_CallbackBase != NULL; \
- } \
- \
- bool operator==(const CCallback &callback) \
- { \
- return m_CallbackBase->equals(callback.m_CallbackBase); \
- } \
- \
-private: \
- CCallbackBase *m_CallbackBase; \
- \
-}; /* class CCallback */ \
-
-template
-class CCallback;
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME
-#define NLQT_CALLBACK_ARGS_DECL
-#define NLQT_CALLBACK_ARGS_IMPL
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA
-#define NLQT_CALLBACK_ARGS_IMPL argsA
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB
-#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC
-#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD
-#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE
-#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF
-#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-
-#define NLQT_CALLBACK_ARGS_CLASS CCallback
-#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF, typename TArgsG
-#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF, TArgsG argsG
-#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF, argsG
-NLQT_CALLBACK_TEMPLATE
-#undef NLQT_CALLBACK_ARGS_CLASS
-#undef NLQT_CALLBACK_ARGS_TYPENAME
-#undef NLQT_CALLBACK_ARGS_DECL
-#undef NLQT_CALLBACK_ARGS_IMPL
-#undef NLQT_CALLBACK_ARGS_CLASSNAME
-
-#undef NLQT_CALLBACK_TEMPLATE
-
-typedef CCallback CEmptyCallback;
-
-} /* namespace NLQT */
-
-#endif /* #ifndef NLQT_CALLBACK_H */
-
-/* end of file */
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.cpp
deleted file mode 100644
index 8fd118252..000000000
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- Object Viewer Qt
- Copyright (C) 2010 Dzmitry Kamiahin
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-*/
-
-#include "stdpch.h"
-#include "configuration.h"
-
-// NeL includes
-#include
-#include
-#include
-#include
-
-#include "modules.h"
-
-using namespace std;
-using namespace NLMISC;
-
-namespace NLQT
-{
-
-CConfiguration::CConfiguration()
-{
-
-}
-
-CConfiguration::~CConfiguration()
-{
-
-}
-
-void CConfiguration::init()
-{
- nldebug("CConfiguration::init");
-
- // verify data
- nlassert(!ConfigCallbacks.size());
-
- // load config
- try
- {
- ConfigFile.load(NLQT_CONFIG_FILE);
- }
- catch(...)
- {
- nlerror("Error opening files object_viewer.cfg or object_viewer_default.cfg. Check this files");
- }
- // setup config file callback
- Modules::config().setCallback("SearchPaths", CConfigCallback(this, &CConfiguration::cfcbSearchPaths));
-
-}
-
-void CConfiguration::release()
-{
- nldebug("CConfiguration::release");
-
- Modules::config().dropCallback("SearchPaths");
-
- // save and release the config file
- if (ConfigFile.exists("SaveConfig") && ConfigFile.getVarPtr("SaveConfig")->asBool())
- {
- ConfigFile.save();
- }
- ConfigFile.clear();
-
- // release the search paths etc
- CPath::releaseInstance();
-
- // verify data
- nlassert(!ConfigCallbacks.size());
-}
-
-void CConfiguration::updateUtilities()
-{
- //H_AUTO2
- CConfigFile::checkConfigFiles();
-}
-
-void CConfiguration::configSearchPaths()
-{
- cfcbSearchPaths(Modules::config().getConfigFile().getVar("SearchPaths"));
-}
-
-void CConfiguration::configRemapExtensions()
-{
- CConfigFile::CVar *var;
- var = ConfigFile.getVarPtr("RemapExtensions");
- uint varsize = var->size();
- for (uint i = 0; i < varsize; i += 2)
- CPath::remapExtension(var->asString(i), var->asString(i + 1), true);
-}
-
-void CConfiguration::setAndCallback(const std::string &varName, CConfigCallback configCallback)
-{
- ConfigCallbacks[varName] = configCallback;
- ConfigFile.setCallback(varName, cbConfigCallback);
- configCallback(*ConfigFile.getVarPtr(varName));
-}
-
-void CConfiguration::setCallback(const std::string &varName, CConfigCallback configCallback)
-{
- ConfigCallbacks[varName] = configCallback;
- ConfigFile.setCallback(varName, cbConfigCallback);
-}
-
-void CConfiguration::dropCallback(const std::string &varName)
-{
- ConfigFile.setCallback(varName, NULL);
- ConfigCallbacks.erase(varName);
-}
-
-float CConfiguration::getValue(const string &varName, float defaultValue)
-{
- if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asFloat();
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsDouble((double)defaultValue);
- ConfigFile.insertVar(varName, varToCopy);
- return defaultValue;
-}
-
-double CConfiguration::getValue(const string &varName, double defaultValue)
-{
- if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asDouble();
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsDouble(defaultValue);
- ConfigFile.insertVar(varName, varToCopy);
- return defaultValue;
-}
-
-int CConfiguration::getValue(const string &varName, int defaultValue)
-{
- if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asInt();
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsInt(defaultValue);
- ConfigFile.insertVar(varName, varToCopy);
- return defaultValue;
-}
-
-string CConfiguration::getValue(const string &varName, const string &defaultValue)
-{
- if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asString();
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsString(defaultValue);
- ConfigFile.insertVar(varName, varToCopy);
- return defaultValue;
-}
-
-ucstring CConfiguration::getValue(const string &varName, const ucstring &defaultValue)
-{
- if (ConfigFile.exists(varName)) return ucstring::makeFromUtf8(ConfigFile.getVar(varName).asString());
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsString(defaultValue.toUtf8());
- ConfigFile.insertVar(varName, varToCopy);
- return defaultValue;
-}
-
-bool CConfiguration::getValue(const string &varName, bool defaultValue)
-{
- if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asBool();
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsInt(defaultValue ? 1 : 0);
- ConfigFile.insertVar(varName, varToCopy);
- return defaultValue;
-}
-
-CRGBA CConfiguration::getValue(const string &varName, const CRGBA &defaultValue)
-{
- if (ConfigFile.exists(varName))
- {
- return getValue(ConfigFile.getVar(varName), defaultValue);
- }
- else
- {
- // create a new value only if one doesn't exist
- CConfigFile::CVar varToCopy;
- varToCopy.forceAsInt(defaultValue.R);
- varToCopy.setAsInt(defaultValue.G, 1);
- varToCopy.setAsInt(defaultValue.B, 2);
- varToCopy.setAsInt(defaultValue.A, 3);
- ConfigFile.insertVar(varName, varToCopy);
- }
- return defaultValue;
-}
-
-CRGBA CConfiguration::getValue(const CConfigFile::CVar &var, const CRGBA &defaultValue)
-{
- if (var.size() >= 3)
- {
- if (var.size() > 4)
- nlwarning("RGBA value in config value '%s' is too long, ignoring unused values");
- return CRGBA((uint8)var.asInt(0), (uint8)var.asInt(1), (uint8)var.asInt(2), var.size() >= 4 ? (uint8)var.asInt(3) : 255);
- }
- nlwarning("Invalid RGBA value in config value '%s', reverting to default { %i, %i, %i, %i }", var.Name.c_str(), (sint)defaultValue.R, (sint)defaultValue.G, (sint)defaultValue.B, (sint)defaultValue.A);
- return defaultValue;
-}
-
-void CConfiguration::cbConfigCallback(NLMISC::CConfigFile::CVar &var)
-{
- Modules::config().ConfigCallbacks[var.Name](var);
-}
-
-void CConfiguration::cfcbSearchPaths(NLMISC::CConfigFile::CVar &var)
-{
- uint varsize = var.size();
- for (uint i = 0; i < varsize; ++i)
- CPath::addSearchPath(var.asString(i), false, false);
-}
-
-} /* namespace NLQT */
\ No newline at end of file
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.h
deleted file mode 100644
index 985bc6630..000000000
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/configuration.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Object Viewer Qt
- Copyright (C) 2010 Dzmitry Kamiahin
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-*/
-
-#ifndef CONFIGURATION_H
-#define CONFIGURATION_H
-
-#include
-
-// STL includes
-#include