From 0fb40e204b65df38a840cd81e13e5e695d6a3978 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 17 Jun 2021 13:11:55 +0200 Subject: [PATCH] Core: remove unused helper functions Change-Id: I74ef89648f42f0016ad7cdfc61e17a712ea145ff Reviewed-by: Eike Ziller --- src/plugins/coreplugin/documentmanager.cpp | 32 +++------------------- src/plugins/coreplugin/documentmanager.h | 2 -- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 0597e488239..a168c345296 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -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; } /*! diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index 7aa85d8c91d..d9b78c47639 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -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,