Merge with develop
This commit is contained in:
parent
52301431e4
commit
1c8dff239d
2 changed files with 9 additions and 16 deletions
|
@ -41,7 +41,7 @@ IF(MFC_FOUND)
|
||||||
LINK_DIRECTORIES(${MFC_LIBRARY_DIR})
|
LINK_DIRECTORIES(${MFC_LIBRARY_DIR})
|
||||||
|
|
||||||
# Set definitions for using MFC in DLL
|
# Set definitions for using MFC in DLL
|
||||||
SET(MFC_DEFINITIONS -D_AFXDLL)
|
SET(MFC_DEFINITIONS -D_AFXDLL -DUNICODE -D_UNICODE)
|
||||||
|
|
||||||
# Set CMake flag to use MFC DLL
|
# Set CMake flag to use MFC DLL
|
||||||
SET(CMAKE_MFC_FLAG 2)
|
SET(CMAKE_MFC_FLAG 2)
|
||||||
|
|
|
@ -493,32 +493,25 @@ void CZoneBank::reset ()
|
||||||
_Selection.clear ();
|
_Selection.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
bool CZoneBank::initFromPath(const std::string &sPathName, std::string &error)
|
bool CZoneBank::initFromPath(const std::string &sPathName, std::string &error)
|
||||||
{
|
{
|
||||||
char sDirBackup[512];
|
std::vector<std::string> files;
|
||||||
GetCurrentDirectory (512, sDirBackup);
|
NLMISC::CPath::getPathContent(sPathName, false, false, true, files);
|
||||||
SetCurrentDirectory (sPathName.c_str());
|
|
||||||
WIN32_FIND_DATA findData;
|
|
||||||
HANDLE hFind;
|
|
||||||
hFind = FindFirstFile ("*.ligozone", &findData);
|
|
||||||
|
|
||||||
while (hFind != INVALID_HANDLE_VALUE)
|
for (uint i = 0, len = files.size(); i < len; ++i)
|
||||||
{
|
{
|
||||||
// If the name of the file is not . or .. then its a valid entry in the DataBase
|
std::string ext = NLMISC::CFile::getExtension(files[i]);
|
||||||
if (!((strcmp (findData.cFileName, ".") == 0) || (strcmp (findData.cFileName, "..") == 0)))
|
|
||||||
|
if (ext == "ligozone")
|
||||||
{
|
{
|
||||||
if (!addElement (findData.cFileName, error))
|
if (!addElement(NLMISC::CFile::getFilename(files[i]), error))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (FindNextFile (hFind, &findData) == 0)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
SetCurrentDirectory (sDirBackup);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // NL_OS_WINDOWS
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
bool CZoneBank::addElement (const std::string &elementName, std::string &error)
|
bool CZoneBank::addElement (const std::string &elementName, std::string &error)
|
||||||
|
|
Loading…
Reference in a new issue