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

ProjectExplorer::Project::isKnownFile() is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important 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

      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).

        For Gerrit Dashboard: QTCREATORBUG-19554
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes