Commit 98723e45 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

De-noise some ProjectExplorer/Utils qualifications

Change-Id: Iaec01ca0e7a43592528bcaf4252540561e109919
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 74ce6e40
......@@ -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();
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment