QMakeProjectManagerPlugin: Limit the usage of qMakePair

Remove unneeded Utils:: scope.

Change-Id: I9d42aa2005214004b91686168e2bcaa420354a6c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2022-09-30 12:42:20 +02:00
parent 4857a58fdd
commit 43f3b70437
14 changed files with 100 additions and 105 deletions

View File

@@ -576,7 +576,7 @@ FileNode *FolderNode::fileNode(const Utils::FilePath &file) const
}));
}
QList<FolderNode*> FolderNode::folderNodes() const
QList<FolderNode *> FolderNode::folderNodes() const
{
QList<FolderNode *> result;
for (const std::unique_ptr<Node> &n : m_nodes) {

View File

@@ -23,6 +23,8 @@
#include <QTextStream>
#include <QVBoxLayout>
using namespace Utils;
namespace QmakeProjectManager::Internal {
const char qt_file_dialog_filter_reg_exp[] =
@@ -38,8 +40,8 @@ static QStringList qt_clean_filter_list(const QString &filter)
return f.split(QLatin1Char(' '), Qt::SkipEmptyParts);
}
static bool validateLibraryPath(const Utils::FilePath &filePath,
const Utils::PathChooser *pathChooser,
static bool validateLibraryPath(const FilePath &filePath,
const PathChooser *pathChooser,
QString *errorMessage)
{
Q_UNUSED(errorMessage)
@@ -49,7 +51,7 @@ static bool validateLibraryPath(const Utils::FilePath &filePath,
const QString fileName = filePath.fileName();
QRegularExpression::PatternOption option =
Utils::HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive
HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive
? QRegularExpression::CaseInsensitiveOption
: QRegularExpression::NoPatternOption;
@@ -63,8 +65,9 @@ static bool validateLibraryPath(const Utils::FilePath &filePath,
return false;
}
AddLibraryWizard::AddLibraryWizard(const Utils::FilePath &proFile, QWidget *parent) :
Utils::Wizard(parent), m_proFile(proFile)
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent)
: Wizard(parent)
, m_proFile(proFile)
{
setWindowTitle(Tr::tr("Add Library"));
m_libraryTypePage = new LibraryTypePage(this);
@@ -77,7 +80,7 @@ AddLibraryWizard::AddLibraryWizard(const Utils::FilePath &proFile, QWidget *pare
AddLibraryWizard::~AddLibraryWizard() = default;
Utils::FilePath AddLibraryWizard::proFile() const
FilePath AddLibraryWizard::proFile() const
{
return m_proFile;
}
@@ -147,7 +150,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
packageLabel->setAttribute(Qt::WA_MacSmallSize, true);
layout->addWidget(packageLabel);
if (Utils::HostOsInfo::isWindowsHost()) {
if (HostOsInfo::isWindowsHost()) {
m_packageRadio->setVisible(false);
packageLabel->setVisible(false);
}
@@ -155,7 +158,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
// select the default
m_internalRadio->setChecked(true);
setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Type"));
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Type"));
}
AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const
@@ -177,16 +180,16 @@ DetailsPage::DetailsPage(AddLibraryWizard *parent)
m_libraryDetailsWidget = new LibraryDetailsWidget(this);
resize(456, 438);
Utils::PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser;
PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser;
libPathChooser->setHistoryCompleter("Qmake.LibDir.History");
const auto pathValidator = [libPathChooser](Utils::FancyLineEdit *edit, QString *errorMessage) {
const auto pathValidator = [libPathChooser](FancyLineEdit *edit, QString *errorMessage) {
return libPathChooser->defaultValidationFunction()(edit, errorMessage)
&& validateLibraryPath(libPathChooser->filePath(),
libPathChooser, errorMessage);
};
libPathChooser->setValidationFunction(pathValidator);
setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Details"));
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Details"));
}
bool DetailsPage::isComplete() const
@@ -272,7 +275,7 @@ SummaryPage::SummaryPage(AddLibraryWizard *parent)
m_snippetLabel->setTextFormat(Qt::RichText);
m_snippetLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
}
void SummaryPage::initializePage()
@@ -302,17 +305,12 @@ QString SummaryPage::snippet() const
LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
{
includePathChooser = new Utils::PathChooser(parent);
includePathChooser = new PathChooser(parent);
packageLineEdit = new QLineEdit(parent);
libraryPathChooser = new Utils::PathChooser(parent);
libraryPathChooser = new PathChooser(parent);
libraryComboBox = new QComboBox(parent);
libraryTypeComboBox = new QComboBox(parent);
platformGroupBox = new QGroupBox(Tr::tr("Platform:"));
platformGroupBox->setFlat(true);
@@ -325,7 +323,6 @@ LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
winGroupBox = new QGroupBox(Tr::tr("Windows:"));
winGroupBox->setFlat(true);
linCheckBox = new QCheckBox(Tr::tr("Linux"));
linCheckBox->setChecked(true);
@@ -348,7 +345,7 @@ LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
addSuffixCheckBox = new QCheckBox(Tr::tr("Add \"d\" suffix for debug version"), winGroupBox);
removeSuffixCheckBox = new QCheckBox(Tr::tr("Remove \"d\" suffix for release version"), winGroupBox);
using namespace Utils::Layouting;
using namespace Layouting;
Column { linCheckBox, macCheckBox, winCheckBox, st }.attachTo(platformGroupBox);

View File

@@ -49,14 +49,14 @@ static QString linguistBinary(const QtSupport::QtVersion *qtVersion)
{
if (qtVersion)
return qtVersion->linguistFilePath().toString();
return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Linguist" : "linguist");
return QLatin1String(HostOsInfo::isMacHost() ? "Linguist" : "linguist");
}
static QString designerBinary(const QtSupport::QtVersion *qtVersion)
{
if (qtVersion)
return qtVersion->designerFilePath().toString();
return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Designer" : "designer");
return QLatin1String(HostOsInfo::isMacHost() ? "Designer" : "designer");
}
// Mac: Change the call 'Foo.app/Contents/MacOS/Foo <filelist>' to
@@ -80,7 +80,7 @@ static const char designerDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors",
static const char linguistDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Qt Linguist");
// -------------- ExternalQtEditor
ExternalQtEditor::ExternalQtEditor(Utils::Id id,
ExternalQtEditor::ExternalQtEditor(Id id,
const QString &displayName,
const QString &mimetype,
const CommandForQtVersion &commandForQtVersion)
@@ -101,7 +101,7 @@ ExternalQtEditor *ExternalQtEditor::createLinguistEditor()
ExternalQtEditor *ExternalQtEditor::createDesignerEditor()
{
if (Utils::HostOsInfo::isMacHost()) {
if (HostOsInfo::isMacHost()) {
return new ExternalQtEditor(designerIdC,
QLatin1String(designerDisplayName),
QLatin1String(ProjectExplorer::Constants::FORM_MIMETYPE),
@@ -124,7 +124,7 @@ static QString findFirstCommand(QVector<QtSupport::QtVersion *> qtVersions,
return QString();
}
bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
bool ExternalQtEditor::getEditorLaunchData(const FilePath &filePath,
LaunchData *data,
QString *errorMessage) const
{
@@ -156,7 +156,7 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
// fallback
if (data->binary.isEmpty()) {
const QString path = qtcEnvironmentVariable("PATH");
data->binary = Utils::QtcProcess::locateBinary(path, m_commandForQtVersion(nullptr));
data->binary = QtcProcess::locateBinary(path, m_commandForQtVersion(nullptr));
}
if (data->binary.isEmpty()) {
@@ -165,14 +165,14 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
}
// Setup binary + arguments, use Mac Open if appropriate
data->arguments.push_back(filePath.toString());
if (Utils::HostOsInfo::isMacHost())
if (HostOsInfo::isMacHost())
*data = createMacOpenCommand(*data);
if (debug)
qDebug() << Q_FUNC_INFO << '\n' << data->binary << data->arguments;
return true;
}
bool ExternalQtEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage)
bool ExternalQtEditor::startEditor(const FilePath &filePath, QString *errorMessage)
{
LaunchData data;
return getEditorLaunchData(filePath, &data, errorMessage)
@@ -215,7 +215,7 @@ void DesignerExternalEditor::processTerminated(const QString &binary)
socket->deleteLater();
}
bool DesignerExternalEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage)
bool DesignerExternalEditor::startEditor(const FilePath &filePath, QString *errorMessage)
{
LaunchData data;
// Find the editor binary

View File

@@ -480,8 +480,8 @@ void QmakeProjectManagerPlugin::testMakefileParser()
MakeFileParse parser("/tmp/something", MakeFileParse::Mode::FilterKnownConfigValues);
parser.parseCommandLine(command, project);
QCOMPARE(Utils::ProcessArgs::splitArgs(parser.unparsedArguments()),
Utils::ProcessArgs::splitArgs(unparsedArguments));
QCOMPARE(ProcessArgs::splitArgs(parser.unparsedArguments()),
ProcessArgs::splitArgs(unparsedArguments));
QCOMPARE(parser.effectiveBuildConfig({}), effectiveBuildConfig);
const QMakeStepConfig qmsc = parser.config();

View File

@@ -40,7 +40,7 @@ class ProFileEditorWidget : public TextEditorWidget
{
private:
void findLinkAt(const QTextCursor &,
const Utils::LinkHandler &processLinkCallback,
const LinkHandler &processLinkCallback,
bool resolveTarget = true,
bool inNextSplit = false) override;
void contextMenuEvent(QContextMenuEvent *) override;
@@ -207,7 +207,7 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor,
QDir dir(textDocument()->filePath().toFileInfo().absolutePath());
QString fileName = dir.filePath(buffer);
QFileInfo fi(fileName);
if (Utils::HostOsInfo::isWindowsHost() && fileName.startsWith("//")) {
if (HostOsInfo::isWindowsHost() && fileName.startsWith("//")) {
// Windows network paths are not supported here since checking for their existence can
// lock the gui thread. See: QTCREATORBUG-26579
} else if (fi.exists()) {
@@ -219,9 +219,9 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor,
else
return processLinkCallback(link);
}
link.targetFilePath = Utils::FilePath::fromString(QDir::cleanPath(fileName));
link.targetFilePath = FilePath::fromString(QDir::cleanPath(fileName));
} else {
link.targetFilePath = Utils::FilePath::fromString(checkForPrfFile(buffer));
link.targetFilePath = FilePath::fromString(checkForPrfFile(buffer));
}
if (!link.targetFilePath.isEmpty()) {
link.linkTextStart = cursor.position() - positionInBlock + beginPos + 1;
@@ -268,7 +268,7 @@ ProFileEditorFactory::ProFileEditorFactory()
completionAssistProvider->setDynamicCompletionFunction(&TextEditor::pathComplete);
setCompletionAssistProvider(completionAssistProvider);
setCommentDefinition(Utils::CommentDefinition::HashStyle);
setCommentDefinition(CommentDefinition::HashStyle);
setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection
| TextEditorActionHandler::JumpToFileUnderCursor);
@@ -276,11 +276,11 @@ ProFileEditorFactory::ProFileEditorFactory()
setSyntaxHighlighterCreator([]() { return new ProFileHighlighter; });
const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT);
Utils::FileIconProvider::registerIconOverlayForSuffix(
FileIconProvider::registerIconOverlayForSuffix(
creatorTheme()->imageFile(Theme::IconOverlayPro, defaultOverlay), "pro");
Utils::FileIconProvider::registerIconOverlayForSuffix(
FileIconProvider::registerIconOverlayForSuffix(
creatorTheme()->imageFile(Theme::IconOverlayPri, defaultOverlay), "pri");
Utils::FileIconProvider::registerIconOverlayForSuffix(
FileIconProvider::registerIconOverlayForSuffix(
creatorTheme()->imageFile(Theme::IconOverlayPrf, defaultOverlay), "prf");
}

View File

@@ -14,6 +14,7 @@
#include <QUrl>
using namespace Core;
using namespace Utils;
namespace QmakeProjectManager {
namespace Internal {
@@ -27,7 +28,7 @@ void ProFileHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidg
int pos,
ReportPriority report)
{
Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); });
ExecuteOnDestruction reportPriority([this, report](){ report(priority()); });
m_docFragment.clear();
m_manualKind = UnknownManual;
@@ -114,8 +115,8 @@ void ProFileHoverHandler::identifyDocFragment(ProFileHoverHandler::ManualKind ma
QUrl url(QString::fromLatin1("qthelp://org.qt-project.qmake/qmake/qmake-%1-reference.html").arg(manualName()));
const QByteArray html = Core::HelpManager::fileData(url);
Utils::HtmlDocExtractor htmlExtractor;
htmlExtractor.setMode(Utils::HtmlDocExtractor::FirstParagraph);
HtmlDocExtractor htmlExtractor;
htmlExtractor.setMode(HtmlDocExtractor::FirstParagraph);
// Document fragment of qmake function is retrieved from docs.
// E.g. in case of the keyword "find" the document fragment

View File

@@ -89,7 +89,7 @@ FilePath QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePa
const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration";
QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Utils::Id id)
QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id)
: BuildConfiguration(target, id)
{
setConfigWidgetDisplayName(Tr::tr("General"));

View File

@@ -96,7 +96,7 @@ KitAspectWidget *QmakeKitAspect::createConfigWidget(Kit *k) const
KitAspect::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const
{
return {qMakePair(Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k)))};
return {{Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k))}};
}
void QmakeKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
@@ -107,7 +107,7 @@ void QmakeKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
});
}
Utils::Id QmakeKitAspect::id()
Id QmakeKitAspect::id()
{
return Constants::KIT_INFORMATION_ID;
}

View File

@@ -115,7 +115,8 @@ bool QmakeBuildSystem::supportsAction(Node *context, ProjectAction action, const
const FolderNode *folder = node->asFolderNode();
if (folder) {
QStringList list;
foreach (FolderNode *f, folder->folderNodes())
const auto folderNodes = folder->folderNodes();
for (FolderNode *f : folderNodes)
list << f->filePath().toString() + QLatin1Char('/');
if (n->deploysFolder(Utils::commonPath(list)))
addExistingFiles = false;
@@ -341,7 +342,7 @@ QStringList QmakeProFileNode::targetApplications() const
return apps;
}
QVariant QmakeProFileNode::data(Utils::Id role) const
QVariant QmakeProFileNode::data(Id role) const
{
if (role == Android::Constants::AndroidAbis)
return variableValue(Variable::AndroidAbis);
@@ -400,7 +401,7 @@ QVariant QmakeProFileNode::data(Utils::Id role) const
return {};
}
bool QmakeProFileNode::setData(Utils::Id role, const QVariant &value) const
bool QmakeProFileNode::setData(Id role, const QVariant &value) const
{
QmakeProFile *pro = proFile();
if (!pro)

View File

@@ -89,14 +89,13 @@ QmakeStaticData::QmakeStaticData()
for (const FileTypeDataStorage &fileType : fileTypeDataStorage) {
const QString desc = QmakeProjectManager::Tr::tr(fileType.typeName);
const QString filter = QString::fromUtf8(fileType.addFileFilter);
fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type,
desc, filter,
Utils::FileIconProvider::directoryIcon(QLatin1String(fileType.icon))));
fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type, desc, filter,
FileIconProvider::directoryIcon(QLatin1String(fileType.icon))));
}
// Project icon
projectIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT);
productIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_PRODUCT);
groupIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_GROUP);
projectIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT);
productIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_PRODUCT);
groupIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_GROUP);
qAddPostRoutine(clearQmakeStaticData);
}
@@ -141,7 +140,7 @@ static void createTree(QmakeBuildSystem *buildSystem,
for (int i = 0; i < fileTypes.size(); ++i) {
FileType type = fileTypes.at(i).type;
const SourceFiles &newFilePaths = Utils::filtered(pri->files(type), [&toExclude](const SourceFile &fn) {
return !Utils::contains(toExclude, [&fn](const Utils::FilePath &ex) { return fn.first.isChildOf(ex); });
return !Utils::contains(toExclude, [&fn](const FilePath &ex) { return fn.first.isChildOf(ex); });
});
if (proFile) {
for (const SourceFile &fp : newFilePaths) {

View File

@@ -19,7 +19,7 @@ QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+?):(\\d+?):\\s(.+?)$"))
OutputLineParser::Result QMakeParser::handleLine(const QString &line, OutputFormat type)
{
if (type != Utils::StdErrFormat)
if (type != StdErrFormat)
return Status::NotHandled;
QString lne = rightTrimmed(line);
QRegularExpressionMatch match = m_error.match(lne);

View File

@@ -89,9 +89,9 @@ class QmakeIncludedPriFile
{
public:
ProFile *proFile;
Utils::FilePath name;
FilePath name;
QmakePriFileEvalResult result;
QMap<Utils::FilePath, QmakeIncludedPriFile *> children;
QMap<FilePath, QmakeIncludedPriFile *> children;
~QmakeIncludedPriFile()
{
@@ -348,18 +348,17 @@ void QmakePriFile::update(const Internal::QmakePriFileEvalResult &result)
files.clear();
const QSet<FilePath> exactFps = result.foundFilesExact.value(type);
for (const FilePath &exactFp : exactFps)
files << qMakePair(exactFp, FileOrigin::ExactParse);
files.insert({exactFp, FileOrigin::ExactParse});
for (const FilePath &cumulativeFp : result.foundFilesCumulative.value(type)) {
if (!exactFps.contains(cumulativeFp))
files << qMakePair(cumulativeFp, FileOrigin::CumulativeParse);
files.insert({cumulativeFp, FileOrigin::CumulativeParse});
}
}
}
void QmakePriFile::watchFolders(const QSet<FilePath> &folders)
{
const QSet<QString> folderStrings =
Utils::transform(folders, &FilePath::toString);
const QSet<QString> folderStrings = Utils::transform(folders, &FilePath::toString);
QSet<QString> toUnwatch = m_watchedFolders;
toUnwatch.subtract(folderStrings);
@@ -431,7 +430,7 @@ bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet<FilePa
SourceFiles &currentFiles = m_files[type];
for (const FilePath &fp : add) {
if (!contains(currentFiles, [&fp](const SourceFile &sf) { return sf.first == fp; }))
currentFiles.insert(qMakePair(fp, FileOrigin::ExactParse));
currentFiles.insert({fp, FileOrigin::ExactParse});
}
for (const FilePath &fp : remove) {
const auto it = std::find_if(currentFiles.begin(), currentFiles.end(),
@@ -534,7 +533,7 @@ bool QmakePriFile::addFiles(const FilePaths &filePaths, FilePaths *notAdded)
// Split into lists by file type and bulk-add them.
TypeFileMap typeFileMap;
for (const FilePath &file : filePaths) {
const Utils::MimeType mt = Utils::mimeTypeForFile(file);
const MimeType mt = Utils::mimeTypeForFile(file);
typeFileMap[mt.name()] << file;
}
@@ -581,7 +580,7 @@ bool QmakePriFile::removeFiles(const FilePaths &filePaths, FilePaths *notRemoved
// Split into lists by file type and bulk-add them.
TypeFileMap typeFileMap;
for (const FilePath &file : filePaths) {
const Utils::MimeType mt = Utils::mimeTypeForFile(file);
const MimeType mt = Utils::mimeTypeForFile(file);
typeFileMap[mt.name()] << file;
}
foreach (const QString &type, typeFileMap.keys()) {
@@ -756,7 +755,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
&errorMsg)
!= TextFileFormat::ReadSuccess) {
QmakeBuildSystem::proFileParseError(errorMsg, filePath());
return qMakePair(includeFile, lines);
return {includeFile, lines};
}
lines = contents.split('\n');
}
@@ -769,7 +768,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
filePath().toString(),
1);
}
return qMakePair(includeFile, lines);
return {includeFile, lines};
}
bool QmakePriFile::prepareForChange()
@@ -1284,10 +1283,9 @@ void QmakeProFile::asyncUpdate()
if (!includedInExactParse())
m_readerExact->setExact(false);
QmakeEvalInput input = evalInput();
QFuture<QmakeEvalResultPtr> future = Utils::runAsync(ProjectExplorerPlugin::sharedThreadPool(),
QThread::LowestPriority,
&QmakeProFile::asyncEvaluate,
this, input);
QFuture<QmakeEvalResultPtr> future = runAsync(ProjectExplorerPlugin::sharedThreadPool(),
QThread::LowestPriority,
&QmakeProFile::asyncEvaluate, this, input);
m_parseFutureWatcher->setFuture(future);
}
@@ -1401,7 +1399,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
FilePaths subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
result->errors.append(errors);
foreach (const Utils::FilePath &subDirName, subDirs) {
foreach (const FilePath &subDirName, subDirs) {
auto subDir = new QmakeIncludedPriFile;
subDir->proFile = nullptr;
subDir->name = subDirName;
@@ -1420,7 +1418,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
continue; // Don't attempt to map subdirs here
QVector<ProFile *> children = includeFiles.value(current->proFile);
foreach (ProFile *child, children) {
const Utils::FilePath childName = Utils::FilePath::fromString(child->fileName());
const FilePath childName = FilePath::fromString(child->fileName());
auto it = current->children.find(childName);
if (it == current->children.end()) {
auto childTree = new QmakeIncludedPriFile;
@@ -1435,8 +1433,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
}
if (result->projectType == ProjectType::SubDirsTemplate) {
FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
foreach (const Utils::FilePath &subDirName, subDirs) {
const FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
for (const FilePath &subDirName : subDirs) {
auto it = result->includedFiles.children.find(subDirName);
if (it == result->includedFiles.children.end()) {
auto subDir = new QmakeIncludedPriFile;
@@ -1456,7 +1454,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
continue; // Don't attempt to map subdirs here
QVector<ProFile *> children = includeFiles.value(current->proFile);
foreach (ProFile *child, children) {
const Utils::FilePath childName = Utils::FilePath::fromString(child->fileName());
const FilePath childName = FilePath::fromString(child->fileName());
auto it = current->children.find(childName);
if (it == current->children.end()) {
auto childTree = new QmakeIncludedPriFile;
@@ -1583,8 +1581,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
if (cumulativeBuildPassReader && cumulativeBuildPassReader != input.readerCumulative)
delete cumulativeBuildPassReader;
QList<QPair<QmakePriFile *, QmakeIncludedPriFile *>> toCompare;
toCompare.append(qMakePair(nullptr, &result->includedFiles));
QList<QPair<QmakePriFile *, QmakeIncludedPriFile *>>
toCompare{{nullptr, &result->includedFiles}};
while (!toCompare.isEmpty()) {
QmakePriFile *pn = toCompare.first().first;
QmakeIncludedPriFile *tree = toCompare.first().second;
@@ -1608,8 +1606,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
result->directChildren << qmakePriFileNode;
qmakePriFileNode->setIncludedInExactParse(input.includedInExcactParse
&& result->state == QmakeEvalResult::EvalOk);
result->priFiles.append(qMakePair(qmakePriFileNode, priFile->result));
toCompare.append(qMakePair(qmakePriFileNode, priFile));
result->priFiles.push_back({qmakePriFileNode, priFile->result});
toCompare.push_back({qmakePriFileNode, priFile});
} else {
auto *qmakeProFileNode = new QmakeProFile(priFile->name);
if (pn)
@@ -1725,9 +1723,9 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result)
if (!result->directoriesWithWildcards.isEmpty()) {
if (!m_wildcardWatcher) {
m_wildcardWatcher = std::make_unique<Utils::FileSystemWatcher>();
m_wildcardWatcher = std::make_unique<FileSystemWatcher>();
QObject::connect(
m_wildcardWatcher.get(), &Utils::FileSystemWatcher::directoryChanged,
m_wildcardWatcher.get(), &FileSystemWatcher::directoryChanged,
[this](QString path) {
QStringList directoryContents = QDir(path).entryList();
if (m_wildcardDirectoryContents.value(path) != directoryContents) {
@@ -1743,8 +1741,7 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result)
});
for (const QString &path : directoriesToAdd)
m_wildcardDirectoryContents.insert(path, QDir(path).entryList());
m_wildcardWatcher->addDirectories(directoriesToAdd,
Utils::FileSystemWatcher::WatchModifiedDate);
m_wildcardWatcher->addDirectories(directoriesToAdd, FileSystemWatcher::WatchModifiedDate);
}
if (m_wildcardWatcher) {
if (result->directoriesWithWildcards.isEmpty()) {
@@ -1980,8 +1977,8 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader,
const QStringList installPrefixVars{"QT_INSTALL_PREFIX", "QT_INSTALL_EXAMPLES"};
QList<QPair<QString, QString>> installPrefixValues;
for (const QString &installPrefix : installPrefixVars) {
installPrefixValues << qMakePair(reader->propertyValue(installPrefix),
reader->propertyValue(installPrefix + "/dev"));
installPrefixValues.push_back({reader->propertyValue(installPrefix),
reader->propertyValue(installPrefix + "/dev")});
}
foreach (const QString &item, itemList) {
@@ -2057,7 +2054,7 @@ FilePaths QmakeProFile::generatedFiles(const FilePath &buildDir,
location = location.pathAppended("ui_"
+ sourceFile.completeBaseName()
+ singleVariableValue(Variable::HeaderExtension));
return { Utils::FilePath::fromString(QDir::cleanPath(location.toString())) };
return { FilePath::fromString(QDir::cleanPath(location.toString())) };
} else if (sourceFileType == FileType::StateChart) {
if (buildDir.isEmpty())
return { };

View File

@@ -81,7 +81,7 @@ static Q_LOGGING_CATEGORY(qmakeBuildSystemLog, "qtc.qmake.buildsystem", QtWarnin
class QmakePriFileDocument : public Core::IDocument
{
public:
QmakePriFileDocument(QmakePriFile *qmakePriFile, const Utils::FilePath &filePath) :
QmakePriFileDocument(QmakePriFile *qmakePriFile, const FilePath &filePath) :
IDocument(nullptr), m_priFile(qmakePriFile)
{
setId("Qmake.PriFile");
@@ -362,7 +362,7 @@ void QmakeBuildSystem::updateCppCodeModel()
if (pro->variableValue(Variable::Config).contains(QLatin1String("qt")))
rpp.setQtVersion(kitInfo.projectPartQtVersion);
else
rpp.setQtVersion(Utils::QtMajorVersion::None);
rpp.setQtVersion(QtMajorVersion::None);
// Header paths
ProjectExplorer::HeaderPaths headerPaths;
@@ -381,7 +381,7 @@ void QmakeBuildSystem::updateCppCodeModel()
QStringList fileList = pro->variableValue(Variable::ExactSource) + cumulativeSourceFiles;
QList<ProjectExplorer::ExtraCompiler *> proGenerators = pro->extraCompilers();
foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) {
ec->forEachTarget([&](const Utils::FilePath &generatedFile) {
ec->forEachTarget([&](const FilePath &generatedFile) {
fileList += generatedFile.toString();
});
}
@@ -421,7 +421,7 @@ void QmakeBuildSystem::updateQmlJSCodeModel()
const QStringList &cumulativeResources = file->variableValue(Variable::CumulativeResource);
QString errorMessage;
for (const QString &rc : exactResources) {
Utils::FilePath rcPath = Utils::FilePath::fromString(rc);
FilePath rcPath = FilePath::fromString(rc);
projectInfo.activeResourceFiles.append(rcPath);
projectInfo.allResourceFiles.append(rcPath);
QString contents;
@@ -430,7 +430,7 @@ void QmakeBuildSystem::updateQmlJSCodeModel()
projectInfo.resourceFileContents[rcPath] = contents;
}
for (const QString &rc : cumulativeResources) {
Utils::FilePath rcPath = Utils::FilePath::fromString(rc);
FilePath rcPath = FilePath::fromString(rc);
projectInfo.allResourceFiles.append(rcPath);
QString contents;
int id = m_qmakeVfs->idForFileName(rc, QMakeVfs::VfsCumulative);
@@ -1358,8 +1358,8 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
}
}
static Utils::FilePath getFullPathOf(const QmakeProFile *pro, Variable variable,
const BuildConfiguration *bc)
static FilePath getFullPathOf(const QmakeProFile *pro, Variable variable,
const BuildConfiguration *bc)
{
// Take last non-flag value, to cover e.g. '@echo $< && $$QMAKE_CC' or 'ccache gcc'
const QStringList values = Utils::filtered(pro->variableValue(variable),
@@ -1367,12 +1367,12 @@ static Utils::FilePath getFullPathOf(const QmakeProFile *pro, Variable variable,
return !value.startsWith('-');
});
if (values.isEmpty())
return Utils::FilePath();
return {};
const QString exe = values.last();
QTC_ASSERT(bc, return Utils::FilePath::fromUserInput(exe));
QTC_ASSERT(bc, return FilePath::fromUserInput(exe));
QFileInfo fi(exe);
if (fi.isAbsolute())
return Utils::FilePath::fromUserInput(exe);
return FilePath::fromUserInput(exe);
return bc->environment().searchInPath(exe);
}
@@ -1382,12 +1382,12 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const
if (!tc || path.isEmpty())
return;
const Utils::FilePath expected = tc->compilerCommand();
const FilePath expected = tc->compilerCommand();
Environment env = buildConfiguration()->environment();
if (tc->matchesCompilerCommand(expected, env))
return;
const QPair<Utils::FilePath, Utils::FilePath> pair = qMakePair(expected, path);
const QPair<FilePath, FilePath> pair{expected, path};
if (m_toolChainWarnings.contains(pair))
return;
// Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode.
@@ -1478,7 +1478,7 @@ FilePaths QmakeBuildSystem::filesGeneratedFrom(const FilePath &input) const
return {};
}
QVariant QmakeBuildSystem::additionalData(Utils::Id id) const
QVariant QmakeBuildSystem::additionalData(Id id) const
{
if (id == "QmlDesignerImportPath")
return m_rootProFile->variableValue(Variable::QmlDesignerImportPath);

View File

@@ -39,14 +39,14 @@ using namespace Utils;
namespace QmakeProjectManager::Internal {
const Utils::Id QT_IS_TEMPORARY("Qmake.TempQt");
const Id QT_IS_TEMPORARY("Qmake.TempQt");
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // ugly
struct DirectoryData
{
QString makefile;
Utils::FilePath buildDirectory;
Utils::FilePath canonicalQmakeBinary;
FilePath buildDirectory;
FilePath canonicalQmakeBinary;
QtProjectImporter::QtVersionData qtVersionData;
QString parsedSpec;
QtVersion::QmakeBuildConfigs buildConfig;