Core: remove unused helper functions

Change-Id: I74ef89648f42f0016ad7cdfc61e17a712ea145ff
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2021-06-17 13:11:55 +02:00
parent aa4b926f02
commit 0fb40e204b
2 changed files with 4 additions and 30 deletions

View File

@@ -571,39 +571,15 @@ void DocumentManager::checkForNewFileName()
}
/*!
Returns a guaranteed cleaned absolute file path for \a filePath in portable form.
Returns a guaranteed cleaned absolute file path for \a filePath.
Resolves symlinks if \a resolveMode is ResolveLinks.
*/
QString DocumentManager::cleanAbsoluteFilePath(const QString &filePath, ResolveMode resolveMode)
{
QFileInfo fi(QDir::fromNativeSeparators(filePath));
if (fi.exists() && resolveMode == ResolveLinks) {
// if the filePath is no link, we want this method to return the same for both ResolveModes
// so wrap with absoluteFilePath because that forces drive letters upper case
return QFileInfo(fi.canonicalFilePath()).absoluteFilePath();
}
return QDir::cleanPath(fi.absoluteFilePath());
}
/*!
Returns a representation of \a filePath that can be used as a key for maps.
It is a cleaned absolute file path in portable form, that is all lowercase
if the file system is case insensitive in the host OS settings.
Resolves symlinks if \a resolveMode is ResolveLinks.
*/
QString DocumentManager::filePathKey(const QString &filePath, ResolveMode resolveMode)
{
QString s = cleanAbsoluteFilePath(filePath, resolveMode);
if (HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive)
s = s.toLower();
return s;
}
FilePath DocumentManager::filePathKey(const Utils::FilePath &filePath, ResolveMode resolveMode)
{
const FilePath &result = filePath.absoluteFilePath().cleanPath();
if (resolveMode == ResolveLinks)
return filePath.canonicalPath().absoluteFilePath();
return filePath.absoluteFilePath();
return result.canonicalPath();
return result;
}
/*!

View File

@@ -76,8 +76,6 @@ public:
static void saveSettings();
// helper functions
static QString cleanAbsoluteFilePath(const QString &filePath, ResolveMode resolveMode);
static QString filePathKey(const QString &filePath, ResolveMode resolveMode);
static Utils::FilePath filePathKey(const Utils::FilePath &filePath, ResolveMode resolveMode);
static bool saveDocument(IDocument *document,