Fixed: #1193 Settings of "remap extensions" loads from settings file.

This commit is contained in:
dnk-88 2011-05-21 01:54:20 +03:00
parent 65eaa95bf8
commit d612e6fdfb
6 changed files with 11 additions and 6 deletions

View file

@ -78,6 +78,7 @@ const char * const SEARCH_PATHS = "SearchPaths";
const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes";
const char * const LEVELDESIGN_PATH = "LevelDesignPath"; const char * const LEVELDESIGN_PATH = "LevelDesignPath";
const char * const ASSETS_PATH = "AssetsPath"; const char * const ASSETS_PATH = "AssetsPath";
const char * const REMAP_EXTENSIONS = "RemapExtensions";
//resources //resources
const char * const ICON_NEL = ":/core/images/nel.png"; const char * const ICON_NEL = ":/core/images/nel.png";

View file

@ -92,17 +92,20 @@ void CSearchPathsSettingsPage::finish()
void CSearchPathsSettingsPage::applySearchPaths() void CSearchPathsSettingsPage::applySearchPaths()
{ {
QStringList paths; QStringList paths, remapExt;
QSettings *settings = Core::ICore::instance()->settings(); QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::DATA_PATH_SECTION); settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList();
remapExt = settings->value(Core::Constants::REMAP_EXTENSIONS).toStringList();
settings->endGroup(); settings->endGroup();
for (int i = 1; i < remapExt.size(); i += 2)
NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true);
Q_FOREACH(QString path, paths) Q_FOREACH(QString path, paths)
{ {
NLMISC::CPath::addSearchPath(path.toStdString(), false, false); NLMISC::CPath::addSearchPath(path.toStdString(), false, false);
} }
NLMISC::CPath::remapExtension("png", "tga", true);
NLMISC::CPath::remapExtension("png", "dds", true);
} }
void CSearchPathsSettingsPage::addPath() void CSearchPathsSettingsPage::addPath()

View file

@ -49,6 +49,7 @@ public:
void apply(); void apply();
void finish(); void finish();
// Set of the search paths(not recursive) and the remap extensions (loading from settings file)
void applySearchPaths(); void applySearchPaths();
private Q_SLOTS: private Q_SLOTS:

View file

@ -38,7 +38,7 @@ QNLWidget::QNLWidget(QWidget *parent)
m_initialized(false), m_initialized(false),
m_interval(25) m_interval(25)
{ {
setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_PaintOnScreen);
setMouseTracking(true); setMouseTracking(true);

View file

@ -49,7 +49,7 @@ namespace NLQT
CGraphicsViewport::CGraphicsViewport(QWidget *parent) CGraphicsViewport::CGraphicsViewport(QWidget *parent)
: QNLWidget(parent) : QNLWidget(parent)
{ {
setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_PaintOnScreen);
} }

View file

@ -226,7 +226,7 @@ void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index)
_treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL); _treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL);
_currentItem = static_cast<CParticleTreeItem *>(index.internalPointer()); _currentItem = static_cast<CParticleTreeItem *>(index.internalPointer());
if (_currentItem == 0) if (_currentItem == 0)
return; return;