forked from qt-creator/qt-creator
Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -93,7 +93,7 @@ CppcheckOptions ManualRunDialog::options() const
|
||||
return result;
|
||||
}
|
||||
|
||||
Utils::FilePathList ManualRunDialog::filePaths() const
|
||||
Utils::FilePaths ManualRunDialog::filePaths() const
|
||||
{
|
||||
return m_model->selectedFiles();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
namespace Utils {
|
||||
class FilePath;
|
||||
using FilePathList = QList<FilePath>;
|
||||
using FilePaths = QList<FilePath>;
|
||||
} // namespace Utils
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
const ProjectExplorer::Project *project);
|
||||
|
||||
CppcheckOptions options() const;
|
||||
Utils::FilePathList filePaths() const;
|
||||
Utils::FilePaths filePaths() const;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -77,10 +77,10 @@ void CppcheckRunner::reconfigure(const QString &binary, const QString &arguments
|
||||
m_arguments = arguments;
|
||||
}
|
||||
|
||||
void CppcheckRunner::addToQueue(const Utils::FilePathList &files,
|
||||
void CppcheckRunner::addToQueue(const Utils::FilePaths &files,
|
||||
const QString &additionalArguments)
|
||||
{
|
||||
Utils::FilePathList &existing = m_queue[additionalArguments];
|
||||
Utils::FilePaths &existing = m_queue[additionalArguments];
|
||||
if (existing.isEmpty()) {
|
||||
existing = files;
|
||||
} else {
|
||||
@@ -96,7 +96,7 @@ void CppcheckRunner::addToQueue(const Utils::FilePathList &files,
|
||||
m_queueTimer.start();
|
||||
}
|
||||
|
||||
void CppcheckRunner::stop(const Utils::FilePathList &files)
|
||||
void CppcheckRunner::stop(const Utils::FilePaths &files)
|
||||
{
|
||||
if (!m_isRunning)
|
||||
return;
|
||||
@@ -105,7 +105,7 @@ void CppcheckRunner::stop(const Utils::FilePathList &files)
|
||||
m_process->kill();
|
||||
}
|
||||
|
||||
void CppcheckRunner::removeFromQueue(const Utils::FilePathList &files)
|
||||
void CppcheckRunner::removeFromQueue(const Utils::FilePaths &files)
|
||||
{
|
||||
if (m_queue.isEmpty())
|
||||
return;
|
||||
@@ -121,7 +121,7 @@ void CppcheckRunner::removeFromQueue(const Utils::FilePathList &files)
|
||||
}
|
||||
}
|
||||
|
||||
const Utils::FilePathList &CppcheckRunner::currentFiles() const
|
||||
const Utils::FilePaths &CppcheckRunner::currentFiles() const
|
||||
{
|
||||
return m_currentFiles;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ void CppcheckRunner::checkQueued()
|
||||
if (m_queue.isEmpty() || m_binary.isEmpty())
|
||||
return;
|
||||
|
||||
Utils::FilePathList files = m_queue.begin().value();
|
||||
Utils::FilePaths files = m_queue.begin().value();
|
||||
QString arguments = m_arguments + ' ' + m_queue.begin().key();
|
||||
m_currentFiles.clear();
|
||||
int argumentsLength = arguments.length();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
namespace Utils {
|
||||
class QtcProcess;
|
||||
class FilePath;
|
||||
using FilePathList = QList<FilePath>;
|
||||
using FilePaths = QList<FilePath>;
|
||||
}
|
||||
|
||||
namespace Cppcheck {
|
||||
@@ -48,12 +48,12 @@ public:
|
||||
~CppcheckRunner() override;
|
||||
|
||||
void reconfigure(const QString &binary, const QString &arguments);
|
||||
void addToQueue(const Utils::FilePathList &files,
|
||||
void addToQueue(const Utils::FilePaths &files,
|
||||
const QString &additionalArguments = {});
|
||||
void removeFromQueue(const Utils::FilePathList &files);
|
||||
void stop(const Utils::FilePathList &files = {});
|
||||
void removeFromQueue(const Utils::FilePaths &files);
|
||||
void stop(const Utils::FilePaths &files = {});
|
||||
|
||||
const Utils::FilePathList ¤tFiles() const;
|
||||
const Utils::FilePaths ¤tFiles() const;
|
||||
QString currentCommand() const;
|
||||
|
||||
private:
|
||||
@@ -67,8 +67,8 @@ private:
|
||||
Utils::QtcProcess *m_process = nullptr;
|
||||
QString m_binary;
|
||||
QString m_arguments;
|
||||
QHash<QString, Utils::FilePathList> m_queue;
|
||||
Utils::FilePathList m_currentFiles;
|
||||
QHash<QString, Utils::FilePaths> m_queue;
|
||||
Utils::FilePaths m_currentFiles;
|
||||
QTimer m_queueTimer;
|
||||
int m_maxArgumentsLength = 32767;
|
||||
bool m_isRunning = false;
|
||||
|
||||
@@ -45,7 +45,7 @@ void CppcheckTextMarkManager::add(const Diagnostic &diagnostic)
|
||||
fileMarks.push_back(std::make_unique<CppcheckTextMark>(diagnostic));
|
||||
}
|
||||
|
||||
void CppcheckTextMarkManager::clearFiles(const Utils::FilePathList &files)
|
||||
void CppcheckTextMarkManager::clearFiles(const Utils::FilePaths &files)
|
||||
{
|
||||
if (m_marks.empty())
|
||||
return;
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
~CppcheckTextMarkManager() override;
|
||||
|
||||
void add(const Diagnostic &diagnostic) override;
|
||||
void clearFiles(const Utils::FilePathList &files);
|
||||
void clearFiles(const Utils::FilePaths &files);
|
||||
|
||||
private:
|
||||
using MarkPtr = std::unique_ptr<CppcheckTextMark>;
|
||||
|
||||
@@ -181,11 +181,11 @@ const CppcheckOptions &CppcheckTool::options() const
|
||||
return m_options;
|
||||
}
|
||||
|
||||
void CppcheckTool::check(const Utils::FilePathList &files)
|
||||
void CppcheckTool::check(const Utils::FilePaths &files)
|
||||
{
|
||||
QTC_ASSERT(m_project, return);
|
||||
|
||||
Utils::FilePathList filtered;
|
||||
Utils::FilePaths filtered;
|
||||
if (m_filters.isEmpty()) {
|
||||
filtered = files;
|
||||
} else {
|
||||
@@ -208,7 +208,7 @@ void CppcheckTool::check(const Utils::FilePathList &files)
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<CppTools::ProjectPart::Ptr, Utils::FilePathList> groups;
|
||||
std::map<CppTools::ProjectPart::Ptr, Utils::FilePaths> groups;
|
||||
for (const Utils::FilePath &file : qAsConst(filtered)) {
|
||||
const QString stringed = file.toString();
|
||||
for (const CppTools::ProjectPart::Ptr &part : parts) {
|
||||
@@ -224,7 +224,7 @@ void CppcheckTool::check(const Utils::FilePathList &files)
|
||||
addToQueue(group.second, *group.first);
|
||||
}
|
||||
|
||||
void CppcheckTool::addToQueue(const Utils::FilePathList &files, CppTools::ProjectPart &part)
|
||||
void CppcheckTool::addToQueue(const Utils::FilePaths &files, CppTools::ProjectPart &part)
|
||||
{
|
||||
const QString key = part.id();
|
||||
if (!m_cachedAdditionalArguments.contains(key))
|
||||
@@ -232,7 +232,7 @@ void CppcheckTool::addToQueue(const Utils::FilePathList &files, CppTools::Projec
|
||||
m_runner->addToQueue(files, m_cachedAdditionalArguments[key]);
|
||||
}
|
||||
|
||||
void CppcheckTool::stop(const Utils::FilePathList &files)
|
||||
void CppcheckTool::stop(const Utils::FilePaths &files)
|
||||
{
|
||||
m_runner->removeFromQueue(files);
|
||||
m_runner->stop(files);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
namespace Utils {
|
||||
class FilePath;
|
||||
using FilePathList = QList<FilePath>;
|
||||
using FilePaths = QList<FilePath>;
|
||||
}
|
||||
|
||||
namespace CppTools {
|
||||
@@ -63,8 +63,8 @@ public:
|
||||
|
||||
void updateOptions(const CppcheckOptions &options);
|
||||
void setProject(ProjectExplorer::Project *project);
|
||||
void check(const Utils::FilePathList &files);
|
||||
void stop(const Utils::FilePathList &files);
|
||||
void check(const Utils::FilePaths &files);
|
||||
void stop(const Utils::FilePaths &files);
|
||||
|
||||
void startParsing();
|
||||
void parseOutputLine(const QString &line);
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
private:
|
||||
void updateArguments();
|
||||
void addToQueue(const Utils::FilePathList &files, CppTools::ProjectPart &part);
|
||||
void addToQueue(const Utils::FilePaths &files, CppTools::ProjectPart &part);
|
||||
QStringList additionalArguments(const CppTools::ProjectPart &part) const;
|
||||
|
||||
CppcheckDiagnosticManager &m_manager;
|
||||
|
||||
@@ -83,7 +83,7 @@ void CppcheckTrigger::checkEditors(const QList<Core::IEditor *> &editors)
|
||||
const QList<Core::IEditor *> editorList = !editors.isEmpty()
|
||||
? editors : Core::DocumentModel::editorsForOpenedDocuments();
|
||||
|
||||
Utils::FilePathList toCheck;
|
||||
Utils::FilePaths toCheck;
|
||||
for (const Core::IEditor *editor : editorList) {
|
||||
QTC_ASSERT(editor, continue);
|
||||
Core::IDocument *document = editor->document();
|
||||
@@ -128,7 +128,7 @@ void CppcheckTrigger::removeEditors(const QList<Core::IEditor *> &editors)
|
||||
const QList<Core::IEditor *> editorList = !editors.isEmpty()
|
||||
? editors : Core::DocumentModel::editorsForOpenedDocuments();
|
||||
|
||||
Utils::FilePathList toRemove;
|
||||
Utils::FilePaths toRemove;
|
||||
for (const Core::IEditor *editor : editorList) {
|
||||
QTC_ASSERT(editor, return);
|
||||
const Core::IDocument *document = editor->document();
|
||||
@@ -185,12 +185,12 @@ void CppcheckTrigger::updateProjectFiles(ProjectExplorer::Project *project)
|
||||
checkEditors(Core::DocumentModel::editorsForOpenedDocuments());
|
||||
}
|
||||
|
||||
void CppcheckTrigger::check(const Utils::FilePathList &files)
|
||||
void CppcheckTrigger::check(const Utils::FilePaths &files)
|
||||
{
|
||||
m_tool.check(files);
|
||||
}
|
||||
|
||||
void CppcheckTrigger::remove(const Utils::FilePathList &files)
|
||||
void CppcheckTrigger::remove(const Utils::FilePaths &files)
|
||||
{
|
||||
m_marks.clearFiles(files);
|
||||
m_tool.stop(files);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
namespace Utils {
|
||||
class FilePath;
|
||||
using FilePathList = QList<FilePath>;
|
||||
using FilePaths = QList<FilePath>;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -64,8 +64,8 @@ private:
|
||||
void checkChangedDocument(Core::IDocument *document);
|
||||
void changeCurrentProject(ProjectExplorer::Project *project);
|
||||
void updateProjectFiles(ProjectExplorer::Project *project);
|
||||
void check(const Utils::FilePathList &files);
|
||||
void remove(const Utils::FilePathList &files);
|
||||
void check(const Utils::FilePaths &files);
|
||||
void remove(const Utils::FilePaths &files);
|
||||
|
||||
CppcheckTextMarkManager &m_marks;
|
||||
CppcheckTool &m_tool;
|
||||
|
||||
Reference in New Issue
Block a user