Utils: Rename FileName to FilePath

More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-05-28 13:49:26 +02:00
parent 4704f49fbb
commit 473a741c9f
688 changed files with 3487 additions and 3484 deletions

View File

@@ -301,10 +301,10 @@ void ClangDiagnosticManager::generateFixItAvailableMarkers()
static void addTask(const ClangBackEnd::DiagnosticContainer &diagnostic, bool isChild = false)
{
using namespace ProjectExplorer;
using ::Utils::FileName;
using ::Utils::FilePath;
Task::TaskType taskType = ProjectExplorer::Task::TaskType::Unknown;
FileName iconPath;
FilePath iconPath;
QIcon icon;
if (!isChild) {
@@ -325,7 +325,7 @@ static void addTask(const ClangBackEnd::DiagnosticContainer &diagnostic, bool is
TaskHub::addTask(Task(taskType,
Utils::diagnosticCategoryPrefixRemoved(diagnostic.text.toString()),
FileName::fromString(diagnostic.location.filePath.toString()),
FilePath::fromString(diagnostic.location.filePath.toString()),
diagnostic.location.line,
Constants::TASK_CATEGORY_DIAGNOSTICS,
icon,
@@ -452,7 +452,7 @@ void ClangDiagnosticManager::addClangTextMarks(
m_clangTextMarks.erase(it, m_clangTextMarks.end());
delete mark;
};
auto textMark = new ClangTextMark(::Utils::FileName::fromString(filePath()),
auto textMark = new ClangTextMark(::Utils::FilePath::fromString(filePath()),
diagnostic,
onMarkRemoved,
m_fullVisualization);

View File

@@ -159,7 +159,7 @@ static ::Utils::ProcessLinkCallback extendedCallback(::Utils::ProcessLinkCallbac
};
}
static bool isSameInvocationContext(const Utils::FileName &filePath)
static bool isSameInvocationContext(const Utils::FilePath &filePath)
{
return TextEditor::BaseTextEditor::currentTextEditor()->editorWidget()->isVisible()
&& Core::EditorManager::currentDocument()->filePath() == filePath;

View File

@@ -154,7 +154,7 @@ void ClangModelManagerSupport::onCurrentEditorChanged(Core::IEditor *editor)
if (!editor || !editor->document() || !cppModelManager()->isCppEditor(editor))
return;
const ::Utils::FileName filePath = editor->document()->filePath();
const ::Utils::FilePath filePath = editor->document()->filePath();
if (auto processor = ClangEditorDocumentProcessor::get(filePath.toString()))
processor->generateTaskHubIssues();
}

View File

@@ -209,7 +209,7 @@ void disableDiagnosticInCurrentProjectConfig(const ClangBackEnd::DiagnosticConta
} // anonymous namespace
ClangTextMark::ClangTextMark(const FileName &fileName,
ClangTextMark::ClangTextMark(const FilePath &fileName,
const ClangBackEnd::DiagnosticContainer &diagnostic,
const RemovedFromEditorHandler &removedHandler,
bool fullVisualization)

View File

@@ -40,7 +40,7 @@ class ClangTextMark : public TextEditor::TextMark
public:
using RemovedFromEditorHandler = std::function<void(ClangTextMark *)>;
ClangTextMark(const ::Utils::FileName &fileName,
ClangTextMark(const ::Utils::FilePath &fileName,
const ClangBackEnd::DiagnosticContainer &diagnostic,
const RemovedFromEditorHandler &removedHandler,
bool fullVisualization);

View File

@@ -301,11 +301,11 @@ QString diagnosticCategoryPrefixRemoved(const QString &text)
return text;
}
static ::Utils::FileName compilerPath(const CppTools::ProjectPart &projectPart)
static ::Utils::FilePath compilerPath(const CppTools::ProjectPart &projectPart)
{
ProjectExplorer::Target *target = projectPart.project->activeTarget();
if (!target)
return ::Utils::FileName();
return ::Utils::FilePath();
ProjectExplorer::ToolChain *toolchain = ProjectExplorer::ToolChainKitAspect::toolChain(
target->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
@@ -313,15 +313,15 @@ static ::Utils::FileName compilerPath(const CppTools::ProjectPart &projectPart)
return toolchain->compilerCommand();
}
static ::Utils::FileName buildDirectory(const ProjectExplorer::Project &project)
static ::Utils::FilePath buildDirectory(const ProjectExplorer::Project &project)
{
ProjectExplorer::Target *target = project.activeTarget();
if (!target)
return ::Utils::FileName();
return ::Utils::FilePath();
ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration();
if (!buildConfig)
return ::Utils::FileName();
return ::Utils::FilePath();
return buildConfig->buildDirectory();
}
@@ -356,7 +356,7 @@ static QStringList projectPartArguments(const ProjectPart &projectPart)
return args;
}
static QJsonObject createFileObject(const ::Utils::FileName &buildDir,
static QJsonObject createFileObject(const ::Utils::FilePath &buildDir,
const QStringList &arguments,
const ProjectPart &projectPart,
const ProjectFile &projFile)
@@ -388,7 +388,7 @@ static QJsonObject createFileObject(const ::Utils::FileName &buildDir,
GenerateCompilationDbResult generateCompilationDB(CppTools::ProjectInfo projectInfo)
{
const ::Utils::FileName buildDir = buildDirectory(*projectInfo.project());
const ::Utils::FilePath buildDir = buildDirectory(*projectInfo.project());
QTC_ASSERT(!buildDir.isEmpty(), return GenerateCompilationDbResult(QString(),
QCoreApplication::translate("ClangUtils", "Could not retrieve build directory.")));

View File

@@ -42,7 +42,7 @@ class ProjectInfo;
}
namespace Utils {
class FileName;
class FilePath;
}
namespace ClangBackEnd { class TokenInfoContainer; }