mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-07 18:15:51 +08:00
Ref T103, verify important files/directories
* utility function in CDirectoryUtils * deployed in main/application
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d25be35868
commit
07b096b398
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user