Avoid long "hanging" if Windows UNC path is not reachable

Use own "isDirExisting" function checking UNC paths
This commit is contained in:
Klaus Basan
2018-03-08 18:48:14 +01:00
parent 32196f5e8e
commit 42ef7c5633
8 changed files with 120 additions and 13 deletions

View File

@@ -157,8 +157,8 @@ namespace BlackMisc
QStringList CXPlaneUtil::pluginSubdirectories(const QString &pluginDir)
{
const QString dirName = pluginDir.isEmpty() ? xplaneRootDir() : pluginDir;
if (!CDirectoryUtils::isDirExisting(dirName)) { return QStringList(); }
const QDir dir(dirName);
if (!dir.exists()) { return QStringList(); }
return dir.entryList(QDir::Dirs, QDir::Name | QDir::IgnoreCase);
}
@@ -180,7 +180,7 @@ namespace BlackMisc
if (!rootDir.isEmpty())
{
const QString xswiftbusDir = CFileUtils::appendFilePathsAndFixUnc(CXPlaneUtil::pluginDirFromRootDir(xplaneRootDir), CXPlaneUtil::xswiftbusPathName());
if (QDir(xswiftbusDir).exists())
if (CDirectoryUtils::isDirExisting(xswiftbusDir))
{
return xswiftbusDir;
}
@@ -197,7 +197,7 @@ namespace BlackMisc
if (!rootDir.isEmpty())
{
const QString xswiftbusLegacy = CFileUtils::appendFilePathsAndFixUnc(xplaneRootDir, legacyPath);
if (QDir(xswiftbusLegacy).exists())
if (CDirectoryUtils::isDirExisting(xswiftbusLegacy))
{
return xswiftbusLegacy;
}