Kaydet (Commit) 5244a49b authored tarafından Markus Mohrhard's avatar Markus Mohrhard

updater: find all the language update files

Change-Id: I5261d8d96f83b8b81b0dc2576cbd9241705ae9b7
üst ebeb76f0
......@@ -2556,13 +2556,39 @@ static int
GetUpdateFileNames(std::vector<tstring> fileNames)
{
NS_tchar fileName[MAXPATHLEN];
// TODO: moggi: needs adaption for LibreOffice
// We would like to store the name inside of an ini file
NS_tsnprintf(fileName, MAXPATHLEN,
NS_T("%s/update.mar"), gPatchDirPath);
fileNames.push_back(fileName);
// add the language packs
NS_tDIR* dir = NS_topendir(gPatchDirPath);
if (!dir)
{
LOG(("Could not open directory " LOG_S, gPatchDirPath));
return READ_ERROR;
}
NS_tdirent* entry;
while ((entry = NS_treaddir(dir)) != nullptr)
{
if (NS_tstrcmp(entry->d_name, NS_T(".")) &&
NS_tstrcmp(entry->d_name, NS_T("..")))
{
if (NS_tstrncmp(entry->d_name, NS_T("update"), 6) == 0)
{
char *dot = strrchr(entry->d_name, '.');
if (dot && !strcmp(dot, ".mar"))
{
NS_tchar updatePath[MAXPATHLEN];
NS_tsnprintf(updatePath, sizeof(updatePath)/sizeof(updatePath[0]),
NS_T("%s/%s"), gPatchDirPath, entry->d_name);
LOG (("Found language update file: " LOG_S, updatePath));
fileNames.push_back(updatePath);
}
}
}
}
return OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment