mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T253, utility functions to support UNC
This commit is contained in:
@@ -114,6 +114,11 @@ namespace BlackMisc
|
||||
return QDir::cleanPath(path1 + QChar('/') + path2);
|
||||
}
|
||||
|
||||
QString CFileUtils::appendFilePathsAndFixUnc(const QString &path1, const QString &path2)
|
||||
{
|
||||
return CFileUtils::fixWindowsUncPath(appendFilePaths(path1, path2));
|
||||
}
|
||||
|
||||
QString CFileUtils::stripFileFromPath(const QString &path)
|
||||
{
|
||||
if (path.endsWith('/')) { return path; }
|
||||
@@ -126,6 +131,11 @@ namespace BlackMisc
|
||||
return CFileUtils::appendFilePaths(CFileUtils::appendFilePaths(path1, path2), path3);
|
||||
}
|
||||
|
||||
QString CFileUtils::appendFilePathsAndFixUnc(const QString &path1, const QString &path2, const QString &path3)
|
||||
{
|
||||
return CFileUtils::fixWindowsUncPath(CFileUtils::appendFilePaths(CFileUtils::appendFilePaths(path1, path2), path3));
|
||||
}
|
||||
|
||||
bool CFileUtils::copyRecursively(const QString &sourceDir, const QString &destinationDir)
|
||||
{
|
||||
QFileInfo sourceFileInfo(sourceDir);
|
||||
|
||||
@@ -67,13 +67,21 @@ namespace BlackMisc
|
||||
//! \sa CNetworkUtils::buildUrl for URLs
|
||||
static QString appendFilePaths(const QString &path1, const QString &path2);
|
||||
|
||||
//! Strip file from path a/b/c.json a/b
|
||||
static QString stripFileFromPath(const QString &path);
|
||||
//! Append file paths
|
||||
//! \sa CNetworkUtils::buildUrl for URLs
|
||||
static QString appendFilePathsAndFixUnc(const QString &path1, const QString &path2);
|
||||
|
||||
//! Append file paths
|
||||
//! \sa CNetworkUtils::buildUrl for URLs
|
||||
static QString appendFilePaths(const QString &path1, const QString &path2, const QString &path3);
|
||||
|
||||
//! Append file paths
|
||||
//! \sa CNetworkUtils::buildUrl for URLs
|
||||
static QString appendFilePathsAndFixUnc(const QString &path1, const QString &path2, const QString &path3);
|
||||
|
||||
//! Strip file from path a/b/c.json a/b
|
||||
static QString stripFileFromPath(const QString &path);
|
||||
|
||||
//! If `sourceDir` is a directory, copies it recursively, so that `sourceDir` becomes `destinationDir`.
|
||||
//! If it is a file, just copies the file.
|
||||
static bool copyRecursively(const QString &sourceDir, const QString &destinationDir);
|
||||
|
||||
@@ -567,7 +567,7 @@ namespace BlackMisc
|
||||
|
||||
const QString CXPlaneSimulatorSettings::getPluginDirOrDefault() const
|
||||
{
|
||||
return CFileUtils::appendFilePaths(this->getSimulatorDirectoryOrDefault(), CXPlaneUtil::xplanePluginPath());
|
||||
return CFileUtils::appendFilePathsAndFixUnc(this->getSimulatorDirectoryOrDefault(), CXPlaneUtil::xplanePluginPath());
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user