Ref T103, verify important files/directories

* utility function in CDirectoryUtils
* deployed in main/application
This commit is contained in:
Klaus Basan
2017-07-07 19:31:15 +02:00
committed by Mathew Sutcliffe
parent d25be35868
commit 07b096b398
9 changed files with 68 additions and 16 deletions

View File

@@ -327,6 +327,34 @@ namespace BlackMisc
return dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
}
QStringList CDirectoryUtils::verifyRuntimeDirectoriesAndFiles()
{
QStringList failed;
QDir d(CDirectoryUtils::binDirectory());
if (!d.isReadable()) { failed.append(d.absolutePath()); }
d = QDir(CDirectoryUtils::imagesDirectory());
if (!d.isReadable()) { failed.append(d.absolutePath()); }
d = QDir(CDirectoryUtils::stylesheetsDirectory());
if (!d.isReadable()) { failed.append(d.absolutePath()); }
d = QDir(CDirectoryUtils::applicationDataDirectory());
if (!d.isReadable()) { failed.append(d.absolutePath()); }
// check if the executables are avialable
QString fn = CDirectoryUtils::executableFilePath(CBuildConfig::swiftCoreExecutableName());
if (!QFile::exists(fn)) { failed.append(fn); }
fn = CDirectoryUtils::executableFilePath(CBuildConfig::swiftDataExecutableName());
if (!QFile::exists(fn)) { failed.append(fn); }
fn = CDirectoryUtils::executableFilePath(CBuildConfig::swiftGuiExecutableName());
if (!QFile::exists(fn)) { failed.append(fn); }
return failed;
}
QSet<QString> CDirectoryUtils::fileNamesToQSet(const QFileInfoList &fileInfoList)
{
QSet<QString> sl;