Yip I'm aware of that. I guess exists() uses the file system's case sensitivity. I need to check it on Windows since I generate scripts that's run on a Linux machine. The easiest way I could come up with its:
bool FirmwareCore::FileModel::caseSensitiveExists() const {
// Only do it if it says it exists;
// exists() is a normal exists on QFileInfo
if (exists()) {
// Check the directory where the file is located:
// fileInfo() below is a normal QFileInfo object.
QDir parent_dir
= fileInfo
().
dir();
return parent_dir.entryList().contains(fileName(),Qt::CaseSensitive);
} else
return false;
}
bool FirmwareCore::FileModel::caseSensitiveExists() const {
// Only do it if it says it exists;
// exists() is a normal exists on QFileInfo
if (exists()) {
// Check the directory where the file is located:
// fileInfo() below is a normal QFileInfo object.
QDir parent_dir = fileInfo().dir();
return parent_dir.entryList().contains(fileName(),Qt::CaseSensitive);
} else
return false;
}
To copy to clipboard, switch view to plain text mode
Bookmarks