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 LEVELDESIGN_PATH = "LevelDesignPath";
const char * const ASSETS_PATH = "AssetsPath";
const char * const REMAP_EXTENSIONS = "RemapExtensions";
//resources
const char * const ICON_NEL = ":/core/images/nel.png";

View file

@ -92,17 +92,20 @@ void CSearchPathsSettingsPage::finish()
void CSearchPathsSettingsPage::applySearchPaths()
{
QStringList paths;
QStringList paths, remapExt;
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList();
remapExt = settings->value(Core::Constants::REMAP_EXTENSIONS).toStringList();
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)
{
NLMISC::CPath::addSearchPath(path.toStdString(), false, false);
}
NLMISC::CPath::remapExtension("png", "tga", true);
NLMISC::CPath::remapExtension("png", "dds", true);
}
void CSearchPathsSettingsPage::addPath()

View file

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