forked from qt-creator/qt-creator
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:
@@ -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;
|
QList<FolderNode *> result;
|
||||||
for (const std::unique_ptr<Node> &n : m_nodes) {
|
for (const std::unique_ptr<Node> &n : m_nodes) {
|
||||||
|
@@ -23,6 +23,8 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QmakeProjectManager::Internal {
|
namespace QmakeProjectManager::Internal {
|
||||||
|
|
||||||
const char qt_file_dialog_filter_reg_exp[] =
|
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);
|
return f.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool validateLibraryPath(const Utils::FilePath &filePath,
|
static bool validateLibraryPath(const FilePath &filePath,
|
||||||
const Utils::PathChooser *pathChooser,
|
const PathChooser *pathChooser,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
@@ -49,7 +51,7 @@ static bool validateLibraryPath(const Utils::FilePath &filePath,
|
|||||||
const QString fileName = filePath.fileName();
|
const QString fileName = filePath.fileName();
|
||||||
|
|
||||||
QRegularExpression::PatternOption option =
|
QRegularExpression::PatternOption option =
|
||||||
Utils::HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive
|
HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive
|
||||||
? QRegularExpression::CaseInsensitiveOption
|
? QRegularExpression::CaseInsensitiveOption
|
||||||
: QRegularExpression::NoPatternOption;
|
: QRegularExpression::NoPatternOption;
|
||||||
|
|
||||||
@@ -63,8 +65,9 @@ static bool validateLibraryPath(const Utils::FilePath &filePath,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLibraryWizard::AddLibraryWizard(const Utils::FilePath &proFile, QWidget *parent) :
|
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent)
|
||||||
Utils::Wizard(parent), m_proFile(proFile)
|
: Wizard(parent)
|
||||||
|
, m_proFile(proFile)
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("Add Library"));
|
setWindowTitle(Tr::tr("Add Library"));
|
||||||
m_libraryTypePage = new LibraryTypePage(this);
|
m_libraryTypePage = new LibraryTypePage(this);
|
||||||
@@ -77,7 +80,7 @@ AddLibraryWizard::AddLibraryWizard(const Utils::FilePath &proFile, QWidget *pare
|
|||||||
|
|
||||||
AddLibraryWizard::~AddLibraryWizard() = default;
|
AddLibraryWizard::~AddLibraryWizard() = default;
|
||||||
|
|
||||||
Utils::FilePath AddLibraryWizard::proFile() const
|
FilePath AddLibraryWizard::proFile() const
|
||||||
{
|
{
|
||||||
return m_proFile;
|
return m_proFile;
|
||||||
}
|
}
|
||||||
@@ -147,7 +150,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
|
|||||||
packageLabel->setAttribute(Qt::WA_MacSmallSize, true);
|
packageLabel->setAttribute(Qt::WA_MacSmallSize, true);
|
||||||
layout->addWidget(packageLabel);
|
layout->addWidget(packageLabel);
|
||||||
|
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
m_packageRadio->setVisible(false);
|
m_packageRadio->setVisible(false);
|
||||||
packageLabel->setVisible(false);
|
packageLabel->setVisible(false);
|
||||||
}
|
}
|
||||||
@@ -155,7 +158,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
|
|||||||
// select the default
|
// select the default
|
||||||
m_internalRadio->setChecked(true);
|
m_internalRadio->setChecked(true);
|
||||||
|
|
||||||
setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Type"));
|
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const
|
AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const
|
||||||
@@ -177,16 +180,16 @@ DetailsPage::DetailsPage(AddLibraryWizard *parent)
|
|||||||
m_libraryDetailsWidget = new LibraryDetailsWidget(this);
|
m_libraryDetailsWidget = new LibraryDetailsWidget(this);
|
||||||
resize(456, 438);
|
resize(456, 438);
|
||||||
|
|
||||||
Utils::PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser;
|
PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser;
|
||||||
libPathChooser->setHistoryCompleter("Qmake.LibDir.History");
|
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)
|
return libPathChooser->defaultValidationFunction()(edit, errorMessage)
|
||||||
&& validateLibraryPath(libPathChooser->filePath(),
|
&& validateLibraryPath(libPathChooser->filePath(),
|
||||||
libPathChooser, errorMessage);
|
libPathChooser, errorMessage);
|
||||||
};
|
};
|
||||||
libPathChooser->setValidationFunction(pathValidator);
|
libPathChooser->setValidationFunction(pathValidator);
|
||||||
setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Details"));
|
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Details"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DetailsPage::isComplete() const
|
bool DetailsPage::isComplete() const
|
||||||
@@ -272,7 +275,7 @@ SummaryPage::SummaryPage(AddLibraryWizard *parent)
|
|||||||
m_snippetLabel->setTextFormat(Qt::RichText);
|
m_snippetLabel->setTextFormat(Qt::RichText);
|
||||||
m_snippetLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
m_snippetLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
|
||||||
setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
|
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SummaryPage::initializePage()
|
void SummaryPage::initializePage()
|
||||||
@@ -302,17 +305,12 @@ QString SummaryPage::snippet() const
|
|||||||
|
|
||||||
LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
|
LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
|
||||||
{
|
{
|
||||||
includePathChooser = new Utils::PathChooser(parent);
|
includePathChooser = new PathChooser(parent);
|
||||||
|
|
||||||
packageLineEdit = new QLineEdit(parent);
|
packageLineEdit = new QLineEdit(parent);
|
||||||
|
libraryPathChooser = new PathChooser(parent);
|
||||||
libraryPathChooser = new Utils::PathChooser(parent);
|
|
||||||
|
|
||||||
libraryComboBox = new QComboBox(parent);
|
libraryComboBox = new QComboBox(parent);
|
||||||
|
|
||||||
libraryTypeComboBox = new QComboBox(parent);
|
libraryTypeComboBox = new QComboBox(parent);
|
||||||
|
|
||||||
|
|
||||||
platformGroupBox = new QGroupBox(Tr::tr("Platform:"));
|
platformGroupBox = new QGroupBox(Tr::tr("Platform:"));
|
||||||
platformGroupBox->setFlat(true);
|
platformGroupBox->setFlat(true);
|
||||||
|
|
||||||
@@ -325,7 +323,6 @@ LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
|
|||||||
winGroupBox = new QGroupBox(Tr::tr("Windows:"));
|
winGroupBox = new QGroupBox(Tr::tr("Windows:"));
|
||||||
winGroupBox->setFlat(true);
|
winGroupBox->setFlat(true);
|
||||||
|
|
||||||
|
|
||||||
linCheckBox = new QCheckBox(Tr::tr("Linux"));
|
linCheckBox = new QCheckBox(Tr::tr("Linux"));
|
||||||
linCheckBox->setChecked(true);
|
linCheckBox->setChecked(true);
|
||||||
|
|
||||||
@@ -348,7 +345,7 @@ LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
|
|||||||
addSuffixCheckBox = new QCheckBox(Tr::tr("Add \"d\" suffix for debug version"), winGroupBox);
|
addSuffixCheckBox = new QCheckBox(Tr::tr("Add \"d\" suffix for debug version"), winGroupBox);
|
||||||
removeSuffixCheckBox = new QCheckBox(Tr::tr("Remove \"d\" suffix for release 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);
|
Column { linCheckBox, macCheckBox, winCheckBox, st }.attachTo(platformGroupBox);
|
||||||
|
|
||||||
|
@@ -49,14 +49,14 @@ static QString linguistBinary(const QtSupport::QtVersion *qtVersion)
|
|||||||
{
|
{
|
||||||
if (qtVersion)
|
if (qtVersion)
|
||||||
return qtVersion->linguistFilePath().toString();
|
return qtVersion->linguistFilePath().toString();
|
||||||
return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Linguist" : "linguist");
|
return QLatin1String(HostOsInfo::isMacHost() ? "Linguist" : "linguist");
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString designerBinary(const QtSupport::QtVersion *qtVersion)
|
static QString designerBinary(const QtSupport::QtVersion *qtVersion)
|
||||||
{
|
{
|
||||||
if (qtVersion)
|
if (qtVersion)
|
||||||
return qtVersion->designerFilePath().toString();
|
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
|
// 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");
|
static const char linguistDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Qt Linguist");
|
||||||
|
|
||||||
// -------------- ExternalQtEditor
|
// -------------- ExternalQtEditor
|
||||||
ExternalQtEditor::ExternalQtEditor(Utils::Id id,
|
ExternalQtEditor::ExternalQtEditor(Id id,
|
||||||
const QString &displayName,
|
const QString &displayName,
|
||||||
const QString &mimetype,
|
const QString &mimetype,
|
||||||
const CommandForQtVersion &commandForQtVersion)
|
const CommandForQtVersion &commandForQtVersion)
|
||||||
@@ -101,7 +101,7 @@ ExternalQtEditor *ExternalQtEditor::createLinguistEditor()
|
|||||||
|
|
||||||
ExternalQtEditor *ExternalQtEditor::createDesignerEditor()
|
ExternalQtEditor *ExternalQtEditor::createDesignerEditor()
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isMacHost()) {
|
if (HostOsInfo::isMacHost()) {
|
||||||
return new ExternalQtEditor(designerIdC,
|
return new ExternalQtEditor(designerIdC,
|
||||||
QLatin1String(designerDisplayName),
|
QLatin1String(designerDisplayName),
|
||||||
QLatin1String(ProjectExplorer::Constants::FORM_MIMETYPE),
|
QLatin1String(ProjectExplorer::Constants::FORM_MIMETYPE),
|
||||||
@@ -124,7 +124,7 @@ static QString findFirstCommand(QVector<QtSupport::QtVersion *> qtVersions,
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
|
bool ExternalQtEditor::getEditorLaunchData(const FilePath &filePath,
|
||||||
LaunchData *data,
|
LaunchData *data,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
@@ -156,7 +156,7 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
|
|||||||
// fallback
|
// fallback
|
||||||
if (data->binary.isEmpty()) {
|
if (data->binary.isEmpty()) {
|
||||||
const QString path = qtcEnvironmentVariable("PATH");
|
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()) {
|
if (data->binary.isEmpty()) {
|
||||||
@@ -165,14 +165,14 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath,
|
|||||||
}
|
}
|
||||||
// Setup binary + arguments, use Mac Open if appropriate
|
// Setup binary + arguments, use Mac Open if appropriate
|
||||||
data->arguments.push_back(filePath.toString());
|
data->arguments.push_back(filePath.toString());
|
||||||
if (Utils::HostOsInfo::isMacHost())
|
if (HostOsInfo::isMacHost())
|
||||||
*data = createMacOpenCommand(*data);
|
*data = createMacOpenCommand(*data);
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << data->binary << data->arguments;
|
qDebug() << Q_FUNC_INFO << '\n' << data->binary << data->arguments;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExternalQtEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage)
|
bool ExternalQtEditor::startEditor(const FilePath &filePath, QString *errorMessage)
|
||||||
{
|
{
|
||||||
LaunchData data;
|
LaunchData data;
|
||||||
return getEditorLaunchData(filePath, &data, errorMessage)
|
return getEditorLaunchData(filePath, &data, errorMessage)
|
||||||
@@ -215,7 +215,7 @@ void DesignerExternalEditor::processTerminated(const QString &binary)
|
|||||||
socket->deleteLater();
|
socket->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DesignerExternalEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage)
|
bool DesignerExternalEditor::startEditor(const FilePath &filePath, QString *errorMessage)
|
||||||
{
|
{
|
||||||
LaunchData data;
|
LaunchData data;
|
||||||
// Find the editor binary
|
// Find the editor binary
|
||||||
|
@@ -480,8 +480,8 @@ void QmakeProjectManagerPlugin::testMakefileParser()
|
|||||||
MakeFileParse parser("/tmp/something", MakeFileParse::Mode::FilterKnownConfigValues);
|
MakeFileParse parser("/tmp/something", MakeFileParse::Mode::FilterKnownConfigValues);
|
||||||
parser.parseCommandLine(command, project);
|
parser.parseCommandLine(command, project);
|
||||||
|
|
||||||
QCOMPARE(Utils::ProcessArgs::splitArgs(parser.unparsedArguments()),
|
QCOMPARE(ProcessArgs::splitArgs(parser.unparsedArguments()),
|
||||||
Utils::ProcessArgs::splitArgs(unparsedArguments));
|
ProcessArgs::splitArgs(unparsedArguments));
|
||||||
QCOMPARE(parser.effectiveBuildConfig({}), effectiveBuildConfig);
|
QCOMPARE(parser.effectiveBuildConfig({}), effectiveBuildConfig);
|
||||||
|
|
||||||
const QMakeStepConfig qmsc = parser.config();
|
const QMakeStepConfig qmsc = parser.config();
|
||||||
|
@@ -40,7 +40,7 @@ class ProFileEditorWidget : public TextEditorWidget
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
void findLinkAt(const QTextCursor &,
|
void findLinkAt(const QTextCursor &,
|
||||||
const Utils::LinkHandler &processLinkCallback,
|
const LinkHandler &processLinkCallback,
|
||||||
bool resolveTarget = true,
|
bool resolveTarget = true,
|
||||||
bool inNextSplit = false) override;
|
bool inNextSplit = false) override;
|
||||||
void contextMenuEvent(QContextMenuEvent *) override;
|
void contextMenuEvent(QContextMenuEvent *) override;
|
||||||
@@ -207,7 +207,7 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor,
|
|||||||
QDir dir(textDocument()->filePath().toFileInfo().absolutePath());
|
QDir dir(textDocument()->filePath().toFileInfo().absolutePath());
|
||||||
QString fileName = dir.filePath(buffer);
|
QString fileName = dir.filePath(buffer);
|
||||||
QFileInfo fi(fileName);
|
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
|
// Windows network paths are not supported here since checking for their existence can
|
||||||
// lock the gui thread. See: QTCREATORBUG-26579
|
// lock the gui thread. See: QTCREATORBUG-26579
|
||||||
} else if (fi.exists()) {
|
} else if (fi.exists()) {
|
||||||
@@ -219,9 +219,9 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor,
|
|||||||
else
|
else
|
||||||
return processLinkCallback(link);
|
return processLinkCallback(link);
|
||||||
}
|
}
|
||||||
link.targetFilePath = Utils::FilePath::fromString(QDir::cleanPath(fileName));
|
link.targetFilePath = FilePath::fromString(QDir::cleanPath(fileName));
|
||||||
} else {
|
} else {
|
||||||
link.targetFilePath = Utils::FilePath::fromString(checkForPrfFile(buffer));
|
link.targetFilePath = FilePath::fromString(checkForPrfFile(buffer));
|
||||||
}
|
}
|
||||||
if (!link.targetFilePath.isEmpty()) {
|
if (!link.targetFilePath.isEmpty()) {
|
||||||
link.linkTextStart = cursor.position() - positionInBlock + beginPos + 1;
|
link.linkTextStart = cursor.position() - positionInBlock + beginPos + 1;
|
||||||
@@ -268,7 +268,7 @@ ProFileEditorFactory::ProFileEditorFactory()
|
|||||||
completionAssistProvider->setDynamicCompletionFunction(&TextEditor::pathComplete);
|
completionAssistProvider->setDynamicCompletionFunction(&TextEditor::pathComplete);
|
||||||
setCompletionAssistProvider(completionAssistProvider);
|
setCompletionAssistProvider(completionAssistProvider);
|
||||||
|
|
||||||
setCommentDefinition(Utils::CommentDefinition::HashStyle);
|
setCommentDefinition(CommentDefinition::HashStyle);
|
||||||
setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection
|
setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection
|
||||||
| TextEditorActionHandler::JumpToFileUnderCursor);
|
| TextEditorActionHandler::JumpToFileUnderCursor);
|
||||||
|
|
||||||
@@ -276,11 +276,11 @@ ProFileEditorFactory::ProFileEditorFactory()
|
|||||||
setSyntaxHighlighterCreator([]() { return new ProFileHighlighter; });
|
setSyntaxHighlighterCreator([]() { return new ProFileHighlighter; });
|
||||||
|
|
||||||
const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT);
|
const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT);
|
||||||
Utils::FileIconProvider::registerIconOverlayForSuffix(
|
FileIconProvider::registerIconOverlayForSuffix(
|
||||||
creatorTheme()->imageFile(Theme::IconOverlayPro, defaultOverlay), "pro");
|
creatorTheme()->imageFile(Theme::IconOverlayPro, defaultOverlay), "pro");
|
||||||
Utils::FileIconProvider::registerIconOverlayForSuffix(
|
FileIconProvider::registerIconOverlayForSuffix(
|
||||||
creatorTheme()->imageFile(Theme::IconOverlayPri, defaultOverlay), "pri");
|
creatorTheme()->imageFile(Theme::IconOverlayPri, defaultOverlay), "pri");
|
||||||
Utils::FileIconProvider::registerIconOverlayForSuffix(
|
FileIconProvider::registerIconOverlayForSuffix(
|
||||||
creatorTheme()->imageFile(Theme::IconOverlayPrf, defaultOverlay), "prf");
|
creatorTheme()->imageFile(Theme::IconOverlayPrf, defaultOverlay), "prf");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -27,7 +28,7 @@ void ProFileHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidg
|
|||||||
int pos,
|
int pos,
|
||||||
ReportPriority report)
|
ReportPriority report)
|
||||||
{
|
{
|
||||||
Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); });
|
ExecuteOnDestruction reportPriority([this, report](){ report(priority()); });
|
||||||
|
|
||||||
m_docFragment.clear();
|
m_docFragment.clear();
|
||||||
m_manualKind = UnknownManual;
|
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()));
|
QUrl url(QString::fromLatin1("qthelp://org.qt-project.qmake/qmake/qmake-%1-reference.html").arg(manualName()));
|
||||||
const QByteArray html = Core::HelpManager::fileData(url);
|
const QByteArray html = Core::HelpManager::fileData(url);
|
||||||
|
|
||||||
Utils::HtmlDocExtractor htmlExtractor;
|
HtmlDocExtractor htmlExtractor;
|
||||||
htmlExtractor.setMode(Utils::HtmlDocExtractor::FirstParagraph);
|
htmlExtractor.setMode(HtmlDocExtractor::FirstParagraph);
|
||||||
|
|
||||||
// Document fragment of qmake function is retrieved from docs.
|
// Document fragment of qmake function is retrieved from docs.
|
||||||
// E.g. in case of the keyword "find" the document fragment
|
// E.g. in case of the keyword "find" the document fragment
|
||||||
|
@@ -89,7 +89,7 @@ FilePath QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePa
|
|||||||
|
|
||||||
const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration";
|
const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration";
|
||||||
|
|
||||||
QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Utils::Id id)
|
QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id)
|
||||||
: BuildConfiguration(target, id)
|
: BuildConfiguration(target, id)
|
||||||
{
|
{
|
||||||
setConfigWidgetDisplayName(Tr::tr("General"));
|
setConfigWidgetDisplayName(Tr::tr("General"));
|
||||||
|
@@ -96,7 +96,7 @@ KitAspectWidget *QmakeKitAspect::createConfigWidget(Kit *k) const
|
|||||||
|
|
||||||
KitAspect::ItemList QmakeKitAspect::toUserOutput(const 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
|
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;
|
return Constants::KIT_INFORMATION_ID;
|
||||||
}
|
}
|
||||||
|
@@ -115,7 +115,8 @@ bool QmakeBuildSystem::supportsAction(Node *context, ProjectAction action, const
|
|||||||
const FolderNode *folder = node->asFolderNode();
|
const FolderNode *folder = node->asFolderNode();
|
||||||
if (folder) {
|
if (folder) {
|
||||||
QStringList list;
|
QStringList list;
|
||||||
foreach (FolderNode *f, folder->folderNodes())
|
const auto folderNodes = folder->folderNodes();
|
||||||
|
for (FolderNode *f : folderNodes)
|
||||||
list << f->filePath().toString() + QLatin1Char('/');
|
list << f->filePath().toString() + QLatin1Char('/');
|
||||||
if (n->deploysFolder(Utils::commonPath(list)))
|
if (n->deploysFolder(Utils::commonPath(list)))
|
||||||
addExistingFiles = false;
|
addExistingFiles = false;
|
||||||
@@ -341,7 +342,7 @@ QStringList QmakeProFileNode::targetApplications() const
|
|||||||
return apps;
|
return apps;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant QmakeProFileNode::data(Utils::Id role) const
|
QVariant QmakeProFileNode::data(Id role) const
|
||||||
{
|
{
|
||||||
if (role == Android::Constants::AndroidAbis)
|
if (role == Android::Constants::AndroidAbis)
|
||||||
return variableValue(Variable::AndroidAbis);
|
return variableValue(Variable::AndroidAbis);
|
||||||
@@ -400,7 +401,7 @@ QVariant QmakeProFileNode::data(Utils::Id role) const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmakeProFileNode::setData(Utils::Id role, const QVariant &value) const
|
bool QmakeProFileNode::setData(Id role, const QVariant &value) const
|
||||||
{
|
{
|
||||||
QmakeProFile *pro = proFile();
|
QmakeProFile *pro = proFile();
|
||||||
if (!pro)
|
if (!pro)
|
||||||
|
@@ -89,14 +89,13 @@ QmakeStaticData::QmakeStaticData()
|
|||||||
for (const FileTypeDataStorage &fileType : fileTypeDataStorage) {
|
for (const FileTypeDataStorage &fileType : fileTypeDataStorage) {
|
||||||
const QString desc = QmakeProjectManager::Tr::tr(fileType.typeName);
|
const QString desc = QmakeProjectManager::Tr::tr(fileType.typeName);
|
||||||
const QString filter = QString::fromUtf8(fileType.addFileFilter);
|
const QString filter = QString::fromUtf8(fileType.addFileFilter);
|
||||||
fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type,
|
fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type, desc, filter,
|
||||||
desc, filter,
|
FileIconProvider::directoryIcon(QLatin1String(fileType.icon))));
|
||||||
Utils::FileIconProvider::directoryIcon(QLatin1String(fileType.icon))));
|
|
||||||
}
|
}
|
||||||
// Project icon
|
// Project icon
|
||||||
projectIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT);
|
projectIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT);
|
||||||
productIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_PRODUCT);
|
productIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_PRODUCT);
|
||||||
groupIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_GROUP);
|
groupIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_GROUP);
|
||||||
|
|
||||||
qAddPostRoutine(clearQmakeStaticData);
|
qAddPostRoutine(clearQmakeStaticData);
|
||||||
}
|
}
|
||||||
@@ -141,7 +140,7 @@ static void createTree(QmakeBuildSystem *buildSystem,
|
|||||||
for (int i = 0; i < fileTypes.size(); ++i) {
|
for (int i = 0; i < fileTypes.size(); ++i) {
|
||||||
FileType type = fileTypes.at(i).type;
|
FileType type = fileTypes.at(i).type;
|
||||||
const SourceFiles &newFilePaths = Utils::filtered(pri->files(type), [&toExclude](const SourceFile &fn) {
|
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) {
|
if (proFile) {
|
||||||
for (const SourceFile &fp : newFilePaths) {
|
for (const SourceFile &fp : newFilePaths) {
|
||||||
|
@@ -19,7 +19,7 @@ QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+?):(\\d+?):\\s(.+?)$"))
|
|||||||
|
|
||||||
OutputLineParser::Result QMakeParser::handleLine(const QString &line, OutputFormat type)
|
OutputLineParser::Result QMakeParser::handleLine(const QString &line, OutputFormat type)
|
||||||
{
|
{
|
||||||
if (type != Utils::StdErrFormat)
|
if (type != StdErrFormat)
|
||||||
return Status::NotHandled;
|
return Status::NotHandled;
|
||||||
QString lne = rightTrimmed(line);
|
QString lne = rightTrimmed(line);
|
||||||
QRegularExpressionMatch match = m_error.match(lne);
|
QRegularExpressionMatch match = m_error.match(lne);
|
||||||
|
@@ -89,9 +89,9 @@ class QmakeIncludedPriFile
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProFile *proFile;
|
ProFile *proFile;
|
||||||
Utils::FilePath name;
|
FilePath name;
|
||||||
QmakePriFileEvalResult result;
|
QmakePriFileEvalResult result;
|
||||||
QMap<Utils::FilePath, QmakeIncludedPriFile *> children;
|
QMap<FilePath, QmakeIncludedPriFile *> children;
|
||||||
|
|
||||||
~QmakeIncludedPriFile()
|
~QmakeIncludedPriFile()
|
||||||
{
|
{
|
||||||
@@ -348,18 +348,17 @@ void QmakePriFile::update(const Internal::QmakePriFileEvalResult &result)
|
|||||||
files.clear();
|
files.clear();
|
||||||
const QSet<FilePath> exactFps = result.foundFilesExact.value(type);
|
const QSet<FilePath> exactFps = result.foundFilesExact.value(type);
|
||||||
for (const FilePath &exactFp : exactFps)
|
for (const FilePath &exactFp : exactFps)
|
||||||
files << qMakePair(exactFp, FileOrigin::ExactParse);
|
files.insert({exactFp, FileOrigin::ExactParse});
|
||||||
for (const FilePath &cumulativeFp : result.foundFilesCumulative.value(type)) {
|
for (const FilePath &cumulativeFp : result.foundFilesCumulative.value(type)) {
|
||||||
if (!exactFps.contains(cumulativeFp))
|
if (!exactFps.contains(cumulativeFp))
|
||||||
files << qMakePair(cumulativeFp, FileOrigin::CumulativeParse);
|
files.insert({cumulativeFp, FileOrigin::CumulativeParse});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakePriFile::watchFolders(const QSet<FilePath> &folders)
|
void QmakePriFile::watchFolders(const QSet<FilePath> &folders)
|
||||||
{
|
{
|
||||||
const QSet<QString> folderStrings =
|
const QSet<QString> folderStrings = Utils::transform(folders, &FilePath::toString);
|
||||||
Utils::transform(folders, &FilePath::toString);
|
|
||||||
QSet<QString> toUnwatch = m_watchedFolders;
|
QSet<QString> toUnwatch = m_watchedFolders;
|
||||||
toUnwatch.subtract(folderStrings);
|
toUnwatch.subtract(folderStrings);
|
||||||
|
|
||||||
@@ -431,7 +430,7 @@ bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet<FilePa
|
|||||||
SourceFiles ¤tFiles = m_files[type];
|
SourceFiles ¤tFiles = m_files[type];
|
||||||
for (const FilePath &fp : add) {
|
for (const FilePath &fp : add) {
|
||||||
if (!contains(currentFiles, [&fp](const SourceFile &sf) { return sf.first == fp; }))
|
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) {
|
for (const FilePath &fp : remove) {
|
||||||
const auto it = std::find_if(currentFiles.begin(), currentFiles.end(),
|
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.
|
// Split into lists by file type and bulk-add them.
|
||||||
TypeFileMap typeFileMap;
|
TypeFileMap typeFileMap;
|
||||||
for (const FilePath &file : filePaths) {
|
for (const FilePath &file : filePaths) {
|
||||||
const Utils::MimeType mt = Utils::mimeTypeForFile(file);
|
const MimeType mt = Utils::mimeTypeForFile(file);
|
||||||
typeFileMap[mt.name()] << 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.
|
// Split into lists by file type and bulk-add them.
|
||||||
TypeFileMap typeFileMap;
|
TypeFileMap typeFileMap;
|
||||||
for (const FilePath &file : filePaths) {
|
for (const FilePath &file : filePaths) {
|
||||||
const Utils::MimeType mt = Utils::mimeTypeForFile(file);
|
const MimeType mt = Utils::mimeTypeForFile(file);
|
||||||
typeFileMap[mt.name()] << file;
|
typeFileMap[mt.name()] << file;
|
||||||
}
|
}
|
||||||
foreach (const QString &type, typeFileMap.keys()) {
|
foreach (const QString &type, typeFileMap.keys()) {
|
||||||
@@ -756,7 +755,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
|
|||||||
&errorMsg)
|
&errorMsg)
|
||||||
!= TextFileFormat::ReadSuccess) {
|
!= TextFileFormat::ReadSuccess) {
|
||||||
QmakeBuildSystem::proFileParseError(errorMsg, filePath());
|
QmakeBuildSystem::proFileParseError(errorMsg, filePath());
|
||||||
return qMakePair(includeFile, lines);
|
return {includeFile, lines};
|
||||||
}
|
}
|
||||||
lines = contents.split('\n');
|
lines = contents.split('\n');
|
||||||
}
|
}
|
||||||
@@ -769,7 +768,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
|
|||||||
filePath().toString(),
|
filePath().toString(),
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
return qMakePair(includeFile, lines);
|
return {includeFile, lines};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmakePriFile::prepareForChange()
|
bool QmakePriFile::prepareForChange()
|
||||||
@@ -1284,10 +1283,9 @@ void QmakeProFile::asyncUpdate()
|
|||||||
if (!includedInExactParse())
|
if (!includedInExactParse())
|
||||||
m_readerExact->setExact(false);
|
m_readerExact->setExact(false);
|
||||||
QmakeEvalInput input = evalInput();
|
QmakeEvalInput input = evalInput();
|
||||||
QFuture<QmakeEvalResultPtr> future = Utils::runAsync(ProjectExplorerPlugin::sharedThreadPool(),
|
QFuture<QmakeEvalResultPtr> future = runAsync(ProjectExplorerPlugin::sharedThreadPool(),
|
||||||
QThread::LowestPriority,
|
QThread::LowestPriority,
|
||||||
&QmakeProFile::asyncEvaluate,
|
&QmakeProFile::asyncEvaluate, this, input);
|
||||||
this, input);
|
|
||||||
m_parseFutureWatcher->setFuture(future);
|
m_parseFutureWatcher->setFuture(future);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1401,7 +1399,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
FilePaths subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
|
FilePaths subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
|
||||||
result->errors.append(errors);
|
result->errors.append(errors);
|
||||||
|
|
||||||
foreach (const Utils::FilePath &subDirName, subDirs) {
|
foreach (const FilePath &subDirName, subDirs) {
|
||||||
auto subDir = new QmakeIncludedPriFile;
|
auto subDir = new QmakeIncludedPriFile;
|
||||||
subDir->proFile = nullptr;
|
subDir->proFile = nullptr;
|
||||||
subDir->name = subDirName;
|
subDir->name = subDirName;
|
||||||
@@ -1420,7 +1418,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
continue; // Don't attempt to map subdirs here
|
continue; // Don't attempt to map subdirs here
|
||||||
QVector<ProFile *> children = includeFiles.value(current->proFile);
|
QVector<ProFile *> children = includeFiles.value(current->proFile);
|
||||||
foreach (ProFile *child, children) {
|
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);
|
auto it = current->children.find(childName);
|
||||||
if (it == current->children.end()) {
|
if (it == current->children.end()) {
|
||||||
auto childTree = new QmakeIncludedPriFile;
|
auto childTree = new QmakeIncludedPriFile;
|
||||||
@@ -1435,8 +1433,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result->projectType == ProjectType::SubDirsTemplate) {
|
if (result->projectType == ProjectType::SubDirsTemplate) {
|
||||||
FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
|
const FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
|
||||||
foreach (const Utils::FilePath &subDirName, subDirs) {
|
for (const FilePath &subDirName : subDirs) {
|
||||||
auto it = result->includedFiles.children.find(subDirName);
|
auto it = result->includedFiles.children.find(subDirName);
|
||||||
if (it == result->includedFiles.children.end()) {
|
if (it == result->includedFiles.children.end()) {
|
||||||
auto subDir = new QmakeIncludedPriFile;
|
auto subDir = new QmakeIncludedPriFile;
|
||||||
@@ -1456,7 +1454,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
continue; // Don't attempt to map subdirs here
|
continue; // Don't attempt to map subdirs here
|
||||||
QVector<ProFile *> children = includeFiles.value(current->proFile);
|
QVector<ProFile *> children = includeFiles.value(current->proFile);
|
||||||
foreach (ProFile *child, children) {
|
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);
|
auto it = current->children.find(childName);
|
||||||
if (it == current->children.end()) {
|
if (it == current->children.end()) {
|
||||||
auto childTree = new QmakeIncludedPriFile;
|
auto childTree = new QmakeIncludedPriFile;
|
||||||
@@ -1583,8 +1581,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
if (cumulativeBuildPassReader && cumulativeBuildPassReader != input.readerCumulative)
|
if (cumulativeBuildPassReader && cumulativeBuildPassReader != input.readerCumulative)
|
||||||
delete cumulativeBuildPassReader;
|
delete cumulativeBuildPassReader;
|
||||||
|
|
||||||
QList<QPair<QmakePriFile *, QmakeIncludedPriFile *>> toCompare;
|
QList<QPair<QmakePriFile *, QmakeIncludedPriFile *>>
|
||||||
toCompare.append(qMakePair(nullptr, &result->includedFiles));
|
toCompare{{nullptr, &result->includedFiles}};
|
||||||
while (!toCompare.isEmpty()) {
|
while (!toCompare.isEmpty()) {
|
||||||
QmakePriFile *pn = toCompare.first().first;
|
QmakePriFile *pn = toCompare.first().first;
|
||||||
QmakeIncludedPriFile *tree = toCompare.first().second;
|
QmakeIncludedPriFile *tree = toCompare.first().second;
|
||||||
@@ -1608,8 +1606,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
result->directChildren << qmakePriFileNode;
|
result->directChildren << qmakePriFileNode;
|
||||||
qmakePriFileNode->setIncludedInExactParse(input.includedInExcactParse
|
qmakePriFileNode->setIncludedInExactParse(input.includedInExcactParse
|
||||||
&& result->state == QmakeEvalResult::EvalOk);
|
&& result->state == QmakeEvalResult::EvalOk);
|
||||||
result->priFiles.append(qMakePair(qmakePriFileNode, priFile->result));
|
result->priFiles.push_back({qmakePriFileNode, priFile->result});
|
||||||
toCompare.append(qMakePair(qmakePriFileNode, priFile));
|
toCompare.push_back({qmakePriFileNode, priFile});
|
||||||
} else {
|
} else {
|
||||||
auto *qmakeProFileNode = new QmakeProFile(priFile->name);
|
auto *qmakeProFileNode = new QmakeProFile(priFile->name);
|
||||||
if (pn)
|
if (pn)
|
||||||
@@ -1725,9 +1723,9 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result)
|
|||||||
|
|
||||||
if (!result->directoriesWithWildcards.isEmpty()) {
|
if (!result->directoriesWithWildcards.isEmpty()) {
|
||||||
if (!m_wildcardWatcher) {
|
if (!m_wildcardWatcher) {
|
||||||
m_wildcardWatcher = std::make_unique<Utils::FileSystemWatcher>();
|
m_wildcardWatcher = std::make_unique<FileSystemWatcher>();
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
m_wildcardWatcher.get(), &Utils::FileSystemWatcher::directoryChanged,
|
m_wildcardWatcher.get(), &FileSystemWatcher::directoryChanged,
|
||||||
[this](QString path) {
|
[this](QString path) {
|
||||||
QStringList directoryContents = QDir(path).entryList();
|
QStringList directoryContents = QDir(path).entryList();
|
||||||
if (m_wildcardDirectoryContents.value(path) != directoryContents) {
|
if (m_wildcardDirectoryContents.value(path) != directoryContents) {
|
||||||
@@ -1743,8 +1741,7 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result)
|
|||||||
});
|
});
|
||||||
for (const QString &path : directoriesToAdd)
|
for (const QString &path : directoriesToAdd)
|
||||||
m_wildcardDirectoryContents.insert(path, QDir(path).entryList());
|
m_wildcardDirectoryContents.insert(path, QDir(path).entryList());
|
||||||
m_wildcardWatcher->addDirectories(directoriesToAdd,
|
m_wildcardWatcher->addDirectories(directoriesToAdd, FileSystemWatcher::WatchModifiedDate);
|
||||||
Utils::FileSystemWatcher::WatchModifiedDate);
|
|
||||||
}
|
}
|
||||||
if (m_wildcardWatcher) {
|
if (m_wildcardWatcher) {
|
||||||
if (result->directoriesWithWildcards.isEmpty()) {
|
if (result->directoriesWithWildcards.isEmpty()) {
|
||||||
@@ -1980,8 +1977,8 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader,
|
|||||||
const QStringList installPrefixVars{"QT_INSTALL_PREFIX", "QT_INSTALL_EXAMPLES"};
|
const QStringList installPrefixVars{"QT_INSTALL_PREFIX", "QT_INSTALL_EXAMPLES"};
|
||||||
QList<QPair<QString, QString>> installPrefixValues;
|
QList<QPair<QString, QString>> installPrefixValues;
|
||||||
for (const QString &installPrefix : installPrefixVars) {
|
for (const QString &installPrefix : installPrefixVars) {
|
||||||
installPrefixValues << qMakePair(reader->propertyValue(installPrefix),
|
installPrefixValues.push_back({reader->propertyValue(installPrefix),
|
||||||
reader->propertyValue(installPrefix + "/dev"));
|
reader->propertyValue(installPrefix + "/dev")});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QString &item, itemList) {
|
foreach (const QString &item, itemList) {
|
||||||
@@ -2057,7 +2054,7 @@ FilePaths QmakeProFile::generatedFiles(const FilePath &buildDir,
|
|||||||
location = location.pathAppended("ui_"
|
location = location.pathAppended("ui_"
|
||||||
+ sourceFile.completeBaseName()
|
+ sourceFile.completeBaseName()
|
||||||
+ singleVariableValue(Variable::HeaderExtension));
|
+ singleVariableValue(Variable::HeaderExtension));
|
||||||
return { Utils::FilePath::fromString(QDir::cleanPath(location.toString())) };
|
return { FilePath::fromString(QDir::cleanPath(location.toString())) };
|
||||||
} else if (sourceFileType == FileType::StateChart) {
|
} else if (sourceFileType == FileType::StateChart) {
|
||||||
if (buildDir.isEmpty())
|
if (buildDir.isEmpty())
|
||||||
return { };
|
return { };
|
||||||
|
@@ -81,7 +81,7 @@ static Q_LOGGING_CATEGORY(qmakeBuildSystemLog, "qtc.qmake.buildsystem", QtWarnin
|
|||||||
class QmakePriFileDocument : public Core::IDocument
|
class QmakePriFileDocument : public Core::IDocument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QmakePriFileDocument(QmakePriFile *qmakePriFile, const Utils::FilePath &filePath) :
|
QmakePriFileDocument(QmakePriFile *qmakePriFile, const FilePath &filePath) :
|
||||||
IDocument(nullptr), m_priFile(qmakePriFile)
|
IDocument(nullptr), m_priFile(qmakePriFile)
|
||||||
{
|
{
|
||||||
setId("Qmake.PriFile");
|
setId("Qmake.PriFile");
|
||||||
@@ -362,7 +362,7 @@ void QmakeBuildSystem::updateCppCodeModel()
|
|||||||
if (pro->variableValue(Variable::Config).contains(QLatin1String("qt")))
|
if (pro->variableValue(Variable::Config).contains(QLatin1String("qt")))
|
||||||
rpp.setQtVersion(kitInfo.projectPartQtVersion);
|
rpp.setQtVersion(kitInfo.projectPartQtVersion);
|
||||||
else
|
else
|
||||||
rpp.setQtVersion(Utils::QtMajorVersion::None);
|
rpp.setQtVersion(QtMajorVersion::None);
|
||||||
|
|
||||||
// Header paths
|
// Header paths
|
||||||
ProjectExplorer::HeaderPaths headerPaths;
|
ProjectExplorer::HeaderPaths headerPaths;
|
||||||
@@ -381,7 +381,7 @@ void QmakeBuildSystem::updateCppCodeModel()
|
|||||||
QStringList fileList = pro->variableValue(Variable::ExactSource) + cumulativeSourceFiles;
|
QStringList fileList = pro->variableValue(Variable::ExactSource) + cumulativeSourceFiles;
|
||||||
QList<ProjectExplorer::ExtraCompiler *> proGenerators = pro->extraCompilers();
|
QList<ProjectExplorer::ExtraCompiler *> proGenerators = pro->extraCompilers();
|
||||||
foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) {
|
foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) {
|
||||||
ec->forEachTarget([&](const Utils::FilePath &generatedFile) {
|
ec->forEachTarget([&](const FilePath &generatedFile) {
|
||||||
fileList += generatedFile.toString();
|
fileList += generatedFile.toString();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -421,7 +421,7 @@ void QmakeBuildSystem::updateQmlJSCodeModel()
|
|||||||
const QStringList &cumulativeResources = file->variableValue(Variable::CumulativeResource);
|
const QStringList &cumulativeResources = file->variableValue(Variable::CumulativeResource);
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
for (const QString &rc : exactResources) {
|
for (const QString &rc : exactResources) {
|
||||||
Utils::FilePath rcPath = Utils::FilePath::fromString(rc);
|
FilePath rcPath = FilePath::fromString(rc);
|
||||||
projectInfo.activeResourceFiles.append(rcPath);
|
projectInfo.activeResourceFiles.append(rcPath);
|
||||||
projectInfo.allResourceFiles.append(rcPath);
|
projectInfo.allResourceFiles.append(rcPath);
|
||||||
QString contents;
|
QString contents;
|
||||||
@@ -430,7 +430,7 @@ void QmakeBuildSystem::updateQmlJSCodeModel()
|
|||||||
projectInfo.resourceFileContents[rcPath] = contents;
|
projectInfo.resourceFileContents[rcPath] = contents;
|
||||||
}
|
}
|
||||||
for (const QString &rc : cumulativeResources) {
|
for (const QString &rc : cumulativeResources) {
|
||||||
Utils::FilePath rcPath = Utils::FilePath::fromString(rc);
|
FilePath rcPath = FilePath::fromString(rc);
|
||||||
projectInfo.allResourceFiles.append(rcPath);
|
projectInfo.allResourceFiles.append(rcPath);
|
||||||
QString contents;
|
QString contents;
|
||||||
int id = m_qmakeVfs->idForFileName(rc, QMakeVfs::VfsCumulative);
|
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,
|
static FilePath getFullPathOf(const QmakeProFile *pro, Variable variable,
|
||||||
const BuildConfiguration *bc)
|
const BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
// Take last non-flag value, to cover e.g. '@echo $< && $$QMAKE_CC' or 'ccache gcc'
|
// Take last non-flag value, to cover e.g. '@echo $< && $$QMAKE_CC' or 'ccache gcc'
|
||||||
const QStringList values = Utils::filtered(pro->variableValue(variable),
|
const QStringList values = Utils::filtered(pro->variableValue(variable),
|
||||||
@@ -1367,12 +1367,12 @@ static Utils::FilePath getFullPathOf(const QmakeProFile *pro, Variable variable,
|
|||||||
return !value.startsWith('-');
|
return !value.startsWith('-');
|
||||||
});
|
});
|
||||||
if (values.isEmpty())
|
if (values.isEmpty())
|
||||||
return Utils::FilePath();
|
return {};
|
||||||
const QString exe = values.last();
|
const QString exe = values.last();
|
||||||
QTC_ASSERT(bc, return Utils::FilePath::fromUserInput(exe));
|
QTC_ASSERT(bc, return FilePath::fromUserInput(exe));
|
||||||
QFileInfo fi(exe);
|
QFileInfo fi(exe);
|
||||||
if (fi.isAbsolute())
|
if (fi.isAbsolute())
|
||||||
return Utils::FilePath::fromUserInput(exe);
|
return FilePath::fromUserInput(exe);
|
||||||
|
|
||||||
return bc->environment().searchInPath(exe);
|
return bc->environment().searchInPath(exe);
|
||||||
}
|
}
|
||||||
@@ -1382,12 +1382,12 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const
|
|||||||
if (!tc || path.isEmpty())
|
if (!tc || path.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const Utils::FilePath expected = tc->compilerCommand();
|
const FilePath expected = tc->compilerCommand();
|
||||||
Environment env = buildConfiguration()->environment();
|
Environment env = buildConfiguration()->environment();
|
||||||
|
|
||||||
if (tc->matchesCompilerCommand(expected, env))
|
if (tc->matchesCompilerCommand(expected, env))
|
||||||
return;
|
return;
|
||||||
const QPair<Utils::FilePath, Utils::FilePath> pair = qMakePair(expected, path);
|
const QPair<FilePath, FilePath> pair{expected, path};
|
||||||
if (m_toolChainWarnings.contains(pair))
|
if (m_toolChainWarnings.contains(pair))
|
||||||
return;
|
return;
|
||||||
// Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode.
|
// 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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant QmakeBuildSystem::additionalData(Utils::Id id) const
|
QVariant QmakeBuildSystem::additionalData(Id id) const
|
||||||
{
|
{
|
||||||
if (id == "QmlDesignerImportPath")
|
if (id == "QmlDesignerImportPath")
|
||||||
return m_rootProFile->variableValue(Variable::QmlDesignerImportPath);
|
return m_rootProFile->variableValue(Variable::QmlDesignerImportPath);
|
||||||
|
@@ -39,14 +39,14 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace QmakeProjectManager::Internal {
|
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
|
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // ugly
|
||||||
|
|
||||||
struct DirectoryData
|
struct DirectoryData
|
||||||
{
|
{
|
||||||
QString makefile;
|
QString makefile;
|
||||||
Utils::FilePath buildDirectory;
|
FilePath buildDirectory;
|
||||||
Utils::FilePath canonicalQmakeBinary;
|
FilePath canonicalQmakeBinary;
|
||||||
QtProjectImporter::QtVersionData qtVersionData;
|
QtProjectImporter::QtVersionData qtVersionData;
|
||||||
QString parsedSpec;
|
QString parsedSpec;
|
||||||
QtVersion::QmakeBuildConfigs buildConfig;
|
QtVersion::QmakeBuildConfigs buildConfig;
|
||||||
|
Reference in New Issue
Block a user