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

@@ -18,6 +18,7 @@
#include <QSet>
#include <QString>
#include <QDateTime>
#include <QDir>
#include <QFileInfoList>
namespace BlackMisc
@@ -144,6 +145,14 @@ namespace BlackMisc
//! Get the existing directories
static QStringList getExistingUnemptyDirectories(const QStringList &directories);
//! Directory existing? Also checking UNC paths upfront.
//! \remark Motivation: if an UNC cannot be accessed (e.g. machine is down) it can take very long before functions like QDir respond
//! \remark for non-UNC paths it is the same as the QDir checks
//! @{
static bool isDirExisting(const QString &path);
static bool isDirExisting(const QDir &dir);
//! @}
//! Result of directory comparison
struct DirComparison
{