mirror of
https://github.com/leozide/leocad
synced 2025-01-18 22:26:44 +01:00
Removed strlwr.
This commit is contained in:
parent
d1991b9264
commit
aa1d802c04
3 changed files with 10 additions and 21 deletions
|
@ -46,7 +46,6 @@
|
|||
char* strcasestr(const char *s, const char *find);
|
||||
#else
|
||||
char* strupr(char* string);
|
||||
char* strlwr(char* string);
|
||||
#endif
|
||||
|
||||
// Version number.
|
||||
|
|
|
@ -1352,18 +1352,16 @@ void lcPiecesLibrary::GetPieceFile(const char* PieceName, std::function<void(lcF
|
|||
{
|
||||
lcDiskFile IncludeFile;
|
||||
|
||||
auto LoadIncludeFile = [&IncludeFile, PieceName, this](const char* Folder)
|
||||
auto LoadIncludeFile = [&IncludeFile, PieceName, this](const QLatin1String& Folder)
|
||||
{
|
||||
char IncludeFileName[LC_MAXPATH];
|
||||
sprintf(IncludeFileName, Folder, PieceName);
|
||||
IncludeFile.SetFileName(mLibraryDir.absoluteFilePath(QLatin1String(IncludeFileName)));
|
||||
const QString IncludeFileName = Folder + PieceName;
|
||||
IncludeFile.SetFileName(mLibraryDir.absoluteFilePath(IncludeFileName));
|
||||
if (IncludeFile.Open(QIODevice::ReadOnly))
|
||||
return true;
|
||||
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_LINUX)
|
||||
// todo: instead of using strlwr, search the parts/primitive lists and get the file name from there
|
||||
strlwr(IncludeFileName);
|
||||
IncludeFile.SetFileName(mLibraryDir.absoluteFilePath(QLatin1String(IncludeFileName)));
|
||||
// todo: search the parts/primitive lists and get the file name from there instead of using toLower
|
||||
IncludeFile.SetFileName(mLibraryDir.absoluteFilePath(IncludeFileName.toLower()));
|
||||
return IncludeFile.Open(QIODevice::ReadOnly);
|
||||
#else
|
||||
return false;
|
||||
|
@ -1372,18 +1370,18 @@ void lcPiecesLibrary::GetPieceFile(const char* PieceName, std::function<void(lcF
|
|||
|
||||
if (mHasUnofficial)
|
||||
{
|
||||
Found = LoadIncludeFile("unofficial/parts/%s");
|
||||
Found = LoadIncludeFile(QLatin1String("unofficial/parts/"));
|
||||
|
||||
if (!Found)
|
||||
Found = LoadIncludeFile("unofficial/p/%s");
|
||||
Found = LoadIncludeFile(QLatin1String("unofficial/p/"));
|
||||
}
|
||||
|
||||
if (!Found)
|
||||
{
|
||||
Found = LoadIncludeFile("parts/%s");
|
||||
Found = LoadIncludeFile(QLatin1String("parts/"));
|
||||
|
||||
if (!Found)
|
||||
Found = LoadIncludeFile("p/%s");
|
||||
Found = LoadIncludeFile(QLatin1String("p/"));
|
||||
}
|
||||
|
||||
if (Found)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "lc_global.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
char* strcasestr(const char *s, const char *find)
|
||||
{
|
||||
|
@ -33,12 +33,4 @@ char* strupr(char *string)
|
|||
return string;
|
||||
}
|
||||
|
||||
char* strlwr(char *string)
|
||||
{
|
||||
for (char *c = string; *c; c++)
|
||||
*c = tolower(*c);
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue