Commit 9d3c5c6f authored by Tobias Hunger's avatar Tobias Hunger

Session: Remove projectContainsFile

Use Project::isKnownFile instead.

Change-Id: If69e413e4603fe6d7dc359ecd55d6233d9a3a642
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 43f57d3f
......@@ -208,7 +208,7 @@ void TestCodeParser::onDocumentUpdated(const QString &fileName, bool isQmlFile)
if (!project)
return;
// Quick tests: qml files aren't necessarily listed inside project files
if (!isQmlFile && !SessionManager::projectContainsFile(project, Utils::FileName::fromString(fileName)))
if (!isQmlFile && !project->isKnownFile(Utils::FileName::fromString(fileName)))
return;
scanForTests(QStringList(fileName));
......
......@@ -666,18 +666,13 @@ Project *SessionManager::projectForFile(const Utils::FileName &fileName)
{
const QList<Project *> &projectList = projects();
foreach (Project *p, projectList) {
if (projectContainsFile(p, fileName))
if (p->isKnownFile(fileName))
return p;
}
return nullptr;
}
bool SessionManager::projectContainsFile(Project *p, const Utils::FileName &fileName)
{
return p && p->isKnownFile(fileName);
}
void SessionManager::configureEditor(IEditor *editor, const QString &fileName)
{
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor*>(editor)) {
......@@ -691,7 +686,7 @@ void SessionManager::configureEditor(IEditor *editor, const QString &fileName)
void SessionManager::configureEditors(Project *project)
{
foreach (IDocument *document, DocumentModel::openedDocuments()) {
if (projectContainsFile(project, document->filePath())) {
if (project->isKnownFile(document->filePath())) {
foreach (IEditor *editor, DocumentModel::editorsForDocument(document)) {
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor*>(editor)) {
project->editorConfiguration()->configureEditor(textEditor);
......
......@@ -115,7 +115,6 @@ public:
static Project *projectForNode(Node *node);
static Node *nodeForFile(const Utils::FileName &fileName);
static Project *projectForFile(const Utils::FileName &fileName);
static bool projectContainsFile(Project *p, const Utils::FileName &fileName);
static QStringList projectsForSessionName(const QString &session);
......
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