mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +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;
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace BlackMisc
|
||||
//! \remark In BlackMisc so it can also be used from BlackMisc classes
|
||||
static const QString &logDirectory();
|
||||
|
||||
//! Directory for log files
|
||||
//! Directory for crashpad files
|
||||
static const QString &crashpadDirectory();
|
||||
|
||||
//! Virtually the inverse operation of CDirectoryUtils::normalizedApplicationDirectory
|
||||
@@ -109,6 +109,9 @@ namespace BlackMisc
|
||||
//! All sub directories of given dir
|
||||
static QStringList getSubDirectories(const QString &rootDir);
|
||||
|
||||
//! Check if the (most important) runtime directories are available
|
||||
static QStringList verifyRuntimeDirectoriesAndFiles();
|
||||
|
||||
//! Result of directory comparison
|
||||
struct DirComparison
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user