Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-19554

ProjectExplorer::Project::isKnownFile() is broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 4.6.0-beta1
    • Qt Creator 4.6.0-beta1
    • None
    • Kubuntu Artful (17.10) x86_64, Qt 5.10.0 (qmake 3.1), gcc 7.2.0

    Description

      The method was introduced in commit 43f57d3f31117c7677d23f1477a4579b1b562c67, ending with the following return statement:

      return (it == end) ? false : (*it)->filePath() != filename;
      

       

      I believe this is incorrect, since we are looking for a match. In other words the statement should be as follows:

      return (it == end) ? false : (*it)->filePath() == filename;
      

      This mistake also causes ProjectExplorer::SessionManager::projectForFile() to work incorrectly (i.e. now it returns the first project from the list which actually does not contain the file).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              hunger Tobias Hunger
              kyrylo.bohdanenko Kyrylo Bohdanenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes