forked from qt-creator/qt-creator
ProjectExplorer: Follow up on too-much-magic in IProjectManager
Use a ProjectManager::registerProjectType<Project>(MimeType) function, removing cryptic IProjectManager object ownership. Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
#include "nimproject.h"
|
||||
#include "nimbuildconfiguration.h"
|
||||
#include "nimprojectnode.h"
|
||||
#include "nimprojectmanager.h"
|
||||
#include "nimtoolchain.h"
|
||||
|
||||
#include "../nimconstants.h"
|
||||
@@ -54,12 +53,12 @@ namespace Nim {
|
||||
|
||||
const int MIN_TIME_BETWEEN_PROJECT_SCANS = 4500;
|
||||
|
||||
NimProject::NimProject(const QString &fileName)
|
||||
NimProject::NimProject(const FileName &fileName)
|
||||
{
|
||||
setId(Constants::C_NIMPROJECT_ID);
|
||||
setDocument(new TextEditor::TextDocument);
|
||||
document()->setFilePath(FileName::fromString(fileName));
|
||||
QFileInfo fi = QFileInfo(fileName);
|
||||
document()->setFilePath(fileName);
|
||||
QFileInfo fi = fileName.toFileInfo();
|
||||
QDir dir = fi.dir();
|
||||
setRootProjectNode(new NimProjectNode(*this, FileName::fromString(dir.absolutePath())));
|
||||
rootProjectNode()->setDisplayName(dir.dirName());
|
||||
|
||||
Reference in New Issue
Block a user