diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-29 10:06:01 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-29 09:19:17 +0000 |
commit | 4291fcd8b3cc4e5bcfe04f7e54ea02f6231737cc (patch) | |
tree | 2f8a0a3ecfc5d77120e5e7ded8dc3a23545c8cfd /plugins/haskell/haskellproject.cpp | |
parent | dd695dcd2cfbc441cb98e01b616af7e1e92aa979 (diff) |
Adapt to upstream changes
In FileName, and project management
Change-Id: I8c549c56e2de6dd1fc3f9451e3964bad31327651
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'plugins/haskell/haskellproject.cpp')
-rw-r--r-- | plugins/haskell/haskellproject.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
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<QString> parseExecutableNames(const FileName &projectFilePath) +static QVector<QString> parseExecutableNames(const FilePath &projectFilePath) { static const QString EXECUTABLE = "executable"; static const int EXECUTABLE_LEN = EXECUTABLE.length(); @@ -65,11 +65,11 @@ static QVector<QString> 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<QList<FileNode *>> 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<FileNode *> &nodes) { - auto root = new HaskellProjectNode(projectDirectory(), id()); + auto root = new HaskellProjectNode(projectDirectory()); root->setDisplayName(displayName()); std::vector<std::unique_ptr<FileNode>> nodePtrs = Utils::transform<std::vector>(nodes, [](FileNode *fn) { @@ -112,20 +112,18 @@ void HaskellProject::updateApplicationTargets(Target *target) { QTC_ASSERT(target, return); const QVector<QString> executables = parseExecutableNames(projectFilePath()); - const Utils::FileName projFilePath = projectFilePath(); + const Utils::FilePath projFilePath = projectFilePath(); const QList<BuildTargetInfo> appTargets = Utils::transform<QList>(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(); } |