mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-14 11:19:07 +00:00
Fixed: #1193 Settings of "remap extensions" loads from settings file.
This commit is contained in:
parent
5b4c5204c7
commit
00ea8b5a24
6 changed files with 11 additions and 6 deletions
|
@ -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";
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue