From 4291fcd8b3cc4e5bcfe04f7e54ea02f6231737cc Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 29 May 2019 10:06:01 +0200 Subject: Adapt to upstream changes In FileName, and project management Change-Id: I8c549c56e2de6dd1fc3f9451e3964bad31327651 Reviewed-by: hjk --- plugins/haskell/haskellproject.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'plugins/haskell/haskellproject.cpp') diff --git a/plugins/haskell/haskellproject.cpp b/plugins/haskell/haskellproject.cpp index bdc3860..92b30e6 100644 --- a/plugins/haskell/haskellproject.cpp +++ b/plugins/haskell/haskellproject.cpp @@ -47,7 +47,7 @@ using namespace Utils; namespace Haskell { namespace Internal { -static QVector parseExecutableNames(const FileName &projectFilePath) +static QVector parseExecutableNames(const FilePath &projectFilePath) { static const QString EXECUTABLE = "executable"; static const int EXECUTABLE_LEN = EXECUTABLE.length(); @@ -65,11 +65,11 @@ static QVector parseExecutableNames(const FileName &projectFilePath) return result; } -HaskellProjectNode::HaskellProjectNode(const FileName &projectFilePath, Core::Id id) - : ProjectNode(projectFilePath, id.toString().toLatin1()) +HaskellProjectNode::HaskellProjectNode(const FilePath &projectFilePath) + : ProjectNode(projectFilePath) {} -HaskellProject::HaskellProject(const Utils::FileName &fileName) +HaskellProject::HaskellProject(const Utils::FilePath &fileName) : Project(Constants::C_HASKELL_PROJECT_MIMETYPE, fileName, [this] { refresh(); }) { setId(Constants::C_HASKELL_PROJECT_ID); @@ -86,17 +86,17 @@ bool HaskellProject::isHaskellProject(Project *project) void HaskellProject::updateFiles() { emitParsingStarted(); - FileName projectDir = projectDirectory(); + FilePath projectDir = projectDirectory(); QFuture> future = Utils::runAsync([this, projectDir] { - return FileNode::scanForFiles(projectDir, [this](const FileName &fn) -> FileNode * { - if (fn != FileName::fromString(projectFilePath().toString() + ".user")) - return new FileNode(fn, FileType::Source, false); + return FileNode::scanForFiles(projectDir, [this](const FilePath &fn) -> FileNode * { + if (fn != FilePath::fromString(projectFilePath().toString() + ".user")) + return new FileNode(fn, FileType::Source); else return nullptr; }); }); Utils::onResultReady(future, this, [this](const QList &nodes) { - auto root = new HaskellProjectNode(projectDirectory(), id()); + auto root = new HaskellProjectNode(projectDirectory()); root->setDisplayName(displayName()); std::vector> nodePtrs = Utils::transform(nodes, [](FileNode *fn) { @@ -112,20 +112,18 @@ void HaskellProject::updateApplicationTargets(Target *target) { QTC_ASSERT(target, return); const QVector executables = parseExecutableNames(projectFilePath()); - const Utils::FileName projFilePath = projectFilePath(); + const Utils::FilePath projFilePath = projectFilePath(); const QList appTargets = Utils::transform(executables, [projFilePath](const QString &executable) { BuildTargetInfo bti; bti.displayName = executable; bti.buildKey = executable; - bti.targetFilePath = FileName::fromString(executable); + bti.targetFilePath = FilePath::fromString(executable); bti.projectFilePath = projFilePath; bti.isQtcRunnable = true; return bti; }); - BuildTargetInfoList list; - list.list = appTargets; - target->setApplicationTargets(list); + target->setApplicationTargets(appTargets); target->updateDefaultRunConfigurations(); } -- cgit v1.2.3