forked from qt-creator/qt-creator
De-noise some ProjectExplorer/Utils qualifications
Change-Id: Iaec01ca0e7a43592528bcaf4252540561e109919 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
74ce6e409d
commit
98723e4557
@@ -477,11 +477,11 @@ bool AndroidManifestEditorWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
void AndroidManifestEditorWidget::updateTargetComboBox()
|
||||
{
|
||||
const QString docPath(m_textEditorWidget->textDocument()->filePath().toString());
|
||||
ProjectExplorer::Project *project = androidProject(docPath);
|
||||
Project *project = androidProject(docPath);
|
||||
QStringList items;
|
||||
if (project) {
|
||||
ProjectExplorer::Kit *kit = project->activeTarget()->kit();
|
||||
if (ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(kit) == Constants::ANDROID_DEVICE_TYPE)
|
||||
Kit *kit = project->activeTarget()->kit();
|
||||
if (DeviceTypeKitInformation::deviceTypeId(kit) == Constants::ANDROID_DEVICE_TYPE)
|
||||
items = AndroidManager::androidQtSupport(project->activeTarget())->projectTargetApplications(project->activeTarget());
|
||||
}
|
||||
|
||||
|
@@ -71,6 +71,7 @@
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
// QtCreator CMake Generator wishlist:
|
||||
// Which make targets we need to build to get all executables
|
||||
@@ -171,7 +172,7 @@ void CMakeProject::activeTargetWasChanged(Target *target)
|
||||
|
||||
void CMakeProject::changeBuildDirectory(CMakeBuildConfiguration *bc, const QString &newBuildDirectory)
|
||||
{
|
||||
bc->setBuildDirectory(Utils::FileName::fromString(newBuildDirectory));
|
||||
bc->setBuildDirectory(FileName::fromString(newBuildDirectory));
|
||||
parseCMakeLists();
|
||||
}
|
||||
|
||||
@@ -493,7 +494,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
|
||||
|
||||
bool hasUserFile = activeTarget();
|
||||
if (!hasUserFile) {
|
||||
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, projectDirectory().toString(), Utils::Environment::systemEnvironment());
|
||||
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, projectDirectory().toString(), Environment::systemEnvironment());
|
||||
if (copw.exec() != QDialog::Accepted)
|
||||
return false;
|
||||
Kit *k = copw.kit();
|
||||
@@ -501,7 +502,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
|
||||
CMakeBuildConfiguration *bc(new CMakeBuildConfiguration(t));
|
||||
bc->setDefaultDisplayName(QLatin1String("all"));
|
||||
bc->setUseNinja(copw.useNinja());
|
||||
bc->setBuildDirectory(Utils::FileName::fromString(copw.buildDirectory()));
|
||||
bc->setBuildDirectory(FileName::fromString(copw.buildDirectory()));
|
||||
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
ProjectExplorer::BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
|
||||
|
||||
@@ -578,17 +579,17 @@ CMakeBuildTarget CMakeProject::buildTargetForTitle(const QString &title)
|
||||
QString CMakeProject::uiHeaderFile(const QString &uiFile)
|
||||
{
|
||||
QFileInfo fi(uiFile);
|
||||
Utils::FileName project = projectDirectory();
|
||||
Utils::FileName baseDirectory = Utils::FileName::fromString(fi.absolutePath());
|
||||
FileName project = projectDirectory();
|
||||
FileName baseDirectory = FileName::fromString(fi.absolutePath());
|
||||
|
||||
while (baseDirectory.isChildOf(project)) {
|
||||
Utils::FileName cmakeListsTxt = baseDirectory;
|
||||
FileName cmakeListsTxt = baseDirectory;
|
||||
cmakeListsTxt.appendPath(QLatin1String("CMakeLists.txt"));
|
||||
if (cmakeListsTxt.exists())
|
||||
break;
|
||||
QDir dir(baseDirectory.toString());
|
||||
dir.cdUp();
|
||||
baseDirectory = Utils::FileName::fromString(dir.absolutePath());
|
||||
baseDirectory = FileName::fromString(dir.absolutePath());
|
||||
}
|
||||
|
||||
QDir srcDirRoot = QDir(project.toString());
|
||||
@@ -699,8 +700,8 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
|
||||
if (ct.targetType == ExecutableType) {
|
||||
// TODO: Put a path to corresponding .cbp file into projectFilePath?
|
||||
appTargetList.list << BuildTargetInfo(ct.title,
|
||||
Utils::FileName::fromString(ct.executable),
|
||||
Utils::FileName::fromString(ct.executable));
|
||||
FileName::fromString(ct.executable),
|
||||
FileName::fromString(ct.executable));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,7 +742,7 @@ CMakeFile::CMakeFile(CMakeProject *parent, QString fileName)
|
||||
{
|
||||
setId("Cmake.ProjectFile");
|
||||
setMimeType(QLatin1String(Constants::CMAKEPROJECTMIMETYPE));
|
||||
setFilePath(Utils::FileName::fromString(fileName));
|
||||
setFilePath(FileName::fromString(fileName));
|
||||
}
|
||||
|
||||
bool CMakeFile::save(QString *errorString, const QString &fileName, bool autoSave)
|
||||
@@ -856,7 +857,7 @@ void CMakeBuildSettingsWidget::runCMake()
|
||||
////
|
||||
|
||||
namespace {
|
||||
int distance(const QString &targetDirectory, const Utils::FileName &fileName)
|
||||
int distance(const QString &targetDirectory, const FileName &fileName)
|
||||
{
|
||||
const QString commonParent = Utils::commonPath(QStringList() << targetDirectory << fileName.toString());
|
||||
return targetDirectory.mid(commonParent.size()).count(QLatin1Char('/'))
|
||||
@@ -871,15 +872,15 @@ int distance(const QString &targetDirectory, const Utils::FileName &fileName)
|
||||
void CMakeCbpParser::sortFiles()
|
||||
{
|
||||
QLoggingCategory log("qtc.cmakeprojectmanager.filetargetmapping");
|
||||
QList<Utils::FileName> fileNames = Utils::transform(m_fileList, [] (FileNode *node) {
|
||||
return Utils::FileName::fromString(node->path());
|
||||
QList<FileName> fileNames = Utils::transform(m_fileList, [] (FileNode *node) {
|
||||
return FileName::fromString(node->path());
|
||||
});
|
||||
|
||||
Utils::sort(fileNames);
|
||||
|
||||
|
||||
CMakeBuildTarget *last = 0;
|
||||
Utils::FileName parentDirectory;
|
||||
FileName parentDirectory;
|
||||
|
||||
qCDebug(log) << "###############";
|
||||
qCDebug(log) << "# Pre Dump #";
|
||||
@@ -908,7 +909,7 @@ void CMakeCbpParser::sortFiles()
|
||||
qCDebug(log) << "# Sorting #";
|
||||
qCDebug(log) << "###############";
|
||||
|
||||
foreach (const Utils::FileName &fileName, fileNames) {
|
||||
foreach (const FileName &fileName, fileNames) {
|
||||
qCDebug(log) << fileName;
|
||||
if (fileName.parentDir() == parentDirectory && last) {
|
||||
// easy case, same parent directory as last file
|
||||
@@ -1077,7 +1078,7 @@ void CMakeCbpParser::parseBuildTargetOption()
|
||||
QDir dir(m_buildDirectory);
|
||||
const QString relative = dir.relativeFilePath(m_buildTarget.workingDirectory);
|
||||
m_buildTarget.sourceDirectory
|
||||
= Utils::FileName::fromString(m_sourceDirectory).appendPath(relative).toString();
|
||||
= FileName::fromString(m_sourceDirectory).appendPath(relative).toString();
|
||||
}
|
||||
}
|
||||
while (!atEnd()) {
|
||||
@@ -1213,7 +1214,7 @@ void CMakeCbpParser::parseUnit()
|
||||
m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false));
|
||||
} else {
|
||||
bool generated = false;
|
||||
QString onlyFileName = Utils::FileName::fromString(fileName).fileName();
|
||||
QString onlyFileName = FileName::fromString(fileName).fileName();
|
||||
if ( (onlyFileName.startsWith(QLatin1String("moc_")) && onlyFileName.endsWith(QLatin1String(".cxx")))
|
||||
|| (onlyFileName.startsWith(QLatin1String("ui_")) && onlyFileName.endsWith(QLatin1String(".h")))
|
||||
|| (onlyFileName.startsWith(QLatin1String("qrc_")) && onlyFileName.endsWith(QLatin1String(".cxx"))))
|
||||
|
@@ -52,6 +52,7 @@ namespace {
|
||||
const char EXTERNAL_FILE_WARNING[] = "ExternalFile";
|
||||
}
|
||||
|
||||
using namespace Utils;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Internal;
|
||||
|
||||
@@ -133,8 +134,7 @@ void ProjectTree::updateFromFocus(bool invalidCurrentNode)
|
||||
{
|
||||
ProjectTreeWidget *focus = m_focusForContextMenu;
|
||||
if (!focus)
|
||||
focus = Utils::findOrDefault(m_projectTreeWidgets,
|
||||
&ProjectTree::hasFocus);
|
||||
focus = Utils::findOrDefault(m_projectTreeWidgets, &ProjectTree::hasFocus);
|
||||
|
||||
if (focus)
|
||||
updateFromProjectTreeWidget(focus);
|
||||
@@ -413,12 +413,12 @@ void ProjectTree::updateExternalFileWarning()
|
||||
}
|
||||
if (!infoBar->canInfoBeAdded(externalFileId))
|
||||
return;
|
||||
const Utils::FileName fileName = document->filePath();
|
||||
const FileName fileName = document->filePath();
|
||||
const QList<Project *> projects = SessionManager::projects();
|
||||
if (projects.isEmpty())
|
||||
return;
|
||||
foreach (Project *project, projects) {
|
||||
Utils::FileName projectDir = project->projectDirectory();
|
||||
FileName projectDir = project->projectDirectory();
|
||||
if (projectDir.isEmpty())
|
||||
continue;
|
||||
if (fileName.isChildOf(projectDir))
|
||||
@@ -426,7 +426,7 @@ void ProjectTree::updateExternalFileWarning()
|
||||
// External file. Test if it under the same VCS
|
||||
QString topLevel;
|
||||
if (Core::VcsManager::findVersionControlForDirectory(projectDir.toString(), &topLevel)
|
||||
&& fileName.isChildOf(Utils::FileName::fromString(topLevel))) {
|
||||
&& fileName.isChildOf(FileName::fromString(topLevel))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -47,6 +47,8 @@
|
||||
#include <QTcpSocket>
|
||||
#include <QTcpServer>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
namespace QmakeProjectManager {
|
||||
@@ -130,8 +132,8 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
|
||||
QString *errorMessage) const
|
||||
{
|
||||
// Get the binary either from the current Qt version of the project or Path
|
||||
if (ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(fileName)) {
|
||||
if (const ProjectExplorer::Target *target = project->activeTarget()) {
|
||||
if (Project *project = SessionManager::projectForFile(fileName)) {
|
||||
if (const Target *target = project->activeTarget()) {
|
||||
if (const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit())) {
|
||||
data->binary = (qtVersion->*commandAccessor)();
|
||||
data->workingDirectory = project->projectDirectory().toString();
|
||||
|
@@ -76,6 +76,7 @@
|
||||
#include <utils/QtConcurrentTools>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
// Static cached data in struct QmakeNodeStaticData providing information and icons
|
||||
@@ -83,41 +84,35 @@ using namespace Utils;
|
||||
// to make sure the icons do not outlive QApplication, triggering warnings on X11.
|
||||
|
||||
struct FileTypeDataStorage {
|
||||
ProjectExplorer::FileType type;
|
||||
FileType type;
|
||||
const char *typeName;
|
||||
const char *icon;
|
||||
Theme::ImageFile themeImage;
|
||||
};
|
||||
|
||||
static const FileTypeDataStorage fileTypeDataStorage[] = {
|
||||
{ ProjectExplorer::HeaderType,
|
||||
QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Headers"),
|
||||
{ HeaderType, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Headers"),
|
||||
":/qmakeprojectmanager/images/headers.png", Theme::ProjectExplorerHeader },
|
||||
{ ProjectExplorer::SourceType,
|
||||
QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Sources"),
|
||||
{ SourceType, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Sources"),
|
||||
":/qmakeprojectmanager/images/sources.png", Theme::ProjectExplorerSource },
|
||||
{ ProjectExplorer::FormType,
|
||||
QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Forms"),
|
||||
{ FormType, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Forms"),
|
||||
":/qtsupport/images/forms.png", Theme::ProjectExplorerForm },
|
||||
{ ProjectExplorer::ResourceType,
|
||||
QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Resources"),
|
||||
{ ResourceType, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Resources"),
|
||||
":/qtsupport/images/qt_qrc.png", Theme::ProjectExplorerResource },
|
||||
{ ProjectExplorer::QMLType,
|
||||
QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "QML"),
|
||||
{ QMLType, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "QML"),
|
||||
":/qtsupport/images/qml.png", Theme::ProjectExplorerQML },
|
||||
{ ProjectExplorer::UnknownFileType,
|
||||
QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Other files"),
|
||||
{ UnknownFileType, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Other files"),
|
||||
":/qmakeprojectmanager/images/unknown.png", Theme::ProjectExplorerOtherFiles }
|
||||
};
|
||||
|
||||
class SortByPath
|
||||
{
|
||||
public:
|
||||
bool operator()(ProjectExplorer::Node *a, ProjectExplorer::Node *b)
|
||||
bool operator()(Node *a, Node *b)
|
||||
{ return operator()(a->path(), b->path()); }
|
||||
bool operator()(ProjectExplorer::Node *a, const QString &b)
|
||||
bool operator()(Node *a, const QString &b)
|
||||
{ return operator()(a->path(), b); }
|
||||
bool operator()(const QString &a, ProjectExplorer::Node *b)
|
||||
bool operator()(const QString &a, Node *b)
|
||||
{ return operator()(a, b->path()); }
|
||||
bool operator()(const QString &a, const QString &b)
|
||||
{ return a < b; }
|
||||
@@ -127,12 +122,12 @@ class QmakeNodeStaticData {
|
||||
public:
|
||||
class FileTypeData {
|
||||
public:
|
||||
FileTypeData(ProjectExplorer::FileType t = ProjectExplorer::UnknownFileType,
|
||||
FileTypeData(FileType t = UnknownFileType,
|
||||
const QString &tN = QString(),
|
||||
const QIcon &i = QIcon()) :
|
||||
type(t), typeName(tN), icon(i) { }
|
||||
|
||||
ProjectExplorer::FileType type;
|
||||
FileType type;
|
||||
QString typeName;
|
||||
QIcon icon;
|
||||
};
|
||||
@@ -212,8 +207,8 @@ class PriFileEvalResult
|
||||
{
|
||||
public:
|
||||
QStringList folders;
|
||||
QSet<Utils::FileName> recursiveEnumerateFiles;
|
||||
QMap<FileType, QSet<Utils::FileName> > foundFiles;
|
||||
QSet<FileName> recursiveEnumerateFiles;
|
||||
QMap<FileType, QSet<FileName> > foundFiles;
|
||||
};
|
||||
|
||||
class EvalResult
|
||||
@@ -246,7 +241,7 @@ QmakePriFile::QmakePriFile(QmakeProjectManager::QmakePriFileNode *qmakePriFile)
|
||||
{
|
||||
setId("Qmake.PriFile");
|
||||
setMimeType(QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));
|
||||
setFilePath(Utils::FileName::fromString(m_priFile->path()));
|
||||
setFilePath(FileName::fromString(m_priFile->path()));
|
||||
}
|
||||
|
||||
bool QmakePriFile::save(QString *errorString, const QString &fileName, bool autoSave)
|
||||
@@ -335,7 +330,7 @@ struct InternalNode
|
||||
QList<InternalNode *> virtualfolders;
|
||||
QMap<QString, InternalNode *> subnodes;
|
||||
QStringList files;
|
||||
ProjectExplorer::FileType type;
|
||||
FileType type;
|
||||
int priority;
|
||||
QString displayName;
|
||||
QString typeName;
|
||||
@@ -344,7 +339,7 @@ struct InternalNode
|
||||
|
||||
InternalNode()
|
||||
{
|
||||
type = ProjectExplorer::UnknownFileType;
|
||||
type = UnknownFileType;
|
||||
priority = 0;
|
||||
}
|
||||
|
||||
@@ -372,12 +367,12 @@ struct InternalNode
|
||||
// ...
|
||||
// and afterwards calls compress() which merges directory nodes with single children, i.e. to
|
||||
// * /absolute/path
|
||||
void create(const QString &projectDir, const QSet<Utils::FileName> &newFilePaths, ProjectExplorer::FileType type)
|
||||
void create(const QString &projectDir, const QSet<FileName> &newFilePaths, FileType type)
|
||||
{
|
||||
static const QChar separator = QLatin1Char('/');
|
||||
const Utils::FileName projectDirFileName = Utils::FileName::fromString(projectDir);
|
||||
foreach (const Utils::FileName &file, newFilePaths) {
|
||||
Utils::FileName fileWithoutPrefix;
|
||||
const FileName projectDirFileName = FileName::fromString(projectDir);
|
||||
foreach (const FileName &file, newFilePaths) {
|
||||
FileName fileWithoutPrefix;
|
||||
bool isRelative;
|
||||
if (file.isChildOf(projectDirFileName)) {
|
||||
isRelative = true;
|
||||
@@ -387,7 +382,7 @@ struct InternalNode
|
||||
fileWithoutPrefix = file;
|
||||
}
|
||||
QStringList parts = fileWithoutPrefix.toString().split(separator, QString::SkipEmptyParts);
|
||||
if (!Utils::HostOsInfo::isWindowsHost() && !isRelative && parts.count() > 0)
|
||||
if (!HostOsInfo::isWindowsHost() && !isRelative && parts.count() > 0)
|
||||
parts[0].prepend(separator);
|
||||
QStringListIterator it(parts);
|
||||
InternalNode *currentNode = this;
|
||||
@@ -453,9 +448,9 @@ struct InternalNode
|
||||
}
|
||||
|
||||
// Makes the projectNode's subtree below the given folder match this internal node's subtree
|
||||
void updateSubFolders(ProjectExplorer::FolderNode *folder)
|
||||
void updateSubFolders(FolderNode *folder)
|
||||
{
|
||||
if (type == ProjectExplorer::ResourceType)
|
||||
if (type == ResourceType)
|
||||
updateResourceFiles(folder);
|
||||
else
|
||||
updateFiles(folder, type);
|
||||
@@ -481,9 +476,8 @@ struct InternalNode
|
||||
QMultiMap<QString, FolderNode *>::const_iterator oldit
|
||||
= existingFolderNodes.constFind(path);
|
||||
while (oldit != existingFolderNodes.constEnd() && oldit.key() == path) {
|
||||
if (oldit.value()->nodeType() == ProjectExplorer::VirtualFolderNodeType) {
|
||||
ProjectExplorer::VirtualFolderNode *vfn
|
||||
= dynamic_cast<ProjectExplorer::VirtualFolderNode *>(oldit.value());
|
||||
if (oldit.value()->nodeType() == VirtualFolderNodeType) {
|
||||
VirtualFolderNode *vfn = dynamic_cast<VirtualFolderNode *>(oldit.value());
|
||||
if (vfn->priority() == (*it)->priority) {
|
||||
found = true;
|
||||
break;
|
||||
@@ -511,7 +505,7 @@ struct InternalNode
|
||||
QMultiMap<QString, FolderNode *>::const_iterator oldit
|
||||
= existingFolderNodes.constFind(path);
|
||||
while (oldit != existingFolderNodes.constEnd() && oldit.key() == path) {
|
||||
if (oldit.value()->nodeType() == ProjectExplorer::FolderNodeType) {
|
||||
if (oldit.value()->nodeType() == FolderNodeType) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -566,7 +560,7 @@ struct InternalNode
|
||||
|
||||
QList<FileNode *> nodesToAdd;
|
||||
foreach (const QString &file, filesToAdd)
|
||||
nodesToAdd << new ProjectExplorer::FileNode(file, type, false);
|
||||
nodesToAdd << new FileNode(file, type, false);
|
||||
|
||||
folder->removeFileNodes(filesToRemove);
|
||||
folder->addFileNodes(nodesToAdd);
|
||||
@@ -575,13 +569,13 @@ struct InternalNode
|
||||
// Makes the folder's files match this internal node's file list
|
||||
void updateResourceFiles(FolderNode *folder)
|
||||
{
|
||||
QList<ProjectExplorer::FolderNode *> existingResourceNodes; // for resource special handling
|
||||
QList<FolderNode *> existingResourceNodes; // for resource special handling
|
||||
foreach (FolderNode *folderNode, folder->subFolderNodes()) {
|
||||
if (ResourceEditor::ResourceTopLevelNode *rn = dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(folderNode))
|
||||
existingResourceNodes << rn;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::FolderNode *> resourcesToRemove;
|
||||
QList<FolderNode *> resourcesToRemove;
|
||||
QStringList resourcesToAdd;
|
||||
|
||||
SortByPath sortByPath;
|
||||
@@ -629,9 +623,9 @@ QStringList QmakePriFileNode::fullVPaths(const QStringList &baseVPaths, QtSuppor
|
||||
return vPaths;
|
||||
}
|
||||
|
||||
QSet<Utils::FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder)
|
||||
QSet<FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder)
|
||||
{
|
||||
QSet<Utils::FileName> result;
|
||||
QSet<FileName> result;
|
||||
QFileInfo fi(folder);
|
||||
if (fi.isDir()) {
|
||||
QDir dir(folder);
|
||||
@@ -641,10 +635,10 @@ QSet<Utils::FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder
|
||||
if (file.isDir() && !file.isSymLink())
|
||||
result += recursiveEnumerate(file.absoluteFilePath());
|
||||
else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
|
||||
result += Utils::FileName(file);
|
||||
result += FileName(file);
|
||||
}
|
||||
} else if (fi.exists()) {
|
||||
result << Utils::FileName(fi);
|
||||
result << FileName(fi);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -684,7 +678,7 @@ PriFileEvalResult QmakePriFileNode::extractValues(const EvalInput &input, ProFil
|
||||
++it;
|
||||
} else {
|
||||
// move files directly to recursiveEnumerateFiles
|
||||
result.recursiveEnumerateFiles << Utils::FileName::fromString(*it);
|
||||
result.recursiveEnumerateFiles << FileName::fromString(*it);
|
||||
it = result.folders.erase(it);
|
||||
}
|
||||
} else {
|
||||
@@ -702,14 +696,14 @@ PriFileEvalResult QmakePriFileNode::extractValues(const EvalInput &input, ProFil
|
||||
for (int i = 0; i < fileTypes.size(); ++i) {
|
||||
FileType type = fileTypes.at(i).type;
|
||||
const QList<VariableAndVPathInformation> &qmakeVariables = variableAndVPathInformation.at(i);
|
||||
QSet<Utils::FileName> newFilePaths;
|
||||
QSet<FileName> newFilePaths;
|
||||
foreach (const VariableAndVPathInformation &qmakeVariable, qmakeVariables) {
|
||||
if (includeFileExact) {
|
||||
QStringList tmp = input.readerExact->absoluteFileValues(qmakeVariable.variable, input.projectDir, qmakeVariable.vPathsExact, includeFileExact);
|
||||
foreach (const QString &t, tmp) {
|
||||
tmpFi.setFile(t);
|
||||
if (tmpFi.isFile())
|
||||
newFilePaths += Utils::FileName::fromString(t);
|
||||
newFilePaths += FileName::fromString(t);
|
||||
}
|
||||
}
|
||||
if (includeFileCumlative) {
|
||||
@@ -717,7 +711,7 @@ PriFileEvalResult QmakePriFileNode::extractValues(const EvalInput &input, ProFil
|
||||
foreach (const QString &t, tmp) {
|
||||
tmpFi.setFile(t);
|
||||
if (tmpFi.isFile())
|
||||
newFilePaths += Utils::FileName::fromString(t);
|
||||
newFilePaths += FileName::fromString(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -729,7 +723,7 @@ PriFileEvalResult QmakePriFileNode::extractValues(const EvalInput &input, ProFil
|
||||
|
||||
for (int i = 0; i < fileTypes.size(); ++i) {
|
||||
FileType type = fileTypes.at(i).type;
|
||||
QSet<Utils::FileName> newFilePaths = filterFilesProVariables(type, result.foundFiles[type]);
|
||||
QSet<FileName> newFilePaths = filterFilesProVariables(type, result.foundFiles[type]);
|
||||
newFilePaths += filterFilesRecursiveEnumerata(type, result.recursiveEnumerateFiles);
|
||||
result.foundFiles[type] = newFilePaths;
|
||||
}
|
||||
@@ -742,7 +736,7 @@ void QmakePriFileNode::update(const Internal::PriFileEvalResult &result)
|
||||
{
|
||||
// add project file node
|
||||
if (m_fileNodes.isEmpty())
|
||||
addFileNodes(QList<FileNode *>() << new ProjectExplorer::FileNode(m_projectFilePath, ProjectExplorer::ProjectFileType, false));
|
||||
addFileNodes(QList<FileNode *>() << new FileNode(m_projectFilePath, ProjectFileType, false));
|
||||
|
||||
m_recursiveEnumerateFiles = result.recursiveEnumerateFiles;
|
||||
watchFolders(result.folders.toSet());
|
||||
@@ -751,7 +745,7 @@ void QmakePriFileNode::update(const Internal::PriFileEvalResult &result)
|
||||
const QVector<QmakeNodeStaticData::FileTypeData> &fileTypes = qmakeNodeStaticData()->fileTypeData;
|
||||
for (int i = 0; i < fileTypes.size(); ++i) {
|
||||
FileType type = fileTypes.at(i).type;
|
||||
const QSet<Utils::FileName> &newFilePaths = result.foundFiles.value(type);
|
||||
const QSet<FileName> &newFilePaths = result.foundFiles.value(type);
|
||||
// We only need to save this information if
|
||||
// we are watching folders
|
||||
if (!result.folders.isEmpty())
|
||||
@@ -792,19 +786,19 @@ void QmakePriFileNode::watchFolders(const QSet<QString> &folders)
|
||||
m_watchedFolders = folders;
|
||||
}
|
||||
|
||||
bool QmakePriFileNode::folderChanged(const QString &changedFolder, const QSet<Utils::FileName> &newFiles)
|
||||
bool QmakePriFileNode::folderChanged(const QString &changedFolder, const QSet<FileName> &newFiles)
|
||||
{
|
||||
//qDebug()<<"########## QmakePriFileNode::folderChanged";
|
||||
// So, we need to figure out which files changed.
|
||||
|
||||
QSet<Utils::FileName> addedFiles = newFiles;
|
||||
QSet<FileName> addedFiles = newFiles;
|
||||
addedFiles.subtract(m_recursiveEnumerateFiles);
|
||||
|
||||
QSet<Utils::FileName> removedFiles = m_recursiveEnumerateFiles;
|
||||
QSet<FileName> removedFiles = m_recursiveEnumerateFiles;
|
||||
removedFiles.subtract(newFiles);
|
||||
|
||||
foreach (const Utils::FileName &file, removedFiles) {
|
||||
if (!file.isChildOf(Utils::FileName::fromString(changedFolder)))
|
||||
foreach (const FileName &file, removedFiles) {
|
||||
if (!file.isChildOf(FileName::fromString(changedFolder)))
|
||||
removedFiles.remove(file);
|
||||
}
|
||||
|
||||
@@ -818,8 +812,8 @@ bool QmakePriFileNode::folderChanged(const QString &changedFolder, const QSet<Ut
|
||||
const QVector<QmakeNodeStaticData::FileTypeData> &fileTypes = qmakeNodeStaticData()->fileTypeData;
|
||||
for (int i = 0; i < fileTypes.size(); ++i) {
|
||||
FileType type = fileTypes.at(i).type;
|
||||
QSet<Utils::FileName> add = filterFilesRecursiveEnumerata(type, addedFiles);
|
||||
QSet<Utils::FileName> remove = filterFilesRecursiveEnumerata(type, removedFiles);
|
||||
QSet<FileName> add = filterFilesRecursiveEnumerata(type, addedFiles);
|
||||
QSet<FileName> remove = filterFilesRecursiveEnumerata(type, removedFiles);
|
||||
|
||||
if (!add.isEmpty() || !remove.isEmpty()) {
|
||||
// Scream :)
|
||||
@@ -870,12 +864,12 @@ bool QmakePriFileNode::deploysFolder(const QString &folder) const
|
||||
return false;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::RunConfiguration *> QmakePriFileNode::runConfigurations() const
|
||||
QList<RunConfiguration *> QmakePriFileNode::runConfigurations() const
|
||||
{
|
||||
QmakeRunConfigurationFactory *factory = QmakeRunConfigurationFactory::find(m_project->activeTarget());
|
||||
if (factory)
|
||||
return factory->runConfigurationsForNode(m_project->activeTarget(), this);
|
||||
return QList<ProjectExplorer::RunConfiguration *>();
|
||||
return QList<RunConfiguration *>();
|
||||
}
|
||||
|
||||
QList<QmakePriFileNode *> QmakePriFileNode::subProjectNodesExact() const
|
||||
@@ -904,9 +898,9 @@ void QmakePriFileNode::setIncludedInExactParse(bool b)
|
||||
m_includedInExactParse = b;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
|
||||
QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
|
||||
{
|
||||
QList<ProjectExplorer::ProjectAction> actions;
|
||||
QList<ProjectAction> actions;
|
||||
|
||||
const FolderNode *folderNode = this;
|
||||
const QmakeProFileNode *proFileNode;
|
||||
@@ -922,14 +916,14 @@ QList<ProjectExplorer::ProjectAction> QmakePriFileNode::supportedActions(Node *n
|
||||
// projects (e.g. cpp). It'd be nice if the "add" action could
|
||||
// work on a subset of the file types according to project type.
|
||||
|
||||
actions << ProjectExplorer::AddNewFile;
|
||||
if (m_recursiveEnumerateFiles.contains(Utils::FileName::fromString(node->path())))
|
||||
actions << ProjectExplorer::EraseFile;
|
||||
actions << AddNewFile;
|
||||
if (m_recursiveEnumerateFiles.contains(FileName::fromString(node->path())))
|
||||
actions << EraseFile;
|
||||
else
|
||||
actions << ProjectExplorer::RemoveFile;
|
||||
actions << RemoveFile;
|
||||
|
||||
bool addExistingFiles = true;
|
||||
if (node->nodeType() == ProjectExplorer::VirtualFolderNodeType) {
|
||||
if (node->nodeType() == VirtualFolderNodeType) {
|
||||
// A virtual folder, we do what the projectexplorer does
|
||||
FolderNode *folder = dynamic_cast<FolderNode *>(node);
|
||||
if (folder) {
|
||||
@@ -944,27 +938,27 @@ QList<ProjectExplorer::ProjectAction> QmakePriFileNode::supportedActions(Node *n
|
||||
addExistingFiles = addExistingFiles && !deploysFolder(node->path());
|
||||
|
||||
if (addExistingFiles)
|
||||
actions << ProjectExplorer::AddExistingFile << ProjectExplorer::AddExistingDirectory;
|
||||
actions << AddExistingFile << AddExistingDirectory;
|
||||
|
||||
break;
|
||||
}
|
||||
case SubDirsTemplate:
|
||||
actions << ProjectExplorer::AddSubProject << ProjectExplorer::RemoveSubProject;
|
||||
actions << AddSubProject << RemoveSubProject;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ProjectExplorer::FileNode *fileNode = dynamic_cast<FileNode *>(node);
|
||||
if ((fileNode && fileNode->fileType() != ProjectExplorer::ProjectFileType)
|
||||
FileNode *fileNode = dynamic_cast<FileNode *>(node);
|
||||
if ((fileNode && fileNode->fileType() != ProjectFileType)
|
||||
|| dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node))
|
||||
actions << ProjectExplorer::Rename;
|
||||
actions << Rename;
|
||||
|
||||
|
||||
ProjectExplorer::Target *target = m_project->activeTarget();
|
||||
Target *target = m_project->activeTarget();
|
||||
QmakeRunConfigurationFactory *factory = QmakeRunConfigurationFactory::find(target);
|
||||
if (factory && !factory->runConfigurationsForNode(target, node).isEmpty())
|
||||
actions << ProjectExplorer::HasSubProjectRunConfigurations;
|
||||
actions << HasSubProjectRunConfigurations;
|
||||
|
||||
return actions;
|
||||
}
|
||||
@@ -992,7 +986,7 @@ static QString simplifyProFilePath(const QString &proFilePath)
|
||||
|
||||
bool QmakePriFileNode::addSubProjects(const QStringList &proFilePaths)
|
||||
{
|
||||
ProjectExplorer::FindAllFilesVisitor visitor;
|
||||
FindAllFilesVisitor visitor;
|
||||
accept(&visitor);
|
||||
const QStringList &allFiles = visitor.filePaths();
|
||||
|
||||
@@ -1027,7 +1021,7 @@ bool QmakePriFileNode::addFiles(const QStringList &filePaths, QStringList *notAd
|
||||
// So it's obviously a bit limited, but in those cases you need to edit the
|
||||
// project files manually anyway.
|
||||
|
||||
ProjectExplorer::FindAllFilesVisitor visitor;
|
||||
FindAllFilesVisitor visitor;
|
||||
accept(&visitor);
|
||||
const QStringList &allFiles = visitor.filePaths();
|
||||
|
||||
@@ -1118,10 +1112,10 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
{
|
||||
Q_UNUSED(files)
|
||||
return ProjectExplorer::FolderNode::AddNewInformation(FileName::fromString(path()).fileName(), context && context->projectNode() == this ? 120 : 90);
|
||||
return FolderNode::AddNewInformation(FileName::fromString(path()).fileName(), context && context->projectNode() == this ? 120 : 90);
|
||||
}
|
||||
|
||||
bool QmakePriFileNode::priFileWritable(const QString &path)
|
||||
@@ -1209,7 +1203,7 @@ QPair<ProFile *, QStringList> QmakePriFileNode::readProFile(const QString &file)
|
||||
{
|
||||
QString contents;
|
||||
{
|
||||
Utils::FileReader reader;
|
||||
FileReader reader;
|
||||
if (!reader.fetch(file, QIODevice::Text)) {
|
||||
QmakeProject::proFileParseError(reader.errorString());
|
||||
return qMakePair(includeFile, lines);
|
||||
@@ -1287,7 +1281,7 @@ bool QmakePriFileNode::setProVariable(const QString &var, const QStringList &val
|
||||
void QmakePriFileNode::save(const QStringList &lines)
|
||||
{
|
||||
Core::DocumentManager::expectFileChange(m_projectFilePath);
|
||||
Utils::FileSaver saver(m_projectFilePath, QIODevice::Text);
|
||||
FileSaver saver(m_projectFilePath, QIODevice::Text);
|
||||
saver.write(lines.join(QLatin1Char('\n')).toLocal8Bit());
|
||||
saver.finalize(Core::ICore::mainWindow());
|
||||
|
||||
@@ -1310,15 +1304,15 @@ void QmakePriFileNode::save(const QStringList &lines)
|
||||
errorStrings.join(QLatin1Char('\n')));
|
||||
}
|
||||
|
||||
QStringList QmakePriFileNode::varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact)
|
||||
QStringList QmakePriFileNode::varNames(FileType type, QtSupport::ProFileReader *readerExact)
|
||||
{
|
||||
QStringList vars;
|
||||
switch (type) {
|
||||
case ProjectExplorer::HeaderType:
|
||||
case HeaderType:
|
||||
vars << QLatin1String("HEADERS");
|
||||
vars << QLatin1String("PRECOMPILED_HEADER");
|
||||
break;
|
||||
case ProjectExplorer::SourceType: {
|
||||
case SourceType: {
|
||||
vars << QLatin1String("SOURCES");
|
||||
QStringList listOfExtraCompilers = readerExact->values(QLatin1String("QMAKE_EXTRA_COMPILERS"));
|
||||
foreach (const QString &var, listOfExtraCompilers) {
|
||||
@@ -1332,16 +1326,16 @@ QStringList QmakePriFileNode::varNames(ProjectExplorer::FileType type, QtSupport
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ProjectExplorer::ResourceType:
|
||||
case ResourceType:
|
||||
vars << QLatin1String("RESOURCES");
|
||||
break;
|
||||
case ProjectExplorer::FormType:
|
||||
case FormType:
|
||||
vars << QLatin1String("FORMS");
|
||||
break;
|
||||
case ProjectExplorer::ProjectFileType:
|
||||
case ProjectFileType:
|
||||
vars << QLatin1String("SUBDIRS");
|
||||
break;
|
||||
case ProjectExplorer::QMLType:
|
||||
case QMLType:
|
||||
vars << QLatin1String("OTHER_FILES");
|
||||
vars << QLatin1String("DISTFILES");
|
||||
break;
|
||||
@@ -1449,34 +1443,34 @@ QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerEx
|
||||
return result;
|
||||
}
|
||||
|
||||
QSet<Utils::FileName> QmakePriFileNode::filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files)
|
||||
QSet<FileName> QmakePriFileNode::filterFilesProVariables(FileType fileType, const QSet<FileName> &files)
|
||||
{
|
||||
if (fileType != ProjectExplorer::QMLType && fileType != ProjectExplorer::UnknownFileType)
|
||||
if (fileType != QMLType && fileType != UnknownFileType)
|
||||
return files;
|
||||
QSet<Utils::FileName> result;
|
||||
if (fileType == ProjectExplorer::QMLType) {
|
||||
foreach (const Utils::FileName &file, files)
|
||||
QSet<FileName> result;
|
||||
if (fileType == QMLType) {
|
||||
foreach (const FileName &file, files)
|
||||
if (file.toString().endsWith(QLatin1String(".qml")))
|
||||
result << file;
|
||||
} else {
|
||||
foreach (const Utils::FileName &file, files)
|
||||
foreach (const FileName &file, files)
|
||||
if (!file.toString().endsWith(QLatin1String(".qml")))
|
||||
result << file;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QSet<Utils::FileName> QmakePriFileNode::filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files)
|
||||
QSet<FileName> QmakePriFileNode::filterFilesRecursiveEnumerata(FileType fileType, const QSet<FileName> &files)
|
||||
{
|
||||
QSet<Utils::FileName> result;
|
||||
if (fileType != ProjectExplorer::QMLType && fileType != ProjectExplorer::UnknownFileType)
|
||||
QSet<FileName> result;
|
||||
if (fileType != QMLType && fileType != UnknownFileType)
|
||||
return result;
|
||||
if (fileType == ProjectExplorer::QMLType) {
|
||||
foreach (const Utils::FileName &file, files)
|
||||
if (fileType == QMLType) {
|
||||
foreach (const FileName &file, files)
|
||||
if (file.toString().endsWith(QLatin1String(".qml")))
|
||||
result << file;
|
||||
} else {
|
||||
foreach (const Utils::FileName &file, files)
|
||||
foreach (const FileName &file, files)
|
||||
if (!file.toString().endsWith(QLatin1String(".qml")))
|
||||
result << file;
|
||||
}
|
||||
@@ -1506,7 +1500,7 @@ static QmakeProjectType proFileTemplateTypeToProjectType(ProFileEvaluator::Templ
|
||||
|
||||
namespace {
|
||||
// find all ui files in project
|
||||
class FindUiFileNodesVisitor : public ProjectExplorer::NodesVisitor {
|
||||
class FindUiFileNodesVisitor : public NodesVisitor {
|
||||
public:
|
||||
void visitProjectNode(ProjectNode *projectNode)
|
||||
{
|
||||
@@ -1515,7 +1509,7 @@ namespace {
|
||||
void visitFolderNode(FolderNode *folderNode)
|
||||
{
|
||||
foreach (FileNode *fileNode, folderNode->fileNodes()) {
|
||||
if (fileNode->fileType() == ProjectExplorer::FormType)
|
||||
if (fileNode->fileType() == FormType)
|
||||
uiFileNodes << fileNode;
|
||||
}
|
||||
}
|
||||
@@ -1542,7 +1536,7 @@ QString QmakeProFileNode::makefile() const
|
||||
QString QmakeProFileNode::objectExtension() const
|
||||
{
|
||||
if (m_varValues[ObjectExt].isEmpty())
|
||||
return Utils::HostOsInfo::isWindowsHost() ? QLatin1String(".obj") : QLatin1String(".o");
|
||||
return HostOsInfo::isWindowsHost() ? QLatin1String(".obj") : QLatin1String(".o");
|
||||
return m_varValues[ObjectExt].first();
|
||||
}
|
||||
|
||||
@@ -1620,7 +1614,7 @@ bool QmakeProFileNode::showInSimpleTree() const
|
||||
return showInSimpleTree(projectType()) || m_project->rootProjectNode() == this;
|
||||
}
|
||||
|
||||
ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
|
||||
{
|
||||
Q_UNUSED(files)
|
||||
return AddNewInformation(FileName::fromString(path()).fileName(), context && context->projectNode() == this ? 120 : 100);
|
||||
@@ -1743,8 +1737,8 @@ EvalInput QmakeProFileNode::evalInput() const
|
||||
input.buildDirectory = buildDir();
|
||||
input.readerExact = m_readerExact;
|
||||
input.readerCumulative = m_readerCumulative;
|
||||
ProjectExplorer::Target *t = m_project->activeTarget();
|
||||
ProjectExplorer::Kit *k = t ? t->kit() : ProjectExplorer::KitManager::defaultKit();
|
||||
Target *t = m_project->activeTarget();
|
||||
Kit *k = t ? t->kit() : KitManager::defaultKit();
|
||||
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k);
|
||||
input.isQt5 = !qtVersion || qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5,0,0);
|
||||
input.qmakeGlobals = m_project->qmakeGlobals();
|
||||
@@ -2069,12 +2063,12 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
bool changesShowInSimpleTree = showInSimpleTree() ^ showInSimpleTree(result->projectType);
|
||||
|
||||
if (changesShowInSimpleTree)
|
||||
ProjectExplorer::ProjectTree::instance()->emitAboutToChangeShowInSimpleTree(this);
|
||||
ProjectTree::instance()->emitAboutToChangeShowInSimpleTree(this);
|
||||
|
||||
m_projectType = result->projectType;
|
||||
|
||||
if (changesShowInSimpleTree)
|
||||
ProjectExplorer::ProjectTree::instance()->emitShowInSimpleTreeChanged(this);
|
||||
ProjectTree::instance()->emitShowInSimpleTreeChanged(this);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2177,7 +2171,7 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
|
||||
// Loop preventation, make sure that exact same node is not in our parent chain
|
||||
bool loop = false;
|
||||
ProjectExplorer::Node *n = this;
|
||||
Node *n = this;
|
||||
while ((n = n->parentFolderNode())) {
|
||||
if (dynamic_cast<QmakePriFileNode *>(n) && n->path() == nodeToAdd) {
|
||||
loop = true;
|
||||
@@ -2492,11 +2486,11 @@ void QmakeProFileNode::updateUiFiles(const QString &buildDir)
|
||||
// Find all ui files
|
||||
FindUiFileNodesVisitor uiFilesVisitor;
|
||||
this->accept(&uiFilesVisitor);
|
||||
const QList<ProjectExplorer::FileNode*> uiFiles = uiFilesVisitor.uiFileNodes;
|
||||
const QList<FileNode*> uiFiles = uiFilesVisitor.uiFileNodes;
|
||||
|
||||
// Find the UiDir, there can only ever be one
|
||||
const QString uiDir = uiDirectory(buildDir);
|
||||
foreach (const ProjectExplorer::FileNode *uiFile, uiFiles)
|
||||
foreach (const FileNode *uiFile, uiFiles)
|
||||
m_uiFiles.insert(uiFile->path(), uiHeaderFile(uiDir, uiFile->path()));
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ enum { debug = 0 };
|
||||
|
||||
namespace {
|
||||
|
||||
QmakeBuildConfiguration *enableActiveQmakeBuildConfiguration(ProjectExplorer::Target *t, bool enabled)
|
||||
QmakeBuildConfiguration *enableActiveQmakeBuildConfiguration(Target *t, bool enabled)
|
||||
{
|
||||
if (!t)
|
||||
return 0;
|
||||
@@ -171,8 +171,8 @@ public:
|
||||
void clear();
|
||||
bool equals(const QmakeProjectFiles &f) const;
|
||||
|
||||
QStringList files[ProjectExplorer::FileTypeSize];
|
||||
QStringList generatedFiles[ProjectExplorer::FileTypeSize];
|
||||
QStringList files[FileTypeSize];
|
||||
QStringList generatedFiles[FileTypeSize];
|
||||
QStringList proFiles;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ QDebug operator<<(QDebug d, const QmakeProjectFiles &f)
|
||||
}
|
||||
|
||||
// A visitor to collect all files of a project in a QmakeProjectFiles struct
|
||||
class ProjectFilesVisitor : public ProjectExplorer::NodesVisitor
|
||||
class ProjectFilesVisitor : public NodesVisitor
|
||||
{
|
||||
ProjectFilesVisitor(QmakeProjectFiles *files);
|
||||
|
||||
@@ -283,7 +283,7 @@ QmakeProjectFile::QmakeProjectFile(const QString &filePath, QObject *parent)
|
||||
{
|
||||
setId("Qmake.ProFile");
|
||||
setMimeType(QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));
|
||||
setFilePath(Utils::FileName::fromString(filePath));
|
||||
setFilePath(FileName::fromString(filePath));
|
||||
}
|
||||
|
||||
bool QmakeProjectFile::save(QString *, const QString &, bool)
|
||||
@@ -417,12 +417,13 @@ bool QmakeProject::fromMap(const QVariantMap &map)
|
||||
|
||||
// On active buildconfiguration changes, reevaluate the .pro files
|
||||
m_activeTarget = activeTarget();
|
||||
if (m_activeTarget)
|
||||
connect(m_activeTarget, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(scheduleAsyncUpdate()));
|
||||
if (m_activeTarget) {
|
||||
connect(m_activeTarget, &Target::activeBuildConfigurationChanged,
|
||||
this, &QmakeProject::scheduleAsyncUpdateLater);
|
||||
}
|
||||
|
||||
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
|
||||
this, SLOT(activeTargetWasChanged()));
|
||||
connect(this, &Project::activeTargetChanged,
|
||||
this, &QmakeProject::activeTargetWasChanged);
|
||||
|
||||
scheduleAsyncUpdate(QmakeProFileNode::ParseNow);
|
||||
return true;
|
||||
@@ -472,7 +473,7 @@ void QmakeProject::updateCppCodeModel()
|
||||
|
||||
Kit *k = 0;
|
||||
QtSupport::BaseQtVersion *qtVersion = 0;
|
||||
if (ProjectExplorer::Target *target = activeTarget())
|
||||
if (Target *target = activeTarget())
|
||||
k = target->kit();
|
||||
else
|
||||
k = KitManager::defaultKit();
|
||||
@@ -623,7 +624,7 @@ void QmakeProject::updateQmlJSCodeModel()
|
||||
bool hasQmlLib = false;
|
||||
foreach (QmakeProFileNode *node, proFiles) {
|
||||
foreach (const QString &path, node->variableValue(QmlImportPathVar))
|
||||
projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(path),
|
||||
projectInfo.importPaths.maybeInsert(FileName::fromString(path),
|
||||
QmlJS::Dialect::Qml);
|
||||
projectInfo.activeResourceFiles.append(node->variableValue(ExactResourceVar));
|
||||
projectInfo.allResourceFiles.append(node->variableValue(ResourceVar));
|
||||
@@ -884,7 +885,7 @@ void QmakeProject::buildFinished(bool success)
|
||||
m_qmakeVfs->invalidateContents();
|
||||
}
|
||||
|
||||
ProjectExplorer::IProjectManager *QmakeProject::projectManager() const
|
||||
IProjectManager *QmakeProject::projectManager() const
|
||||
{
|
||||
return m_manager;
|
||||
}
|
||||
@@ -970,7 +971,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo
|
||||
m_qmakeGlobalsRefCnt = 0;
|
||||
|
||||
Kit *k;
|
||||
Utils::Environment env = Utils::Environment::systemEnvironment();
|
||||
Environment env = Environment::systemEnvironment();
|
||||
QStringList qmakeArgs;
|
||||
if (!bc)
|
||||
bc = activeTarget() ? static_cast<QmakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration()) : 0;
|
||||
@@ -997,7 +998,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo
|
||||
m_qmakeGlobals->setDirectories(m_rootProjectNode->sourceDir(), m_rootProjectNode->buildDir());
|
||||
m_qmakeGlobals->sysroot = systemRoot;
|
||||
|
||||
Utils::Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
||||
Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
||||
for (; eit != eend; ++eit)
|
||||
m_qmakeGlobals->environment.insert(env.key(eit), env.value(eit));
|
||||
|
||||
@@ -1053,7 +1054,7 @@ void QmakeProject::destroyProFileReader(QtSupport::ProFileReader *reader)
|
||||
}
|
||||
}
|
||||
|
||||
ProjectExplorer::ProjectNode *QmakeProject::rootProjectNode() const
|
||||
ProjectNode *QmakeProject::rootProjectNode() const
|
||||
{
|
||||
return m_rootProjectNode;
|
||||
}
|
||||
@@ -1139,8 +1140,8 @@ QList<Core::Id> QmakeProject::idsForNodes(Core::Id base, const QList<QmakeProFil
|
||||
void QmakeProject::activeTargetWasChanged()
|
||||
{
|
||||
if (m_activeTarget) {
|
||||
disconnect(m_activeTarget, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(scheduleAsyncUpdate()));
|
||||
disconnect(m_activeTarget, &Target::activeBuildConfigurationChanged,
|
||||
this, &QmakeProject::scheduleAsyncUpdateLater);
|
||||
}
|
||||
|
||||
m_activeTarget = activeTarget();
|
||||
@@ -1148,8 +1149,8 @@ void QmakeProject::activeTargetWasChanged()
|
||||
if (!m_activeTarget)
|
||||
return;
|
||||
|
||||
connect(m_activeTarget, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(scheduleAsyncUpdate()));
|
||||
connect(m_activeTarget, &Target::activeBuildConfigurationChanged,
|
||||
this, &QmakeProject::scheduleAsyncUpdateLater);
|
||||
|
||||
scheduleAsyncUpdate();
|
||||
}
|
||||
@@ -1346,7 +1347,7 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
||||
QList<QmakePriFileNode *> nodes = m_map.values(dir);
|
||||
if (!nodes.isEmpty()) {
|
||||
// Collect all the files
|
||||
QSet<Utils::FileName> newFiles;
|
||||
QSet<FileName> newFiles;
|
||||
newFiles += QmakePriFileNode::recursiveEnumerate(folder);
|
||||
foreach (QmakePriFileNode *node, nodes) {
|
||||
newOrRemovedFiles = newOrRemovedFiles
|
||||
@@ -1465,8 +1466,8 @@ void QmakeProject::updateBuildSystemData()
|
||||
BuildTargetInfoList appTargetList;
|
||||
foreach (const QmakeProFileNode * const node, applicationProFiles()) {
|
||||
appTargetList.list << BuildTargetInfo(node->targetInformation().target,
|
||||
Utils::FileName::fromString(executableFor(node)),
|
||||
Utils::FileName::fromString(node->path()));
|
||||
FileName::fromString(executableFor(node)),
|
||||
FileName::fromString(node->path()));
|
||||
}
|
||||
target->setApplicationTargets(appTargetList);
|
||||
}
|
||||
@@ -1526,9 +1527,8 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
|
||||
const QString targetPath = node->installsList().targetPath;
|
||||
if (targetPath.isEmpty())
|
||||
return;
|
||||
const ProjectExplorer::Kit * const kit = activeTarget()->kit();
|
||||
const ProjectExplorer::ToolChain * const toolchain
|
||||
= ProjectExplorer::ToolChainKitInformation::toolChain(kit);
|
||||
const Kit * const kit = activeTarget()->kit();
|
||||
const ToolChain * const toolchain = ToolChainKitInformation::toolChain(kit);
|
||||
if (!toolchain)
|
||||
return;
|
||||
|
||||
@@ -1538,7 +1538,7 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
|
||||
const bool isStatic = config.contains(QLatin1String("static"));
|
||||
const bool isPlugin = config.contains(QLatin1String("plugin"));
|
||||
switch (toolchain->targetAbi().os()) {
|
||||
case ProjectExplorer::Abi::WindowsOS: {
|
||||
case Abi::WindowsOS: {
|
||||
QString targetVersionExt = node->singleVariableValue(TargetVersionExtVar);
|
||||
if (targetVersionExt.isEmpty()) {
|
||||
const QString version = node->singleVariableValue(VersionVar);
|
||||
@@ -1553,7 +1553,7 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
|
||||
deploymentData.addFile(destDirFor(ti) + QLatin1Char('/') + targetFileName, targetPath);
|
||||
break;
|
||||
}
|
||||
case ProjectExplorer::Abi::MacOS: {
|
||||
case Abi::MacOS: {
|
||||
QString destDir = destDirFor(ti);
|
||||
if (config.contains(QLatin1String("lib_bundle"))) {
|
||||
destDir.append(QLatin1Char('/')).append(ti.target)
|
||||
@@ -1575,9 +1575,9 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
|
||||
deploymentData.addFile(destDir + QLatin1Char('/') + targetFileName, targetPath);
|
||||
break;
|
||||
}
|
||||
case ProjectExplorer::Abi::LinuxOS:
|
||||
case ProjectExplorer::Abi::BsdOS:
|
||||
case ProjectExplorer::Abi::UnixOS:
|
||||
case Abi::LinuxOS:
|
||||
case Abi::BsdOS:
|
||||
case Abi::UnixOS:
|
||||
targetFileName.prepend(QLatin1String("lib"));
|
||||
targetFileName += QLatin1Char('.');
|
||||
if (isStatic) {
|
||||
@@ -1609,7 +1609,7 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
|
||||
bool QmakeProject::matchesKit(const Kit *kit)
|
||||
{
|
||||
QList<QtSupport::BaseQtVersion *> parentQts;
|
||||
Utils::FileName filePath = projectFilePath();
|
||||
FileName filePath = projectFilePath();
|
||||
foreach (QtSupport::BaseQtVersion *version, QtSupport::QtVersionManager::validVersions()) {
|
||||
if (version->isSubProject(filePath))
|
||||
parentQts.append(version);
|
||||
@@ -1623,9 +1623,8 @@ bool QmakeProject::matchesKit(const Kit *kit)
|
||||
|
||||
QString QmakeProject::executableFor(const QmakeProFileNode *node)
|
||||
{
|
||||
const ProjectExplorer::Kit * const kit = activeTarget()->kit();
|
||||
const ProjectExplorer::ToolChain * const toolchain
|
||||
= ProjectExplorer::ToolChainKitInformation::toolChain(kit);
|
||||
const Kit * const kit = activeTarget()->kit();
|
||||
const ToolChain * const toolchain = ToolChainKitInformation::toolChain(kit);
|
||||
if (!toolchain)
|
||||
return QString();
|
||||
|
||||
@@ -1633,7 +1632,7 @@ QString QmakeProject::executableFor(const QmakeProFileNode *node)
|
||||
QString target;
|
||||
|
||||
switch (toolchain->targetAbi().os()) {
|
||||
case ProjectExplorer::Abi::MacOS:
|
||||
case Abi::MacOS:
|
||||
if (node->variableValue(ConfigVar).contains(QLatin1String("app_bundle"))) {
|
||||
target = ti.target + QLatin1String(".app/Contents/MacOS/") + ti.target;
|
||||
break;
|
||||
|
@@ -150,6 +150,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void scheduleAsyncUpdate(QmakeProFileNode::AsyncUpdateDelay delay = QmakeProFileNode::ParseLater);
|
||||
void scheduleAsyncUpdateLater() { scheduleAsyncUpdate(); }
|
||||
|
||||
protected:
|
||||
bool fromMap(const QVariantMap &map);
|
||||
|
@@ -57,6 +57,8 @@
|
||||
#include <QPlainTextEdit>
|
||||
#include <QApplication>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
enum {
|
||||
debug = false
|
||||
};
|
||||
@@ -212,7 +214,7 @@ QString DesignDocument::fileName() const
|
||||
return editor()->document()->filePath().toString();
|
||||
}
|
||||
|
||||
ProjectExplorer::Kit *DesignDocument::currentKit() const
|
||||
Kit *DesignDocument::currentKit() const
|
||||
{
|
||||
return m_currentKit;
|
||||
}
|
||||
@@ -626,9 +628,9 @@ void DesignDocument::redo()
|
||||
viewManager().resetPropertyEditorView();
|
||||
}
|
||||
|
||||
static bool isFileInProject(DesignDocument *designDocument, ProjectExplorer::Project *project)
|
||||
static bool isFileInProject(DesignDocument *designDocument, Project *project)
|
||||
{
|
||||
foreach (const QString &fileNameInProject, project->files(ProjectExplorer::Project::ExcludeGeneratedFiles)) {
|
||||
foreach (const QString &fileNameInProject, project->files(Project::ExcludeGeneratedFiles)) {
|
||||
if (designDocument->fileName() == fileNameInProject)
|
||||
return true;
|
||||
}
|
||||
@@ -636,12 +638,12 @@ static bool isFileInProject(DesignDocument *designDocument, ProjectExplorer::Pro
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline ProjectExplorer::Kit *getActiveKit(DesignDocument *designDocument)
|
||||
static inline Kit *getActiveKit(DesignDocument *designDocument)
|
||||
{
|
||||
ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectTree::currentProject();
|
||||
Project *currentProject = ProjectTree::currentProject();
|
||||
|
||||
if (!currentProject)
|
||||
currentProject = ProjectExplorer::SessionManager::projectForFile(designDocument->fileName());
|
||||
currentProject = SessionManager::projectForFile(designDocument->fileName());
|
||||
|
||||
if (!currentProject)
|
||||
return 0;
|
||||
@@ -649,18 +651,20 @@ static inline ProjectExplorer::Kit *getActiveKit(DesignDocument *designDocument)
|
||||
if (!isFileInProject(designDocument, currentProject))
|
||||
return 0;
|
||||
|
||||
QObject::connect(ProjectExplorer::ProjectTree::instance(), &ProjectExplorer::ProjectTree::currentProjectChanged,
|
||||
QObject::connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged,
|
||||
designDocument, &DesignDocument::updateActiveQtVersion, Qt::UniqueConnection);
|
||||
|
||||
designDocument->connect(currentProject, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), designDocument, SLOT(updateActiveQtVersion()), Qt::UniqueConnection);
|
||||
QObject::connect(currentProject, &Project::activeTargetChanged,
|
||||
designDocument, &DesignDocument::updateActiveQtVersion, Qt::UniqueConnection);
|
||||
|
||||
|
||||
ProjectExplorer::Target *target = currentProject->activeTarget();
|
||||
Target *target = currentProject->activeTarget();
|
||||
|
||||
if (!target)
|
||||
return 0;
|
||||
|
||||
designDocument->connect(target, SIGNAL(kitChanged()), designDocument, SLOT(updateActiveQtVersion()), Qt::UniqueConnection);
|
||||
QObject::connect(target, &Target::kitChanged,
|
||||
designDocument, &DesignDocument::updateActiveQtVersion, Qt::UniqueConnection);
|
||||
|
||||
return target->kit();
|
||||
}
|
||||
|
Reference in New Issue
Block a user